When I transfer the token from the contract address: KT1LkNWZgVYh3zdaRkBb9aNgLEFCjVJwEKu2
, it works well. However, when I switch back to the address KT1P8RdJ5MfHMK5phKJ5JsfNfask5v2b2NQS
, an issue occurs. Below is my code:
const { TezosToolkit } = require ('@taquito/taquito');
const { InMemorySigner } = require ('@taquito/signer');
const Tezos = new TezosToolkit('https://ghostnet.ecadinfra.com/');
Tezos.setProvider({
signer: new InMemorySigner('edskRpi3j2hwiRqRvjoETUe99L14Kz796pLS3N6rq6K3sLC9Xq2BY27KhTFtAUtkgEwacZWvsFaJ6Cnju2EWNYSEJkhDSwjGzf'),
});
var from = "tz1MSint56iUqoogrKsvEMEykpbKv2Yhmzss"
var to = "tz1S2aWw5Jhz7RBcAKvJYfAG82Mv9LhEUobc"
var amount = 99
async function tranfer(){
const contract = await Tezos.contract.at('KT1P8RdJ5MfHMK5phKJ5JsfNfask5v2b2NQS');
await contract.methods.transfer([{
from_: from,
txs: [{ to_: to, token_id: 0, amount: amount }]
}]).send();
}
tranfer()
The error I encounter is:
AddressValidationError: [from] Address is not valid: [{"from_":"tz1MSint56iUqoogrKsvEMEykpbKv2Yhmzss","txs":[{"to_":"tz1S2aWw5Jhz7RBcAKvJYfAG82Mv9LhEUobc","token_id":0,"amount":99}]}]