You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
💡 Smart Description: This code sends a specified amount of cryptocurrency to a specified address, with an optional message. If the "wait" parameter is true, it waits for the transaction to be confirmed and returns the transaction hash.
💡 Smart Description: This code sends a specified amount of cryptocurrency to a specified address, with an optional message. If the "wait" parameter is true, it waits for the transaction to be confirmed and returns the transaction hash.
Async Ton Transfer Function.
Preview:
asyncfunctionsendTon(mnemonic: string,nano: string,to: string,message: string='',waitForResult: boolean): Promise<any>{constkey=awaitmnemonicToKeyPair(mnemonic.split(" "));//creates keyPair from mnemonicconsttonweb=newTonWeb(newTonWeb.HttpProvider('https://toncenter.com/api/v2/jsonRPC',{apiKey: 'API_KEY'}));//creates Tonweb with your api keyconstWalletClass=tonweb.wallet.all["v4R2"];//loads WalletClassconstwallet=newWalletClass(tonweb.provider,{publicKey: key.publicKey});//creates wallet from key public keyconstseqno=awaitwallet.methods.seqno().call()||0;//waits for current seqno