Class: AccountUpdate
Implements
Table of contents
Constructors
Properties
Accessors
Methods
- hash
- isDummy
- send
- sign
- toFields
- toJSON
- toPublicInput
- token
- assertBetween
- assertEquals
- clone
- create
- createSigned
- defaultAccountUpdate
- defaultFeePayer
- dummy
- dummyFeePayer
- fundNewAccount
- getNonce
- getNonceUnchecked
- setValue
- signFeePayerInPlace
- witness
- witnessTree
Constructors
constructor
• new AccountUpdate(body
, authorization?
)
Parameters
Name | Type |
---|---|
body | Body |
authorization? | Object |
authorization.proof? | string |
authorization.signature? | string |
Defined in
Properties
account
• account: PreconditionClassType
<AccountPrecondition
>
Defined in
authorization
• authorization: Object
Type declaration
Name | Type |
---|---|
proof? | string |
signature? | string |
Implementation of
Types.AccountUpdate.authorization
Defined in
body
• body: Body
Implementation of
Types.AccountUpdate.body
Defined in
children
• children: Object
Type declaration
Name | Type |
---|---|
accountUpdates | AccountUpdate [] |
calls? | Field |
Defined in
isSelf
• Private
isSelf: boolean
Defined in
lazyAuthorization
• lazyAuthorization: undefined
| LazySignature
| LazyProof
= undefined
Defined in
network
• network: PreconditionClassType
<{ blockchainLength
: { isSome
: Bool
; value
: { lower
: UInt32
; upper
: UInt32
} } ; globalSlotSinceGenesis
: { isSome
: Bool
; value
: { lower
: UInt32
; upper
: UInt32
} } ; globalSlotSinceHardFork
: { isSome
: Bool
; value
: { lower
: UInt32
; upper
: UInt32
} } ; minWindowDensity
: { isSome
: Bool
; value
: { lower
: UInt32
; upper
: UInt32
} } ; nextEpochData
: { epochLength
: { isSome
: Bool
; value
: { lower
: UInt32
; upper
: UInt32
} } ; ledger
: { hash
: { isSome
: Bool
; value
: Field
} ; totalCurrency
: { isSome
: Bool
; value
: { lower
: UInt64
; upper
: UInt64
} } } ; lockCheckpoint
: { isSome
: Bool
; value
: Field
} ; seed
: { isSome
: Bool
; value
: Field
} ; startCheckpoint
: { isSome
: Bool
; value
: Field
} } ; snarkedLedgerHash
: { isSome
: Bool
; value
: Field
} ; stakingEpochData
: { epochLength
: { isSome
: Bool
; value
: { lower
: UInt32
; upper
: UInt32
} } ; ledger
: { hash
: { isSome
: Bool
; value
: Field
} ; totalCurrency
: { isSome
: Bool
; value
: { lower
: UInt64
; upper
: UInt64
} } } ; lockCheckpoint
: { isSome
: Bool
; value
: Field
} ; seed
: { isSome
: Bool
; value
: Field
} ; startCheckpoint
: { isSome
: Bool
; value
: Field
} } ; timestamp
: { isSome
: Bool
; value
: { lower
: UInt64
; upper
: UInt64
} } ; totalCurrency
: { isSome
: Bool
; value
: { lower
: UInt64
; upper
: UInt64
} } }>
Defined in
parent
• parent: undefined
| AccountUpdate
= undefined
Defined in
Accessors
balance
• get
balance(): Object
Returns
Object
Name | Type |
---|---|
addInPlace | (x : string | number | bigint | UInt64 | UInt32 | Int64 ) => void |
subInPlace | (x : string | number | bigint | UInt64 | UInt32 | Int64 ) => void |
Defined in
publicKey
• get
publicKey(): PublicKey
Returns
Defined in
tokenId
• get
tokenId(): Field
Returns
Defined in
tokenSymbol
• get
tokenSymbol(): Object
Returns
Object
Name | Type |
---|---|
set | (tokenSymbol : string ) => void |
Defined in
update
• get
update(): Object
Returns
Object
Name | Type |
---|---|
appState | { isSome : Bool ; value : Field }[] |
delegate | { isSome : Bool ; value : PublicKey } |
delegate.isSome | Bool |
delegate.value | PublicKey |
permissions | { isSome : Bool ; value : { editSequenceState : AuthRequired ; editState : AuthRequired ; incrementNonce : AuthRequired ; receive : AuthRequired ; send : AuthRequired ; setDelegate : AuthRequired ; setPermissions : AuthRequired ; setTokenSymbol : AuthRequired ; setVerificationKey : AuthRequired ; setVotingFor : AuthRequired ; setZkappUri : AuthRequired } } |
permissions.isSome | Bool |
permissions.value | { editSequenceState : AuthRequired ; editState : AuthRequired ; incrementNonce : AuthRequired ; receive : AuthRequired ; send : AuthRequired ; setDelegate : AuthRequired ; setPermissions : AuthRequired ; setTokenSymbol : AuthRequired ; setVerificationKey : AuthRequired ; setVotingFor : AuthRequired ; setZkappUri : AuthRequired } |
permissions.value.editSequenceState | AuthRequired |
permissions.value.editState | AuthRequired |
permissions.value.incrementNonce | AuthRequired |
permissions.value.receive | AuthRequired |
permissions.value.send | AuthRequired |
permissions.value.setDelegate | AuthRequired |
permissions.value.setPermissions | AuthRequired |
permissions.value.setTokenSymbol | AuthRequired |
permissions.value.setVerificationKey | AuthRequired |
permissions.value.setVotingFor | AuthRequired |
permissions.value.setZkappUri | AuthRequired |
timing | { isSome : Bool ; value : { cliffAmount : UInt64 ; cliffTime : UInt32 ; initialMinimumBalance : UInt64 ; vestingIncrement : UInt64 ; vestingPeriod : UInt32 } } |
timing.isSome | Bool |
timing.value | { cliffAmount : UInt64 ; cliffTime : UInt32 ; initialMinimumBalance : UInt64 ; vestingIncrement : UInt64 ; vestingPeriod : UInt32 } |
timing.value.cliffAmount | UInt64 |
timing.value.cliffTime | UInt32 |
timing.value.initialMinimumBalance | UInt64 |
timing.value.vestingIncrement | UInt64 |
timing.value.vestingPeriod | UInt32 |
tokenSymbol | { isSome : Bool ; value : TokenSymbol } |
tokenSymbol.isSome | Bool |
tokenSymbol.value | TokenSymbol |
verificationKey | { isSome : Bool ; value : { data : string ; hash : Field } } |
verificationKey.isSome | Bool |
verificationKey.value | { data : string ; hash : Field } |
verificationKey.value.data | string |
verificationKey.value.hash | Field |
votingFor | { isSome : Bool ; value : Field } |
votingFor.isSome | Bool |
votingFor.value | Field |
zkappUri | { isSome : Bool ; value : { data : string ; hash : Field } } |
zkappUri.isSome | Bool |
zkappUri.value | { data : string ; hash : Field } |
zkappUri.value.data | string |
zkappUri.value.hash | Field |
Defined in
Methods
hash
▸ hash(): Field
Returns
Defined in
isDummy
▸ isDummy(): Bool
Returns
Defined in
send
▸ send(__namedParameters
): void
Parameters
Name | Type |
---|---|
__namedParameters | Object |
__namedParameters.amount | number | bigint | UInt64 |
__namedParameters.to | PublicKey | AccountUpdate |
Returns
void
Defined in
sign
▸ sign(privateKey?
): void
Parameters
Name | Type |
---|---|
privateKey? | PrivateKey |
Returns
void
Defined in
toFields
▸ toFields(): Field
[]
Returns
Field
[]
Defined in
toJSON
▸ toJSON(): AccountUpdate
Returns
Defined in
toPublicInput
▸ toPublicInput(): ZkappPublicInput
Returns
Defined in
token
▸ token(): Object
Returns
Object
Name | Type |
---|---|
id | Field |
parentTokenId | Field |
tokenOwner | PublicKey |
burn | (__namedParameters : { address : PublicKey ; amount : number | bigint | UInt64 }) => void |
mint | (__namedParameters : { address : PublicKey ; amount : number | bigint | UInt64 }) => AccountUpdate |
send | (__namedParameters : { amount : number | bigint | UInt64 ; from : PublicKey ; to : PublicKey }) => AccountUpdate |
Defined in
assertBetween
▸ Static
assertBetween<T
>(property
, lower
, upper
): void
Constrain a property to lie between lower and upper bounds.
Type parameters
Name |
---|
T |
Parameters
Name | Type | Description |
---|---|---|
property | OrIgnore <ClosedInterval <T >> | The property to constrain |
lower | T | The lower bound |
upper | T | The upper bound Example: To constrain the account balance of a SmartContract to lie between 0 and 20 MINA, you can use ts @method onlyRunsWhenBalanceIsLow() { let lower = UInt64.zero; let upper = UInt64.from(20e9); AccountUpdate.assertBetween(this.self.body.preconditions.account.balance, lower, upper); // ... } |
Returns
void
Defined in
assertEquals
▸ Static
assertEquals<T
>(property
, value
): void
Fix a property to a certain value.
Type parameters
Name |
---|
T |
Parameters
Name | Type | Description |
---|---|---|
property | OrIgnore <T | ClosedInterval <T >> | The property to constrain |
value | T | The value it is fixed to Example: To fix the account nonce of a SmartContract to 0, you can use ts @method onlyRunsWhenNonceIsZero() { AccountUpdate.assertEquals(this.self.body.preconditions.account.nonce, UInt32.zero); // ... } |
Returns
void
Defined in
clone
▸ Static
clone(accountUpdate
): any
Parameters
Name | Type |
---|---|
accountUpdate | AccountUpdate |
Returns
any
Defined in
create
▸ Static
create(publicKey
, tokenId?
): AccountUpdate
Parameters
Name | Type |
---|---|
publicKey | PublicKey |
tokenId? | Field |
Returns
Defined in
createSigned
▸ Static
createSigned(signer
): AccountUpdate
Parameters
Name | Type |
---|---|
signer | PrivateKey |
Returns
Defined in
defaultAccountUpdate
▸ Static
defaultAccountUpdate(address
, tokenId?
): AccountUpdate
Parameters
Name | Type |
---|---|
address | PublicKey |
tokenId? | Field |
Returns
Defined in
defaultFeePayer
▸ Static
defaultFeePayer(address
, key
, nonce
): FeePayerUnsigned
Parameters
Name | Type |
---|---|
address | PublicKey |
key | PrivateKey |
nonce | UInt32 |
Returns
FeePayerUnsigned
Defined in
dummy
▸ Static
dummy(): AccountUpdate
Returns
Defined in
dummyFeePayer
▸ Static
dummyFeePayer(): FeePayerUnsigned
Returns
FeePayerUnsigned
Defined in
fundNewAccount
▸ Static
fundNewAccount(feePayerKey
, initialBalance?
): void
Use this method to pay the account creation fee for another account. Beware that you don't need to pass in the new account! Instead, the protocol will automatically identify accounts in your transaction that need funding.
If you provide an optional initialBalance
, this will be subtracted from the fee-paying account as well,
but you have to separately ensure that it's added to the new account's balance.
Parameters
Name | Type | Description |
---|---|---|
feePayerKey | PrivateKey | the private key of the account that pays the fee |
initialBalance | Object | the initial balance of the new account (default: 0) |
initialBalance.initialBalance | undefined | string | number | UInt64 | - |
Returns
void
Defined in
getNonce
▸ Static
getNonce(accountUpdate
): any
Parameters
Name | Type |
---|---|
accountUpdate | AccountUpdate | FeePayerUnsigned |
Returns
any
Defined in
getNonceUnchecked
▸ Static
Private
getNonceUnchecked(update
): UInt32
Parameters
Name | Type |
---|---|
update | AccountUpdate | FeePayerUnsigned |
Returns
Defined in
setValue
▸ Static
setValue<T
>(maybeValue
, value
): void
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
maybeValue | SetOrKeep <T > |
value | T |
Returns
void
Defined in
signFeePayerInPlace
▸ Static
signFeePayerInPlace(feePayer
, privateKey?
): void
Parameters
Name | Type |
---|---|
feePayer | FeePayerUnsigned |
privateKey? | PrivateKey |
Returns
void
Defined in
witness
▸ Static
witness<T
>(type
, compute
, __namedParameters?
): Object
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
type | AsFieldElements <T > |
compute | () => { accountUpdate : AccountUpdate ; result : T } |
__namedParameters | Object |
__namedParameters.skipCheck | undefined | boolean |
Returns
Object
Name | Type |
---|---|
accountUpdate | AccountUpdate |
result | T |
Defined in
witnessTree
▸ Static
witnessTree<T
>(resultType
, childLayout
, compute
, options?
): Object
Like AccountUpdate.witness, but lets you specify a layout for the accountUpdate's children, which also get witnessed
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
resultType | AsFieldElements <T > |
childLayout | AccountUpdatesLayout |
compute | () => { accountUpdate : AccountUpdate ; result : T } |
options? | Object |
options.skipCheck | boolean |
Returns
Object
Name | Type |
---|---|
accountUpdate | AccountUpdate |
result | T |