Replies: 1 comment
-
Hi @mtedja, this error indicates that the sender/receiver token addresses have not been set to the associate token address correctly. In solana, a wallet has an associated token account for each SPL token. This can be retrived as following: wallet-core/swift/Tests/Blockchains/SolanaTests.swift Lines 214 to 218 in ed65621 Please use the above to get the correct token address and use that in the call. Thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have to create Solana Smart Contract use this function
func (ss *SolanaService) TriggerSolanaSmartContract(tokenMintAddres string, from string, to string, privateKey string, amount uint64, decimals uint32, block string) (string, error) {
priKeyByte, err := hex.DecodeString(privateKey)
if err != nil {
return "", fmt.Errorf("[Solana Service] - failed to decode private key: %w", err)
}
}
And i have this example request body :
{
"token_mint_address": "USDT_Token_Address",
"from": "SOL_Address_Sender",
"to": "SOL_Address_Receiver",
"private_key": "Private_Key_Sender",
"amount": 6600000,
"decimals": 6,
"block": "Latest_Block_Hash"
}
I have try to use CreateAndTransferToken function that got this error :
"error": {
"code": -32002,
"message": "Transaction simulation failed: Error processing Instruction 0: Provided seeds do not result in a valid address",
"data": {
"accounts": null,
"err": {
"InstructionError": [
0,
"InvalidSeeds"
]
},
"innerInstructions": null,
"logs": [
"Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL invoke [1]",
"Program log: Create",
"Program log: Error: Associated address does not match seed derivation",
Before this i try use TokenTransfer function and send same request body and got this error
invalid account data for instruction","data":{"accounts":null,"err":{"InstructionError":[0,"InvalidAccountData"]},"innerInstructions":null,"logs":["Program invoke [1]","Program log: Instruction: TransferChecked","Program log: Error: InvalidAccountData","Program consumed 1357 of 200000 compute units","Program failed: invalid account data for instruction"],"replacementBlockhash":null,"returnData":null,"unitsConsumed":1357}},"id":1}\n" url="https://api.mainnet-beta.solana.com"
Btw, im using main net for this.
Could u help to check what happened. I have try to see #3805 but got the answer.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions