Skip to main content

Class: AccountUpdate

Implements

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new AccountUpdate(body, authorization?)

Parameters

NameType
bodyBody
authorization?Object
authorization.proof?string
authorization.signature?string

Defined in

lib/account_update.ts:599

Properties

account

account: PreconditionClassType<AccountPrecondition>

Defined in

lib/account_update.ts:590


authorization

authorization: Object

Type declaration

NameType
proof?string
signature?string

Implementation of

Types.AccountUpdate.authorization

Defined in

lib/account_update.ts:588


body

body: Body

Implementation of

Types.AccountUpdate.body

Defined in

lib/account_update.ts:587


children

children: Object

Type declaration

NameType
accountUpdatesAccountUpdate[]
calls?Field

Defined in

lib/account_update.ts:592


isSelf

Private isSelf: boolean

Defined in

lib/account_update.ts:597


lazyAuthorization

lazyAuthorization: undefined | LazySignature | LazyProof = undefined

Defined in

lib/account_update.ts:589


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

lib/account_update.ts:591


parent

parent: undefined | AccountUpdate = undefined

Defined in

lib/account_update.ts:595

Accessors

balance

get balance(): Object

Returns

Object

NameType
addInPlace(x: string | number | bigint | UInt64 | UInt32 | Int64) => void
subInPlace(x: string | number | bigint | UInt64 | UInt32 | Int64) => void

Defined in

lib/account_update.ts:773


publicKey

get publicKey(): PublicKey

Returns

PublicKey

Defined in

lib/account_update.ts:850


tokenId

get tokenId(): Field

Returns

Field

Defined in

lib/account_update.ts:723


tokenSymbol

get tokenSymbol(): Object

Returns

Object

NameType
set(tokenSymbol: string) => void

Defined in

lib/account_update.ts:727


update

get update(): Object

Returns

Object

NameType
appState{ isSome: Bool ; value: Field }[]
delegate{ isSome: Bool ; value: PublicKey }
delegate.isSomeBool
delegate.valuePublicKey
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.isSomeBool
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.editSequenceStateAuthRequired
permissions.value.editStateAuthRequired
permissions.value.incrementNonceAuthRequired
permissions.value.receiveAuthRequired
permissions.value.sendAuthRequired
permissions.value.setDelegateAuthRequired
permissions.value.setPermissionsAuthRequired
permissions.value.setTokenSymbolAuthRequired
permissions.value.setVerificationKeyAuthRequired
permissions.value.setVotingForAuthRequired
permissions.value.setZkappUriAuthRequired
timing{ isSome: Bool ; value: { cliffAmount: UInt64 ; cliffTime: UInt32 ; initialMinimumBalance: UInt64 ; vestingIncrement: UInt64 ; vestingPeriod: UInt32 } }
timing.isSomeBool
timing.value{ cliffAmount: UInt64 ; cliffTime: UInt32 ; initialMinimumBalance: UInt64 ; vestingIncrement: UInt64 ; vestingPeriod: UInt32 }
timing.value.cliffAmountUInt64
timing.value.cliffTimeUInt32
timing.value.initialMinimumBalanceUInt64
timing.value.vestingIncrementUInt64
timing.value.vestingPeriodUInt32
tokenSymbol{ isSome: Bool ; value: TokenSymbol }
tokenSymbol.isSomeBool
tokenSymbol.valueTokenSymbol
verificationKey{ isSome: Bool ; value: { data: string ; hash: Field } }
verificationKey.isSomeBool
verificationKey.value{ data: string ; hash: Field }
verificationKey.value.datastring
verificationKey.value.hashField
votingFor{ isSome: Bool ; value: Field }
votingFor.isSomeBool
votingFor.valueField
zkappUri{ isSome: Bool ; value: { data: string ; hash: Field } }
zkappUri.isSomeBool
zkappUri.value{ data: string ; hash: Field }
zkappUri.value.datastring
zkappUri.value.hashField

Defined in

lib/account_update.ts:788

Methods

hash

hash(): Field

Returns

Field

Defined in

lib/account_update.ts:910


isDummy

isDummy(): Bool

Returns

Bool

Defined in

lib/account_update.ts:945


send

send(__namedParameters): void

Parameters

NameType
__namedParametersObject
__namedParameters.amountnumber | bigint | UInt64
__namedParameters.toPublicKey | AccountUpdate

Returns

void

Defined in

lib/account_update.ts:740


sign

sign(privateKey?): void

Parameters

NameType
privateKey?PrivateKey

Returns

void

Defined in

lib/account_update.ts:854


toFields

toFields(): Field[]

Returns

Field[]

Defined in

lib/account_update.ts:902


toJSON

toJSON(): AccountUpdate

Returns

AccountUpdate

Defined in

lib/account_update.ts:906


toPublicInput

toPublicInput(): ZkappPublicInput

Returns

ZkappPublicInput

Defined in

lib/account_update.ts:928


token

token(): Object

Returns

Object

NameType
idField
parentTokenIdField
tokenOwnerPublicKey
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

lib/account_update.ts:625


assertBetween

Static assertBetween<T>(property, lower, upper): void

Constrain a property to lie between lower and upper bounds.

Type parameters

Name
T

Parameters

NameTypeDescription
propertyOrIgnore<ClosedInterval<T>>The property to constrain
lowerTThe lower bound
upperTThe 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

lib/account_update.ts:814


assertEquals

Static assertEquals<T>(property, value): void

Fix a property to a certain value.

Type parameters

Name
T

Parameters

NameTypeDescription
propertyOrIgnore<T | ClosedInterval<T>>The property to constrain
valueTThe 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

lib/account_update.ts:840


clone

Static clone(accountUpdate): any

Parameters

NameType
accountUpdateAccountUpdate

Returns

any

Defined in

lib/account_update.ts:609


create

Static create(publicKey, tokenId?): AccountUpdate

Parameters

NameType
publicKeyPublicKey
tokenId?Field

Returns

AccountUpdate

Defined in

lib/account_update.ts:967


createSigned

Static createSigned(signer): AccountUpdate

Parameters

NameType
signerPrivateKey

Returns

AccountUpdate

Defined in

lib/account_update.ts:980


defaultAccountUpdate

Static defaultAccountUpdate(address, tokenId?): AccountUpdate

Parameters

NameType
addressPublicKey
tokenId?Field

Returns

AccountUpdate

Defined in

lib/account_update.ts:934


defaultFeePayer

Static defaultFeePayer(address, key, nonce): FeePayerUnsigned

Parameters

NameType
addressPublicKey
keyPrivateKey
nonceUInt32

Returns

FeePayerUnsigned

Defined in

lib/account_update.ts:949


dummy

Static dummy(): AccountUpdate

Returns

AccountUpdate

Defined in

lib/account_update.ts:942


dummyFeePayer

Static dummyFeePayer(): FeePayerUnsigned

Returns

FeePayerUnsigned

Defined in

lib/account_update.ts:962


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

NameTypeDescription
feePayerKeyPrivateKeythe private key of the account that pays the fee
initialBalanceObjectthe initial balance of the new account (default: 0)
initialBalance.initialBalanceundefined | string | number | UInt64-

Returns

void

Defined in

lib/account_update.ts:1011


getNonce

Static getNonce(accountUpdate): any

Parameters

NameType
accountUpdateAccountUpdate | FeePayerUnsigned

Returns

any

Defined in

lib/account_update.ts:870


getNonceUnchecked

Static Private getNonceUnchecked(update): UInt32

Parameters

NameType
updateAccountUpdate | FeePayerUnsigned

Returns

UInt32

Defined in

lib/account_update.ts:876


setValue

Static setValue<T>(maybeValue, value): void

Type parameters

Name
T

Parameters

NameType
maybeValueSetOrKeep<T>
valueT

Returns

void

Defined in

lib/account_update.ts:792


signFeePayerInPlace

Static signFeePayerInPlace(feePayer, privateKey?): void

Parameters

NameType
feePayerFeePayerUnsigned
privateKey?PrivateKey

Returns

void

Defined in

lib/account_update.ts:861


witness

Static witness<T>(type, compute, __namedParameters?): Object

Type parameters

Name
T

Parameters

NameType
typeAsFieldElements<T>
compute() => { accountUpdate: AccountUpdate ; result: T }
__namedParametersObject
__namedParameters.skipCheckundefined | boolean

Returns

Object

NameType
accountUpdateAccountUpdate
resultT

Defined in

lib/account_update.ts:1023


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

NameType
resultTypeAsFieldElements<T>
childLayoutAccountUpdatesLayout
compute() => { accountUpdate: AccountUpdate ; result: T }
options?Object
options.skipCheckboolean

Returns

Object

NameType
accountUpdateAccountUpdate
resultT

Defined in

lib/account_update.ts:1081