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
Im trying to initiate a send money transaction in my basic web-wallet that sends some near from a funded address to a new address in a custom CRA javascript application, but the function for actually building, signing and submitting the transaction to the network is failing. My codebase looks like this:
Im using the inMemoryKeyStore because im generating a wallet from a mnemonic. The wallet.account.secretKey is the secret key im using and the wallet.address is a valid near protocol address. The address im using is this: 1933b1fa96e6f84bcedf0ab46ccd2a224e92362c3a7c4478e2bd71b4fe83f699; it has about 0.25 Near as of the time of this writing, enough to be recognized by the network as a valid account.
...
const amount = this.nearToYocto('0.1')
const account = await near.account(wallet.address);
try{
var state = await account.state()
console.log(state)
const result = await account.sendMoney(wallet2.address, amount); //<---------- this call fails
console.log("Transaction Result:", result);
}catch(e){
console.log(e)
}
}
this.nearToYocto() converts a specified amount of Near into the base unit denominations and wallet2.address is a second new address i'm generating from another mnemonic. I query the state of the account to check if it exists in the network and it does; heres the response i'm getting from the await account.state() function call:
but when it attempts to execute the await account.sendMoney() function, it fails throwing this error:
TypedError: Can not sign transactions for account 1933b1fa96e6f84bcedf0ab46ccd2a224e92362c3a7c4478e2bd71b4fe83f699 on network mainnet, no matching key pair exists for this account
at Account.signTransaction (account.cjs:50:1)
at async account.cjs:72:1
at async exponentialBackoff (exponential-backoff.cjs:8:1)
at async Account.signAndSendTransaction (account.cjs:71:1)
at async App.run_near_transaction (App.js:2680:1)
NPM version: 9.6.7, Node version: 18.17.1, the near-api-js version in my package.json: "near-api-js": "^5.0.1".
The text was updated successfully, but these errors were encountered:
Im trying to initiate a send money transaction in my basic web-wallet that sends some near from a funded address to a new address in a custom CRA javascript application, but the function for actually building, signing and submitting the transaction to the network is failing. My codebase looks like this:
Im using the inMemoryKeyStore because im generating a wallet from a mnemonic. The
wallet.account.secretKey
is the secret key im using and thewallet.address
is a valid near protocol address. The address im using is this:1933b1fa96e6f84bcedf0ab46ccd2a224e92362c3a7c4478e2bd71b4fe83f699
; it has about 0.25 Near as of the time of this writing, enough to be recognized by the network as a valid account.this.nearToYocto()
converts a specified amount of Near into the base unit denominations and wallet2.address is a second new address i'm generating from another mnemonic. I query the state of the account to check if it exists in the network and it does; heres the response i'm getting from theawait account.state()
function call:but when it attempts to execute the
await account.sendMoney()
function, it fails throwing this error:NPM version: 9.6.7, Node version: 18.17.1, the near-api-js version in my package.json:
"near-api-js": "^5.0.1"
.The text was updated successfully, but these errors were encountered: