@bebapps/rapyd-sdk
Version:
An un-official [Rapyd](https://rapyd.net) SDK for Node.js.
247 lines (245 loc) • 8.37 kB
text/typescript
import { Wallet } from './Wallet';
import { WalletContact } from './WalletContact';
export interface WalletTransaction {
/**
* ID of the transaction. String starting with **wt_** or UUID.
*
* Unique identifier of the wallet object. String starting with **ewallet_**.
* Relevant to **Funds Added** and **Funds Removed** webhooks.
*/
id: `wt_${string}`;
/**
* Currency accounts of the wallet. See [Wallet Object](ref:wallet-object).
*
* Relevant to **Funds Added** and **Funds Removed** webhooks. Response only.
*/
accounts: (Partial<Wallet>)[];
/**
* Three-letter ISO 4217 code for the currency used in the `amount` field. Uppercase.
*/
alias: string;
/**
* **Transactions:** Amount of the transfer, in units of the currency defined in `currency`. Decimal, including the correct number of decimal places for the currency exponent, as defined in ISO 2417:2015. If the amount is a whole number, use an integer and not a decimal.
*
* **Wallet Account Operations:** Amount of the account limit. See [Wallet Limit Object](ref:wallet-limit-object).
*/
amount: number;
/**
* The updated wallet balance after successful completion of the transaction.
*/
balance: number;
/**
* Balance type affected by the transaction. One of the following:
* - **available_balance**.
* - **on_hold_balance**.
* - **received_balance**.
* - **reserve_balance**.
* See [Wallet Balance Types](ref:wallet-balance-types).
*/
balance_type: 'available_balance' | 'on_hold_balance' | 'received_balance' | 'reserve_balance';
/**
* The type of client wallet. See [Wallet Object](ref:wallet-object).
*
* Relevant to **Funds Added** and **Funds Removed** webhooks. Response only.
*/
category: string;
/**
* Describes details about the wallet contacts. See [Wallet Contact Object](ref:wallet-contact-object).
*
* Relevant to **Funds Added** and **Funds Removed** webhooks. Response only.
*/
contacts: (Partial<WalletContact>)[];
/**
* Time the transaction was made, in [*Unix time*](ref:glossary).
*/
created_at: number;
/**
* Three-letter ISO 4217 code for the currency used in the `amount` field. Uppercase.
*/
currency: string;
/**
* Three-letter ISO 4217 code for the currency used in the `amount` field. Response only.
*/
currency_code: string;
/**
* Indicates the destination balance type when funds are transferred from one balance to another within the wallet.
*/
destination_balance: string;
/**
* ID of the wallet receiving the money. String starting with **ewallet_**.
*/
destination_ewallet: `ewallet_${string}`;
/**
* ID of the wallet receiving the money. String starting with **ewallet_**.
*/
destination_ewallet_id: `ewallet_${string}`;
/**
* Phone number of the owner of the wallet receiving the money, in E.164 format.
*/
destination_phone_number: string;
/**
* ID of the transaction with regard to the destination. String starting with **wt_**.
*/
destination_transaction_id: `wt_${string}`;
/**
* Email address of the wallet owner.
*
* Relevant to **Funds Added** and **Funds Removed** webhooks. Response only.
*/
email: string;
/**
* The ID of the wallet transaction created after the last wallet transaction you want to retrieve. String starting with **wt_**.
*
* Relevant to [List Wallet Transactions](ref:list-wallet-transactions).
*/
ending_before: `wt_${string}`;
/**
* ID of the wallet. String starting with **ewallet_**.
*/
ewallet_id: `ewallet_${string}`;
/**
* Optional wallet ID. See [Wallet Object](ref:wallet-object).
*
* Relevant to **Funds Added** and **Funds Removed** webhooks. Response only.
*/
ewallet_reference_id: string;
/**
* First name of the wallet owner.
*
* Relevant to **Funds Added** and **Funds Removed** webhooks. Response only.
*/
first_name: string;
/**
* Family name of the wallet owner.
*
* Relevant to **Funds Added** and **Funds Removed** webhooks. Response only.
*/
last_name: string;
/**
* Amount of the Funds Added and Funds Removed transactions, in units of the currency defined in `last_transaction_currency`.
*
* Response only.
*/
last_transaction_amount: number;
/**
* Three-letter ISO 4217 code for the currency used in the `last_transaction_amount` field.
*
* Response only.
*/
last_transaction_currency: number;
/**
* Reserved.
*/
limit: string;
/**
* Includes details on limits for single and cumulative transactions.
*/
limits: string;
/**
* A JSON object defined by the client.
*/
metadata: object;
/**
* Page number to retrieve.
*
* Relevant to [List Wallet Transactions](ref:list-wallet-transactions).
*/
page_number: string;
/**
* Number of results per page, up to 100. Default is **10**.
*
* Relevant to [List Wallet Transactions](ref:list-wallet-transactions).
*/
page_size: string;
/**
* Phone number of the wallet owner in E.164 format.
*
* Relevant to **Funds Added** and **Funds Removed** webhooks. Response only.
*/
phone_number: string;
/**
* Explanation for the action.
*/
reason: string;
/**
* Metadata created with [Set Transfer Response](ref:set-transfer-response). Response only.
*/
response_metadata: object;
/**
* Indicates the source balance type when funds are transferred from one balance to another within the wallet.
*/
source_balance: string;
/**
* ID of the wallet sending the money. String starting with **ewallet_**.
*/
source_ewallet: `ewallet_${string}`;
/**
* ID of the wallet sending the money. String starting with **ewallet_**.
*/
source_ewallet_id: `ewallet_${string}`;
/**
* Phone number of the owner of the wallet sending the money, in E.164 format.
*/
source_phone_number: string;
/**
* ID of the transaction with regard to the source. String starting with **wt_**.
*/
source_transaction_id: `wt_${string}`;
/**
* The ID of the wallet transaction created before the first wallet transaction you want to retrieve. String starting with **wt_**.
*
* Relevant to [List Wallet Transactions](ref:list-wallet-transactions).
*/
starting_after: `wt_${string}`;
/**
* **Funds Added and Funds Removed Webhooks:** Status of the wallet. See [Wallet Object](ref:wallet-object). Response only.
*
* Status of the transaction.
*
* * **Webhook - Transfer Funds Between Wallets Response** and **Request (Set Transfer Response)** - One of the following:
* - **accept** - The transferee accepts the transfer.
* - **cancel** - The sender cancels the transaction.
* - **decline** - The transferee declines to accept the transfer.
*
* * **Response** - One of the following:
* - **CAN** - The sender canceled the transaction.
* - **DEC** - The transferee declined to accept the transfer.
* - **PEN** - Pending. Waiting for the transferee to respond.
* - **CLO** - Closed. The transferee accepted the transfer.
*
* Other transactions:
* - **CANCELED**
* - **CLOSED**
*/
status: 'Response' | 'CAN' | 'CANCELED' | 'CLOSED';
/**
* Time of the webhook, in [*Unix time*](ref:glossary). Relevant to webhooks.
*/
timestamp: number;
/**
* Time of the [Set Transfer Response](ref:set-transfer-response) operation, in [*Unix time*](ref:glossary). Read-only.
*/
transfer_response_at: number;
/**
* **Funds Added and Funds Removed Webhooks:** Type of wallet. See [Wallet Object](ref:wallet-object).
*
* **Transactions:** Type of transaction. See [Transaction Types](ref:transaction-types).
*
* **Wallet Account Operations:** See [Wallet Limit Object](ref:wallet-limit-object).
*
* **Webhooks:** Type of webhook. One of the following:
* - **TransferRequest**
* - **TransferCompleted**
*/
type: 'TransferRequest' | 'TransferCompleted';
/**
* Result of the verification check. See [Wallet Object](ref:wallet-object).
*
* Relevant to **Funds Added** and **Funds Removed** webhooks. Response only.
*/
verification_status: string;
/**
* ID of the Rapyd wallet. String starting with **ewallet_**. Relevant to wallet account transactions.
*/
wallet: `ewallet_${string}`;
};