API
Enpoints
Transaction
14 min
transaction retrieve get api/external/transactions/ use this to paginate through existing transactions with optional filters get /api/external/transactions/?limit={limit}\&page={page}&{filters} request (query params) { "limit" number, "page" number, "params" record\<string, string> } response { "count" number, "next" string | null, "previous" string | null, "results" transaction\[] } help text \ (optional) `limit` page size; defaults to `20` \ (optional) `page` 1 indexed page number; defaults to `1` \ (optional) `params` key value filters accepted by primevault transactions api (e g , `status`, `category`, `vaultid`, `asset`, `externalid`) include only the filters you need example request get /api/external/transactions/?limit=10\&page=2\&status=pending\&vaultid=vault 123 sdk function gettransactions(params? record\<string, string>, page? number, limit? number) promise\<transaction\[]> get api/external/transactions/{transactionid}/ request (path param) { "transactionid" string } response transaction help text \ (required) `transactionid` the unique id returned when the transaction was created or retrieved from a list response (`results\[] id`) example request get /api/external/transactions/txn abc123/ sdk function gettransactionbyid(transactionid string) promise\<transaction> fee estimation post api/external/transactions/estimate fee/ get the estimated fee for a transfer transaction request { "source" transferpartydata, "destination" transferpartydata, "amount" string, "asset" string, "blockchain" string } response estimatedfeeresponse help text \ (required) `source` `transferpartydata` describing the sender (vault/contact/external address plus `id` or `value`) \ (required) `destination` `transferpartydata` describing the recipient \ (required) `amount` decimal string amount you expect to transfer \ (required) `asset` token symbol used for the future transfer \ (required) `blockchain` chain identifier (e g , `ethereum`, `polygon`) that matches both parties example request { "source" { "type" "vault", "id" "vault 123" }, "destination" { "type" "contact", "id" "contact 456" }, "amount" "0 50", "asset" "eth", "blockchain" "ethereum" } sdk function estimatefee(request estimatefeerequest) promise\<estimatedfeeresponse> transfer transaction post api/external/transactions/ request { "source" transferpartydata, "destination" transferpartydata, "amount" string, "asset" string, "blockchain" string, "category" enum transactioncategory, "gasparams" transactioncreationgasparams, "externalid" string, "memo" string, "feepayer" feepayer } response transaction \ help text \ (required) `source` `transferpartydata` describing the origin (type `vault`, `contact`, or `external address` plus `id`/`value`) \ (required) `destination` `transferpartydata` describing where the assets should go \ (required) `amount` decimal string amount to transfer (e g , `"0 5"` for 0 5 tokens) \ (required) `asset` asset symbol to send (e g , `eth`, `usdc`) \ (required) `blockchain` chain identifier that matches the wallet/network (e g , `ethereum`, `polygon`) \ (required) `category` must be `transfer` to route through the transfer workflow \ (optional) `gasparams` object with `feetier` to hint low/medium/high fee selection \ (optional) `externalid` unique string from your system for idempotency/correlation \ (optional) `memo` free form note retained with the transaction \ (optional) `feepayer` `{ "id" string }` identifying an alternate vault paying gas example request { "source" { "type" "vault", "id" "vault 123" }, "destination" { "type" "contact", "id" "contact 456" }, "amount" "0 50", "asset" "eth", "blockchain" "ethereum", "category" "transfer", "gasparams" { "feetier" "medium" }, "externalid" "invoice 1001", "memo" "vendor payout #1001" "feepayer" {"id" "vault 234"} } sdk function createtransfertransaction(request createtransfertransactionrequest) promise\<transaction> fee sponser feepayer { "id" string } vault responsible for paying the transaction fee fees are deducted from this vault this represents the actual fee payer, using eip 7702 on evm chains and native fee payer mechanisms on chains such as solana and tron trade transaction create a new trade transaction step 1 get trade quotes fetch the trade quote available for a given asset x chain pair post api/external/transactions/trade quote request (query params/body) { "vaultid" string, "fromasset" string, "fromamount" string, "blockchain" string, "toasset" string, "toblockchain" string, "slippage" string } response gettradequoteresponse help text \ (required) `vaultid` vault providing funds for the swap \ (required) `fromasset` symbol of the asset you are selling \ (required) `fromamount` decimal string of the source amount \ (required) `blockchain` source chain (`fromchain`) for the funds \ (required) `toasset` symbol of the asset you want to receive \ (required) `toblockchain` destination chain (`tochain`) \ (required) `slippage` acceptable slippage percentage as a string (e g , `"1"` for 1%) example request { "vaultid" "vault 789", "fromasset" "usdc", "fromamount" "1000", "blockchain" "ethereum", "toasset" "eth", "toblockchain" "ethereum", "slippage" "1" } example response (truncated) { "traderequestdata" { "fromasset" "usdc", "fromamount" "1000", "blockchain" "ethereum", "toasset" "eth", "toblockchain" "ethereum", "slippage" "1" }, "traderesponsedatalist" \[ { "finaltoamount" "0 52", "finaltoamountusd" "1002 34", "sourcename" "aggregatorx", "feeinusd" "2 00", "autoslippage" "0 5" } ] } sdk function gettradequote(request tradequoterequest) promise\<gettradequoteresponse> step 2 create a trade transaction after selecting a quote from above api, can you pass that quote in the create api post api/external/transactions/ request { "vaultid" string, "traderequestdata" tradequoterequestdata, "traderesponsedata" tradequoteresponsedata, "blockchain" string, "category" enum transactioncategory, "externalid" string, "memo" string } response transaction help text \ (required) `vaultid` the vault executing the trade (source of funds) \ (required) `traderequestdata` the request payload previously used to fetch quotes; include fromasset, fromamount, blockchain, etc \ (required) `traderesponsedata` selected quote entry from `traderesponsedatalist` returned by `gettradequote` \ (required) `blockchain` chain on which the trade executes; should match `traderequestdata blockchain` \ (required) `category` must be `swap` for trade operations \ (optional) `externalid` unique identifier for tracking/idempotency \ (optional) `memo` informational note for audit trails example request { "vaultid" "vault 789", "traderequestdata" { "fromasset" "usdc", "fromamount" "1000", "blockchain" "ethereum", "toasset" "eth", "toblockchain" "ethereum", "slippage" "1" }, "traderesponsedata" { "finaltoamount" "0 52", "finaltoamountusd" "1002 34", "sourcename" "aggregatorx", "feeinusd" "2 00", "autoslippage" "0 5" }, "blockchain" "ethereum", "category" "swap", "externalid" "swap 202", "memo" "rebalance to eth" } sdk function createtradetransaction(request createtradetransactionrequest) promise\<transaction> delegate transaction use this when delegating energy or bandwidth or other resource from one vault to another post /api/external/transactions/ request { "source" transferpartydata, "destination" transferpartydata, "asset" string, "blockchain" string, "amount" string, "resourcetype" enum resourcetype, "externalid" string, "memo" string, "category" enum transactioncategory } response transaction help text \ (required) `source` `transferpartydata` with `type` = `vault`, `contact`, or `external address`; include `id` or `value` depending on reference method \ (required) `destination` same structure as `source`; points to the wallet/contact/external address receiving the delegated resources \ (required) `asset` symbol for the tron token to delegate (commonly `trx`) \ (required) `blockchain` chain identifier string; currently `tron` for resource delegation \ (required) `amount` decimal string amount denoting the number of tokens to delegate \ (required) `resourcetype` either `tron energy` or `tron bandwidth` per the `resourcetype` enum \ (required) `category` must be `delegate resource` to route the transaction correctly \ (optional) `externalid` optional string you supply to correlate transactions in external systems (must be unique if provided) \ (optional) `memo` optional short note retained in the transaction record example request { "source" { "type" "vault", "id" "vault 123" }, "destination" { "type" "contact", "id" "contact 456" }, "asset" "trx", "blockchain" "tron", "amount" "25", "resourcetype" "tron energy", "externalid" "ops 001", "memo" "delegate energy to staking node", "category" "delegate resource" } sdk function delegateresource(request delegateresourcerequest) promise\<transaction> stake transaction use this when staking resources from a single vault back into tron validators or system contracts post /api/external/transactions/ request { "source" transferpartydata, "asset" string, "blockchain" string, "amount" string, "resourcetype" enum resourcetype, "externalid" string, "memo" string, "category" enum transactioncategory } response transaction help text \ (required) `source` `transferpartydata` representing the vault/contact providing tron resources \ (required) `asset` token symbol, typically `trx` \ (required) `blockchain` should be `tron` for staking \ (required) `amount` decimal string amount to stake \ (required) `category` must be `stake` \ (optional) `resourcetype` `tron energy` or `tron bandwidth` when omitted, the chain default applies \ (optional) `externalid` optional correlation/idempotency identifier \ (optional) `memo` optional descriptive note example request { "source" { "type" "vault", "id" "vault 123" }, "asset" "trx", "blockchain" "tron", "amount" "50", "resourcetype" "tron energy", "memo" "stake idle balance", "category" "stake" } sdk function stakeresource(request stakeresourcerequest) promise\<transaction> replace transaction use this to bump or resubmit an existing transaction (for example, to increase gas) while it is still pending it can be useful when a transaction is stuck in the mempool post /api/external/transactions/replace transaction/ request { "transactionid" string } response transaction help text \ (required) `transactionid` id of the original transaction you want to replace; must reference a transaction that is still replaceable (usually pending) example request { "transactionid" "txn abc123" } sdk function replacetransaction(request replacetransactionrequest) promise\<transaction>