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
my use this sdk will get error I'm not sure it‘s bug or I use wrong
starcoin.module.js:7951 Uncaught (in promise) TypeError: se[("serialize" + type.Vector)] is not a function
at starcoin.module.js:7951:1
at Array.forEach ()
at serializeWithType (starcoin.module.js:7945:1)
at starcoin.module.js:7974:1
at Array.map ()
at encodeScriptFunctionArgs (starcoin.module.js:7973:1)
at starcoin.module.js:7726:1
at async batchTransfer_v2 (stcWalletSdk.ts:118:1)
import{providers,utils,bcs}from"@starcoin/starcoin"import{arrayify,hexlify}from'@ethersproject/bytes'exportinterfaceBatchTransferInput{account:stringamount:number}exportasyncfunctionbatchTransfer_v2(input:BatchTransferInput[]){consttoAddress:string[]=[]consttoAmount:number[]=[]input.forEach((item)=>{toAddress.push(item.account)toAmount.push(1)})try{constfunctionId='0x1::TransferScripts::batch_peer_to_peer_v2'consttyArgs=['0x1::STC::STC']constargs=[toAddress,toAmount]constnodeUrl=nodeUrlMap[window.starcoin.networkVersion]window.console.info(functionId,tyArgs,args,nodeUrl)constscriptFunction=awaitutils.tx.encodeScriptFunctionByResolve(functionId,tyArgs,args,nodeUrl)window.console.log(scriptFunction)// Multiple BcsSerializers should be used in different closures, otherwise, the latter will be contaminated by the former.constpayloadInHex=(function(){constse=newbcs.BcsSerializer()scriptFunction.serialize(se)returnhexlify(se.getBytes())})()consttxParams={data: payloadInHex,}constexpiredSecs=10window.console.log({ expiredSecs })if(expiredSecs>0){// txParams.expiredSecs = expiredSecs}conststarcoinProvider=awaitgetProvder();consttransactionHash=awaitstarcoinProvider.getSigner().sendUncheckedTransaction(txParams)window.console.log({ transactionHash })}catch(error){throwerror}}
my use this sdk will get error I'm not sure it‘s bug or I use wrong
starcoin.module.js:7951 Uncaught (in promise) TypeError: se[("serialize" + type.Vector)] is not a function
at starcoin.module.js:7951:1
at Array.forEach ()
at serializeWithType (starcoin.module.js:7945:1)
at starcoin.module.js:7974:1
at Array.map ()
at encodeScriptFunctionArgs (starcoin.module.js:7973:1)
at starcoin.module.js:7726:1
at async batchTransfer_v2 (stcWalletSdk.ts:118:1)
The text was updated successfully, but these errors were encountered: