Namespace: Mina
Table of contents
Type Aliases
Functions
- BerkeleyQANet
- LocalBlockchain
- accountCreationFee
- createTransaction
- currentSlot
- currentTransaction
- fetchEvents
- getAccount
- getActions
- getBalance
- getNetworkState
- hasAccount
- sendTransaction
- setActiveInstance
- transaction
Type Aliases
CurrentTransaction
Ƭ CurrentTransaction: Object
Type declaration
Name | Type |
---|---|
accountUpdates | AccountUpdate [] |
fetchMode | FetchMode |
isFinalRunOutsideCircuit | boolean |
sender? | PublicKey |
Defined in
FeePayerSpec
Ƭ FeePayerSpec: PrivateKey
| { fee?
: number
| string
| UInt64
; feePayerKey
: PrivateKey
; memo?
: string
} | undefined
Defined in
Functions
BerkeleyQANet
▸ BerkeleyQANet(graphqlEndpoint
): Mina
Parameters
Name | Type |
---|---|
graphqlEndpoint | string |
Returns
Mina
Defined in
LocalBlockchain
▸ LocalBlockchain(__namedParameters?
): MockMina
A mock Mina blockchain running locally and useful for testing.
Parameters
Name | Type |
---|---|
__namedParameters | Object |
__namedParameters.accountCreationFee | undefined | string | number |
Returns
MockMina
Defined in
accountCreationFee
▸ accountCreationFee(): UInt64
Returns
Defined in
createTransaction
▸ createTransaction(feePayer
, f
, __namedParameters?
): Transaction
Parameters
Name | Type |
---|---|
feePayer | FeePayerSpec |
f | () => unknown |
__namedParameters | Object |
__namedParameters.fetchMode | undefined | FetchMode |
__namedParameters.isFinalRunOutsideCircuit | undefined | boolean |
Returns
Transaction
Defined in
currentSlot
▸ currentSlot(): UInt32
Returns
The current slot number, according to the active Mina instance.
Defined in
currentTransaction
▸ currentTransaction(): undefined
| CurrentTransaction
Returns
undefined
| CurrentTransaction
Defined in
fetchEvents
▸ fetchEvents(publicKey
, tokenId
): Promise
<any
>
Parameters
Name | Type |
---|---|
publicKey | PublicKey |
tokenId | Field |
Returns
Promise
<any
>
A list of emitted events associated to the given public key.
Defined in
getAccount
▸ getAccount(publicKey
, tokenId?
): Account
Parameters
Name | Type |
---|---|
publicKey | PublicKey |
tokenId? | Field |
Returns
Account
The account data associated to the given public key.
Defined in
getActions
▸ getActions(publicKey
, tokenId
): { actions
: string
[][] ; hash
: string
}[]
Parameters
Name | Type |
---|---|
publicKey | PublicKey |
tokenId | Field |
Returns
{ actions
: string
[][] ; hash
: string
}[]
A list of emitted sequencing actions associated to the given public key.
Defined in
getBalance
▸ getBalance(publicKey
, tokenId?
): UInt64
Parameters
Name | Type |
---|---|
publicKey | PublicKey |
tokenId? | Field |
Returns
The balance associated to the given public key.
Defined in
getNetworkState
▸ getNetworkState(): PreconditionBaseTypes
<{ 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
} } }>
Returns
PreconditionBaseTypes
<{ 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
} } }>
Data associated with the current state of the Mina network.
Defined in
hasAccount
▸ hasAccount(publicKey
, tokenId?
): boolean
Parameters
Name | Type |
---|---|
publicKey | PublicKey |
tokenId? | Field |
Returns
boolean
Defined in
sendTransaction
▸ sendTransaction(txn
): TransactionId
Parameters
Name | Type |
---|---|
txn | Transaction |
Returns
TransactionId
Defined in
setActiveInstance
▸ setActiveInstance(m
): void
Set the currently used Mina instance.
Parameters
Name | Type |
---|---|
m | Mina |
Returns
void
Defined in
transaction
▸ transaction(f
): Promise
<Transaction
>
Construct a smart contract transaction. Within the callback passed to this function, you can call into the methods of smart contracts.
transaction(() => {
myZkapp.update();
someOtherZkapp.someOtherMethod();
})
Parameters
Name | Type |
---|---|
f | () => void |
Returns
Promise
<Transaction
>
A transaction that can subsequently be submitted to the chain.
Defined in
▸ transaction(sender
, f
): Promise
<Transaction
>
Parameters
Name | Type |
---|---|
sender | FeePayerSpec |
f | () => void |
Returns
Promise
<Transaction
>