nekoton_bridge
library
Functions
callSendResult ({required String id , required DynamicValue value })
→ void
Callback functions for returning Dart method result
createLogStream ()
→ Stream <LogEntry >
Create log stream
initCaller ()
→ Stream <DartCallStubRegistred >
Init caller
initLogger ({required LogLevel level , required bool mobileLogger })
→ Future <void >
loadExternalLibrary (ExternalLibraryLoaderConfig config )
→ FutureOr <ExternalLibrary >
Load the ExternalLibrary
, with the following cases in mind:
ntCheckPublicKey ({required String publicKey })
→ bool
ntCodeToTvc ({required String code })
→ List <String >
Convert code to base64 tvc string and return it or throw error
returns tvc, hash
ntComputeStorageFee ({required String config , required String account , required int utime , required bool isMasterchain })
→ Future <String >
ntComputeTonWalletAddress ({required String publicKey , required String walletType , required int workchain })
→ String
ntCreateExternalMessage ({required String dst , required String contractAbi , required String method , String ? stateInit , required String input , required String publicKey , required int timeout })
→ Future <UnsignedMessageImpl >
Create external unsigned message that can be listened and handled or throws error
timeout - milliseconds
ntCreateExternalMessageWithoutSignature ({required String dst , required String contractAbi , required String method , String ? stateInit , required String input , required int timeout })
→ Future <String >
Returns json-encoded SignedMessage from nekoton or throws error
timeout - milliseconds
ntCreateRawExternalMessage ({required String dst , String ? stateInit , String ? body , required int timeout })
→ Future <String >
Returns json-encoded SignedMessage or throws error
dst - destination address
timeout - milliseconds
ntDecodeEvent ({required String messageBody , required String contractAbi , String ? event })
→ Future <String >
Decode input data and return json-encoded DecodedEvent or throws error
ntDecodeInput ({required String messageBody , required String contractAbi , String ? method , required bool internal })
→ Future <String >
Decode input data and return json-encoded DecodedInput or throws error
ntDecodeOutput ({required String messageBody , required String contractAbi , String ? method })
→ Future <String >
Decode output data and return json-encoded DecodedOutput or throws error
ntDecodeTransaction ({required String transaction , required String contractAbi , String ? method })
→ Future <String >
Decode transaction and return json-encoded DecodedTransaction or throws error
ntDecodeTransactionEvents ({required String transaction , required String contractAbi })
→ Future <String >
Decode events of transaction and return json-encoded list of DecodedEvent or throws error
ntDeriveFromPhrase ({required String phrase , required MnemonicType mnemonicType })
→ String
Generate public and secret keys from seed phrase and mnemonic type
Returns json {'public': '...', 'secret': '...'}
or throws Exception
ntEncodeInternalInput ({required String contractAbi , required String method , required String input })
→ Future <String >
Returns base64-encoded body that was encoded or throws error
ntEncodeInternalMessage ({String ? src , required String dst , required bool bounce , String ? stateInit , String ? body , required String amount , bool ? bounced })
→ Future <String >
Returns base-64 encoded Message or throws error
src - address of sender
dst - address of destination
body - base64-encoded data
ntExecuteLocal ({required String config , required String account , required String message , required int utime , required bool disableSignatureCheck , String ? overwriteBalance , int ? globalId })
→ Future <List <String > >
Run contract locally.
config
- base64-encoded ConfigParams after (getBlockchainConfig)
message
- base64-encoded Message after (encodeInternalMessage)
utime
- unixtime in milliseconds
account
- account address
Returns boc, transaction
if everything is ok or
error_code
if transaction failed
or throws error
Extract public key from boc and return it or throw error
ntGenerateKey ({required MnemonicType accountType })
→ GeneratedKeyG
ntGetBocHash ({required String boc })
→ String
Returns hash of decoded boc or throws error
ntGetCodeSalt ({required String code })
→ String ?
Get salt from code if possible and return base64-encoded salt or throw error
ntGetContractTypeNumber ({required String walletType })
→ int
ntGetExpectedAddress ({required String tvc , required String contractAbi , required int workchainId , String ? publicKey , required String initData })
→ Future <List <String > >
Get address of tvc and contract_abi.
Returns list of address, boc of state_init, hash
or throws error
ntGetHints ({required String input })
→ List <String >
Get hints for input part of word of seed phrase to get possible words
input: acco
returns account, accommodate, ...
ntMakeFullAccountBoc ({String ? accountStuffBoc })
→ Future <String >
Returns base-64 encoded Account or throws error
ntMergeTvc ({required String code , required String data })
→ List <String >
Merge code and data to tvc base64 string and return it or throw error
returns tvc, hash
ntPackAddress ({required String address , required bool isUrlSafe , required bool bounceable })
→ String
ntPackIntoCell ({required String params , required String tokens , String ? version })
→ List <String >
Return base64 encoded bytes of tokens or throws error
returns tvc, hash
ntPackStdSmcAddr ({required String addr , required bool base64Url , required bool bounceable })
→ String
Pack address std smd or throw error
Returns new packed address as string
ntParseFullAccountBoc ({required String account })
→ Future <String ? >
Returns optional json-encoded FullContractState or throws error
account - base64-encoded boc after execute_local
ntParseKnownPayload ({required String payload })
→ String ?
Parse payload and return optional json-encoded KnownPayload or throws error
ntRepackAddress ({required String address })
→ String
Repack address and return MsgAddressInt string or original string if failed
ntRunGetter ({required String accountStuffBoc , required String contractAbi , required String methodId , required String input , int ? signatureId })
→ Future <String >
Run getter.
Return json-encoded VmGetterOutput or throws error.
ntRunLocal ({required String accountStuffBoc , required String contractAbi , required String methodId , required String input , required bool responsible , int ? signatureId })
→ Future <String >
Run contract local.
Return json-encoded ExecutionOutput or throws error.
ntSetCodeSalt ({required String code , required String salt })
→ List <String >
Set salt to code and return base64-encoded string or throw error
returns tvc, hash
ntSplitTvc ({required String tvc })
→ List <String ? >
Split base64 tvc string into data and code.
Return vec![data, code] or throw error
ntUnpackContractFields ({required String contractAbi , required String boc , required bool allowPartial })
→ Future <String ? >
Unpack contract fields.
Returns optional json-encoded Map<String, Token> or throw error
ntUnpackFromCell ({required String params , required String boc , required bool allowPartial , String ? version })
→ String
Parse list of params and return json-encoded Tokens or throws error
ntUnpackInitData ({required String contractAbi , required String data })
→ Future <List <String ? > >
Unpack data by contract.
Returns option publicKey, json-encoded Map<String, Token>
or throw error
ntUnpackStdSmcAddr ({required String packed , required bool base64Url })
→ String
Unpack address std smd or throw error.
Returns json-encoded MsgAddressInt
ntValidateAddress ({required String address })
→ bool
Return true if address is valid, false otherwise
ntVerifySignature ({required String publicKey , required String data , required String signature , int ? signatureId })
→ Future <bool >
setClockOffset ({required PlatformInt64 offsetMs })
→ Future <void >
Set clock offset in milliseconds
simpleAdder ({required int a , required int b })
→ Future <int >
simpleAdderSync ({required int a , required int b })
→ int
simpleCallDart ()
→ Future <void >
simpleCallFunc0 ({required bool needResult })
→ Future <void >
simpleCallFunc1 ({required bool needResult })
→ Future <void >
simpleCallFunc2 ()
→ Future <void >
simpleCallFunc3 ()
→ Future <void >
simpleLog ({required String string })
→ Future <void >
simplePanic ()
→ Future <void >
stubCallDart ({required DartCallStub stub })
→ Future <void >
stubDcs ()
→ Future <DartCallStub >
stubDv ()
→ Future <DynamicValue >
testCallerCallTest0Async ({required String string , required bool needResult })
→ Future <DynamicValue >
testCallerCallTest0Sync ({required String string , required bool needResult })
→ DynamicValue
testCallerCallTest1Async ({required String string , required bool needResult })
→ Future <DynamicValue >
testLoggerDebug ({required String string })
→ Future <void >
testLoggerError ({required String string })
→ Future <void >
testLoggerInfo ({required String string })
→ Future <void >
testLoggerPanic ({required String string })
→ Future <void >
testLoggerWarn ({required String string })
→ Future <void >