0

is it possible to get the token mint address when a new token is called from the websocket API?

context: { slot: 305696650 }, value: { signature: '4fAVhJUL5MT5Yws5BWn7TtGKhWZJeD9JTnUYisxPHHS3VnfafJLKncoeWWgg2FiSHZ9g7p72dywtQx7LfTDgQ8m7', err: { InstructionError: [Array] }, logs: [ 'Program ComputeBudget111111111111111111111111111111 invoke [1]', 'Program ComputeBudget111111111111111111111111111111 success', 'Program ComputeBudget111111111111111111111111111111 invoke [1]', 'Program ComputeBudget111111111111111111111111111111 success', 'Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 invoke [1]', 'Program log: Instruction: Route', 'Program LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo invoke [2]', 'Program log: Instruction: Swap', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]', 'Program log: Instruction: TransferChecked', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 6238 of 83263 compute units', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]', 'Program log: Instruction: TransferChecked', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 6147 of 73591 compute units', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success', 'Program LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo invoke [3]', 'Program LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo consumed 2134 of 64010 compute units', 'Program LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo success', 'Program LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo consumed 126226 of 186534 compute units', 'Program LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo success', 'Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 invoke [2]', 'Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 consumed 471 of 57863 compute units', 'Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 success', 'Program 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 invoke [2]', 'Program log: ray_log: A4HzfuiAAAAAAAAAAAAAAAABAAAAAAAAAIHzfuiAAAAAOfa3TfgAAAAVbm1T6CMAAHF76mwDAAAA', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]', 'Program log: Instruction: Transfer', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4645 of 31245 compute units', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]', 'Program log: Instruction: Transfer', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4736 of 23619 compute units', 'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success', 'Program 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 consumed 30539 of 48568 compute units', 'Program 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 success', 'Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 invoke [2]', 'Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 consumed 471 of 15655 compute units', 'Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 success', 'Program log: AnchorError thrown in programs/jupiter/src/lib.rs:346. Error Code: SlippageToleranceExceeded. Error Number: 6001. Error Message: Slippage tolerance exceeded.', 'Program log: Left: 14712208241', 'Program log: Right: 16000000010', 'Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 consumed 195977 of 204962 compute units', 'Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 failed: custom program error: 0x1771' ] } }

This is the only info I get, do I need to use the REST API to query? I dont want to use helius for this.

When I do a reuqest right after the message I get this

Executing curl command:

            curl -s -X POST https://solana-rpc.publicnode.com                 -H "Content-Type: application/json"                 -d '{
                "jsonrpc": "2.0",
                "id": 1,
                "method": "getTransaction",
                "params": [
                    "QZXAwPZyjwCfCZ61Xp8XsMZmAKviMi8DaH6bx3SHtGGhKZdEa3ay54ycJKe4nsR9U31qg6iZja4WovB4UMt7dK8",
                    {
                        "encoding": "jsonParsed",
                        "commitment": "finalized",
                        "maxSupportedTransactionVersion": 0
                    }
                ]
            }'

Full raw response: {"jsonrpc":"2.0","result":null,"id":1} Transaction not found or pruned. Response: { "jsonrpc": "2.0", "result": null, "id": 1 }

Why is it not found???

Thank you.

1 Answer 1

1

To get the token mint address for newly minted tokens, you need to subscribe to Solana WebSocket logs for token creation events (like mintTo or CreateToken instructions) and then use the transaction signature with getTransaction to retrieve the full details, ensuring the transaction is not pruned.

2
  • thank you, getTransaction needs to be done with the API or can be retried in websockets? Commented Dec 6 at 22:47
  • Sorry for late reply. You need to use the RPC API to call getTransaction. WebSocket subscriptions cannot retrieve transaction details directly. Retries with getTransaction via API can help ensure the transaction is not pruned.
    – mumut3k
    Commented Dec 11 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.