nekoton/nekoton_lib library

Classes

AbiParam
AccountsList
AccountsStorage
Implementations of nekoton's AccountsStorage
AccountToAdd
AdditionalAssets
Address
Blockchain address
AssetsList
BlockchainConfig
Config of transport that could be used in executeLocal
ContractState
CreateKeyInput
DecodedEvent
DecodedInput
DecodedOutput
DecodedTransaction
DecodedTransactionEvent
DePoolAsset
DePoolOnRoundCompleteNotification
DePoolReceiveAnswerNotification
DerivedKeyCreateInput
Input for creating labs key
DerivedKeyCreateInputDerive
DerivedKeyCreateInputImport
DerivedKeyExportOutput
DerivedKeyExportSeedParams
DerivedKeyGetPublicKeys
DerivedKeyPassword
DerivedKeyPasswordByAccountId
DerivedKeyPasswordByPublicKey
DerivedKeyUpdateParams
DerivedKeyUpdateParamsChangePassword
DerivedKeyUpdateParamsRenameKey
EncryptedData
EncryptedKeyCreateInput
Input for creating legacy key
EncryptedKeyExportSeedOutput
EncryptedKeyGetPublicKeys
EncryptedKeyPassword
EncryptedKeyUpdateParams
EncryptedKeyUpdateParamsChangePassword
EncryptedKeyUpdateParamsRename
ExecutionOutput
ExistingContract
ExistingWalletInfo
Expiration
ExportKeyInput
ExportKeyOutput
FullContractState
FunctionCall
GenericContract
Implementation of nekoton's GenericContract.
GenTimings
GetPublicKeys
GqlConnection
GqlNetworkSettings
GqlTransport
Implementation of jrpc transport
InternalMessage
JrpcConnection
JrpcNetworkSettings
JrpcTransport
Implementation of jrpc transport
Keypair
KeyStore
Implementation of nekoton's KeyStore For all of method: signer - is one of strings to identify type of key (ENCRYPTED_KEY_SIGNER_NAME, DERIVED_KEY_SIGNER_NAME or LEDGER_KEY_SIGNER_NAME)
KeyStoreEntry
KnownPayload
LastTransactionId
LedgerConnection
LedgerKeyCreateInput
LedgerKeyGetPublicKeys
LedgerSignatureContext
LedgerSignInput
LedgerUpdateKeyInput
LedgerUpdateKeyInputRename
Message
MultisigConfirmTransaction
MultisigPendingTransaction
MultisigSendTransaction
MultisigSubmitTransaction
MultisigTransaction
OnBalanceChangedPayload
OnMessageExpiredPayload
OnMessageSentPayload
OnStateChangedPayload
OnTransactionsFoundPayload
Password
PasswordCacheBehavior
PasswordExplicit
PendingTransaction
ProtoConnection
ProtoNetworkSettings
ProtoTransport
Implementation of proto transport
PublicKey
Public key of the account
RawContractState
RawTransaction
RefreshingInterface
Interface, that should be implemented by any wallet or contract that supports functionality of refreshing.
RootTokenContractDetails
SignedMessage
SignInput
Storage
StorageFeeInfo
SubscriptionHandlerMessage
Symbol
TokenIncomingTransfer
TokenOutgoingTransfer
TokenSwapBack
TokenWallet
Implementation of nekoton's TonWallet.
TokenWalletAsset
TokenWalletDeployedNotification
TokenWalletDetails
TokenWalletTransaction
TokenWalletTransactionWithData
TonWallet
Implementation of nekoton's TonWallet.
TonWalletAsset
TonWalletDetails
TonWalletTransactionWithData
Transaction
TransactionAdditionalInfo
TransactionId
TransactionsBatchInfo
TransactionsList
TransactionWithData<T>
TransferRecipient
Transport
Abstract class for transport, so we can combine both implementations into single list
TxTreeSimulationError
TxTreeSimulationErrorItem
UnsignedMessage
Wrapper above nekoton's UnsignedMessage
UpdateKeyInput
WalletInteractionInfo
WalletInteractionMethod
WalletType

Constants

accountsStorageKey → const String
amountJsonConverter → const _BigIntJsonConverter
Json converter of amount value from string to BigInt (without currency identification)
dateSecondsSinceEpochJsonConverter → const _DateTimeJsonConverter
Json converter for date time from secondsSinceEpoch (typically used for fields such as expireAt)
keystoreStorageKey → const String
publicKeyLength → const int
secretKeyLength → const int
signatureLength → const int
uriJsonConverter → const _UriJsonConverter
Json converter of Uri value from string to Uri

Functions

checkPublicKey({required PublicKey publicKey}) Future<bool>
Check if public key is correct. Return true or false
codeToTvc(String code) Future<(String, String)>
Convert code to base64 tvc string and return (tvc, hash) or throw error
computeStorageFee({required String config, required String account, required int utime, bool? isMasterchain}) Future<StorageFeeInfo>
config - value from Transport.getBlockchainConfig account - base64-encoded boc utime - seconds isMasterchain - default: false
createExternalMessage({required String dst, required String contractAbi, required String method, String? stateInit, required TokensObject input, required PublicKey publicKey, required Duration timeout}) Future<UnsignedMessage>
Create external unsigned message that can be listened and handled or throws error
createExternalMessageWithoutSignature({required Address dst, required String contractAbi, required String method, String? stateInit, required TokensObject input, required Duration timeout}) Future<SignedMessage>
Returns SignedMessage from nekoton or throws error
createRawExternalMessage({required Address dst, required Duration timeout, String? stateInit, String? body}) Future<SignedMessage>
Create raw external message without real signing or throws error
decodeEvent({required String messageBody, required String contractAbi, dynamic event}) Future<DecodedEvent?>
Decode input data and return DecodedEvent or throws error
decodeInput({required String messageBody, required String contractAbi, dynamic method, required bool internal}) Future<DecodedInput?>
Decode input data and return DecodedInput or throws error
decodeOutput({required String messageBody, required String contractAbi, dynamic method}) Future<DecodedOutput?>
Decode output data and return DecodedOutput or throws error
decodeTransaction({required Transaction transaction, required String contractAbi, dynamic method}) Future<DecodedTransaction?>
Decode transaction and return DecodedTransaction or throws error
decodeTransactionEvents({required Transaction transaction, required String contractAbi}) Future<List<DecodedEvent>>
Decode events of transaction and return list of DecodedEvent or throws error
deriveFromPhrase({required String phrase, required MnemonicType mnemonicType}) Future<Keypair>
Generate public and secret keys from seed phrase and mnemonic type Returns json {'public': '...', 'secret': '...'} or throws Exception
encodeInternalInput({required String contractAbi, required String method, required TokensObject input}) Future<String>
Returns base64-encoded body that was encoded or throws error
encodeInternalMessage({required Address dst, required bool bounce, required BigInt amount, Address? src, String? stateInit, String? body, bool? bounced}) Future<String>
Returns base-64 encoded Message or throws error
executeLocal({required String config, required String account, required String message, required DateTime utime, required bool disableSignatureCheck, BigInt? overwriteBalance, int? globalId}) Future<(String, Transaction)>
Run contract locally. config - value from Transport.getBlockchainConfig account - boc from makeFullAccountBoc message - base64-encoded boc from one of:
extractPublicKey(String boc) Future<PublicKey>
Extract public key from boc and return it or throw error
generateKey({required MnemonicType accountType}) Future<GeneratedKeyG>
Generate seed phrase by specified mnemonic type
getBocHash(String boc) Future<String>
Returns hash of decoded boc or throws error
getCodeSalt(String code) Future<String?>
Get salt from code if possible and return base64-encoded salt or throw error
getExpectedAddress({required String tvc, required String contractAbi, required int workchainId, PublicKey? publicKey, required TokensObject initData}) Future<(Address, String, String)>
Get address of tvc and contract_abi. Returns list of address, state_init, hash or throws error
getHash(String string) String
Get hash of String
getHints({required String input}) Future<List<String>>
Get hints for input part of word of seed phrase to get possible words input: acco returns account, accommodate, ...
makeFullAccountBoc(String? accountStuffBoc) Future<String>
Returns base-64 encoded Account or throws error accountStuffBoc - FullContractState.boc
mergeTvc({required String code, required String data}) Future<(String, String)>
Merge code and data to tvc base64 string and return (tvc, hash) or throw error
packIntoCell({required List<AbiParam> params, required TokensObject tokens, required String? abiVersion}) Future<(String, String)>
Return (base64 tvc, hash) or throws error
packStdSmcAddr({required Address address, required bool base64Url, required bool bounceable}) Future<String>
Pack address std smd or throw error Returns new packed address as string
parseFullAccountBoc(String account) Future<FullContractState?>
account - base64-encoded boc after executeLocal
parseKnownPayload(String payload) Future<KnownPayload?>
Parse payload and return KnownPayload or throws error
repackAddress(Address address) Future<Address>
Repack address and return json-encoded MsgAddressInt or throw error
runLocal({required String accountStuffBoc, required String contractAbi, required String method, required Map<String, dynamic> input, required bool responsible}) Future<ExecutionOutput>
Run contract local. Return json-encoded ExecutionOutput or throws error.
setCodeSalt({required String code, required String salt}) Future<(String, String)>
Set salt to code and return (tvc, hash) or throw error
splitTvc(String tvc) Future<(String?, String?)>
Split base64 tvc string into data and code. Return (data, code) or throw error
unpackContractFields({required String contractAbi, required String boc, required bool allowPartial}) Future<Map<String, dynamic>?>
Unpack contract fields. Returns optional json-encoded Map<String, Token> or throw error
unpackFromCell({required List<AbiParam> params, required String boc, required bool allowPartial, required String? abiVersion}) Future<TokensObject>
Parse list of params and return json-encoded Tokens or throws error
unpackInitData({required String contractAbi, required String data}) Future<(PublicKey?, Map<String, dynamic>)>
Unpack data from contractAbi. Returns optional public key and json-encoded Map<String, Token> or throws error.
unpackStdSmcAddr({required String packed, required bool base64Url}) Future<String>
validateAddress(Address address) Future<bool>
Return true if address is valid, false otherwise
verifySignature({required PublicKey publicKey, required String data, required String signature, required int? signatureId}) Future<bool>
Check signature by publicKey and data hash

Typedefs

GqlConnectionGet = Future<String> Function(String endpoint)
GqlConnectionPost = Future<String> Function({required String data, required String endpoint, required Map<String, String> headers})
JrpcConnectionPost = Future<String> Function({required String data, required String endpoint, required Map<String, String> headers})
LedgerConnectionGetPublicKey = Future<PublicKey> Function(int accountId)
LedgerConnectionSign = Future<String> Function({required int account, Object? context, required List<int> message})
MethodName = dynamic
ProtoConnectionPost = Future<Uint8List> Function({required Uint8List dataBytes, required String endpoint, required Map<String, String> headers})
Callback to make post requrest in proto connection. Must return bytes.
StorageGet = Future<String?> Function(String key)
StorageRemove = Future<void> Function(String key)
StorageRemoveUnchecked = void Function(String key)
StorageSet = Future<void> Function({required String key, required String value})
StorageSetUnchecked = void Function({required String key, required String value})
TokensObject = Map<String, dynamic>

Exceptions / Errors

ExecuteLocalException
None code-related exception that means that executeLocal finished with specified errorCode.
TransportCallAfterDisposeError
Exception that is thrown when transport is disposed and user calls its methods