Jump to
Ctrl
+
/

Prepare A Transaction From An Address In HD Wallet (xPub, yPub, zPub)

POST
/blockchain-data/{blockchain}/{network}/transactions/prepare-account-based-transaction

Through this endpoint users can prepare a transaction for signing from a synced with Crypto APIs address from the specific xPub. This endpoint applies to all supported account-based blockchain protocols, e.g. Ethereum, BSC, etc.

Path Parameters

blockchain string Required

Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.

network string Required

Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "sepolia" are test networks.

Query Parameters

context string Optional

In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

Request Body Schema application/json

context string Optional

In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

data object Required
item object Required
additionalData string Optional

Representation of the additional data.

amount string Required

Representation of the amount of the transaction

recipient string Required

Represents a list of recipient addresses with the respective amounts. In account-based protocols like Ethereum there is only one address in this list.

sender string Required

Represents a sender address with the respective amount. In account-based protocols like Ethereum there is only one address in this list.

xpub string Required

Defines the account extended publicly known key which is used to derive all child public keys.

fee object Required

When isConfirmed is True - Defines the amount of the transaction fee When isConfirmed is False - For ETH-based blockchains this attribute represents the max fee value.

exactAmount string Optional

String representation of the exact amount

priority string Required

Enum representation of the fee priority

nonce string Optional

Representation of the nonce value

transactionType string Optional

Representation of the transaction type. For Ethereum-Classic and Binance Smart Chain there is no need to provide "transactionType" in the request.

sequence string Required

String representation of the sequence

Response Schema

apiVersion string Required

Specifies the version of the API that incorporates this endpoint.

2023-04-25
requestId string Required

Defines the ID of the request. The requestId is generated by Crypto APIs and it's unique for every request.

601c1710034ed6d407996b30
context string Optional

In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

yourExampleString
data object Required
item object Required
amount string Required

Representation of the amount of the transaction

0.000003
recipient string Required

Represents a recipient addresses. In account-based protocols like Ethereum there is only one address in this list.

0x041c594a0cc194e826bef5411b29c7f27001b7e3
sender string Required

Represents a sender address with the respective amount. In account-based protocols like Ethereum there is only one address in this list.

0x03654A9E78771442CAdf8DB37ae60D6a12bAEa9f
sigHash string Required

Representation of the hash that should be signed.

40738814e379fd2b1923729c87ac80dddc6810a3f8f02fef05452251972ec83a
blockchainSpecific object Required
dataHex string Required

Representation of the data in hex value

0x0079006f00750072004100640064006900740069006f006e0061006c00440061007400610048006500720065
derivationIndex integer Required

Representation of the derivation index of the xpub address

0
fee object Required

When isConfirmed is True - Defines the amount of the transaction fee When isConfirmed is False - For ETH-based blockchains this attribute represents the max fee value.

gasLimit string Required

Represents the amount of gas used by this specific transaction alone.

552020
gasPrice string Required

Represents the price offered to the miner to purchase this amount of gas.

2500000007
maxFeePerGas string Required

Representation of the max fee per gas value

2000000008
maxPriorityFeePerGas string Required

Representation of the max priority fee per gas value

2000000000
nonce string Required

Represents the sequential running number for an address, starting from 0 for the first transaction. E.g., if the nonce of a transaction is 10, it would be the 11th transaction sent from the sender's address.

0
transactionType string Required

Representation of the transaction type

legacy-transaction
unit string Required

Represents the unit of the amount to be sent.

WEI

Credits Cost : 2500 Credits for 1 Results

Was this page helpful?
Yes
No
Powered by
Language
URL

{
    "apiVersion": "2023-04-25",
    "requestId": "601c1710034ed6d407996b30",
    "context": "yourExampleString",
    "data": {
        "item": {
            "amount": "0.000003",
            "recipient": "0x041c594a0cc194e826bef5411b29c7f27001b7e3",
            "sender": "0x03654A9E78771442CAdf8DB37ae60D6a12bAEa9f",
            "sigHash": "40738814e379fd2b1923729c87ac80dddc6810a3f8f02fef05452251972ec83a",
            "blockchainSpecific": {
                "dataHex": "0x0079006f00750072004100640064006900740069006f006e0061006c00440061007400610048006500720065",
                "derivationIndex": 0,
                "fee": {
                    "gasLimit": "552020",
                    "gasPrice": "2500000007",
                    "maxFeePerGas": "2000000008",
                    "maxPriorityFeePerGas": "2000000000"
                },
                "nonce": "0",
                "transactionType": "legacy-transaction",
                "unit": "WEI"
            }
        }
    }
}