Documentation Index
Fetch the complete documentation index at: https://base-a060aa97-pat-schemav2-docs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
The fetchOnrampTransactionStatus utility retrieves the status of onramp transactions for a specific user. This is useful for tracking the progress of crypto purchases and displaying transaction history.
Usage
import { fetchOnrampTransactionStatus } from '@coinbase/onchainkit/fund';
const transactions = await fetchOnrampTransactionStatus({
partnerUserId: 'user123',
nextPageKey: '',
pageSize: '10',
apiKey: 'your-api-key', // Required when using without OnchainKitProvider or in non-React environment
});
Parameters
{
/**
* A unique identifier that will be associated with any transactions created
* by the user during their Onramp session. You can use this with the
* Transaction Status API to check the status of the user's transaction.
* See https://docs.cdp.coinbase.com/onramp/docs/api-reporting#buy-transaction-status
*/
partnerUserId: string; // Your unique identifier for the user
nextPageKey: string; // Token for pagination
pageSize: string; // Number of transactions per page
/**
* Optional API key for Coinbase Onramp. If not provided, the API key from
* OnchainKitProvider will be used. Required when using the utility without
* OnchainKitProvider or in a non-React environment.
*/
apiKey?: string;
}
Returns
Promise<OnrampTransactionStatusResponseData> - Returns a promise that resolves to the transaction status data.
type OnrampTransactionStatusResponseData = {
transactions: OnrampTransaction[];
nextPageKey?: string;
totalCount: string;
};
type OnrampTransaction = {
status: OnrampTransactionStatusName;
purchaseCurrency: string;
purchaseNetwork: string;
purchaseAmount: OnrampAmount;
paymentTotal: OnrampAmount;
paymentSubtotal: OnrampAmount;
coinbaseFee: OnrampAmount;
networkFee: OnrampAmount;
exchangeRate: OnrampAmount;
txHash: string;
createdAt: string;
country: string;
userId: string;
paymentMethod: string;
transactionId: string;
};
type OnrampTransactionStatusName =
| 'ONRAMP_TRANSACTION_STATUS_UNSPECIFIED'
| 'ONRAMP_TRANSACTION_STATUS_CREATED'
| 'ONRAMP_TRANSACTION_STATUS_IN_PROGRESS'
| 'ONRAMP_TRANSACTION_STATUS_SUCCESS'
| 'ONRAMP_TRANSACTION_STATUS_FAILED';
type OnrampAmount = {
value: string;
currency: string;
};