MidnightWalletProvider
@midnight-ntwrk/testkit-js v3.1.0
Provider class that implements wallet functionality for the Midnight network. Handles transaction balancing, submission, and wallet state management.
Implements
MidnightProviderWalletProvider
Properties
dustSecretKey
readonlydustSecretKey:DustSecretKey
env
readonlyenv:EnvironmentConfiguration
logger
logger:
Logger
unshieldedKeystore
readonlyunshieldedKeystore:UnshieldedKeystore
wallet
readonlywallet:WalletFacade
zswapSecretKeys
readonlyzswapSecretKeys:ZswapSecretKeys
Methods
balanceTx()
balanceTx(
tx,ttl?):Promise<FinalizedTransaction>
Balances a transaction
Parameters
tx
UnboundTransaction
The transaction to balance.
ttl?
Date = ...
Returns
Promise<FinalizedTransaction>
Implementation of
WalletProvider.balanceTx
getCoinPublicKey()
getCoinPublicKey():
string
Returns
string
Implementation of
WalletProvider.getCoinPublicKey
getEncryptionPublicKey()
getEncryptionPublicKey():
string
Returns
string
Implementation of
WalletProvider.getEncryptionPublicKey
start()
start(
waitForFundsInWallet?,tokenType?):Promise<void>
Parameters
waitForFundsInWallet?
boolean = true
tokenType?
TokenType = ...
Returns
Promise<void>
stop()
stop():
Promise<void>
Returns
Promise<void>
submitTx()
submitTx(
tx):Promise<string>
Submit a transaction to the network to be consensed upon.
Parameters
tx
FinalizedTransaction
The finalized transaction to submit.
Returns
Promise<string>
The transaction identifier of the submitted transaction.
Implementation of
MidnightProvider.submitTx
build()
staticbuild(logger,env,seed?):Promise<MidnightWalletProvider>
Parameters
logger
Logger
env
seed?
string
Returns
Promise<MidnightWalletProvider>
withWallet()
staticwithWallet(logger,env,wallet,zswapSecretKeys,dustSecretKey,unshieldedKeystore):Promise<MidnightWalletProvider>
Parameters
logger
Logger
env
wallet
WalletFacade
zswapSecretKeys
ZswapSecretKeys
dustSecretKey
DustSecretKey
unshieldedKeystore
UnshieldedKeystore
Returns
Promise<MidnightWalletProvider>