When trying to get started with the SNS JS SDK, attempting to register a new domain in DEVNET produces an error.
const createDevnetDomain = async () => { const [, ixs] = await devnet.bindings.registerDomainName( connection,"boooooo", // The name of the domain you want to register 1_000, window.solana.publicKey, // PublicKey of fee payer getAssociatedTokenAddressSync(NATIVE_MINT, window.solana.publicKey, true), // import from @solana/spl-token NATIVE_MINT ); console.log(ixs); const tx = new Transaction(); tx.feePayer = window.solana.publicKey; tx.recentBlockhash = (await connection.getLatestBlockhash('finalized')).blockhash; tx.add(...ixs); console.log(tx); const signedTx = await window.solana.signTransaction(tx); console.log(signedTx); const signature = await connection.sendRawTransaction(signedTx.serialize()); console.log(signature);}
Note: The instruction being generated contains 15 keys and matches the structure of the createNameRegistry() method (https://github.com/Bonfida/sns-sdk/blob/main/js/src/bindings.ts#L77), rather than reflecting those defined for the function being called.
Transaction Instruction being generated IXs:
[ {"keys": [ {"pubkey": "namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX","isSigner": false,"isWritable": false }, {"pubkey": "5eoDkP6vCQBXqDV9YN2NdUs3nmML3dMRNmEYpiyVNBm2","isSigner": false,"isWritable": false }, {"pubkey": "4sKwnTgwZKjvgNecE7eGPgPw4o6VB2xmH4i2PCVNcTTt","isSigner": false,"isWritable": true }, {"pubkey": "BNVnHvxL2G5Mm1jMD6rEGd8UYLsFY6sXr7ZyP4iXMwth","isSigner": false,"isWritable": true }, {"pubkey": "11111111111111111111111111111111","isSigner": false,"isWritable": false }, {"pubkey": "7NbD1vprif6apthEZAqhRfYuhrqnuderB8qpnfXGCc8H","isSigner": false,"isWritable": false }, {"pubkey": "3Js7k6xYQbvXv6qUYLapYV7Sptfg37Tss9GcAyVEuUqk","isSigner": true,"isWritable": true }, {"pubkey": "9zZpV9wsCT7AbxcWP4xZxywkPBMq9uL86Vmn6yERAXNT","isSigner": false,"isWritable": true }, {"pubkey": "BmA9Z6FjioHJPpjT39QazZyhDRUdZy2ezwx4GiDdE2u2","isSigner": false,"isWritable": false }, {"pubkey": "3Mnn2fX6rQyUsyELYms1sBJyChWofzSNRoqYzvgMVz5E","isSigner": false,"isWritable": false }, {"pubkey": "J83w4HKfqxwcq3BEMMkPFSppX3gqekLyLJBexebFVkix","isSigner": false,"isWritable": false }, {"pubkey": "CK4GgmwCq1Bcz8dgGSLz5bueJbPdBwNfHPRfWQezgXTU","isSigner": false,"isWritable": true }, {"pubkey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA","isSigner": false,"isWritable": false }, {"pubkey": "SysvarRent111111111111111111111111111111111","isSigner": false,"isWritable": false }, {"pubkey": "7X2FuvVr3Ji2VpmknqBW1mC4uEo7dapGPHxVARzWf9mR","isSigner": false,"isWritable": false } ],"programId": "snshBoEQ9jx4QoHBpZDQPYdNCtw7RMxJvYrKFEhwaPJ","data": [ 13, 7, 0, 0, 0, 98, 111, 111, 111, 111, 111, 111, 232, 3, 0, 0, 0 ] }]
The Transaction itself (TX)
{"recentBlockhash": "8zsaDAYGJaAtq2WYGiuTZto8biiarKTJCsDapPx3dbfH","feePayer": "3Js7k6xYQbvXv6qUYLapYV7Sptfg37Tss9GcAyVEuUqk","nonceInfo": null,"instructions": [ {"keys": [],"programId": "ComputeBudget111111111111111111111111111111","data": [ 3, 160, 134, 1, 0, 0, 0, 0, 0 ] }, {"keys": [],"programId": "ComputeBudget111111111111111111111111111111","data": [ 2, 64, 13, 3, 0 ] }, {"keys": [ {"pubkey": "namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX","isSigner": false,"isWritable": false }, {"pubkey": "5eoDkP6vCQBXqDV9YN2NdUs3nmML3dMRNmEYpiyVNBm2","isSigner": false,"isWritable": false }, {"pubkey": "4sKwnTgwZKjvgNecE7eGPgPw4o6VB2xmH4i2PCVNcTTt","isSigner": false,"isWritable": true }, {"pubkey": "BNVnHvxL2G5Mm1jMD6rEGd8UYLsFY6sXr7ZyP4iXMwth","isSigner": false,"isWritable": true }, {"pubkey": "11111111111111111111111111111111","isSigner": false,"isWritable": false }, {"pubkey": "7NbD1vprif6apthEZAqhRfYuhrqnuderB8qpnfXGCc8H","isSigner": false,"isWritable": false }, {"pubkey": "3Js7k6xYQbvXv6qUYLapYV7Sptfg37Tss9GcAyVEuUqk","isSigner": true,"isWritable": true }, {"pubkey": "9zZpV9wsCT7AbxcWP4xZxywkPBMq9uL86Vmn6yERAXNT","isSigner": false,"isWritable": true }, {"pubkey": "BmA9Z6FjioHJPpjT39QazZyhDRUdZy2ezwx4GiDdE2u2","isSigner": false,"isWritable": false }, {"pubkey": "3Mnn2fX6rQyUsyELYms1sBJyChWofzSNRoqYzvgMVz5E","isSigner": false,"isWritable": false }, {"pubkey": "J83w4HKfqxwcq3BEMMkPFSppX3gqekLyLJBexebFVkix","isSigner": false,"isWritable": false }, {"pubkey": "CK4GgmwCq1Bcz8dgGSLz5bueJbPdBwNfHPRfWQezgXTU","isSigner": false,"isWritable": true }, {"pubkey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA","isSigner": false,"isWritable": false }, {"pubkey": "SysvarRent111111111111111111111111111111111","isSigner": false,"isWritable": false }, {"pubkey": "7X2FuvVr3Ji2VpmknqBW1mC4uEo7dapGPHxVARzWf9mR","isSigner": false,"isWritable": false } ],"programId": "snshBoEQ9jx4QoHBpZDQPYdNCtw7RMxJvYrKFEhwaPJ","data": [ 13, 7, 0, 0, 0, 98, 111, 111, 111, 111, 111, 111, 232, 3, 0, 0, 0 ] } ],"signers": ["3Js7k6xYQbvXv6qUYLapYV7Sptfg37Tss9GcAyVEuUqk" ]}
RPC Network call Payload:
{"method": "sendTransaction","jsonrpc": "2.0","params": ["AXA/ImeY3fiVES+UcP+LuHMmKggqu4ajVwmRJiJpL4oKokNscAR6uPUT5skbSCsnG2BDd7kNZZRwDK4JWNyiJwIBAAwRIkrqC+g88eamANb3tU6OiBJW21IjBWP85MhI4XKkOsc5d4WbWmYH8fhqLWTqMompnC+A9oXPUBQV4d5zciDhx4WctbNAygdk9tKGFr03nHe7J1ijlLLEVmDp2WjE2Eycmhab4eVCClwyaH/AotPoLH/YlY6KOekiv6h/pIByLK6oELVqgd52Dz2CgCIU9Dv4pGJ8XKz7HGSRpuLMccajPwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIwq/4Ow7RgvVX8T7NjVnFjKZFRRUlyArjri/Gvago7lFHX+fdQm0mYbsdlUlyURme8kZqMr23pOMUhetFcJSKV6t/ykp0Zd9U3s5mafl2NR9T8eJrtd3MJqW/fCdDkr6YNb3nby5Y2mVYVGKQ3ND4rKVzoF6atHcJVjVbDABxxCf5MSXwer3YQwufcN6J3kn5mELJuOfeinC0NETCwlNdQMGRm/lIRcy/+ytunLDm+e8jOW7xfcSayxDmzpAAAAA/mUPA2fUp++YFaWT6hXTZZPwZDqq8BSbsEvmerhR3s0LrVH0E8HzqZRg2QDYvy7Wkn7KNNe3hCv4EKlzCC0e3A0C6Q3cyyuuI6c7B9PC+lCenSzLyvl/yllu8RVj4XZBBqfVFxksXFEhjMlMPUrxf1ja7gibof1E49vZigAAAAAG3fbh12Whk9nL4UbO63msHLSF7V9bN5E6jPWFfv8AqXbVGOI7wTVt+4m5U9vreETf4pI2ubHSSjjkPyl8EvSUAwsACQOghgEAAAAAAAsABQJADQMADg8NBwEDBQgAAgoGDAQQDwkRDQcAAABib29vb29v6AMAAAA=", {"encoding": "base64","preflightCommitment": "finalized" } ],"id": "2cade21a-5a69-434d-b27a-1b84372cd000"}
**FULL RESPONSE FROM RPC **
{"jsonrpc": "2.0","error": {"code": -32002,"message": "Transaction simulation failed: Error processing Instruction 2: Program failed to complete","data": {"accounts": null,"err": {"InstructionError": [ 2,"ProgramFailedToComplete" ] },"innerInstructions": null,"logs": ["Program ComputeBudget111111111111111111111111111111 invoke [1]","Program ComputeBudget111111111111111111111111111111 success","Program ComputeBudget111111111111111111111111111111 invoke [1]","Program ComputeBudget111111111111111111111111111111 success","Program snshBoEQ9jx4QoHBpZDQPYdNCtw7RMxJvYrKFEhwaPJ invoke [1]","Program log: Entrypoint","Program log: Beginning processing","Program log: Instruction unpacked","Program log: Instruction: Create v3","Program log: Found product in mapping.","Program log: Found correct price account in product.","Program log: panicked at 'range end index 165 out of range for slice of length 0', src/state.rs:131:19","Program snshBoEQ9jx4QoHBpZDQPYdNCtw7RMxJvYrKFEhwaPJ consumed 47020 of 199700 compute units","Program snshBoEQ9jx4QoHBpZDQPYdNCtw7RMxJvYrKFEhwaPJ failed: SBF program panicked" ],"returnData": null,"unitsConsumed": 47320 } },"id": "2cade21a-5a69-434d-b27a-1b84372cd000"}
UPDATE:
After creating ATAs for wSOL, I am now getting a different error ( Insufficient funds )
{"jsonrpc": "2.0","error": {"code": -32002,"message": "Transaction simulation failed: Error processing Instruction 0: custom program error: 0x1","data": {"accounts": null,"err": {"InstructionError": [ 0, {"Custom": 1 } ] },"innerInstructions": null,"logs": ["Program snshBoEQ9jx4QoHBpZDQPYdNCtw7RMxJvYrKFEhwaPJ invoke [1]","Program log: Entrypoint","Program log: Beginning processing","Program log: Instruction unpacked","Program log: Instruction: Create v3","Program log: Found product in mapping.","Program log: Found correct price account in product.","Program log: Pyth FP32 price value: 550826466","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]","Program log: Instruction: Transfer","Program log: Error: insufficient funds","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4302 of 147304 compute units","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA failed: custom program error: 0x1","Program snshBoEQ9jx4QoHBpZDQPYdNCtw7RMxJvYrKFEhwaPJ consumed 56998 of 200000 compute units","Program snshBoEQ9jx4QoHBpZDQPYdNCtw7RMxJvYrKFEhwaPJ failed: custom program error: 0x1" ],"returnData": null,"unitsConsumed": 56998 } },"id": "dcdd3973-2329-4498-9497-297f4a139be2"}