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
Hey there! So, I've been trying to create a nonce account in Solana using Kotlin code. The catch is, I want to implement this for a multi-signature wallet, but I don't have access to the private keys. When I run the code, I get this error:
Error processing Instruction 1: custom program error: 0x0
Can you help me out with this?
import wallet.core.jni.AnyAddress
import wallet.core.jni.CoinType
import wallet.core.jni.DataVector
import wallet.core.jni.PublicKey
import wallet.core.jni.PublicKeyType
import wallet.core.jni.SolanaAddress
private fun getPreSignedInputData(keysignPayload: KeysignPayload): ByteArray {
val solanaSpecific = keysignPayload.blockChainSpecific as? BlockChainSpecific.Solana
?: error("Invalid blockChainSpecific")
if (keysignPayload.coin.chain != Chain.Solana) {
error("Chain is not Solana")
}
// val toAddress = AnyAddress(keysignPayload.toAddress, coinType)
// Get rent-exempt amount for nonce account (80 bytes)
val rentExemptAmount = getRentExemptAmount() // You'll need to implement this function
//create bytestring and set 80
val input = Solana.SigningInput.newBuilder()
.setRecentBlockhash(solanaSpecific.recentBlockHash)
.setSender(keysignPayload.coin.address)
.setPriorityFeePrice(
Solana.PriorityFeePrice.newBuilder()
.setPrice(solanaSpecific.priorityFee.toLong())
.build()
)
.setCreateNonceAccount(
Solana.CreateNonceAccount.newBuilder()
.setNonceAccount(keysignPayload.coin.address) // The multisig address to upgrade
.setNonceAccountBytes(ByteString.copyFromUtf8("80"))// .setAuthority(keysignPayload.coin.address) // The multisig will be the authority
.setRent(rentExemptAmount) // Rent exempt amount for 80 bytes
// Don't set nonceAccountPrivateKey since it's a multisig
.build()
)
.build()
return input.toByteArray()
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey there! So, I've been trying to create a nonce account in Solana using Kotlin code. The catch is, I want to implement this for a multi-signature wallet, but I don't have access to the private keys. When I run the code, I get this error:
Error processing Instruction 1: custom program error: 0x0
Can you help me out with this?
Beta Was this translation helpful? Give feedback.
All reactions