dutchman-bridge 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -12
- package/dist/index.d.ts +1 -1
- package/dist/sdk.gen.d.ts +18 -12
- package/dist/sdk.gen.js +28 -26
- package/dist/types.gen.d.ts +164 -79
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/sdk.gen.ts +32 -30
- package/src/types.gen.ts +176 -88
package/README.md
CHANGED
|
@@ -11,20 +11,14 @@ and response is typed, and it is regenerated whenever the API changes.
|
|
|
11
11
|
|
|
12
12
|
## Install
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```json
|
|
18
|
-
{
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"dutchman-bridge": "github:Dutchman-io/dutchman-bridge-sdk#v1.0.0"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
14
|
+
```bash
|
|
15
|
+
npm install dutchman-bridge
|
|
23
16
|
```
|
|
24
17
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
Published on the public npm registry. To pin the exact generated source instead, a
|
|
19
|
+
git dependency on a release tag also works:
|
|
20
|
+
`"dutchman-bridge": "github:Dutchman-io/dutchman-bridge-sdk#v1.0.0"` (needs read
|
|
21
|
+
access to the repository).
|
|
28
22
|
|
|
29
23
|
## Configure
|
|
30
24
|
|
|
@@ -144,6 +138,32 @@ do {
|
|
|
144
138
|
} while (cursor);
|
|
145
139
|
```
|
|
146
140
|
|
|
141
|
+
## Retrying safely
|
|
142
|
+
|
|
143
|
+
Every call that moves money takes an optional `reference` — your own request id.
|
|
144
|
+
Send the same value again and you get the original record back; nothing moves
|
|
145
|
+
twice.
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
await bridge.wallet.withdraw({
|
|
149
|
+
path: { customerId },
|
|
150
|
+
body: { amount: 50000, reference: 'req_01HZY4K8N2' },
|
|
151
|
+
});
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
It is accepted by `wallet.withdraw`, `send.submit`, `wallet.initiateFundingCharge`
|
|
155
|
+
and `globalSend.initiate`. Letters, digits, dot, underscore and hyphen; 120
|
|
156
|
+
characters max. It is scoped per endpoint, so the same value on a withdrawal and
|
|
157
|
+
on a send are two different records — choose one per intended operation (a
|
|
158
|
+
request id, not a customer id).
|
|
159
|
+
|
|
160
|
+
**A timeout is not a failure.** If a call times out or answers 5xx, retry it with
|
|
161
|
+
the same `reference` rather than assuming nothing happened — that is the only way
|
|
162
|
+
to find out which. Without one, a retry is a second withdrawal.
|
|
163
|
+
|
|
164
|
+
Buy and sell are covered by their quote instead: a `quoteId` executes exactly
|
|
165
|
+
once, including when two requests arrive together.
|
|
166
|
+
|
|
147
167
|
## Errors
|
|
148
168
|
|
|
149
169
|
On a non-2xx status `error` is the parsed JSON body and `data` is `undefined`. The API
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { client, type CreateClientConfig } from './client.gen';
|
|
2
2
|
export { Bank, Countries, Customers, DutchmanBridge, Features, GlobalSend, Kyc, type Options, Profile, Ramp, Receiving, Send, Wallet, Webhook } from './sdk.gen';
|
|
3
|
-
export type { AddAccountDto, BankAddAccountData, BankAddAccountResponse, BankAddAccountResponses, BankBanksData, BankBanksResponse, BankBanksResponses, BankDeleteAccountData, BankDeleteAccountResponse, BankDeleteAccountResponses, BankGetAccountsData, BankGetAccountsResponse, BankGetAccountsResponses, BankSetDefaultAccountData, BankSetDefaultAccountResponse, BankSetDefaultAccountResponses, BankVerifyAccountData, BankVerifyAccountResponse, BankVerifyAccountResponses, BlockchainNetwork, CheckSelfieDto, ClientOptions, CountriesListData, CountriesListResponse, CountriesListResponses, CustomerSellDto, CustomersFullData, CustomersFullResponse, CustomersFullResponses, CustomersGetData, CustomersGetResponse, CustomersGetResponses, CustomersRegisterData, CustomersRegisterResponse, CustomersRegisterResponses, FeaturesListData, FeaturesListResponse, FeaturesListResponses, FeatureStatus, FundingChargeStatus, GetQuoteDto, GlobalSendBeneficiaryDto, GlobalSendCorridorsData, GlobalSendCorridorsResponse, GlobalSendCorridorsResponses, GlobalSendInitiateData, GlobalSendInitiateResponse, GlobalSendInitiateResponses, GlobalSendQuoteData, GlobalSendQuoteDto, GlobalSendQuoteResponse, GlobalSendQuoteResponses, GlobalSendVerificationStatusData, GlobalSendVerificationStatusResponse, GlobalSendVerificationStatusResponses, InitiateFundingChargeDto, InitiateGlobalSendDto, KycDocumentData, KycDocumentResponse, KycDocumentResponses, KycReverificationData, KycReverificationResponse, KycReverificationResponses, KycSelfieCheckRouteData, KycSelfieCheckRouteResponse, KycSelfieCheckRouteResponses, KycStatus, KycStatusData, KycStatusResponse, KycStatusResponses, KycTier1Data, KycTier1Response, KycTier1Responses, KycTier2Data, KycTier2Response, KycTier2Responses, KycTier3Data, KycTier3Response, KycTier3Responses, LedgerEntryType, PartnerAccountVerificationDto, PartnerBalanceDto, PartnerBankAccountDto, PartnerBankDto, PartnerBuyResultDto, PartnerCorridorDto, PartnerCountryDto, PartnerCustomerDto, PartnerCustomerKycSnapshotDto, PartnerCustomerSnapshotDto, PartnerCustomerWalletSnapshotDto, PartnerDepositAddressDto, PartnerFeatureDto, PartnerFundingChargeDto, PartnerGlobalSendQuoteDto, PartnerGlobalSendResultDto, PartnerKycRecordDto, PartnerKycSubmissionDto, PartnerLedgerEntryDto, PartnerNetworkDto, PartnerRampQuoteDto, PartnerRateDto, PartnerReceivingAccountDto, PartnerReceivingActivityDto, PartnerReverificationRequestDto, PartnerSelfieCheckDto, PartnerSellResultDto, PartnerSendNetworkDto, PartnerSendQuoteDto, PartnerSendResultDto,
|
|
3
|
+
export type { AddAccountDto, BankAddAccountData, BankAddAccountResponse, BankAddAccountResponses, BankBanksData, BankBanksResponse, BankBanksResponses, BankDeleteAccountData, BankDeleteAccountResponse, BankDeleteAccountResponses, BankGetAccountsData, BankGetAccountsResponse, BankGetAccountsResponses, BankSetDefaultAccountData, BankSetDefaultAccountResponse, BankSetDefaultAccountResponses, BankVerifyAccountData, BankVerifyAccountResponse, BankVerifyAccountResponses, BlockchainNetwork, CheckSelfieDto, ClientOptions, CountriesListData, CountriesListResponse, CountriesListResponses, CustomerSellDto, CustomersFullData, CustomersFullResponse, CustomersFullResponses, CustomersGetData, CustomersGetResponse, CustomersGetResponses, CustomersRegisterData, CustomersRegisterResponse, CustomersRegisterResponses, FeaturesListData, FeaturesListResponse, FeaturesListResponses, FeatureStatus, FundingChargeStatus, GetQuoteDto, GlobalSendBeneficiaryDto, GlobalSendCorridorsData, GlobalSendCorridorsResponse, GlobalSendCorridorsResponses, GlobalSendInitiateData, GlobalSendInitiateResponse, GlobalSendInitiateResponses, GlobalSendQuoteData, GlobalSendQuoteDto, GlobalSendQuoteResponse, GlobalSendQuoteResponses, GlobalSendVerificationStatusData, GlobalSendVerificationStatusResponse, GlobalSendVerificationStatusResponses, InitiateFundingChargeDto, InitiateGlobalSendDto, KycDocumentData, KycDocumentResponse, KycDocumentResponses, KycReverificationData, KycReverificationResponse, KycReverificationResponses, KycSelfieCheckRouteData, KycSelfieCheckRouteResponse, KycSelfieCheckRouteResponses, KycStatus, KycStatusData, KycStatusResponse, KycStatusResponses, KycSummaryData, KycSummaryResponse, KycSummaryResponses, KycTier1Data, KycTier1Response, KycTier1Responses, KycTier2Data, KycTier2Response, KycTier2Responses, KycTier3Data, KycTier3Response, KycTier3Responses, LedgerEntryType, PartnerAccountVerificationDto, PartnerBalanceDto, PartnerBankAccountDto, PartnerBankDto, PartnerBuyResultDto, PartnerCorridorDto, PartnerCountryDto, PartnerCustomerDto, PartnerCustomerKycSnapshotDto, PartnerCustomerSnapshotDto, PartnerCustomerWalletSnapshotDto, PartnerDepositAddressDto, PartnerFeatureDto, PartnerFundingChargeDto, PartnerGlobalSendQuoteDto, PartnerGlobalSendResultDto, PartnerKycRecordDto, PartnerKycSubmissionDto, PartnerLedgerEntryDto, PartnerNetworkDto, PartnerRampQuoteDto, PartnerRateDto, PartnerReceivingAccountDto, PartnerReceivingActivityDto, PartnerReverificationRequestDto, PartnerSelfieCheckDto, PartnerSellResultDto, PartnerSendNetworkDto, PartnerSendQuoteDto, PartnerSendResultDto, PartnerTierStateDto, PartnerTierStatus, PartnerUploadedDocumentDto, PartnerVerificationInput, PartnerVerificationRecordDto, PartnerVerificationSummaryDto, PartnerVerificationTiersDto, PartnerVirtualAccountDto, PartnerWebhookConfigDto, PartnerWebhookDeliveryDetailDto, PartnerWebhookDeliveryDto, PartnerWebhookSecretDto, PartnerWebhookTestDto, PartnerWithdrawalBankAccountDto, PartnerWithdrawalDto, PartnerWithdrawalQuoteDto, ProfileChangePasswordData, ProfileChangePasswordResponse, ProfileChangePasswordResponses, ProfileDeleteAccountData, ProfileDeleteAccountResponse, ProfileDeleteAccountResponses, ProfileProfileData, ProfileProfileResponse, ProfileProfileResponses, ProfileUpdateProfileData, ProfileUpdateProfileResponse, ProfileUpdateProfileResponses, ProfileWithdrawalsData, ProfileWithdrawalsResponse, ProfileWithdrawalsResponses, QuoteSendDto, RampBuyData, RampBuyQuoteData, RampBuyQuoteResponse, RampBuyQuoteResponses, RampBuyResponse, RampBuyResponses, RampRateData, RampRateResponse, RampRateResponses, RampSellData, RampSellNetworksData, RampSellNetworksResponse, RampSellNetworksResponses, RampSellQuoteData, RampSellQuoteResponse, RampSellQuoteResponses, RampSellResponse, RampSellResponses, ReceivingActivityData, ReceivingActivityResponse, ReceivingActivityResponses, ReceivingCurrenciesData, ReceivingCurrenciesResponse, ReceivingCurrenciesResponses, ReceivingListData, ReceivingListResponse, ReceivingListResponses, ReceivingOpenData, ReceivingOpenResponse, ReceivingOpenResponses, ReceivingRefreshData, ReceivingRefreshResponse, ReceivingRefreshResponses, RegisterCustomerDto, ResetPassword, ReverificationItem, ReverificationStatus, SendDto, SendNetworksData, SendNetworksResponse, SendNetworksResponses, SendQuoteData, SendQuoteResponse, SendQuoteResponses, SendSubmitData, SendSubmitResponse, SendSubmitResponses, SetWebhookUrlDto, SubmitTier3Dto, Tier1KycDto, Tier2KycDto, UpdateCustomerProfileDto, VerifyAccountNumberInput, WalletAddressesData, WalletAddressesResponse, WalletAddressesResponses, WalletBalanceData, WalletBalanceResponse, WalletBalanceResponses, WalletFundingChargesData, WalletFundingChargesResponse, WalletFundingChargesResponses, WalletInitiateFundingChargeData, WalletInitiateFundingChargeResponse, WalletInitiateFundingChargeResponses, WalletStreamBalanceData, WalletStreamBalanceResponses, WalletTransactionsData, WalletTransactionsResponse, WalletTransactionsResponses, WalletVirtualAccountForData, WalletVirtualAccountForResponse, WalletVirtualAccountForResponses, WalletWithdrawalQuoteData, WalletWithdrawalQuoteResponse, WalletWithdrawalQuoteResponses, WalletWithdrawData, WalletWithdrawResponse, WalletWithdrawResponses, WebhookConfigData, WebhookConfigResponse, WebhookConfigResponses, WebhookDeliveriesData, WebhookDeliveriesResponse, WebhookDeliveriesResponses, WebhookDeliveryData, WebhookDeliveryResponse, WebhookDeliveryResponses, WebhookDeliveryStatus, WebhookReplayData, WebhookReplayResponse, WebhookReplayResponses, WebhookRotateSecretData, WebhookRotateSecretResponse, WebhookRotateSecretResponses, WebhookSetUrlData, WebhookSetUrlResponse, WebhookSetUrlResponses, WithdrawalStatus, WithdrawDto } from './types.gen';
|
package/dist/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Client, type ClientMeta, type Options as Options2, type RequestResult, type TDataShape } from './client';
|
|
2
|
-
import type { BankAddAccountData, BankAddAccountResponses, BankBanksData, BankBanksResponses, BankDeleteAccountData, BankDeleteAccountResponses, BankGetAccountsData, BankGetAccountsResponses, BankSetDefaultAccountData, BankSetDefaultAccountResponses, BankVerifyAccountData, BankVerifyAccountResponses, CountriesListData, CountriesListResponses, CustomersFullData, CustomersFullResponses, CustomersGetData, CustomersGetResponses, CustomersRegisterData, CustomersRegisterResponses, FeaturesListData, FeaturesListResponses, GlobalSendCorridorsData, GlobalSendCorridorsResponses, GlobalSendInitiateData, GlobalSendInitiateResponses, GlobalSendQuoteData, GlobalSendQuoteResponses, GlobalSendVerificationStatusData, GlobalSendVerificationStatusResponses, KycDocumentData, KycDocumentResponses, KycReverificationData, KycReverificationResponses, KycSelfieCheckRouteData, KycSelfieCheckRouteResponses, KycStatusData, KycStatusResponses, KycTier1Data, KycTier1Responses, KycTier2Data, KycTier2Responses, KycTier3Data, KycTier3Responses, ProfileChangePasswordData, ProfileChangePasswordResponses, ProfileDeleteAccountData, ProfileDeleteAccountResponses,
|
|
2
|
+
import type { BankAddAccountData, BankAddAccountResponses, BankBanksData, BankBanksResponses, BankDeleteAccountData, BankDeleteAccountResponses, BankGetAccountsData, BankGetAccountsResponses, BankSetDefaultAccountData, BankSetDefaultAccountResponses, BankVerifyAccountData, BankVerifyAccountResponses, CountriesListData, CountriesListResponses, CustomersFullData, CustomersFullResponses, CustomersGetData, CustomersGetResponses, CustomersRegisterData, CustomersRegisterResponses, FeaturesListData, FeaturesListResponses, GlobalSendCorridorsData, GlobalSendCorridorsResponses, GlobalSendInitiateData, GlobalSendInitiateResponses, GlobalSendQuoteData, GlobalSendQuoteResponses, GlobalSendVerificationStatusData, GlobalSendVerificationStatusResponses, KycDocumentData, KycDocumentResponses, KycReverificationData, KycReverificationResponses, KycSelfieCheckRouteData, KycSelfieCheckRouteResponses, KycStatusData, KycStatusResponses, KycSummaryData, KycSummaryResponses, KycTier1Data, KycTier1Responses, KycTier2Data, KycTier2Responses, KycTier3Data, KycTier3Responses, ProfileChangePasswordData, ProfileChangePasswordResponses, ProfileDeleteAccountData, ProfileDeleteAccountResponses, ProfileProfileData, ProfileProfileResponses, ProfileUpdateProfileData, ProfileUpdateProfileResponses, ProfileWithdrawalsData, ProfileWithdrawalsResponses, RampBuyData, RampBuyQuoteData, RampBuyQuoteResponses, RampBuyResponses, RampRateData, RampRateResponses, RampSellData, RampSellNetworksData, RampSellNetworksResponses, RampSellQuoteData, RampSellQuoteResponses, RampSellResponses, ReceivingActivityData, ReceivingActivityResponses, ReceivingCurrenciesData, ReceivingCurrenciesResponses, ReceivingListData, ReceivingListResponses, ReceivingOpenData, ReceivingOpenResponses, ReceivingRefreshData, ReceivingRefreshResponses, SendNetworksData, SendNetworksResponses, SendQuoteData, SendQuoteResponses, SendSubmitData, SendSubmitResponses, WalletAddressesData, WalletAddressesResponses, WalletBalanceData, WalletBalanceResponses, WalletFundingChargesData, WalletFundingChargesResponses, WalletInitiateFundingChargeData, WalletInitiateFundingChargeResponses, WalletStreamBalanceData, WalletStreamBalanceResponses, WalletTransactionsData, WalletTransactionsResponses, WalletVirtualAccountForData, WalletVirtualAccountForResponses, WalletWithdrawalQuoteData, WalletWithdrawalQuoteResponses, WalletWithdrawData, WalletWithdrawResponses, WebhookConfigData, WebhookConfigResponses, WebhookDeliveriesData, WebhookDeliveriesResponses, WebhookDeliveryData, WebhookDeliveryResponses, WebhookReplayData, WebhookReplayResponses, WebhookRotateSecretData, WebhookRotateSecretResponses, WebhookSetUrlData, WebhookSetUrlResponses } from './types.gen';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -64,20 +64,18 @@ export declare class Profile extends HeyApiClient {
|
|
|
64
64
|
* Change the customer's password
|
|
65
65
|
*/
|
|
66
66
|
changePassword<ThrowOnError extends boolean = false>(options: Options<ProfileChangePasswordData, ThrowOnError>): RequestResult<ProfileChangePasswordResponses, unknown, ThrowOnError>;
|
|
67
|
-
/**
|
|
68
|
-
* Read the customer's settlement preference (AUTO to default bank vs MANUAL hold)
|
|
69
|
-
*/
|
|
70
|
-
getSettlementMode<ThrowOnError extends boolean = false>(options: Options<ProfileGetSettlementModeData, ThrowOnError>): RequestResult<ProfileGetSettlementModeResponses, unknown, ThrowOnError>;
|
|
71
|
-
/**
|
|
72
|
-
* Update how the customer's sale proceeds settle
|
|
73
|
-
*/
|
|
74
|
-
setSettlementMode<ThrowOnError extends boolean = false>(options: Options<ProfileSetSettlementModeData, ThrowOnError>): RequestResult<ProfileSetSettlementModeResponses, unknown, ThrowOnError>;
|
|
75
67
|
/**
|
|
76
68
|
* The customer's withdrawal / global payout history, newest first
|
|
77
69
|
*/
|
|
78
70
|
withdrawals<ThrowOnError extends boolean = false>(options: Options<ProfileWithdrawalsData, ThrowOnError>): RequestResult<ProfileWithdrawalsResponses, unknown, ThrowOnError>;
|
|
79
71
|
}
|
|
80
72
|
export declare class Kyc extends HeyApiClient {
|
|
73
|
+
/**
|
|
74
|
+
* Where the customer stands, and what to submit next
|
|
75
|
+
*
|
|
76
|
+
* The recommended single read: the highest approved tier, each tier's status, the inputs to submit next (with any open re-verification items first), the open re-verification request, and the KYC records. Replaces calling GET .../kyc and GET .../kyc/reverification separately.
|
|
77
|
+
*/
|
|
78
|
+
summary<ThrowOnError extends boolean = false>(options: Options<KycSummaryData, ThrowOnError>): RequestResult<KycSummaryResponses, unknown, ThrowOnError>;
|
|
81
79
|
/**
|
|
82
80
|
* A customer's KYC records, newest first
|
|
83
81
|
*/
|
|
@@ -136,8 +134,16 @@ export declare class Wallet extends HeyApiClient {
|
|
|
136
134
|
* Issued on first read in the customer's own fiat (NGN needs an approved BVN first); the same account is returned on every read after.
|
|
137
135
|
*/
|
|
138
136
|
virtualAccountFor<ThrowOnError extends boolean = false>(options: Options<WalletVirtualAccountForData, ThrowOnError>): RequestResult<WalletVirtualAccountForResponses, unknown, ThrowOnError>;
|
|
137
|
+
/**
|
|
138
|
+
* Price a withdrawal before submitting it
|
|
139
|
+
*
|
|
140
|
+
* The withdrawal fee (a percentage of the amount plus a fixed charge for the currency) is charged on top of the amount: the bank receives `amount`, the balance is debited `totalDebited`. Nothing is reserved.
|
|
141
|
+
*/
|
|
142
|
+
withdrawalQuote<ThrowOnError extends boolean = false>(options: Options<WalletWithdrawalQuoteData, ThrowOnError>): RequestResult<WalletWithdrawalQuoteResponses, unknown, ThrowOnError>;
|
|
139
143
|
/**
|
|
140
144
|
* Pay a held balance out to the customer's default bank account
|
|
145
|
+
*
|
|
146
|
+
* The bank receives `amount`; the withdrawal fee is debited on top of it. Price it first with GET .../withdraw/quote.
|
|
141
147
|
*/
|
|
142
148
|
withdraw<ThrowOnError extends boolean = false>(options: Options<WalletWithdrawData, ThrowOnError>): RequestResult<WalletWithdrawResponses, unknown, ThrowOnError>;
|
|
143
149
|
/**
|
|
@@ -191,13 +197,13 @@ export declare class Ramp extends HeyApiClient {
|
|
|
191
197
|
*/
|
|
192
198
|
buy<ThrowOnError extends boolean = false>(options: Options<RampBuyData, ThrowOnError>): RequestResult<RampBuyResponses, unknown, ThrowOnError>;
|
|
193
199
|
/**
|
|
194
|
-
* Networks the customer can
|
|
200
|
+
* Networks the customer can deposit USDT on
|
|
195
201
|
*/
|
|
196
202
|
sellNetworks<ThrowOnError extends boolean = false>(options: Options<RampSellNetworksData, ThrowOnError>): RequestResult<RampSellNetworksResponses, unknown, ThrowOnError>;
|
|
197
203
|
/**
|
|
198
|
-
* Live USDT rates in the customer's local fiat, for previewing a conversion
|
|
204
|
+
* Live all-in USDT rates in the customer's local fiat, for previewing a conversion
|
|
199
205
|
*
|
|
200
|
-
* Does not lock a rate -- checkout still goes through the quote routes.
|
|
206
|
+
* Rates include our spread and every fee, so amount * rate is what the customer pays or receives. Pass ?amount (USDT) to fold the fixed exchange fee into sellRate for that amount. Does not lock a rate -- checkout still goes through the quote routes.
|
|
201
207
|
*/
|
|
202
208
|
rate<ThrowOnError extends boolean = false>(options: Options<RampRateData, ThrowOnError>): RequestResult<RampRateResponses, unknown, ThrowOnError>;
|
|
203
209
|
/**
|
package/dist/sdk.gen.js
CHANGED
|
@@ -120,42 +120,30 @@ class Profile extends HeyApiClient {
|
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
123
|
+
* The customer's withdrawal / global payout history, newest first
|
|
124
124
|
*/
|
|
125
|
-
|
|
125
|
+
withdrawals(options) {
|
|
126
126
|
return (options.client ?? this.client).get({
|
|
127
127
|
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
128
|
-
url: '/api/v1/partner/v1/customers/{customerId}/
|
|
128
|
+
url: '/api/v1/partner/v1/customers/{customerId}/withdrawals',
|
|
129
129
|
...options
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
+
}
|
|
133
|
+
exports.Profile = Profile;
|
|
134
|
+
class Kyc extends HeyApiClient {
|
|
132
135
|
/**
|
|
133
|
-
*
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return (options.client ?? this.client).patch({
|
|
137
|
-
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
138
|
-
url: '/api/v1/partner/v1/customers/{customerId}/settlement-mode',
|
|
139
|
-
...options,
|
|
140
|
-
headers: {
|
|
141
|
-
'Content-Type': 'application/json',
|
|
142
|
-
...options.headers
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* The customer's withdrawal / global payout history, newest first
|
|
136
|
+
* Where the customer stands, and what to submit next
|
|
137
|
+
*
|
|
138
|
+
* The recommended single read: the highest approved tier, each tier's status, the inputs to submit next (with any open re-verification items first), the open re-verification request, and the KYC records. Replaces calling GET .../kyc and GET .../kyc/reverification separately.
|
|
148
139
|
*/
|
|
149
|
-
|
|
140
|
+
summary(options) {
|
|
150
141
|
return (options.client ?? this.client).get({
|
|
151
142
|
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
152
|
-
url: '/api/v1/partner/v1/customers/{customerId}/
|
|
143
|
+
url: '/api/v1/partner/v1/customers/{customerId}/verification',
|
|
153
144
|
...options
|
|
154
145
|
});
|
|
155
146
|
}
|
|
156
|
-
}
|
|
157
|
-
exports.Profile = Profile;
|
|
158
|
-
class Kyc extends HeyApiClient {
|
|
159
147
|
/**
|
|
160
148
|
* A customer's KYC records, newest first
|
|
161
149
|
*/
|
|
@@ -308,8 +296,22 @@ class Wallet extends HeyApiClient {
|
|
|
308
296
|
...options
|
|
309
297
|
});
|
|
310
298
|
}
|
|
299
|
+
/**
|
|
300
|
+
* Price a withdrawal before submitting it
|
|
301
|
+
*
|
|
302
|
+
* The withdrawal fee (a percentage of the amount plus a fixed charge for the currency) is charged on top of the amount: the bank receives `amount`, the balance is debited `totalDebited`. Nothing is reserved.
|
|
303
|
+
*/
|
|
304
|
+
withdrawalQuote(options) {
|
|
305
|
+
return (options.client ?? this.client).get({
|
|
306
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
307
|
+
url: '/api/v1/partner/v1/customers/{customerId}/withdraw/quote',
|
|
308
|
+
...options
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
311
|
/**
|
|
312
312
|
* Pay a held balance out to the customer's default bank account
|
|
313
|
+
*
|
|
314
|
+
* The bank receives `amount`; the withdrawal fee is debited on top of it. Price it first with GET .../withdraw/quote.
|
|
313
315
|
*/
|
|
314
316
|
withdraw(options) {
|
|
315
317
|
return (options.client ?? this.client).post({
|
|
@@ -470,7 +472,7 @@ class Ramp extends HeyApiClient {
|
|
|
470
472
|
});
|
|
471
473
|
}
|
|
472
474
|
/**
|
|
473
|
-
* Networks the customer can
|
|
475
|
+
* Networks the customer can deposit USDT on
|
|
474
476
|
*/
|
|
475
477
|
sellNetworks(options) {
|
|
476
478
|
return (options.client ?? this.client).get({
|
|
@@ -480,9 +482,9 @@ class Ramp extends HeyApiClient {
|
|
|
480
482
|
});
|
|
481
483
|
}
|
|
482
484
|
/**
|
|
483
|
-
* Live USDT rates in the customer's local fiat, for previewing a conversion
|
|
485
|
+
* Live all-in USDT rates in the customer's local fiat, for previewing a conversion
|
|
484
486
|
*
|
|
485
|
-
* Does not lock a rate -- checkout still goes through the quote routes.
|
|
487
|
+
* Rates include our spread and every fee, so amount * rate is what the customer pays or receives. Pass ?amount (USDT) to fold the fixed exchange fee into sellRate for that amount. Does not lock a rate -- checkout still goes through the quote routes.
|
|
486
488
|
*/
|
|
487
489
|
rate(options) {
|
|
488
490
|
return (options.client ?? this.client).get({
|
package/dist/types.gen.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export type ClientOptions = {
|
|
2
2
|
baseUrl: 'https://app.dutchmannetwork.online' | (string & {});
|
|
3
3
|
};
|
|
4
|
-
export type SettlementMode = 'AUTO' | 'MANUAL';
|
|
5
4
|
export type PartnerCustomerDto = {
|
|
6
5
|
id: string;
|
|
7
6
|
firstName: string;
|
|
@@ -20,7 +19,6 @@ export type PartnerCustomerDto = {
|
|
|
20
19
|
* When identity verification was approved; null until then.
|
|
21
20
|
*/
|
|
22
21
|
verifiedAt: string | null;
|
|
23
|
-
settlementMode: SettlementMode;
|
|
24
22
|
createdAt: string;
|
|
25
23
|
updatedAt: string;
|
|
26
24
|
};
|
|
@@ -107,6 +105,61 @@ export type PartnerCustomerSnapshotDto = {
|
|
|
107
105
|
kyc: PartnerCustomerKycSnapshotDto;
|
|
108
106
|
wallet: PartnerCustomerWalletSnapshotDto;
|
|
109
107
|
};
|
|
108
|
+
/**
|
|
109
|
+
* NOT_STARTED when nothing has been submitted for the tier; otherwise the decision on the newest submission.
|
|
110
|
+
*/
|
|
111
|
+
export type PartnerTierStatus = 'NOT_STARTED' | 'PENDING' | 'REVIEW' | 'APPROVED' | 'REJECTED';
|
|
112
|
+
export type PartnerTierStateDto = {
|
|
113
|
+
/**
|
|
114
|
+
* NOT_STARTED when nothing has been submitted for the tier; otherwise the decision on the newest submission.
|
|
115
|
+
*/
|
|
116
|
+
status: PartnerTierStatus;
|
|
117
|
+
/**
|
|
118
|
+
* When the tier last changed; null when NOT_STARTED.
|
|
119
|
+
*/
|
|
120
|
+
updatedAt: string | null;
|
|
121
|
+
/**
|
|
122
|
+
* Why it was REJECTED; null otherwise.
|
|
123
|
+
*/
|
|
124
|
+
rejectionReason: string | null;
|
|
125
|
+
};
|
|
126
|
+
export type PartnerVerificationTiersDto = {
|
|
127
|
+
/**
|
|
128
|
+
* Tier 1: BVN + NIN.
|
|
129
|
+
*/
|
|
130
|
+
1: PartnerTierStateDto;
|
|
131
|
+
/**
|
|
132
|
+
* Tier 2: ID document + selfie.
|
|
133
|
+
*/
|
|
134
|
+
2: PartnerTierStateDto;
|
|
135
|
+
/**
|
|
136
|
+
* Tier 3: date of birth + address, decided by the cross-border verification partners.
|
|
137
|
+
*/
|
|
138
|
+
3: PartnerTierStateDto;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* What to submit next, in order. BVN and NIN go to POST .../kyc/tier1; ID_DOCUMENT and SELFIE to POST .../kyc/tier2; DATE_OF_BIRTH and ADDRESS to POST .../kyc/tier3; COUNTRY and ADDRESS_PROOF only ever appear from an open re-verification request. Empty when the next tier is already PENDING or in REVIEW, or every tier is APPROVED.
|
|
142
|
+
*/
|
|
143
|
+
export type PartnerVerificationInput = 'BVN' | 'NIN' | 'ID_DOCUMENT' | 'SELFIE' | 'DATE_OF_BIRTH' | 'ADDRESS' | 'COUNTRY' | 'ADDRESS_PROOF';
|
|
144
|
+
export type PartnerVerificationSummaryDto = {
|
|
145
|
+
/**
|
|
146
|
+
* The highest APPROVED tier; 0 when none is.
|
|
147
|
+
*/
|
|
148
|
+
currentTier: 0 | 1 | 2 | 3;
|
|
149
|
+
tiers: PartnerVerificationTiersDto;
|
|
150
|
+
/**
|
|
151
|
+
* What to submit next, in order. BVN and NIN go to POST .../kyc/tier1; ID_DOCUMENT and SELFIE to POST .../kyc/tier2; DATE_OF_BIRTH and ADDRESS to POST .../kyc/tier3; COUNTRY and ADDRESS_PROOF only ever appear from an open re-verification request. Empty when the next tier is already PENDING or in REVIEW, or every tier is APPROVED.
|
|
152
|
+
*/
|
|
153
|
+
nextRequired: Array<PartnerVerificationInput>;
|
|
154
|
+
/**
|
|
155
|
+
* The open re-verification request an admin has raised, or null. Its items are already at the front of nextRequired.
|
|
156
|
+
*/
|
|
157
|
+
reverification: PartnerReverificationRequestDto | null;
|
|
158
|
+
/**
|
|
159
|
+
* Every KYC record, newest first -- the same as GET .../kyc.
|
|
160
|
+
*/
|
|
161
|
+
records: Array<PartnerKycRecordDto>;
|
|
162
|
+
};
|
|
110
163
|
export type PartnerKycSubmissionDto = {
|
|
111
164
|
/**
|
|
112
165
|
* APPROVED when the checks cleared immediately; REVIEW while a reviewer decides.
|
|
@@ -217,7 +270,7 @@ export type PartnerLedgerEntryDto = {
|
|
|
217
270
|
id: string;
|
|
218
271
|
type: LedgerEntryType;
|
|
219
272
|
/**
|
|
220
|
-
* deposit | fiat.deposit | withdrawal | withdrawal.reversal | buy | sell | crypto_send | crypto_send.reversal | offramp.settlement | reversal
|
|
273
|
+
* deposit | fiat.deposit | withdrawal | withdrawal.fee | withdrawal.reversal | buy | sell | crypto_send | crypto_send.reversal | offramp.settlement | reversal
|
|
221
274
|
*/
|
|
222
275
|
reason: string;
|
|
223
276
|
currency: string;
|
|
@@ -237,6 +290,29 @@ export type PartnerLedgerEntryDto = {
|
|
|
237
290
|
network: string | null;
|
|
238
291
|
createdAt: string;
|
|
239
292
|
};
|
|
293
|
+
export type PartnerWithdrawalQuoteDto = {
|
|
294
|
+
currency: string;
|
|
295
|
+
/**
|
|
296
|
+
* What the bank account receives.
|
|
297
|
+
*/
|
|
298
|
+
amount: number;
|
|
299
|
+
/**
|
|
300
|
+
* Withdrawal fee, same currency: the percentage fee on the amount plus the fixed fee for the currency.
|
|
301
|
+
*/
|
|
302
|
+
fee: number;
|
|
303
|
+
/**
|
|
304
|
+
* amount + fee: what leaves the balance.
|
|
305
|
+
*/
|
|
306
|
+
totalDebited: number;
|
|
307
|
+
/**
|
|
308
|
+
* Percentage part of the fee, basis points.
|
|
309
|
+
*/
|
|
310
|
+
feeBps: number;
|
|
311
|
+
/**
|
|
312
|
+
* Fixed part of the fee, same currency.
|
|
313
|
+
*/
|
|
314
|
+
feeFlat: number;
|
|
315
|
+
};
|
|
240
316
|
export type WithdrawalStatus = 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'PENDING_LIQUIDITY';
|
|
241
317
|
export type PartnerWithdrawalBankAccountDto = {
|
|
242
318
|
bankName: string | null;
|
|
@@ -247,9 +323,17 @@ export type PartnerWithdrawalDto = {
|
|
|
247
323
|
id: string;
|
|
248
324
|
reference: string;
|
|
249
325
|
/**
|
|
250
|
-
* Decimal string, e.g. "5000.00000000".
|
|
326
|
+
* What the bank account receives. Decimal string, e.g. "5000.00000000".
|
|
251
327
|
*/
|
|
252
328
|
amount: string;
|
|
329
|
+
/**
|
|
330
|
+
* Withdrawal fee charged on top of amount. Decimal string.
|
|
331
|
+
*/
|
|
332
|
+
fee: string;
|
|
333
|
+
/**
|
|
334
|
+
* amount + fee: what left the balance. Decimal string.
|
|
335
|
+
*/
|
|
336
|
+
totalDebited: string;
|
|
253
337
|
currency: string;
|
|
254
338
|
status: WithdrawalStatus;
|
|
255
339
|
failureReason: string | null;
|
|
@@ -259,9 +343,13 @@ export type PartnerWithdrawalDto = {
|
|
|
259
343
|
};
|
|
260
344
|
export type WithdrawDto = {
|
|
261
345
|
/**
|
|
262
|
-
* Amount
|
|
346
|
+
* Amount the bank account receives. The withdrawal fee is charged on top, so the balance is debited amount + fee.
|
|
263
347
|
*/
|
|
264
348
|
amount: number;
|
|
349
|
+
/**
|
|
350
|
+
* Idempotency key. Resending the same value returns the existing withdrawal rather than moving money again — pass the client's request id. Letters, digits, dot, underscore and hyphen; 120 characters max.
|
|
351
|
+
*/
|
|
352
|
+
reference?: string;
|
|
265
353
|
};
|
|
266
354
|
export type FundingChargeStatus = 'PENDING' | 'SUCCESS' | 'FAILED';
|
|
267
355
|
export type PartnerFundingChargeDto = {
|
|
@@ -294,6 +382,10 @@ export type InitiateFundingChargeDto = {
|
|
|
294
382
|
* Amount to fund, in the user’s local fiat (derived from their country).
|
|
295
383
|
*/
|
|
296
384
|
amount: number;
|
|
385
|
+
/**
|
|
386
|
+
* Idempotency key. Resending the same value returns the existing funding charge rather than moving money again — pass the client's request id. Letters, digits, dot, underscore and hyphen; 120 characters max.
|
|
387
|
+
*/
|
|
388
|
+
reference?: string;
|
|
297
389
|
};
|
|
298
390
|
/**
|
|
299
391
|
* The id to send in requests.
|
|
@@ -389,6 +481,10 @@ export type SendDto = {
|
|
|
389
481
|
* Destination on-chain address
|
|
390
482
|
*/
|
|
391
483
|
toAddress: string;
|
|
484
|
+
/**
|
|
485
|
+
* Idempotency key. Resending the same value returns the existing send rather than moving money again — pass the client's request id. Letters, digits, dot, underscore and hyphen; 120 characters max.
|
|
486
|
+
*/
|
|
487
|
+
reference?: string;
|
|
392
488
|
};
|
|
393
489
|
export type PartnerCorridorDto = {
|
|
394
490
|
/**
|
|
@@ -509,7 +605,7 @@ export type InitiateGlobalSendDto = {
|
|
|
509
605
|
asset?: 'USDT' | 'USDC';
|
|
510
606
|
beneficiary: GlobalSendBeneficiaryDto;
|
|
511
607
|
/**
|
|
512
|
-
* Idempotency key. Resending the same value returns the existing send rather than
|
|
608
|
+
* Idempotency key. Resending the same value returns the existing send rather than moving money again — pass the client's request id. Letters, digits, dot, underscore and hyphen; 120 characters max.
|
|
513
609
|
*/
|
|
514
610
|
reference?: string;
|
|
515
611
|
};
|
|
@@ -530,18 +626,9 @@ export type PartnerRampQuoteDto = {
|
|
|
530
626
|
*/
|
|
531
627
|
rate: number;
|
|
532
628
|
/**
|
|
533
|
-
*
|
|
534
|
-
*/
|
|
535
|
-
payoutFee: number;
|
|
536
|
-
/**
|
|
537
|
-
* In the destination currency; 0 on a buy.
|
|
538
|
-
*/
|
|
539
|
-
networkGasFee: number;
|
|
540
|
-
/**
|
|
541
|
-
* In the destination currency; 0 on a buy.
|
|
629
|
+
* The exchange's fixed execution fee, in the destination currency; 0 on a buy.
|
|
542
630
|
*/
|
|
543
631
|
exchangeFee: number;
|
|
544
|
-
network: BlockchainNetwork;
|
|
545
632
|
/**
|
|
546
633
|
* Seconds until the quote expires.
|
|
547
634
|
*/
|
|
@@ -552,7 +639,12 @@ export type GetQuoteDto = {
|
|
|
552
639
|
sourceCurrency: string;
|
|
553
640
|
destinationCurrency: string;
|
|
554
641
|
type: 'sell' | 'buy';
|
|
555
|
-
|
|
642
|
+
/**
|
|
643
|
+
* Ignored. A buy or sell moves balances only, so no chain is involved and no gas is charged; gas applies to crypto sends. Still accepted so older requests keep working.
|
|
644
|
+
*
|
|
645
|
+
* @deprecated
|
|
646
|
+
*/
|
|
647
|
+
network?: 'ethereum' | 'polygon' | 'arbitrum' | 'base' | 'arc' | 'bsc' | 'optimism' | 'tron';
|
|
556
648
|
/**
|
|
557
649
|
* Optional preferred exchange venue. If omitted, the system auto-routes to the best available rate.
|
|
558
650
|
*/
|
|
@@ -584,23 +676,19 @@ export type PartnerNetworkDto = {
|
|
|
584
676
|
export type PartnerRateDto = {
|
|
585
677
|
fiatCurrency: string;
|
|
586
678
|
/**
|
|
587
|
-
* Fiat per USDT when buying
|
|
679
|
+
* Fiat paid per USDT when buying. All-in: spread applied, and buys carry no fees.
|
|
588
680
|
*/
|
|
589
681
|
buyRate: number;
|
|
590
682
|
/**
|
|
591
|
-
* Fiat per USDT when selling
|
|
683
|
+
* Fiat received per USDT when selling. All-in: spread applied, plus the fixed exchange fee when ?amount was given, so amount * sellRate is exactly what the customer receives. The withdrawal fee is separate; see GET .../withdraw/quote.
|
|
592
684
|
*/
|
|
593
685
|
sellRate: number;
|
|
594
686
|
/**
|
|
595
|
-
*
|
|
687
|
+
* USDT amount sellRate was priced for; null when ?amount was omitted, in which case the fixed exchange fee is not in sellRate.
|
|
596
688
|
*/
|
|
597
|
-
|
|
598
|
-
/**
|
|
599
|
-
* Sell-side gas estimate for the network, USD.
|
|
600
|
-
*/
|
|
601
|
-
networkGasFeeUsd: number;
|
|
689
|
+
amount: number | null;
|
|
602
690
|
/**
|
|
603
|
-
*
|
|
691
|
+
* Fixed sell-side exchange fee, USDT. In sellRate only when ?amount was given.
|
|
604
692
|
*/
|
|
605
693
|
exchangeFeeUsdt: number;
|
|
606
694
|
};
|
|
@@ -608,12 +696,10 @@ export type PartnerSellResultDto = {
|
|
|
608
696
|
reference: string;
|
|
609
697
|
usdtSold: number;
|
|
610
698
|
fiatCurrency: string;
|
|
611
|
-
fiatCredited: number;
|
|
612
|
-
settlementMode: SettlementMode;
|
|
613
699
|
/**
|
|
614
|
-
*
|
|
700
|
+
* Now on the customer's fiat balance; withdraw it with POST .../withdraw.
|
|
615
701
|
*/
|
|
616
|
-
|
|
702
|
+
fiatCredited: number;
|
|
617
703
|
};
|
|
618
704
|
export type PartnerBankDto = {
|
|
619
705
|
code: string;
|
|
@@ -693,18 +779,6 @@ export type ResetPassword = {
|
|
|
693
779
|
oldPassword: string;
|
|
694
780
|
newPassword: string;
|
|
695
781
|
};
|
|
696
|
-
export type PartnerSettlementModeDto = {
|
|
697
|
-
/**
|
|
698
|
-
* AUTO pays sale proceeds straight to the default bank; MANUAL holds them as a fiat balance.
|
|
699
|
-
*/
|
|
700
|
-
mode: SettlementMode;
|
|
701
|
-
};
|
|
702
|
-
export type SettlementModeDto = {
|
|
703
|
-
/**
|
|
704
|
-
* AUTO settles sale proceeds straight to the default bank; MANUAL holds them as an NGN balance to withdraw later.
|
|
705
|
-
*/
|
|
706
|
-
mode: 'AUTO' | 'MANUAL';
|
|
707
|
-
};
|
|
708
782
|
export type PartnerReceivingAccountDto = {
|
|
709
783
|
id: string;
|
|
710
784
|
currency: string;
|
|
@@ -921,6 +995,24 @@ export type CustomersFullResponses = {
|
|
|
921
995
|
};
|
|
922
996
|
};
|
|
923
997
|
export type CustomersFullResponse = CustomersFullResponses[keyof CustomersFullResponses];
|
|
998
|
+
export type KycSummaryData = {
|
|
999
|
+
body?: never;
|
|
1000
|
+
path: {
|
|
1001
|
+
/**
|
|
1002
|
+
* Id of one of your customers, as returned by customers.register.
|
|
1003
|
+
*/
|
|
1004
|
+
customerId: string;
|
|
1005
|
+
};
|
|
1006
|
+
query?: never;
|
|
1007
|
+
url: '/api/v1/partner/v1/customers/{customerId}/verification';
|
|
1008
|
+
};
|
|
1009
|
+
export type KycSummaryResponses = {
|
|
1010
|
+
200: {
|
|
1011
|
+
success: boolean;
|
|
1012
|
+
data: PartnerVerificationSummaryDto;
|
|
1013
|
+
};
|
|
1014
|
+
};
|
|
1015
|
+
export type KycSummaryResponse = KycSummaryResponses[keyof KycSummaryResponses];
|
|
924
1016
|
export type KycStatusData = {
|
|
925
1017
|
body?: never;
|
|
926
1018
|
path: {
|
|
@@ -1153,6 +1245,29 @@ export type WalletVirtualAccountForResponses = {
|
|
|
1153
1245
|
};
|
|
1154
1246
|
};
|
|
1155
1247
|
export type WalletVirtualAccountForResponse = WalletVirtualAccountForResponses[keyof WalletVirtualAccountForResponses];
|
|
1248
|
+
export type WalletWithdrawalQuoteData = {
|
|
1249
|
+
body?: never;
|
|
1250
|
+
path: {
|
|
1251
|
+
/**
|
|
1252
|
+
* Id of one of your customers, as returned by customers.register.
|
|
1253
|
+
*/
|
|
1254
|
+
customerId: string;
|
|
1255
|
+
};
|
|
1256
|
+
query: {
|
|
1257
|
+
/**
|
|
1258
|
+
* Amount the bank account would receive.
|
|
1259
|
+
*/
|
|
1260
|
+
amount: number;
|
|
1261
|
+
};
|
|
1262
|
+
url: '/api/v1/partner/v1/customers/{customerId}/withdraw/quote';
|
|
1263
|
+
};
|
|
1264
|
+
export type WalletWithdrawalQuoteResponses = {
|
|
1265
|
+
200: {
|
|
1266
|
+
success: boolean;
|
|
1267
|
+
data: PartnerWithdrawalQuoteDto;
|
|
1268
|
+
};
|
|
1269
|
+
};
|
|
1270
|
+
export type WalletWithdrawalQuoteResponse = WalletWithdrawalQuoteResponses[keyof WalletWithdrawalQuoteResponses];
|
|
1156
1271
|
export type WalletWithdrawData = {
|
|
1157
1272
|
body: WithdrawDto;
|
|
1158
1273
|
path: {
|
|
@@ -1412,9 +1527,15 @@ export type RampRateData = {
|
|
|
1412
1527
|
};
|
|
1413
1528
|
query?: {
|
|
1414
1529
|
/**
|
|
1415
|
-
*
|
|
1530
|
+
* Ignored. A buy or sell moves balances only, so no gas is priced into the rate; gas applies to crypto sends. Still accepted so older requests keep working.
|
|
1531
|
+
*
|
|
1532
|
+
* @deprecated
|
|
1416
1533
|
*/
|
|
1417
1534
|
network?: 'ethereum' | 'polygon' | 'arbitrum' | 'base' | 'arc' | 'bsc' | 'optimism' | 'tron';
|
|
1535
|
+
/**
|
|
1536
|
+
* USDT amount to price the sell rate for. When given, the fixed exchange fee is spread over it, so amount * sellRate is exactly what the customer receives. Omit for a per-unit rate that carries the spread only.
|
|
1537
|
+
*/
|
|
1538
|
+
amount?: number;
|
|
1418
1539
|
};
|
|
1419
1540
|
url: '/api/v1/partner/v1/customers/{customerId}/rate';
|
|
1420
1541
|
};
|
|
@@ -1630,42 +1751,6 @@ export type ProfileChangePasswordResponses = {
|
|
|
1630
1751
|
204: void;
|
|
1631
1752
|
};
|
|
1632
1753
|
export type ProfileChangePasswordResponse = ProfileChangePasswordResponses[keyof ProfileChangePasswordResponses];
|
|
1633
|
-
export type ProfileGetSettlementModeData = {
|
|
1634
|
-
body?: never;
|
|
1635
|
-
path: {
|
|
1636
|
-
/**
|
|
1637
|
-
* Id of one of your customers, as returned by customers.register.
|
|
1638
|
-
*/
|
|
1639
|
-
customerId: string;
|
|
1640
|
-
};
|
|
1641
|
-
query?: never;
|
|
1642
|
-
url: '/api/v1/partner/v1/customers/{customerId}/settlement-mode';
|
|
1643
|
-
};
|
|
1644
|
-
export type ProfileGetSettlementModeResponses = {
|
|
1645
|
-
200: {
|
|
1646
|
-
success: boolean;
|
|
1647
|
-
data: PartnerSettlementModeDto;
|
|
1648
|
-
};
|
|
1649
|
-
};
|
|
1650
|
-
export type ProfileGetSettlementModeResponse = ProfileGetSettlementModeResponses[keyof ProfileGetSettlementModeResponses];
|
|
1651
|
-
export type ProfileSetSettlementModeData = {
|
|
1652
|
-
body: SettlementModeDto;
|
|
1653
|
-
path: {
|
|
1654
|
-
/**
|
|
1655
|
-
* Id of one of your customers, as returned by customers.register.
|
|
1656
|
-
*/
|
|
1657
|
-
customerId: string;
|
|
1658
|
-
};
|
|
1659
|
-
query?: never;
|
|
1660
|
-
url: '/api/v1/partner/v1/customers/{customerId}/settlement-mode';
|
|
1661
|
-
};
|
|
1662
|
-
export type ProfileSetSettlementModeResponses = {
|
|
1663
|
-
200: {
|
|
1664
|
-
success: boolean;
|
|
1665
|
-
data: PartnerSettlementModeDto;
|
|
1666
|
-
};
|
|
1667
|
-
};
|
|
1668
|
-
export type ProfileSetSettlementModeResponse = ProfileSetSettlementModeResponses[keyof ProfileSetSettlementModeResponses];
|
|
1669
1754
|
export type ProfileWithdrawalsData = {
|
|
1670
1755
|
body?: never;
|
|
1671
1756
|
path: {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
export { client, type CreateClientConfig } from './client.gen';
|
|
4
4
|
export { Bank, Countries, Customers, DutchmanBridge, Features, GlobalSend, Kyc, type Options, Profile, Ramp, Receiving, Send, Wallet, Webhook } from './sdk.gen';
|
|
5
|
-
export type { AddAccountDto, BankAddAccountData, BankAddAccountResponse, BankAddAccountResponses, BankBanksData, BankBanksResponse, BankBanksResponses, BankDeleteAccountData, BankDeleteAccountResponse, BankDeleteAccountResponses, BankGetAccountsData, BankGetAccountsResponse, BankGetAccountsResponses, BankSetDefaultAccountData, BankSetDefaultAccountResponse, BankSetDefaultAccountResponses, BankVerifyAccountData, BankVerifyAccountResponse, BankVerifyAccountResponses, BlockchainNetwork, CheckSelfieDto, ClientOptions, CountriesListData, CountriesListResponse, CountriesListResponses, CustomerSellDto, CustomersFullData, CustomersFullResponse, CustomersFullResponses, CustomersGetData, CustomersGetResponse, CustomersGetResponses, CustomersRegisterData, CustomersRegisterResponse, CustomersRegisterResponses, FeaturesListData, FeaturesListResponse, FeaturesListResponses, FeatureStatus, FundingChargeStatus, GetQuoteDto, GlobalSendBeneficiaryDto, GlobalSendCorridorsData, GlobalSendCorridorsResponse, GlobalSendCorridorsResponses, GlobalSendInitiateData, GlobalSendInitiateResponse, GlobalSendInitiateResponses, GlobalSendQuoteData, GlobalSendQuoteDto, GlobalSendQuoteResponse, GlobalSendQuoteResponses, GlobalSendVerificationStatusData, GlobalSendVerificationStatusResponse, GlobalSendVerificationStatusResponses, InitiateFundingChargeDto, InitiateGlobalSendDto, KycDocumentData, KycDocumentResponse, KycDocumentResponses, KycReverificationData, KycReverificationResponse, KycReverificationResponses, KycSelfieCheckRouteData, KycSelfieCheckRouteResponse, KycSelfieCheckRouteResponses, KycStatus, KycStatusData, KycStatusResponse, KycStatusResponses, KycTier1Data, KycTier1Response, KycTier1Responses, KycTier2Data, KycTier2Response, KycTier2Responses, KycTier3Data, KycTier3Response, KycTier3Responses, LedgerEntryType, PartnerAccountVerificationDto, PartnerBalanceDto, PartnerBankAccountDto, PartnerBankDto, PartnerBuyResultDto, PartnerCorridorDto, PartnerCountryDto, PartnerCustomerDto, PartnerCustomerKycSnapshotDto, PartnerCustomerSnapshotDto, PartnerCustomerWalletSnapshotDto, PartnerDepositAddressDto, PartnerFeatureDto, PartnerFundingChargeDto, PartnerGlobalSendQuoteDto, PartnerGlobalSendResultDto, PartnerKycRecordDto, PartnerKycSubmissionDto, PartnerLedgerEntryDto, PartnerNetworkDto, PartnerRampQuoteDto, PartnerRateDto, PartnerReceivingAccountDto, PartnerReceivingActivityDto, PartnerReverificationRequestDto, PartnerSelfieCheckDto, PartnerSellResultDto, PartnerSendNetworkDto, PartnerSendQuoteDto, PartnerSendResultDto,
|
|
5
|
+
export type { AddAccountDto, BankAddAccountData, BankAddAccountResponse, BankAddAccountResponses, BankBanksData, BankBanksResponse, BankBanksResponses, BankDeleteAccountData, BankDeleteAccountResponse, BankDeleteAccountResponses, BankGetAccountsData, BankGetAccountsResponse, BankGetAccountsResponses, BankSetDefaultAccountData, BankSetDefaultAccountResponse, BankSetDefaultAccountResponses, BankVerifyAccountData, BankVerifyAccountResponse, BankVerifyAccountResponses, BlockchainNetwork, CheckSelfieDto, ClientOptions, CountriesListData, CountriesListResponse, CountriesListResponses, CustomerSellDto, CustomersFullData, CustomersFullResponse, CustomersFullResponses, CustomersGetData, CustomersGetResponse, CustomersGetResponses, CustomersRegisterData, CustomersRegisterResponse, CustomersRegisterResponses, FeaturesListData, FeaturesListResponse, FeaturesListResponses, FeatureStatus, FundingChargeStatus, GetQuoteDto, GlobalSendBeneficiaryDto, GlobalSendCorridorsData, GlobalSendCorridorsResponse, GlobalSendCorridorsResponses, GlobalSendInitiateData, GlobalSendInitiateResponse, GlobalSendInitiateResponses, GlobalSendQuoteData, GlobalSendQuoteDto, GlobalSendQuoteResponse, GlobalSendQuoteResponses, GlobalSendVerificationStatusData, GlobalSendVerificationStatusResponse, GlobalSendVerificationStatusResponses, InitiateFundingChargeDto, InitiateGlobalSendDto, KycDocumentData, KycDocumentResponse, KycDocumentResponses, KycReverificationData, KycReverificationResponse, KycReverificationResponses, KycSelfieCheckRouteData, KycSelfieCheckRouteResponse, KycSelfieCheckRouteResponses, KycStatus, KycStatusData, KycStatusResponse, KycStatusResponses, KycSummaryData, KycSummaryResponse, KycSummaryResponses, KycTier1Data, KycTier1Response, KycTier1Responses, KycTier2Data, KycTier2Response, KycTier2Responses, KycTier3Data, KycTier3Response, KycTier3Responses, LedgerEntryType, PartnerAccountVerificationDto, PartnerBalanceDto, PartnerBankAccountDto, PartnerBankDto, PartnerBuyResultDto, PartnerCorridorDto, PartnerCountryDto, PartnerCustomerDto, PartnerCustomerKycSnapshotDto, PartnerCustomerSnapshotDto, PartnerCustomerWalletSnapshotDto, PartnerDepositAddressDto, PartnerFeatureDto, PartnerFundingChargeDto, PartnerGlobalSendQuoteDto, PartnerGlobalSendResultDto, PartnerKycRecordDto, PartnerKycSubmissionDto, PartnerLedgerEntryDto, PartnerNetworkDto, PartnerRampQuoteDto, PartnerRateDto, PartnerReceivingAccountDto, PartnerReceivingActivityDto, PartnerReverificationRequestDto, PartnerSelfieCheckDto, PartnerSellResultDto, PartnerSendNetworkDto, PartnerSendQuoteDto, PartnerSendResultDto, PartnerTierStateDto, PartnerTierStatus, PartnerUploadedDocumentDto, PartnerVerificationInput, PartnerVerificationRecordDto, PartnerVerificationSummaryDto, PartnerVerificationTiersDto, PartnerVirtualAccountDto, PartnerWebhookConfigDto, PartnerWebhookDeliveryDetailDto, PartnerWebhookDeliveryDto, PartnerWebhookSecretDto, PartnerWebhookTestDto, PartnerWithdrawalBankAccountDto, PartnerWithdrawalDto, PartnerWithdrawalQuoteDto, ProfileChangePasswordData, ProfileChangePasswordResponse, ProfileChangePasswordResponses, ProfileDeleteAccountData, ProfileDeleteAccountResponse, ProfileDeleteAccountResponses, ProfileProfileData, ProfileProfileResponse, ProfileProfileResponses, ProfileUpdateProfileData, ProfileUpdateProfileResponse, ProfileUpdateProfileResponses, ProfileWithdrawalsData, ProfileWithdrawalsResponse, ProfileWithdrawalsResponses, QuoteSendDto, RampBuyData, RampBuyQuoteData, RampBuyQuoteResponse, RampBuyQuoteResponses, RampBuyResponse, RampBuyResponses, RampRateData, RampRateResponse, RampRateResponses, RampSellData, RampSellNetworksData, RampSellNetworksResponse, RampSellNetworksResponses, RampSellQuoteData, RampSellQuoteResponse, RampSellQuoteResponses, RampSellResponse, RampSellResponses, ReceivingActivityData, ReceivingActivityResponse, ReceivingActivityResponses, ReceivingCurrenciesData, ReceivingCurrenciesResponse, ReceivingCurrenciesResponses, ReceivingListData, ReceivingListResponse, ReceivingListResponses, ReceivingOpenData, ReceivingOpenResponse, ReceivingOpenResponses, ReceivingRefreshData, ReceivingRefreshResponse, ReceivingRefreshResponses, RegisterCustomerDto, ResetPassword, ReverificationItem, ReverificationStatus, SendDto, SendNetworksData, SendNetworksResponse, SendNetworksResponses, SendQuoteData, SendQuoteResponse, SendQuoteResponses, SendSubmitData, SendSubmitResponse, SendSubmitResponses, SetWebhookUrlDto, SubmitTier3Dto, Tier1KycDto, Tier2KycDto, UpdateCustomerProfileDto, VerifyAccountNumberInput, WalletAddressesData, WalletAddressesResponse, WalletAddressesResponses, WalletBalanceData, WalletBalanceResponse, WalletBalanceResponses, WalletFundingChargesData, WalletFundingChargesResponse, WalletFundingChargesResponses, WalletInitiateFundingChargeData, WalletInitiateFundingChargeResponse, WalletInitiateFundingChargeResponses, WalletStreamBalanceData, WalletStreamBalanceResponses, WalletTransactionsData, WalletTransactionsResponse, WalletTransactionsResponses, WalletVirtualAccountForData, WalletVirtualAccountForResponse, WalletVirtualAccountForResponses, WalletWithdrawalQuoteData, WalletWithdrawalQuoteResponse, WalletWithdrawalQuoteResponses, WalletWithdrawData, WalletWithdrawResponse, WalletWithdrawResponses, WebhookConfigData, WebhookConfigResponse, WebhookConfigResponses, WebhookDeliveriesData, WebhookDeliveriesResponse, WebhookDeliveriesResponses, WebhookDeliveryData, WebhookDeliveryResponse, WebhookDeliveryResponses, WebhookDeliveryStatus, WebhookReplayData, WebhookReplayResponse, WebhookReplayResponses, WebhookRotateSecretData, WebhookRotateSecretResponse, WebhookRotateSecretResponses, WebhookSetUrlData, WebhookSetUrlResponse, WebhookSetUrlResponses, WithdrawalStatus, WithdrawDto } from './types.gen';
|
package/src/sdk.gen.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { type Client, type ClientMeta, formDataBodySerializer, type Options as Options2, type RequestResult, type TDataShape } from './client';
|
|
4
4
|
import { client } from './client.gen';
|
|
5
|
-
import type { BankAddAccountData, BankAddAccountResponses, BankBanksData, BankBanksResponses, BankDeleteAccountData, BankDeleteAccountResponses, BankGetAccountsData, BankGetAccountsResponses, BankSetDefaultAccountData, BankSetDefaultAccountResponses, BankVerifyAccountData, BankVerifyAccountResponses, CountriesListData, CountriesListResponses, CustomersFullData, CustomersFullResponses, CustomersGetData, CustomersGetResponses, CustomersRegisterData, CustomersRegisterResponses, FeaturesListData, FeaturesListResponses, GlobalSendCorridorsData, GlobalSendCorridorsResponses, GlobalSendInitiateData, GlobalSendInitiateResponses, GlobalSendQuoteData, GlobalSendQuoteResponses, GlobalSendVerificationStatusData, GlobalSendVerificationStatusResponses, KycDocumentData, KycDocumentResponses, KycReverificationData, KycReverificationResponses, KycSelfieCheckRouteData, KycSelfieCheckRouteResponses, KycStatusData, KycStatusResponses, KycTier1Data, KycTier1Responses, KycTier2Data, KycTier2Responses, KycTier3Data, KycTier3Responses, ProfileChangePasswordData, ProfileChangePasswordResponses, ProfileDeleteAccountData, ProfileDeleteAccountResponses,
|
|
5
|
+
import type { BankAddAccountData, BankAddAccountResponses, BankBanksData, BankBanksResponses, BankDeleteAccountData, BankDeleteAccountResponses, BankGetAccountsData, BankGetAccountsResponses, BankSetDefaultAccountData, BankSetDefaultAccountResponses, BankVerifyAccountData, BankVerifyAccountResponses, CountriesListData, CountriesListResponses, CustomersFullData, CustomersFullResponses, CustomersGetData, CustomersGetResponses, CustomersRegisterData, CustomersRegisterResponses, FeaturesListData, FeaturesListResponses, GlobalSendCorridorsData, GlobalSendCorridorsResponses, GlobalSendInitiateData, GlobalSendInitiateResponses, GlobalSendQuoteData, GlobalSendQuoteResponses, GlobalSendVerificationStatusData, GlobalSendVerificationStatusResponses, KycDocumentData, KycDocumentResponses, KycReverificationData, KycReverificationResponses, KycSelfieCheckRouteData, KycSelfieCheckRouteResponses, KycStatusData, KycStatusResponses, KycSummaryData, KycSummaryResponses, KycTier1Data, KycTier1Responses, KycTier2Data, KycTier2Responses, KycTier3Data, KycTier3Responses, ProfileChangePasswordData, ProfileChangePasswordResponses, ProfileDeleteAccountData, ProfileDeleteAccountResponses, ProfileProfileData, ProfileProfileResponses, ProfileUpdateProfileData, ProfileUpdateProfileResponses, ProfileWithdrawalsData, ProfileWithdrawalsResponses, RampBuyData, RampBuyQuoteData, RampBuyQuoteResponses, RampBuyResponses, RampRateData, RampRateResponses, RampSellData, RampSellNetworksData, RampSellNetworksResponses, RampSellQuoteData, RampSellQuoteResponses, RampSellResponses, ReceivingActivityData, ReceivingActivityResponses, ReceivingCurrenciesData, ReceivingCurrenciesResponses, ReceivingListData, ReceivingListResponses, ReceivingOpenData, ReceivingOpenResponses, ReceivingRefreshData, ReceivingRefreshResponses, SendNetworksData, SendNetworksResponses, SendQuoteData, SendQuoteResponses, SendSubmitData, SendSubmitResponses, WalletAddressesData, WalletAddressesResponses, WalletBalanceData, WalletBalanceResponses, WalletFundingChargesData, WalletFundingChargesResponses, WalletInitiateFundingChargeData, WalletInitiateFundingChargeResponses, WalletStreamBalanceData, WalletStreamBalanceResponses, WalletTransactionsData, WalletTransactionsResponses, WalletVirtualAccountForData, WalletVirtualAccountForResponses, WalletWithdrawalQuoteData, WalletWithdrawalQuoteResponses, WalletWithdrawData, WalletWithdrawResponses, WebhookConfigData, WebhookConfigResponses, WebhookDeliveriesData, WebhookDeliveriesResponses, WebhookDeliveryData, WebhookDeliveryResponses, WebhookReplayData, WebhookReplayResponses, WebhookRotateSecretData, WebhookRotateSecretResponses, WebhookSetUrlData, WebhookSetUrlResponses } from './types.gen';
|
|
6
6
|
|
|
7
7
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
8
8
|
/**
|
|
@@ -146,32 +146,6 @@ export class Profile extends HeyApiClient {
|
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
/**
|
|
150
|
-
* Read the customer's settlement preference (AUTO to default bank vs MANUAL hold)
|
|
151
|
-
*/
|
|
152
|
-
public getSettlementMode<ThrowOnError extends boolean = false>(options: Options<ProfileGetSettlementModeData, ThrowOnError>): RequestResult<ProfileGetSettlementModeResponses, unknown, ThrowOnError> {
|
|
153
|
-
return (options.client ?? this.client).get<ProfileGetSettlementModeResponses, unknown, ThrowOnError>({
|
|
154
|
-
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
155
|
-
url: '/api/v1/partner/v1/customers/{customerId}/settlement-mode',
|
|
156
|
-
...options
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Update how the customer's sale proceeds settle
|
|
162
|
-
*/
|
|
163
|
-
public setSettlementMode<ThrowOnError extends boolean = false>(options: Options<ProfileSetSettlementModeData, ThrowOnError>): RequestResult<ProfileSetSettlementModeResponses, unknown, ThrowOnError> {
|
|
164
|
-
return (options.client ?? this.client).patch<ProfileSetSettlementModeResponses, unknown, ThrowOnError>({
|
|
165
|
-
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
166
|
-
url: '/api/v1/partner/v1/customers/{customerId}/settlement-mode',
|
|
167
|
-
...options,
|
|
168
|
-
headers: {
|
|
169
|
-
'Content-Type': 'application/json',
|
|
170
|
-
...options.headers
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
|
|
175
149
|
/**
|
|
176
150
|
* The customer's withdrawal / global payout history, newest first
|
|
177
151
|
*/
|
|
@@ -185,6 +159,19 @@ export class Profile extends HeyApiClient {
|
|
|
185
159
|
}
|
|
186
160
|
|
|
187
161
|
export class Kyc extends HeyApiClient {
|
|
162
|
+
/**
|
|
163
|
+
* Where the customer stands, and what to submit next
|
|
164
|
+
*
|
|
165
|
+
* The recommended single read: the highest approved tier, each tier's status, the inputs to submit next (with any open re-verification items first), the open re-verification request, and the KYC records. Replaces calling GET .../kyc and GET .../kyc/reverification separately.
|
|
166
|
+
*/
|
|
167
|
+
public summary<ThrowOnError extends boolean = false>(options: Options<KycSummaryData, ThrowOnError>): RequestResult<KycSummaryResponses, unknown, ThrowOnError> {
|
|
168
|
+
return (options.client ?? this.client).get<KycSummaryResponses, unknown, ThrowOnError>({
|
|
169
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
170
|
+
url: '/api/v1/partner/v1/customers/{customerId}/verification',
|
|
171
|
+
...options
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
188
175
|
/**
|
|
189
176
|
* A customer's KYC records, newest first
|
|
190
177
|
*/
|
|
@@ -348,8 +335,23 @@ export class Wallet extends HeyApiClient {
|
|
|
348
335
|
});
|
|
349
336
|
}
|
|
350
337
|
|
|
338
|
+
/**
|
|
339
|
+
* Price a withdrawal before submitting it
|
|
340
|
+
*
|
|
341
|
+
* The withdrawal fee (a percentage of the amount plus a fixed charge for the currency) is charged on top of the amount: the bank receives `amount`, the balance is debited `totalDebited`. Nothing is reserved.
|
|
342
|
+
*/
|
|
343
|
+
public withdrawalQuote<ThrowOnError extends boolean = false>(options: Options<WalletWithdrawalQuoteData, ThrowOnError>): RequestResult<WalletWithdrawalQuoteResponses, unknown, ThrowOnError> {
|
|
344
|
+
return (options.client ?? this.client).get<WalletWithdrawalQuoteResponses, unknown, ThrowOnError>({
|
|
345
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
346
|
+
url: '/api/v1/partner/v1/customers/{customerId}/withdraw/quote',
|
|
347
|
+
...options
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
|
|
351
351
|
/**
|
|
352
352
|
* Pay a held balance out to the customer's default bank account
|
|
353
|
+
*
|
|
354
|
+
* The bank receives `amount`; the withdrawal fee is debited on top of it. Price it first with GET .../withdraw/quote.
|
|
353
355
|
*/
|
|
354
356
|
public withdraw<ThrowOnError extends boolean = false>(options: Options<WalletWithdrawData, ThrowOnError>): RequestResult<WalletWithdrawResponses, unknown, ThrowOnError> {
|
|
355
357
|
return (options.client ?? this.client).post<WalletWithdrawResponses, unknown, ThrowOnError>({
|
|
@@ -519,7 +521,7 @@ export class Ramp extends HeyApiClient {
|
|
|
519
521
|
}
|
|
520
522
|
|
|
521
523
|
/**
|
|
522
|
-
* Networks the customer can
|
|
524
|
+
* Networks the customer can deposit USDT on
|
|
523
525
|
*/
|
|
524
526
|
public sellNetworks<ThrowOnError extends boolean = false>(options: Options<RampSellNetworksData, ThrowOnError>): RequestResult<RampSellNetworksResponses, unknown, ThrowOnError> {
|
|
525
527
|
return (options.client ?? this.client).get<RampSellNetworksResponses, unknown, ThrowOnError>({
|
|
@@ -530,9 +532,9 @@ export class Ramp extends HeyApiClient {
|
|
|
530
532
|
}
|
|
531
533
|
|
|
532
534
|
/**
|
|
533
|
-
* Live USDT rates in the customer's local fiat, for previewing a conversion
|
|
535
|
+
* Live all-in USDT rates in the customer's local fiat, for previewing a conversion
|
|
534
536
|
*
|
|
535
|
-
* Does not lock a rate -- checkout still goes through the quote routes.
|
|
537
|
+
* Rates include our spread and every fee, so amount * rate is what the customer pays or receives. Pass ?amount (USDT) to fold the fixed exchange fee into sellRate for that amount. Does not lock a rate -- checkout still goes through the quote routes.
|
|
536
538
|
*/
|
|
537
539
|
public rate<ThrowOnError extends boolean = false>(options: Options<RampRateData, ThrowOnError>): RequestResult<RampRateResponses, unknown, ThrowOnError> {
|
|
538
540
|
return (options.client ?? this.client).get<RampRateResponses, unknown, ThrowOnError>({
|
package/src/types.gen.ts
CHANGED
|
@@ -4,8 +4,6 @@ export type ClientOptions = {
|
|
|
4
4
|
baseUrl: 'https://app.dutchmannetwork.online' | (string & {});
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
export type SettlementMode = 'AUTO' | 'MANUAL';
|
|
8
|
-
|
|
9
7
|
export type PartnerCustomerDto = {
|
|
10
8
|
id: string;
|
|
11
9
|
firstName: string;
|
|
@@ -24,7 +22,6 @@ export type PartnerCustomerDto = {
|
|
|
24
22
|
* When identity verification was approved; null until then.
|
|
25
23
|
*/
|
|
26
24
|
verifiedAt: string | null;
|
|
27
|
-
settlementMode: SettlementMode;
|
|
28
25
|
createdAt: string;
|
|
29
26
|
updatedAt: string;
|
|
30
27
|
};
|
|
@@ -124,6 +121,66 @@ export type PartnerCustomerSnapshotDto = {
|
|
|
124
121
|
wallet: PartnerCustomerWalletSnapshotDto;
|
|
125
122
|
};
|
|
126
123
|
|
|
124
|
+
/**
|
|
125
|
+
* NOT_STARTED when nothing has been submitted for the tier; otherwise the decision on the newest submission.
|
|
126
|
+
*/
|
|
127
|
+
export type PartnerTierStatus = 'NOT_STARTED' | 'PENDING' | 'REVIEW' | 'APPROVED' | 'REJECTED';
|
|
128
|
+
|
|
129
|
+
export type PartnerTierStateDto = {
|
|
130
|
+
/**
|
|
131
|
+
* NOT_STARTED when nothing has been submitted for the tier; otherwise the decision on the newest submission.
|
|
132
|
+
*/
|
|
133
|
+
status: PartnerTierStatus;
|
|
134
|
+
/**
|
|
135
|
+
* When the tier last changed; null when NOT_STARTED.
|
|
136
|
+
*/
|
|
137
|
+
updatedAt: string | null;
|
|
138
|
+
/**
|
|
139
|
+
* Why it was REJECTED; null otherwise.
|
|
140
|
+
*/
|
|
141
|
+
rejectionReason: string | null;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export type PartnerVerificationTiersDto = {
|
|
145
|
+
/**
|
|
146
|
+
* Tier 1: BVN + NIN.
|
|
147
|
+
*/
|
|
148
|
+
1: PartnerTierStateDto;
|
|
149
|
+
/**
|
|
150
|
+
* Tier 2: ID document + selfie.
|
|
151
|
+
*/
|
|
152
|
+
2: PartnerTierStateDto;
|
|
153
|
+
/**
|
|
154
|
+
* Tier 3: date of birth + address, decided by the cross-border verification partners.
|
|
155
|
+
*/
|
|
156
|
+
3: PartnerTierStateDto;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* What to submit next, in order. BVN and NIN go to POST .../kyc/tier1; ID_DOCUMENT and SELFIE to POST .../kyc/tier2; DATE_OF_BIRTH and ADDRESS to POST .../kyc/tier3; COUNTRY and ADDRESS_PROOF only ever appear from an open re-verification request. Empty when the next tier is already PENDING or in REVIEW, or every tier is APPROVED.
|
|
161
|
+
*/
|
|
162
|
+
export type PartnerVerificationInput = 'BVN' | 'NIN' | 'ID_DOCUMENT' | 'SELFIE' | 'DATE_OF_BIRTH' | 'ADDRESS' | 'COUNTRY' | 'ADDRESS_PROOF';
|
|
163
|
+
|
|
164
|
+
export type PartnerVerificationSummaryDto = {
|
|
165
|
+
/**
|
|
166
|
+
* The highest APPROVED tier; 0 when none is.
|
|
167
|
+
*/
|
|
168
|
+
currentTier: 0 | 1 | 2 | 3;
|
|
169
|
+
tiers: PartnerVerificationTiersDto;
|
|
170
|
+
/**
|
|
171
|
+
* What to submit next, in order. BVN and NIN go to POST .../kyc/tier1; ID_DOCUMENT and SELFIE to POST .../kyc/tier2; DATE_OF_BIRTH and ADDRESS to POST .../kyc/tier3; COUNTRY and ADDRESS_PROOF only ever appear from an open re-verification request. Empty when the next tier is already PENDING or in REVIEW, or every tier is APPROVED.
|
|
172
|
+
*/
|
|
173
|
+
nextRequired: Array<PartnerVerificationInput>;
|
|
174
|
+
/**
|
|
175
|
+
* The open re-verification request an admin has raised, or null. Its items are already at the front of nextRequired.
|
|
176
|
+
*/
|
|
177
|
+
reverification: PartnerReverificationRequestDto | null;
|
|
178
|
+
/**
|
|
179
|
+
* Every KYC record, newest first -- the same as GET .../kyc.
|
|
180
|
+
*/
|
|
181
|
+
records: Array<PartnerKycRecordDto>;
|
|
182
|
+
};
|
|
183
|
+
|
|
127
184
|
export type PartnerKycSubmissionDto = {
|
|
128
185
|
/**
|
|
129
186
|
* APPROVED when the checks cleared immediately; REVIEW while a reviewer decides.
|
|
@@ -243,7 +300,7 @@ export type PartnerLedgerEntryDto = {
|
|
|
243
300
|
id: string;
|
|
244
301
|
type: LedgerEntryType;
|
|
245
302
|
/**
|
|
246
|
-
* deposit | fiat.deposit | withdrawal | withdrawal.reversal | buy | sell | crypto_send | crypto_send.reversal | offramp.settlement | reversal
|
|
303
|
+
* deposit | fiat.deposit | withdrawal | withdrawal.fee | withdrawal.reversal | buy | sell | crypto_send | crypto_send.reversal | offramp.settlement | reversal
|
|
247
304
|
*/
|
|
248
305
|
reason: string;
|
|
249
306
|
currency: string;
|
|
@@ -264,6 +321,30 @@ export type PartnerLedgerEntryDto = {
|
|
|
264
321
|
createdAt: string;
|
|
265
322
|
};
|
|
266
323
|
|
|
324
|
+
export type PartnerWithdrawalQuoteDto = {
|
|
325
|
+
currency: string;
|
|
326
|
+
/**
|
|
327
|
+
* What the bank account receives.
|
|
328
|
+
*/
|
|
329
|
+
amount: number;
|
|
330
|
+
/**
|
|
331
|
+
* Withdrawal fee, same currency: the percentage fee on the amount plus the fixed fee for the currency.
|
|
332
|
+
*/
|
|
333
|
+
fee: number;
|
|
334
|
+
/**
|
|
335
|
+
* amount + fee: what leaves the balance.
|
|
336
|
+
*/
|
|
337
|
+
totalDebited: number;
|
|
338
|
+
/**
|
|
339
|
+
* Percentage part of the fee, basis points.
|
|
340
|
+
*/
|
|
341
|
+
feeBps: number;
|
|
342
|
+
/**
|
|
343
|
+
* Fixed part of the fee, same currency.
|
|
344
|
+
*/
|
|
345
|
+
feeFlat: number;
|
|
346
|
+
};
|
|
347
|
+
|
|
267
348
|
export type WithdrawalStatus = 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'PENDING_LIQUIDITY';
|
|
268
349
|
|
|
269
350
|
export type PartnerWithdrawalBankAccountDto = {
|
|
@@ -276,9 +357,17 @@ export type PartnerWithdrawalDto = {
|
|
|
276
357
|
id: string;
|
|
277
358
|
reference: string;
|
|
278
359
|
/**
|
|
279
|
-
* Decimal string, e.g. "5000.00000000".
|
|
360
|
+
* What the bank account receives. Decimal string, e.g. "5000.00000000".
|
|
280
361
|
*/
|
|
281
362
|
amount: string;
|
|
363
|
+
/**
|
|
364
|
+
* Withdrawal fee charged on top of amount. Decimal string.
|
|
365
|
+
*/
|
|
366
|
+
fee: string;
|
|
367
|
+
/**
|
|
368
|
+
* amount + fee: what left the balance. Decimal string.
|
|
369
|
+
*/
|
|
370
|
+
totalDebited: string;
|
|
282
371
|
currency: string;
|
|
283
372
|
status: WithdrawalStatus;
|
|
284
373
|
failureReason: string | null;
|
|
@@ -289,9 +378,13 @@ export type PartnerWithdrawalDto = {
|
|
|
289
378
|
|
|
290
379
|
export type WithdrawDto = {
|
|
291
380
|
/**
|
|
292
|
-
* Amount
|
|
381
|
+
* Amount the bank account receives. The withdrawal fee is charged on top, so the balance is debited amount + fee.
|
|
293
382
|
*/
|
|
294
383
|
amount: number;
|
|
384
|
+
/**
|
|
385
|
+
* Idempotency key. Resending the same value returns the existing withdrawal rather than moving money again — pass the client's request id. Letters, digits, dot, underscore and hyphen; 120 characters max.
|
|
386
|
+
*/
|
|
387
|
+
reference?: string;
|
|
295
388
|
};
|
|
296
389
|
|
|
297
390
|
export type FundingChargeStatus = 'PENDING' | 'SUCCESS' | 'FAILED';
|
|
@@ -327,6 +420,10 @@ export type InitiateFundingChargeDto = {
|
|
|
327
420
|
* Amount to fund, in the user’s local fiat (derived from their country).
|
|
328
421
|
*/
|
|
329
422
|
amount: number;
|
|
423
|
+
/**
|
|
424
|
+
* Idempotency key. Resending the same value returns the existing funding charge rather than moving money again — pass the client's request id. Letters, digits, dot, underscore and hyphen; 120 characters max.
|
|
425
|
+
*/
|
|
426
|
+
reference?: string;
|
|
330
427
|
};
|
|
331
428
|
|
|
332
429
|
/**
|
|
@@ -428,6 +525,10 @@ export type SendDto = {
|
|
|
428
525
|
* Destination on-chain address
|
|
429
526
|
*/
|
|
430
527
|
toAddress: string;
|
|
528
|
+
/**
|
|
529
|
+
* Idempotency key. Resending the same value returns the existing send rather than moving money again — pass the client's request id. Letters, digits, dot, underscore and hyphen; 120 characters max.
|
|
530
|
+
*/
|
|
531
|
+
reference?: string;
|
|
431
532
|
};
|
|
432
533
|
|
|
433
534
|
export type PartnerCorridorDto = {
|
|
@@ -554,7 +655,7 @@ export type InitiateGlobalSendDto = {
|
|
|
554
655
|
asset?: 'USDT' | 'USDC';
|
|
555
656
|
beneficiary: GlobalSendBeneficiaryDto;
|
|
556
657
|
/**
|
|
557
|
-
* Idempotency key. Resending the same value returns the existing send rather than
|
|
658
|
+
* Idempotency key. Resending the same value returns the existing send rather than moving money again — pass the client's request id. Letters, digits, dot, underscore and hyphen; 120 characters max.
|
|
558
659
|
*/
|
|
559
660
|
reference?: string;
|
|
560
661
|
};
|
|
@@ -576,18 +677,9 @@ export type PartnerRampQuoteDto = {
|
|
|
576
677
|
*/
|
|
577
678
|
rate: number;
|
|
578
679
|
/**
|
|
579
|
-
*
|
|
580
|
-
*/
|
|
581
|
-
payoutFee: number;
|
|
582
|
-
/**
|
|
583
|
-
* In the destination currency; 0 on a buy.
|
|
584
|
-
*/
|
|
585
|
-
networkGasFee: number;
|
|
586
|
-
/**
|
|
587
|
-
* In the destination currency; 0 on a buy.
|
|
680
|
+
* The exchange's fixed execution fee, in the destination currency; 0 on a buy.
|
|
588
681
|
*/
|
|
589
682
|
exchangeFee: number;
|
|
590
|
-
network: BlockchainNetwork;
|
|
591
683
|
/**
|
|
592
684
|
* Seconds until the quote expires.
|
|
593
685
|
*/
|
|
@@ -599,7 +691,12 @@ export type GetQuoteDto = {
|
|
|
599
691
|
sourceCurrency: string;
|
|
600
692
|
destinationCurrency: string;
|
|
601
693
|
type: 'sell' | 'buy';
|
|
602
|
-
|
|
694
|
+
/**
|
|
695
|
+
* Ignored. A buy or sell moves balances only, so no chain is involved and no gas is charged; gas applies to crypto sends. Still accepted so older requests keep working.
|
|
696
|
+
*
|
|
697
|
+
* @deprecated
|
|
698
|
+
*/
|
|
699
|
+
network?: 'ethereum' | 'polygon' | 'arbitrum' | 'base' | 'arc' | 'bsc' | 'optimism' | 'tron';
|
|
603
700
|
/**
|
|
604
701
|
* Optional preferred exchange venue. If omitted, the system auto-routes to the best available rate.
|
|
605
702
|
*/
|
|
@@ -635,23 +732,19 @@ export type PartnerNetworkDto = {
|
|
|
635
732
|
export type PartnerRateDto = {
|
|
636
733
|
fiatCurrency: string;
|
|
637
734
|
/**
|
|
638
|
-
* Fiat per USDT when buying
|
|
735
|
+
* Fiat paid per USDT when buying. All-in: spread applied, and buys carry no fees.
|
|
639
736
|
*/
|
|
640
737
|
buyRate: number;
|
|
641
738
|
/**
|
|
642
|
-
* Fiat per USDT when selling
|
|
739
|
+
* Fiat received per USDT when selling. All-in: spread applied, plus the fixed exchange fee when ?amount was given, so amount * sellRate is exactly what the customer receives. The withdrawal fee is separate; see GET .../withdraw/quote.
|
|
643
740
|
*/
|
|
644
741
|
sellRate: number;
|
|
645
742
|
/**
|
|
646
|
-
*
|
|
743
|
+
* USDT amount sellRate was priced for; null when ?amount was omitted, in which case the fixed exchange fee is not in sellRate.
|
|
647
744
|
*/
|
|
648
|
-
|
|
649
|
-
/**
|
|
650
|
-
* Sell-side gas estimate for the network, USD.
|
|
651
|
-
*/
|
|
652
|
-
networkGasFeeUsd: number;
|
|
745
|
+
amount: number | null;
|
|
653
746
|
/**
|
|
654
|
-
*
|
|
747
|
+
* Fixed sell-side exchange fee, USDT. In sellRate only when ?amount was given.
|
|
655
748
|
*/
|
|
656
749
|
exchangeFeeUsdt: number;
|
|
657
750
|
};
|
|
@@ -660,12 +753,10 @@ export type PartnerSellResultDto = {
|
|
|
660
753
|
reference: string;
|
|
661
754
|
usdtSold: number;
|
|
662
755
|
fiatCurrency: string;
|
|
663
|
-
fiatCredited: number;
|
|
664
|
-
settlementMode: SettlementMode;
|
|
665
756
|
/**
|
|
666
|
-
*
|
|
757
|
+
* Now on the customer's fiat balance; withdraw it with POST .../withdraw.
|
|
667
758
|
*/
|
|
668
|
-
|
|
759
|
+
fiatCredited: number;
|
|
669
760
|
};
|
|
670
761
|
|
|
671
762
|
export type PartnerBankDto = {
|
|
@@ -753,20 +844,6 @@ export type ResetPassword = {
|
|
|
753
844
|
newPassword: string;
|
|
754
845
|
};
|
|
755
846
|
|
|
756
|
-
export type PartnerSettlementModeDto = {
|
|
757
|
-
/**
|
|
758
|
-
* AUTO pays sale proceeds straight to the default bank; MANUAL holds them as a fiat balance.
|
|
759
|
-
*/
|
|
760
|
-
mode: SettlementMode;
|
|
761
|
-
};
|
|
762
|
-
|
|
763
|
-
export type SettlementModeDto = {
|
|
764
|
-
/**
|
|
765
|
-
* AUTO settles sale proceeds straight to the default bank; MANUAL holds them as an NGN balance to withdraw later.
|
|
766
|
-
*/
|
|
767
|
-
mode: 'AUTO' | 'MANUAL';
|
|
768
|
-
};
|
|
769
|
-
|
|
770
847
|
export type PartnerReceivingAccountDto = {
|
|
771
848
|
id: string;
|
|
772
849
|
currency: string;
|
|
@@ -1007,6 +1084,27 @@ export type CustomersFullResponses = {
|
|
|
1007
1084
|
|
|
1008
1085
|
export type CustomersFullResponse = CustomersFullResponses[keyof CustomersFullResponses];
|
|
1009
1086
|
|
|
1087
|
+
export type KycSummaryData = {
|
|
1088
|
+
body?: never;
|
|
1089
|
+
path: {
|
|
1090
|
+
/**
|
|
1091
|
+
* Id of one of your customers, as returned by customers.register.
|
|
1092
|
+
*/
|
|
1093
|
+
customerId: string;
|
|
1094
|
+
};
|
|
1095
|
+
query?: never;
|
|
1096
|
+
url: '/api/v1/partner/v1/customers/{customerId}/verification';
|
|
1097
|
+
};
|
|
1098
|
+
|
|
1099
|
+
export type KycSummaryResponses = {
|
|
1100
|
+
200: {
|
|
1101
|
+
success: boolean;
|
|
1102
|
+
data: PartnerVerificationSummaryDto;
|
|
1103
|
+
};
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
export type KycSummaryResponse = KycSummaryResponses[keyof KycSummaryResponses];
|
|
1107
|
+
|
|
1010
1108
|
export type KycStatusData = {
|
|
1011
1109
|
body?: never;
|
|
1012
1110
|
path: {
|
|
@@ -1274,6 +1372,32 @@ export type WalletVirtualAccountForResponses = {
|
|
|
1274
1372
|
|
|
1275
1373
|
export type WalletVirtualAccountForResponse = WalletVirtualAccountForResponses[keyof WalletVirtualAccountForResponses];
|
|
1276
1374
|
|
|
1375
|
+
export type WalletWithdrawalQuoteData = {
|
|
1376
|
+
body?: never;
|
|
1377
|
+
path: {
|
|
1378
|
+
/**
|
|
1379
|
+
* Id of one of your customers, as returned by customers.register.
|
|
1380
|
+
*/
|
|
1381
|
+
customerId: string;
|
|
1382
|
+
};
|
|
1383
|
+
query: {
|
|
1384
|
+
/**
|
|
1385
|
+
* Amount the bank account would receive.
|
|
1386
|
+
*/
|
|
1387
|
+
amount: number;
|
|
1388
|
+
};
|
|
1389
|
+
url: '/api/v1/partner/v1/customers/{customerId}/withdraw/quote';
|
|
1390
|
+
};
|
|
1391
|
+
|
|
1392
|
+
export type WalletWithdrawalQuoteResponses = {
|
|
1393
|
+
200: {
|
|
1394
|
+
success: boolean;
|
|
1395
|
+
data: PartnerWithdrawalQuoteDto;
|
|
1396
|
+
};
|
|
1397
|
+
};
|
|
1398
|
+
|
|
1399
|
+
export type WalletWithdrawalQuoteResponse = WalletWithdrawalQuoteResponses[keyof WalletWithdrawalQuoteResponses];
|
|
1400
|
+
|
|
1277
1401
|
export type WalletWithdrawData = {
|
|
1278
1402
|
body: WithdrawDto;
|
|
1279
1403
|
path: {
|
|
@@ -1572,9 +1696,15 @@ export type RampRateData = {
|
|
|
1572
1696
|
};
|
|
1573
1697
|
query?: {
|
|
1574
1698
|
/**
|
|
1575
|
-
*
|
|
1699
|
+
* Ignored. A buy or sell moves balances only, so no gas is priced into the rate; gas applies to crypto sends. Still accepted so older requests keep working.
|
|
1700
|
+
*
|
|
1701
|
+
* @deprecated
|
|
1576
1702
|
*/
|
|
1577
1703
|
network?: 'ethereum' | 'polygon' | 'arbitrum' | 'base' | 'arc' | 'bsc' | 'optimism' | 'tron';
|
|
1704
|
+
/**
|
|
1705
|
+
* USDT amount to price the sell rate for. When given, the fixed exchange fee is spread over it, so amount * sellRate is exactly what the customer receives. Omit for a per-unit rate that carries the spread only.
|
|
1706
|
+
*/
|
|
1707
|
+
amount?: number;
|
|
1578
1708
|
};
|
|
1579
1709
|
url: '/api/v1/partner/v1/customers/{customerId}/rate';
|
|
1580
1710
|
};
|
|
@@ -1826,48 +1956,6 @@ export type ProfileChangePasswordResponses = {
|
|
|
1826
1956
|
|
|
1827
1957
|
export type ProfileChangePasswordResponse = ProfileChangePasswordResponses[keyof ProfileChangePasswordResponses];
|
|
1828
1958
|
|
|
1829
|
-
export type ProfileGetSettlementModeData = {
|
|
1830
|
-
body?: never;
|
|
1831
|
-
path: {
|
|
1832
|
-
/**
|
|
1833
|
-
* Id of one of your customers, as returned by customers.register.
|
|
1834
|
-
*/
|
|
1835
|
-
customerId: string;
|
|
1836
|
-
};
|
|
1837
|
-
query?: never;
|
|
1838
|
-
url: '/api/v1/partner/v1/customers/{customerId}/settlement-mode';
|
|
1839
|
-
};
|
|
1840
|
-
|
|
1841
|
-
export type ProfileGetSettlementModeResponses = {
|
|
1842
|
-
200: {
|
|
1843
|
-
success: boolean;
|
|
1844
|
-
data: PartnerSettlementModeDto;
|
|
1845
|
-
};
|
|
1846
|
-
};
|
|
1847
|
-
|
|
1848
|
-
export type ProfileGetSettlementModeResponse = ProfileGetSettlementModeResponses[keyof ProfileGetSettlementModeResponses];
|
|
1849
|
-
|
|
1850
|
-
export type ProfileSetSettlementModeData = {
|
|
1851
|
-
body: SettlementModeDto;
|
|
1852
|
-
path: {
|
|
1853
|
-
/**
|
|
1854
|
-
* Id of one of your customers, as returned by customers.register.
|
|
1855
|
-
*/
|
|
1856
|
-
customerId: string;
|
|
1857
|
-
};
|
|
1858
|
-
query?: never;
|
|
1859
|
-
url: '/api/v1/partner/v1/customers/{customerId}/settlement-mode';
|
|
1860
|
-
};
|
|
1861
|
-
|
|
1862
|
-
export type ProfileSetSettlementModeResponses = {
|
|
1863
|
-
200: {
|
|
1864
|
-
success: boolean;
|
|
1865
|
-
data: PartnerSettlementModeDto;
|
|
1866
|
-
};
|
|
1867
|
-
};
|
|
1868
|
-
|
|
1869
|
-
export type ProfileSetSettlementModeResponse = ProfileSetSettlementModeResponses[keyof ProfileSetSettlementModeResponses];
|
|
1870
|
-
|
|
1871
1959
|
export type ProfileWithdrawalsData = {
|
|
1872
1960
|
body?: never;
|
|
1873
1961
|
path: {
|