Skip to main content

Namespace: Mina

Table of contents

Type Aliases

Functions

Type Aliases

CurrentTransaction

Ƭ CurrentTransaction: Object

Type declaration

NameType
accountUpdatesAccountUpdate[]
fetchModeFetchMode
isFinalRunOutsideCircuitboolean
sender?PublicKey

Defined in

lib/mina.ts:65


FeePayerSpec

Ƭ FeePayerSpec: PrivateKey | { fee?: number | string | UInt64 ; feePayerKey: PrivateKey ; memo?: string } | undefined

Defined in

lib/mina.ts:74

Functions

BerkeleyQANet

BerkeleyQANet(graphqlEndpoint): Mina

Parameters

NameType
graphqlEndpointstring

Returns

Mina

Defined in

lib/mina.ts:581


LocalBlockchain

LocalBlockchain(__namedParameters?): MockMina

A mock Mina blockchain running locally and useful for testing.

Parameters

NameType
__namedParametersObject
__namedParameters.accountCreationFeeundefined | string | number

Returns

MockMina

Defined in

lib/mina.ts:235


accountCreationFee

accountCreationFee(): UInt64

Returns

UInt64

Defined in

lib/mina.ts:719


createTransaction

createTransaction(feePayer, f, __namedParameters?): Transaction

Parameters

NameType
feePayerFeePayerSpec
f() => unknown
__namedParametersObject
__namedParameters.fetchModeundefined | FetchMode
__namedParameters.isFinalRunOutsideCircuitundefined | boolean

Returns

Transaction

Defined in

lib/mina.ts:87


currentSlot

currentSlot(): UInt32

Returns

UInt32

The current slot number, according to the active Mina instance.

Defined in

lib/mina.ts:690


currentTransaction

currentTransaction(): undefined | CurrentTransaction

Returns

undefined | CurrentTransaction

Defined in

lib/global-context.ts:6


fetchEvents

fetchEvents(publicKey, tokenId): Promise<any>

Parameters

NameType
publicKeyPublicKey
tokenIdField

Returns

Promise<any>

A list of emitted events associated to the given public key.

Defined in

lib/mina.ts:730


getAccount

getAccount(publicKey, tokenId?): Account

Parameters

NameType
publicKeyPublicKey
tokenId?Field

Returns

Account

The account data associated to the given public key.

Defined in

lib/mina.ts:697


getActions

getActions(publicKey, tokenId): { actions: string[][] ; hash: string }[]

Parameters

NameType
publicKeyPublicKey
tokenIdField

Returns

{ actions: string[][] ; hash: string }[]

A list of emitted sequencing actions associated to the given public key.

Defined in

lib/mina.ts:737


getBalance

getBalance(publicKey, tokenId?): UInt64

Parameters

NameType
publicKeyPublicKey
tokenId?Field

Returns

UInt64

The balance associated to the given public key.

Defined in

lib/mina.ts:715


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

lib/mina.ts:708


hasAccount

hasAccount(publicKey, tokenId?): boolean

Parameters

NameType
publicKeyPublicKey
tokenId?Field

Returns

boolean

Defined in

lib/mina.ts:701


sendTransaction

sendTransaction(txn): TransactionId

Parameters

NameType
txnTransaction

Returns

TransactionId

Defined in

lib/mina.ts:723


setActiveInstance

setActiveInstance(m): void

Set the currently used Mina instance.

Parameters

NameType
mMina

Returns

void

Defined in

lib/mina.ts:652


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

NameType
f() => void

Returns

Promise<Transaction>

A transaction that can subsequently be submitted to the chain.

Defined in

lib/mina.ts:669

transaction(sender, f): Promise<Transaction>

Parameters

NameType
senderFeePayerSpec
f() => void

Returns

Promise<Transaction>

Defined in

lib/mina.ts:670