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
However, when I use ton-connect to create tx, it is failed:
import{useState,useEffect}from"react";import{useTonhubConnect}from"react-ton-x";import{useModel}from"umi";import{toNano,beginCell,Address}from"ton";import{TonhubConnector}from"ton-x";importQRCodefrom"react-qr-code";import{Button}from"antd";exportdefault()=>{const{ address }=useModel("app");const[resp,setResp]=useState("");constconnect=useTonhubConnect();consttx={value: "0.1",to: "UQDvfA-3nVYHKb3uqLWV6yo6uGK4dNkd2IgKIiThVTJQUEC2",state_init:
"te6cckECJwEABNoAAgATAQNTgBSPKP3DZOEU9CEm7lu1QuynO9tGuliVYyclzoMRR6odAAAAAAAAAAAQEAMCAEsAyAPogBSPKP3DZOEU9CEm7lu1QuynO9tGuliVYyclzoMRR6odEAEU/wD0pBP0vPLICwQCAWIGBQAJoR+f4AUCAs4KBwIBIAkIAB0A8jLP1jPFgHPFszJ7VSAAOztRNDTP/pAINdJwgCafwH6QNQwECQQI+AwcFltbYAIBIAwLABE+kQwcLry4U2AC1wyIccAkl8D4NDTAwFxsJJfA+D6QPpAMfoAMXHXIfoAMfoAMPACBLOOFDBsIjRSMscF8uGVAfpA1DAQI/AD4AbTH9M/ghBfzD0UUjC6jocyEDdeMkAT4DA0NDU1ghAvyyaiErrjAl8EhA/y8IA4NAHJwghCLdxc1BcjL/1AEzxYQJIBAcIAQyMsFUAfPFlAF+gIVy2oSyx/LPyJus5RYzxcBkTLiAckB+wAB9lE1xwXy4ZH6QCHwAfpA0gAx+gCCCvrwgBuhIZRTFaCh3iLXCwHDACCSBqGRNuIgwv/y4ZIhjj6CEAUTjZHIUAnPFlALzxZxJEkUVEagcIAQyMsFUAfPFlAF+gIVy2oSyx/LPyJus5RYzxcBkTLiAckB+wAQR5QQKjdb4g8AggKONSbwAYIQ1TJ22xA3RABtcXCAEMjLBVAHzxZQBfoCFctqEssfyz8ibrOUWM8XAZEy4gHJAfsAkzAyNOJVAvADAgASEQCIaHR0cHM6Ly9hcGl2Mi10ZXN0LnBsYXR3aW4uaW8vYXNzZXRzL3Rvbi1jb2xsZWN0aW9uL1RPTnRlc3QvVGVzdENhdC8AiAFodHRwczovL2FwaXYyLXRlc3QucGxhdHdpbi5pby9hc3NldHMvdG9uLWNvbGxlY3Rpb24vVE9OdGVzdC9UZXN0Q2F0ART/APSkE/S88sgLFAIBYhwVAgEgFxYAJbyC32omh9IGmf6mpqGC3oahgsQCASAbGAIBIBoZAC209H2omh9IGmf6mpqGAovgngCOAD4AsAAvtdr9qJofSBpn+pqahg2IOhph+mH/SAYQAEO4tdMe1E0PpA0z/U1NQwECRfBNDUMdQw0HHIywcBzxbMyYAgLNIh0CASAfHgA9Ra8ARwIfAFd4AYyMsFWM8WUAT6AhPLaxLMzMlx+wCAIBICEgABs+QB0yMsCEsoHy//J0IAAtAHIyz/4KM8WyXAgyMsBE/QA9ADLAMmAE59EGOASK3wAOhpgYC42Eit8H0gGADpj+mf9qJofSBpn+pqahhBCDSenKgpQF1HFBuvgoDoQQhUZYBWuEAIZGWCqALnixJ9AQpltQnlj+WfgOeLZMAgfYBwGyi544L5cMiS4ADxgRLgAXGBEuAB8YEYGYHgAkJiUkIwA8jhXU1DAQNEEwyFAFzxYTyz/MzMzJ7VTgXwSED/LwACwyNAH6QDBBRMhQBc8WE8s/zMzMye1UAKY1cAPUMI43gED0lm+lII4pBqQggQD6vpPywY/egQGTIaBTJbvy9AL6ANQwIlRLMPAGI7qTAqQC3gSSbCHis+YwMlBEQxPIUAXPFhPLP8zMzMntVABgNQLTP1MTu/LhklMTugH6ANQwKBA0WfAGjhIBpENDyFAFzxYTyz/MzMzJ7VSSXwXiVI2d/A==",};console.log("To: ",tx.to,Address.parse(tx.to).toFriendly());constcollectionCreate=async()=>{// Request bodyconstrequest={//@ts-ignoreseed: connect.state.seed,// Session Seed//@ts-ignoreappPublicKey: connect.state.walletConfig.appPublicKey,// Wallet's app public keyto: tx.to,// Address.parse(tx.to).toFriendly(), // tx.to, // Destinationvalue: toNano(tx.value).toString(),// Amount in nano-tonstimeout: 5*60*1000,// 5 minut timeoutstateInit: tx.state_init,// Optional serialized to base64 string state_init celltext: "Create Collection",// Optional comment. If no payload specified - sends actual content, if payload is provided this text is used as UI-only hint// payload: tx.state_init, // Optional serialized to base64 string payload cell};constresponse=awaitconnect.api.requestTransaction(request);setResp(JSON.stringify(response));console.log("tx resp: ",response);if(response.type==="rejected"){// Handle rejection}elseif(response.type==="expired"){// Handle expiration}elseif(response.type==="invalid_session"){// Handle expired or invalid session}elseif(response.type==="success"){// Handle successful transactionconstexternalMessage=response.response;// Signed external message that was sent to the network}else{thrownewError("Impossible");}};}
Hello, how to pass stateInit param to ton-connector when deploy nft collection contract? I constructed a raw tx and it is successed:
However, when I use ton-connect to create tx, it is failed:
The success tx is https://testnet.tonapi.io/transaction/75c1fde9e8d9c0fbc1f778be1eee855b758bb800fb73263297d80c8e52a74268, the failed tx is https://testnet.tonapi.io/transaction/903b63fdb031ffce9b74e49715346e3d914e35f71dcc50871f81bfc9e7b388b8
The text was updated successfully, but these errors were encountered: