Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mentions of PublicAccount and AuthAccount #153

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 63 additions & 14 deletions docs/json-cadence-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,20 +453,69 @@ These are basic types like `Int`, `String`, or `StoragePath`.

```json
{
"kind": "Any" | "AnyStruct" | "AnyResource" | "AnyStructAttachment" | "AnyResourceAttachment" | "Type" |
"Void" | "Never" | "Bool" | "String" | "Character" |
"Bytes" | "Address" | "Number" | "SignedNumber" |
"Integer" | "SignedInteger" | "FixedPoint" |
"SignedFixedPoint" | "Int" | "Int8" | "Int16" |
"Int32" | "Int64" | "Int128" | "Int256" | "UInt" |
"UInt8" | "UInt16" | "UInt32" | "UInt64" | "UInt128" |
"UInt256" | "Word8" | "Word16" | "Word32" | "Word64" |
"Fix64" | "UFix64" | "Path" | "CapabilityPath" | "StoragePath" |
"PublicPath" | "PrivatePath" | "AuthAccount" | "PublicAccount" |
"AuthAccount.Keys" | "PublicAccount.Keys" | "AuthAccount.Contracts" |
"PublicAccount.Contracts" | "DeployedContract" | "AccountKey" | "Block"
}
```
"kind": <kind>
}
```

Where `kind` is one of:

- `Account`
- `AccountCapabilityController`
- `AccountKey`
- `Address`
- `AnyResource`
- `AnyResourceAttachment`
- `AnyStruct`
- `AnyStructAttachment`
- `Block`
- `Bool`
- `Capability`
- `CapabilityPath`
- `Character`
- `DeployedContract`
- `DeploymentResult`
- `Fix64`
- `FixedPoint`
- `FixedSizeUnsignedInteger`
- `HashAlgorithm`
- `HashableStruct`
- `Int`
- `Int128`
- `Int16`
- `Int256`
- `Int32`
- `Int64`
- `Int8`
- `Integer`
- `Never`
- `Number`
- `Path`
- `PrivatePath`
- `PublicKey`
- `PublicPath`
- `SignatureAlgorithm`
- `SignedFixedPoint`
- `SignedInteger`
- `SignedNumber`
- `StorageCapabilityController`
- `StoragePath`
- `String`
- `Type`
- `UFix64`
- `UInt`
- `UInt128`
- `UInt16`
- `UInt256`
- `UInt32`
- `UInt64`
- `UInt8`
- `Void`
- `Word128`
- `Word16`
- `Word256`
- `Word32`
- `Word64`
- `Word8`

### Example

Expand Down
2 changes: 1 addition & 1 deletion docs/language/environment-information.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_position: 29
## Transaction Information

To get the addresses of the signers of a transaction,
use the `address` field of each signing `AuthAccount`
use the `address` field of each signing `Account`
that is passed to the transaction's `prepare` phase.

There is currently no API that allows getting other transaction information.
Expand Down
2 changes: 1 addition & 1 deletion docs/solidity-to-cadence.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ transaction(addressAmountMap: {Address: UFix64}) {
// The Vault resource that holds the tokens that are being transferred
let vaultRef: &ExampleToken.Vault

prepare(signer: AuthAccount) {
prepare(signer: auth(Storage) &Account) {

// Get a reference to the signer's stored vault
self.vaultRef = signer.storage.borrow<&ExampleToken.Vault>(from: ExampleToken.VaultStoragePath)
Expand Down
6 changes: 3 additions & 3 deletions docs/tutorial/08-marketplace-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ access(all) contract ExampleMarketplace {
}

// purchase lets a user send tokens to purchase an NFT that is for sale
access(all) fun purchase(tokenID: UInt64,
access(all) fun purchase(tokenID: UInt64,
recipient: Capability<&ExampleNFT.Collection>, buyTokens: @ExampleToken.Vault) {
pre {
self.prices[tokenID] != nil:
Expand Down Expand Up @@ -395,7 +395,7 @@ access(all) contract ExampleMarketplace {
access(all) fun createSaleCollection(
ownerCollection: Capability<auth(ExampleNFT.Withdraw) &ExampleNFT.Collection>,
ownerVault: Capability<&{ExampleToken.Receiver}>
): @SaleCollection
): @SaleCollection
{
return <- create SaleCollection(ownerCollection: ownerCollection, ownerVault: ownerVault)
}
Expand Down Expand Up @@ -485,7 +485,7 @@ Then, users can get that capability from [the public path](../language/accounts/
borrow it, and access the functionality that the owner specified.

```cadence
// Get account 0x06's PublicAccount object
// Get the account object for address 0x06
let publicAccount = getAccount(0x06)

// Retrieve a Vault Receiver Capability from the account's public storage
Expand Down