From 2ee3fb9aaa8a33410901a42dc9c280c0d1e1bb93 Mon Sep 17 00:00:00 2001 From: Daniel Sainati Date: Wed, 17 Nov 2021 16:15:50 -0500 Subject: [PATCH] add documentation --- docs/language/accounts.mdx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/language/accounts.mdx b/docs/language/accounts.mdx index 286ae60d90..e53747aa5c 100644 --- a/docs/language/accounts.mdx +++ b/docs/language/accounts.mdx @@ -377,6 +377,20 @@ to all its stored objects. The path must be a storage path, i.e., only the domain `storage` is allowed. +- `cadence•fun clear(_ path: StoragePath): Bool` + + Clears an object from the account's storage which is stored under the given path + + If there is an object stored, the stored resource or structure is removed from storage, and + destroyed if it is a resource. + + When the function returns, the storage no longer contains an object under the given path. + + The path must be a storage path, i.e., only the domain ` + "`storage`" + ` is allowed. + + The function returns true if a stored object was cleared, and false if no object + was stored under the given path. + - `cadence•fun copy(from: StoragePath): T?` Returns a copy of a structure stored in account storage, without removing it from storage.