Transaction
To create the transaction with wallet
ETH Transaction
1. Build ETH Transaction
To create an Ethereum transaction, use the ETHTransactionRequest
with the following attributes:
create a new Build
ETHTransactionRequest
should include the following attributes:chainID
: Chain ID (e.g., Ethereum is 1).toAddress
: Recipient's wallet address.amount
: Amount to transfer.gasPrice
: Gas price per unit.gasLimit
: Maximum gas allowed for the transaction.nonce
: Transaction count for the sender's account.data
: Optional additional data for the transaction.paillierGroupID
: User's Paillier group ID.keyGenGroupID
: the keygen Group ID of master walletkeyIdentity
: the keyIdentity of walletecType
: Cryptographic algorithm type (e.g.,eddsa
,ecdsa
)
Example:
val rawTxBytes = BuildETHTransactionRequest(
chainID = "1",
toAddress = "0xRecipientAddress",
amount = "10000",
gasPrice = "20000000000",
gasLimit = "21000",
nonce = "0",
data = null,
paillierGroupID = "paillierGroupID",
keyGenGroupID = "keyGenGroupID",
keyIdentity = "walletKeyIdentity",
ecType = "ecdsa"
)
val rawTransaction = client.buildETHTransaction(rawTxBytes)
2. Send ETH Transaction with Web3
Example:
val web3j = Web3j.build(HttpService("https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID"))
val transactionResponse = web3j.ethSendRawTransaction(rawTxBytes).send()
val transactionHash = transactionResponse.transactionHash
SOLANA Transaction
1. Build Solana Transaction
create a new Build
BuildSolTransactionRequest
should include the following attributes:chainID: Chain ID (e.g., Solana mainnet is 501).
fromAddress: Sender's wallet address.
toAddress: Recipient's wallet address.
Amount: Amount to transfer.
paillierGroupID: User's Paillier group ID.
keyGenGroupID: Master wallet's key generation group ID.
KkeyIdentity: the keyIdentity of wallet
eCType: Cryptographic algorithm type (e.g., eddsa, ecdsa).
Example:
val rawTxBytes = BuildSolTransactionRequest(
chainID = "501",
fromAddress = "SenderAddress",
toAddress = "RecipientAddress",
amount = "10000",
paillierGroupID = "paillierGroupID",
keyGenGroupID = "keyGenGroupID",
keyIdentity = "walletKeyIdentity",
ecType = "eddsa"
)
val rawTransaction = client.buildSolTransaction(rawTxBytes)
2. Send SOLANA Transaction
Use a Solana library to send the raw transaction. Encode the raw transaction to Base58 before sending. Example:
val rpc = RPC("https://api.mainnet-beta.solana.com")
val rawTXBase58 = Base58Util.encodeBase58(rawTxBytes)
val transactionHash = rpc.sendTransaction(rawTXBase58)
TRON Transaction
1. Build TRON Transaction
create a new Build
BuildTronTransactionRequest
should include the following attributes:chainID: Chain ID (e.g., Tron mainnet is 728, testnet is 939).
fromAddress: Sender's wallet address.
toAddress: Recipient's wallet address.
amount: Amount to transfer.
paillierGroupID: User's Paillier group ID.
keyGenGroupID: Master wallet's key generation group ID.
KkeyIdentity: the keyIdentity of wallet
eCType: Cryptographic algorithm type (e.g., eddsa, ecdsa).
Example:
val rawTxBytes = BuildTronTransactionRequest(
chainID = "728",
fromAddress = "SenderAddress",
toAddress = "RecipientAddress",
amount = "10000",
paillierGroupID = "paillierGroupID",
keyGenGroupID = "keyGenGroupID",
keyIdentity = "walletKeyIdentity",
ecType = "eddsa"
)
val rawTransaction = client.buildTronTransaction(rawTxBytes)
2. Send TRON Transaction
Use a TRON library to send the raw transaction. Encode the raw transaction to Base58 before sending. Example:
val rpc = RPC("https://api.shasta.trongrid.io")
val transactionHash = rpc.sendTransaction(rawTxBytes)
TON Coin Transaction
1. Build TON CoinTransaction
create a new Build
BuildTonTransactionRequest
should include the following attributes:chainID: Chain ID (e.g., Ton mainnet is ton, testnet is ton-testnet).
fromAddress: Sender's wallet address.
toAddress: Recipient's wallet address.
amount: Amount to transfer.
paillierGroupID: User's Paillier group ID.
keyGenGroupID: Master wallet's key generation group ID.
keyIdentity: the keyIdentity of wallet
ellipticCurveType: Cryptographic algorithm type (e.g., eddsa, ecdsa).
derivationPath: derivation Path of Ton chain "m/44'/607'/0'"
subwallet: The type of ton wallet v3r2 (698983191)
comment: memo of transaction
bounce: the transaction to bounce (true, false)
Example:
val rqTon = BuildTonTransactionRequest(
keyGenGroupID = "keygenGroupId"
paillierGroupID = "paillierGroupId"
keyIdentity = "keyIdentity"
ellipticCurveType = "eddsa"
derivationPath = "derivationPath"
chainID = "ton-testnet"
toAddress = "toAddress"
fromAddress = "fromAddress"
amount = "amount"
subwallet = "subWallet"
comment = "memo"
bounce = true
)
val rawTxBytes = client.buildTonTransaction(rqTon)
2. Send TON Coin Transaction
Use a TON library to send the raw transaction. Encode the raw transaction to Base58 before sending. Example:
val rpc = RPC("https://main.us.mpc.memigma.io/proxy/ton/sendBocReturnHash")
val bocTx = Base64.encodeToString(data, Base64.DEFAULT);
val transactionHash = rpc.sendBocReturnHash(bocTx)
Bitcoin Transaction
1. Build Bitcoin Transaction
create a new Build
BuildBtcTransactionRequest
should include the following attributes:chainID: Chain ID (e.g., BTC mainnet is btc, testnet is btc-testnet).
fromAddress: Sender's wallet address.
receiverAddress: Recipient's wallet address.
amount: Amount to transfer.
paillierGroupID: User's Paillier group ID.
keyGenGroupID: Master wallet's key generation group ID.
keyIdentity: the keyIdentity of wallet
ellipticCurveType: Cryptographic algorithm type (e.g., eddsa, ecdsa).
IgnoringFee: The flag used to skip fee enforcement on testnet. This should always be set to false on mainnet.
Example:
val rqBTC = BuildBtcTransactionRequest(
chainId = "chainId"
fromAddress = "fromAddress"
receiverAddress = "toAddress"
amount = "amount"
ellipticCurveType = "ecType"
paillierGroupID = "paillierGroupId"
keyGenGroupID = "keygenGroupId"
keyIdentity = "keyIdentity"
derivationPath = "derivationPath"
IgnoringFee = true
)`
val rawTxBytes = client.buildBtcTransaction(rqBTC)
2. Send Bitcoin Transaction
Use a BTC library to send the raw transaction. Encode the raw transaction to Base58 before sending. Example:
val rpc = RPC("https://blockstream.info/testnet/api/tx")
val transactionHash = rpc.sendTransaction(rawTxBytes)
XRP Transaction
Build XRP Transaction
To create an XRP transaction, use the buildXrpTransaction
method with the following attributes:
paillierGroupId
: The Paillier group ID associated with your wallet.keygenGroupId
: The Keygen group ID of your master wallet.wallet
: The current wallet object containing details likekeyIdentity
,ecType
, etc.toAddress
: The recipient's XRP wallet address.fromAddress
: The sender's XRP wallet address.chainId
: The ID of the XRP chain or network.amount
: The amount of XRP to send.keygenGroupServerShard
: The server shard of the Keygen group that was saved in secure storage.paillierGroupServerShard
: The server shard of the Paillier group that was saved in secure storage.
Example:
fun main() {
val paillierGroupID = "paillierGroupID"
val keygenGroupID = "keygenGroupID"
val currentWallet = Wallet(/*...*/) // Your initialized wallet
val recipientXrpAddress = "rRecipientXRPAddress"
val senderXrpAddress = "rSenderXRPAddress"
val chainID = "XRPChainID"
val amountToSend = "1000"
// Shards retrieved from your secure storage
val keygenShardBytes = /* Keygen group server shard bytes */
val paillierShardBytes = /* Paillier group server shard bytes */
// Build the XRP transaction
val rawTxFlow = buildXrpTransaction(
paillierGroupId = paillierGroupID,
keygenGroupId = keygenGroupID,
wallet = currentWallet,
toAddress = recipientXrpAddress,
fromAddress = senderXrpAddress,
chainId = chainID,
amount = amountToSend,
keygenGroupServerShard = keygenShardBytes,
paillierGroupServerShard = paillierShardBytes
)
// Retrieve the raw transaction bytes
val rawTransactionBytes = rawTxFlow.first()
println("Raw XRP Transaction Bytes: $rawTransactionBytes")
}
Last updated