@ordanetwork/sdk 2.1.0-beta.1 → 2.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/CHANGELOG.md +0 -17
- package/README.md +10 -2
- package/dist/browser/api/OffRamp.d.ts.map +1 -1
- package/dist/browser/api/OffRamp.js +8 -12
- package/dist/browser/api/OffRamp.js.map +1 -1
- package/dist/browser/api/Recipient.d.ts +1 -7
- package/dist/browser/api/Recipient.d.ts.map +1 -1
- package/dist/browser/api/Recipient.js +0 -8
- package/dist/browser/api/Recipient.js.map +1 -1
- package/dist/browser/index.d.ts +0 -3
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +0 -3
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/types/index.d.ts +0 -5
- package/dist/browser/types/index.d.ts.map +1 -1
- package/dist/browser/types/index.js +0 -1
- package/dist/browser/types/index.js.map +1 -1
- package/dist/browser/types/offramp.d.ts +0 -2
- package/dist/browser/types/offramp.d.ts.map +1 -1
- package/dist/browser/types/onramp.d.ts +2 -2
- package/dist/browser/types/onramp.d.ts.map +1 -1
- package/dist/cjs/api/OffRamp.d.ts.map +1 -1
- package/dist/cjs/api/OffRamp.js +8 -12
- package/dist/cjs/api/OffRamp.js.map +1 -1
- package/dist/cjs/api/Recipient.d.ts +1 -7
- package/dist/cjs/api/Recipient.d.ts.map +1 -1
- package/dist/cjs/api/Recipient.js +0 -8
- package/dist/cjs/api/Recipient.js.map +1 -1
- package/dist/cjs/index.d.ts +0 -3
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/index.d.ts +0 -5
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +0 -1
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/types/offramp.d.ts +0 -2
- package/dist/cjs/types/offramp.d.ts.map +1 -1
- package/dist/cjs/types/onramp.d.ts +2 -2
- package/dist/cjs/types/onramp.d.ts.map +1 -1
- package/dist/esm/api/OffRamp.d.ts.map +1 -1
- package/dist/esm/api/OffRamp.js +8 -12
- package/dist/esm/api/OffRamp.js.map +1 -1
- package/dist/esm/api/Recipient.d.ts +1 -7
- package/dist/esm/api/Recipient.d.ts.map +1 -1
- package/dist/esm/api/Recipient.js +0 -8
- package/dist/esm/api/Recipient.js.map +1 -1
- package/dist/esm/index.d.ts +0 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +0 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/index.d.ts +0 -5
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/esm/types/index.js +0 -1
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/types/offramp.d.ts +0 -2
- package/dist/esm/types/offramp.d.ts.map +1 -1
- package/dist/esm/types/onramp.d.ts +2 -2
- package/dist/esm/types/onramp.d.ts.map +1 -1
- package/dist/types/api/OffRamp.d.ts.map +1 -1
- package/dist/types/api/Recipient.d.ts +1 -7
- package/dist/types/api/Recipient.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +0 -5
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/offramp.d.ts +0 -2
- package/dist/types/types/offramp.d.ts.map +1 -1
- package/dist/types/types/onramp.d.ts +2 -2
- package/dist/types/types/onramp.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/browser/api/Sender.d.ts +0 -43
- package/dist/browser/api/Sender.d.ts.map +0 -1
- package/dist/browser/api/Sender.js +0 -70
- package/dist/browser/api/Sender.js.map +0 -1
- package/dist/browser/types/sender.d.ts +0 -161
- package/dist/browser/types/sender.d.ts.map +0 -1
- package/dist/browser/types/sender.js +0 -10
- package/dist/browser/types/sender.js.map +0 -1
- package/dist/cjs/api/Sender.d.ts +0 -43
- package/dist/cjs/api/Sender.d.ts.map +0 -1
- package/dist/cjs/api/Sender.js +0 -74
- package/dist/cjs/api/Sender.js.map +0 -1
- package/dist/cjs/types/sender.d.ts +0 -161
- package/dist/cjs/types/sender.d.ts.map +0 -1
- package/dist/cjs/types/sender.js +0 -11
- package/dist/cjs/types/sender.js.map +0 -1
- package/dist/esm/api/Sender.d.ts +0 -43
- package/dist/esm/api/Sender.d.ts.map +0 -1
- package/dist/esm/api/Sender.js +0 -70
- package/dist/esm/api/Sender.js.map +0 -1
- package/dist/esm/types/sender.d.ts +0 -161
- package/dist/esm/types/sender.d.ts.map +0 -1
- package/dist/esm/types/sender.js +0 -10
- package/dist/esm/types/sender.js.map +0 -1
- package/dist/types/api/Sender.d.ts +0 -43
- package/dist/types/api/Sender.d.ts.map +0 -1
- package/dist/types/types/sender.d.ts +0 -161
- package/dist/types/types/sender.d.ts.map +0 -1
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { UniversalHttpClient } from '../http/client.js';
|
|
2
|
-
import { CreateSenderParams, CreateSenderResponse, ListSendersParams, ListSendersResponse, SenderResponse } from '../types/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* API wrapper for the `senders` resource (Avenia KYC).
|
|
5
|
-
*
|
|
6
|
-
* A sender represents the KYC'd payer in a fiat flow. Use {@link create} to
|
|
7
|
-
* onboard a sender and obtain upload instructions, {@link get} to fetch a
|
|
8
|
-
* sender (including current KYC status), and {@link list} to page through
|
|
9
|
-
* senders for the project.
|
|
10
|
-
*/
|
|
11
|
-
export declare class Sender {
|
|
12
|
-
private httpClient;
|
|
13
|
-
constructor(httpClient: UniversalHttpClient);
|
|
14
|
-
/**
|
|
15
|
-
* Creates a sender, or returns the existing one for the same tax identity.
|
|
16
|
-
*
|
|
17
|
-
* The response includes the sender, its nested `kyc` block (with selfie /
|
|
18
|
-
* id-document upload instructions while uploads are permitted), and a
|
|
19
|
-
* `wasExisting` flag:
|
|
20
|
-
* - `wasExisting === false` — a new sender was created (HTTP 201).
|
|
21
|
-
* - `wasExisting === true` — an existing sender was returned/retried (HTTP 200).
|
|
22
|
-
*
|
|
23
|
-
* A terminal KYC rejection (HTTP 403) is thrown as a `ForbiddenError` whose
|
|
24
|
-
* message is the rejection reason.
|
|
25
|
-
*
|
|
26
|
-
* @param params Sender creation parameters (tax identity + KYC information)
|
|
27
|
-
* @returns The sender with nested `kyc` and a `wasExisting` flag
|
|
28
|
-
*/
|
|
29
|
-
create(params: CreateSenderParams): Promise<CreateSenderResponse>;
|
|
30
|
-
/**
|
|
31
|
-
* Fetches a sender by ID, including its current KYC status.
|
|
32
|
-
* @param id The sender ID
|
|
33
|
-
* @returns The sender
|
|
34
|
-
*/
|
|
35
|
-
get(id: string): Promise<SenderResponse>;
|
|
36
|
-
/**
|
|
37
|
-
* Lists senders for the project with cursor-based pagination and filters.
|
|
38
|
-
* @param params Pagination and filter parameters
|
|
39
|
-
* @returns A page of senders plus the cursor for the next page
|
|
40
|
-
*/
|
|
41
|
-
list(params?: ListSendersParams): Promise<ListSendersResponse>;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=Sender.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Sender.d.ts","sourceRoot":"","sources":["../../../src/api/Sender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACf,MAAM,UAAU,CAAC;AAElB;;;;;;;GAOG;AACH,qBAAa,MAAM;IACL,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,mBAAmB;IAEnD;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAIvE;;;;OAIG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAI9C;;;;OAIG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CA2BrE"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API wrapper for the `senders` resource (Avenia KYC).
|
|
3
|
-
*
|
|
4
|
-
* A sender represents the KYC'd payer in a fiat flow. Use {@link create} to
|
|
5
|
-
* onboard a sender and obtain upload instructions, {@link get} to fetch a
|
|
6
|
-
* sender (including current KYC status), and {@link list} to page through
|
|
7
|
-
* senders for the project.
|
|
8
|
-
*/
|
|
9
|
-
export class Sender {
|
|
10
|
-
constructor(httpClient) {
|
|
11
|
-
this.httpClient = httpClient;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Creates a sender, or returns the existing one for the same tax identity.
|
|
15
|
-
*
|
|
16
|
-
* The response includes the sender, its nested `kyc` block (with selfie /
|
|
17
|
-
* id-document upload instructions while uploads are permitted), and a
|
|
18
|
-
* `wasExisting` flag:
|
|
19
|
-
* - `wasExisting === false` — a new sender was created (HTTP 201).
|
|
20
|
-
* - `wasExisting === true` — an existing sender was returned/retried (HTTP 200).
|
|
21
|
-
*
|
|
22
|
-
* A terminal KYC rejection (HTTP 403) is thrown as a `ForbiddenError` whose
|
|
23
|
-
* message is the rejection reason.
|
|
24
|
-
*
|
|
25
|
-
* @param params Sender creation parameters (tax identity + KYC information)
|
|
26
|
-
* @returns The sender with nested `kyc` and a `wasExisting` flag
|
|
27
|
-
*/
|
|
28
|
-
async create(params) {
|
|
29
|
-
return this.httpClient.post('/senders', params);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Fetches a sender by ID, including its current KYC status.
|
|
33
|
-
* @param id The sender ID
|
|
34
|
-
* @returns The sender
|
|
35
|
-
*/
|
|
36
|
-
async get(id) {
|
|
37
|
-
return this.httpClient.get(`/senders/${id}`);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Lists senders for the project with cursor-based pagination and filters.
|
|
41
|
-
* @param params Pagination and filter parameters
|
|
42
|
-
* @returns A page of senders plus the cursor for the next page
|
|
43
|
-
*/
|
|
44
|
-
async list(params) {
|
|
45
|
-
const queryParams = {};
|
|
46
|
-
if (params?.cursor !== undefined) {
|
|
47
|
-
queryParams.cursor = params.cursor;
|
|
48
|
-
}
|
|
49
|
-
if (params?.limit !== undefined) {
|
|
50
|
-
queryParams.limit = params.limit.toString();
|
|
51
|
-
}
|
|
52
|
-
if (params?.kycStatus !== undefined) {
|
|
53
|
-
queryParams.kycStatus = params.kycStatus;
|
|
54
|
-
}
|
|
55
|
-
if (params?.isActive !== undefined) {
|
|
56
|
-
queryParams.isActive = params.isActive.toString();
|
|
57
|
-
}
|
|
58
|
-
if (params?.taxId !== undefined) {
|
|
59
|
-
queryParams.taxId = params.taxId;
|
|
60
|
-
}
|
|
61
|
-
if (params?.sort !== undefined) {
|
|
62
|
-
queryParams.sort = params.sort;
|
|
63
|
-
}
|
|
64
|
-
if (params?.order !== undefined) {
|
|
65
|
-
queryParams.order = params.order;
|
|
66
|
-
}
|
|
67
|
-
return this.httpClient.get('/senders', queryParams);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=Sender.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Sender.js","sourceRoot":"","sources":["../../../src/api/Sender.ts"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH,MAAM,OAAO,MAAM;IACjB,YAAoB,UAA+B;QAA/B,eAAU,GAAV,UAAU,CAAqB;IAAG,CAAC;IAEvD;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,MAAM,CAAC,MAA0B;QACrC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAuB,UAAU,EAAE,MAAM,CAAC,CAAC;IACxE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAiB,YAAY,EAAE,EAAE,CA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ST/GET /v1/senders). The response shapes here are the
|
|
6
|
-
* SDK-facing equivalents of `PublicApiSenderResponse` and its
|
|
7
|
-
* nested types on the backend.
|
|
8
|
-
*/
|
|
9
|
-
export type SenderKycStatus = 'AWAITING_UPLOAD' | 'PROCESSING' | 'APPROVED' | 'REJECTED' | 'EXPIRED';
|
|
10
|
-
/**
|
|
11
|
-
* Selfie upload instructions for a sender's KYC.
|
|
12
|
-
*
|
|
13
|
-
* Both branches carry every key; the off-discriminant fields are `null`.
|
|
14
|
-
* - `liveness`: complete a hosted liveness check at `livenessUrl`
|
|
15
|
-
* (with `livenessSessionId`); `uploadUrl` is null.
|
|
16
|
-
* - `presigned`: PUT the selfie image to `uploadUrl`; liveness fields are null.
|
|
17
|
-
*/
|
|
18
|
-
export interface SenderSelfie {
|
|
19
|
-
method: 'liveness' | 'presigned';
|
|
20
|
-
uploadUrl: string | null;
|
|
21
|
-
livenessUrl: string | null;
|
|
22
|
-
livenessSessionId: string | null;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Presigned upload URLs for the sender's identity document.
|
|
26
|
-
* `uploadUrlBack` is null for single-sided documents (e.g. passport).
|
|
27
|
-
*/
|
|
28
|
-
export interface SenderIdDocument {
|
|
29
|
-
uploadUrlFront: string;
|
|
30
|
-
uploadUrlBack: string | null;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* KYC sub-resource on a sender. `selfie`/`idDocument` are only present while
|
|
34
|
-
* the KYC state permits uploads (AWAITING_UPLOAD, or a retryable REJECTED/EXPIRED).
|
|
35
|
-
*/
|
|
36
|
-
export interface SenderKyc {
|
|
37
|
-
status: SenderKycStatus;
|
|
38
|
-
retryable: boolean | null;
|
|
39
|
-
rejectionReason: string | null;
|
|
40
|
-
selfie: SenderSelfie | null;
|
|
41
|
-
idDocument: SenderIdDocument | null;
|
|
42
|
-
}
|
|
43
|
-
export interface SenderFiatSettlement {
|
|
44
|
-
id: string;
|
|
45
|
-
toCurrency: string;
|
|
46
|
-
method: string;
|
|
47
|
-
pixDetails?: {
|
|
48
|
-
pixKey: string;
|
|
49
|
-
keyType?: string | null;
|
|
50
|
-
} | null;
|
|
51
|
-
ibanDetails?: {
|
|
52
|
-
iban: string;
|
|
53
|
-
bankAccount?: string | null;
|
|
54
|
-
bankBranch?: string | null;
|
|
55
|
-
bankAccountType?: string | null;
|
|
56
|
-
} | null;
|
|
57
|
-
cbuDetails?: {
|
|
58
|
-
cbu: string;
|
|
59
|
-
cvu?: string | null;
|
|
60
|
-
} | null;
|
|
61
|
-
}
|
|
62
|
-
export interface SenderKycInformation {
|
|
63
|
-
taxId: string;
|
|
64
|
-
taxIdCountry: string;
|
|
65
|
-
name: string;
|
|
66
|
-
email: string;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* A sender as returned by the Public API.
|
|
70
|
-
* `createdAt`/`updatedAt` are ISO strings over HTTP (typed as `string | Date`
|
|
71
|
-
* to match the rest of the SDK's response models).
|
|
72
|
-
*/
|
|
73
|
-
export interface SenderResponse {
|
|
74
|
-
id: string;
|
|
75
|
-
name: string | null;
|
|
76
|
-
isActive: boolean;
|
|
77
|
-
projectId: string;
|
|
78
|
-
organizationId: string;
|
|
79
|
-
fromChain?: string | null;
|
|
80
|
-
fromAddress?: string | null;
|
|
81
|
-
fiatSettlement?: SenderFiatSettlement | null;
|
|
82
|
-
kycInformation?: SenderKycInformation | null;
|
|
83
|
-
kyc: SenderKyc | null;
|
|
84
|
-
createdAt: string | Date;
|
|
85
|
-
updatedAt: string | Date;
|
|
86
|
-
}
|
|
87
|
-
export type SenderDocumentType = 'ID' | 'PASSPORT' | 'DRIVERS-LICENSE';
|
|
88
|
-
/**
|
|
89
|
-
* KYC information supplied when creating a sender.
|
|
90
|
-
* `name`, `email`, and `documentType` are required; the remaining fields are
|
|
91
|
-
* optional and may be supplied to satisfy higher KYC levels.
|
|
92
|
-
*/
|
|
93
|
-
export interface SenderKycInformationInput {
|
|
94
|
-
name: string;
|
|
95
|
-
email: string;
|
|
96
|
-
documentType: SenderDocumentType;
|
|
97
|
-
/**
|
|
98
|
-
* Whether the identity document has both a front and a back side to upload.
|
|
99
|
-
* When omitted the backend infers it from `documentType` (passport is
|
|
100
|
-
* single-sided; ID and driver's license are double-sided). Set it explicitly
|
|
101
|
-
* to override that default, e.g. to upload only the front of an ID. It drives
|
|
102
|
-
* whether a back upload URL is minted on the returned `kyc.idDocument`.
|
|
103
|
-
*/
|
|
104
|
-
isDoubleSided?: boolean;
|
|
105
|
-
dateOfBirth?: string;
|
|
106
|
-
documentNumber?: string;
|
|
107
|
-
countryOfDocument?: string;
|
|
108
|
-
country?: string;
|
|
109
|
-
state?: string;
|
|
110
|
-
city?: string;
|
|
111
|
-
zipCode?: string;
|
|
112
|
-
streetAddress?: string;
|
|
113
|
-
phone?: string;
|
|
114
|
-
taxId?: string;
|
|
115
|
-
taxIdCountry?: string;
|
|
116
|
-
}
|
|
117
|
-
export interface CreateSenderParams {
|
|
118
|
-
taxId: string;
|
|
119
|
-
taxIdCountry: string;
|
|
120
|
-
kycInformation: SenderKycInformationInput;
|
|
121
|
-
fiatSettlementDetails?: {
|
|
122
|
-
toCurrency: string;
|
|
123
|
-
pixKey?: string;
|
|
124
|
-
bankAccount?: string;
|
|
125
|
-
bankBranch?: string;
|
|
126
|
-
bankAccountType?: string;
|
|
127
|
-
iban?: string;
|
|
128
|
-
cbuCvu?: string;
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Response from POST /v1/senders.
|
|
133
|
-
*
|
|
134
|
-
* Carries the full sender (with nested `kyc`) plus `wasExisting`:
|
|
135
|
-
* - `wasExisting === false`: a new sender was created (HTTP 201).
|
|
136
|
-
* - `wasExisting === true`: an existing sender was returned/retried (HTTP 200).
|
|
137
|
-
*
|
|
138
|
-
* A terminal-rejection (HTTP 403) is surfaced as a `ForbiddenError`, not
|
|
139
|
-
* returned here.
|
|
140
|
-
*/
|
|
141
|
-
export type CreateSenderResponse = SenderResponse & {
|
|
142
|
-
wasExisting: boolean;
|
|
143
|
-
};
|
|
144
|
-
export interface ListSendersParams {
|
|
145
|
-
cursor?: string;
|
|
146
|
-
limit?: number;
|
|
147
|
-
/** Public KYC status filter. Accepts one value or a comma-separated list. */
|
|
148
|
-
kycStatus?: SenderKycStatus | string;
|
|
149
|
-
isActive?: boolean;
|
|
150
|
-
taxId?: string;
|
|
151
|
-
sort?: 'name' | 'createdAt';
|
|
152
|
-
order?: 'asc' | 'desc';
|
|
153
|
-
}
|
|
154
|
-
export interface ListSendersResponse {
|
|
155
|
-
data: SenderResponse[];
|
|
156
|
-
pagination: {
|
|
157
|
-
nextCursor: string | null;
|
|
158
|
-
hasMore: boolean;
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
//# sourceMappingURL=sender.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sender.d.ts","sourceRoot":"","sources":["../../../src/types/sender.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,eAAe,GACvB,iBAAiB,GACjB,YAAY,GACZ,UAAU,GACV,UAAU,GACV,SAAS,CAAC;AAEd;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,UAAU,GAAG,WAAW,CAAC;IACjC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,EAA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,cAAc,GAAG;IAClD,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,SAAS,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAC5B,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,cAAc,EAAE,CAAC;IACvB,UAAU,EAAE;QACV,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;CACH"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sender (Avenia KYC) Types
|
|
3
|
-
*
|
|
4
|
-
* Mirrors the Public API contract for the `senders` resource
|
|
5
|
-
* (POST/GET /v1/senders). The response shapes here are the
|
|
6
|
-
* SDK-facing equivalents of `PublicApiSenderResponse` and its
|
|
7
|
-
* nested types on the backend.
|
|
8
|
-
*/
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=sender.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sender.js","sourceRoot":"","sources":["../../../src/types/sender.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
package/dist/cjs/api/Sender.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { UniversalHttpClient } from '../http/client';
|
|
2
|
-
import { CreateSenderParams, CreateSenderResponse, ListSendersParams, ListSendersResponse, SenderResponse } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* API wrapper for the `senders` resource (Avenia KYC).
|
|
5
|
-
*
|
|
6
|
-
* A sender represents the KYC'd payer in a fiat flow. Use {@link create} to
|
|
7
|
-
* onboard a sender and obtain upload instructions, {@link get} to fetch a
|
|
8
|
-
* sender (including current KYC status), and {@link list} to page through
|
|
9
|
-
* senders for the project.
|
|
10
|
-
*/
|
|
11
|
-
export declare class Sender {
|
|
12
|
-
private httpClient;
|
|
13
|
-
constructor(httpClient: UniversalHttpClient);
|
|
14
|
-
/**
|
|
15
|
-
* Creates a sender, or returns the existing one for the same tax identity.
|
|
16
|
-
*
|
|
17
|
-
* The response includes the sender, its nested `kyc` block (with selfie /
|
|
18
|
-
* id-document upload instructions while uploads are permitted), and a
|
|
19
|
-
* `wasExisting` flag:
|
|
20
|
-
* - `wasExisting === false` — a new sender was created (HTTP 201).
|
|
21
|
-
* - `wasExisting === true` — an existing sender was returned/retried (HTTP 200).
|
|
22
|
-
*
|
|
23
|
-
* A terminal KYC rejection (HTTP 403) is thrown as a `ForbiddenError` whose
|
|
24
|
-
* message is the rejection reason.
|
|
25
|
-
*
|
|
26
|
-
* @param params Sender creation parameters (tax identity + KYC information)
|
|
27
|
-
* @returns The sender with nested `kyc` and a `wasExisting` flag
|
|
28
|
-
*/
|
|
29
|
-
create(params: CreateSenderParams): Promise<CreateSenderResponse>;
|
|
30
|
-
/**
|
|
31
|
-
* Fetches a sender by ID, including its current KYC status.
|
|
32
|
-
* @param id The sender ID
|
|
33
|
-
* @returns The sender
|
|
34
|
-
*/
|
|
35
|
-
get(id: string): Promise<SenderResponse>;
|
|
36
|
-
/**
|
|
37
|
-
* Lists senders for the project with cursor-based pagination and filters.
|
|
38
|
-
* @param params Pagination and filter parameters
|
|
39
|
-
* @returns A page of senders plus the cursor for the next page
|
|
40
|
-
*/
|
|
41
|
-
list(params?: ListSendersParams): Promise<ListSendersResponse>;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=Sender.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Sender.d.ts","sourceRoot":"","sources":["../../../src/api/Sender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACf,MAAM,UAAU,CAAC;AAElB;;;;;;;GAOG;AACH,qBAAa,MAAM;IACL,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,mBAAmB;IAEnD;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAIvE;;;;OAIG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAI9C;;;;OAIG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CA2BrE"}
|
package/dist/cjs/api/Sender.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Sender = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* API wrapper for the `senders` resource (Avenia KYC).
|
|
6
|
-
*
|
|
7
|
-
* A sender represents the KYC'd payer in a fiat flow. Use {@link create} to
|
|
8
|
-
* onboard a sender and obtain upload instructions, {@link get} to fetch a
|
|
9
|
-
* sender (including current KYC status), and {@link list} to page through
|
|
10
|
-
* senders for the project.
|
|
11
|
-
*/
|
|
12
|
-
class Sender {
|
|
13
|
-
constructor(httpClient) {
|
|
14
|
-
this.httpClient = httpClient;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Creates a sender, or returns the existing one for the same tax identity.
|
|
18
|
-
*
|
|
19
|
-
* The response includes the sender, its nested `kyc` block (with selfie /
|
|
20
|
-
* id-document upload instructions while uploads are permitted), and a
|
|
21
|
-
* `wasExisting` flag:
|
|
22
|
-
* - `wasExisting === false` — a new sender was created (HTTP 201).
|
|
23
|
-
* - `wasExisting === true` — an existing sender was returned/retried (HTTP 200).
|
|
24
|
-
*
|
|
25
|
-
* A terminal KYC rejection (HTTP 403) is thrown as a `ForbiddenError` whose
|
|
26
|
-
* message is the rejection reason.
|
|
27
|
-
*
|
|
28
|
-
* @param params Sender creation parameters (tax identity + KYC information)
|
|
29
|
-
* @returns The sender with nested `kyc` and a `wasExisting` flag
|
|
30
|
-
*/
|
|
31
|
-
async create(params) {
|
|
32
|
-
return this.httpClient.post('/senders', params);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Fetches a sender by ID, including its current KYC status.
|
|
36
|
-
* @param id The sender ID
|
|
37
|
-
* @returns The sender
|
|
38
|
-
*/
|
|
39
|
-
async get(id) {
|
|
40
|
-
return this.httpClient.get(`/senders/${id}`);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Lists senders for the project with cursor-based pagination and filters.
|
|
44
|
-
* @param params Pagination and filter parameters
|
|
45
|
-
* @returns A page of senders plus the cursor for the next page
|
|
46
|
-
*/
|
|
47
|
-
async list(params) {
|
|
48
|
-
const queryParams = {};
|
|
49
|
-
if (params?.cursor !== undefined) {
|
|
50
|
-
queryParams.cursor = params.cursor;
|
|
51
|
-
}
|
|
52
|
-
if (params?.limit !== undefined) {
|
|
53
|
-
queryParams.limit = params.limit.toString();
|
|
54
|
-
}
|
|
55
|
-
if (params?.kycStatus !== undefined) {
|
|
56
|
-
queryParams.kycStatus = params.kycStatus;
|
|
57
|
-
}
|
|
58
|
-
if (params?.isActive !== undefined) {
|
|
59
|
-
queryParams.isActive = params.isActive.toString();
|
|
60
|
-
}
|
|
61
|
-
if (params?.taxId !== undefined) {
|
|
62
|
-
queryParams.taxId = params.taxId;
|
|
63
|
-
}
|
|
64
|
-
if (params?.sort !== undefined) {
|
|
65
|
-
queryParams.sort = params.sort;
|
|
66
|
-
}
|
|
67
|
-
if (params?.order !== undefined) {
|
|
68
|
-
queryParams.order = params.order;
|
|
69
|
-
}
|
|
70
|
-
return this.httpClient.get('/senders', queryParams);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
exports.Sender = Sender;
|
|
74
|
-
//# sourceMappingURL=Sender.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Sender.js","sourceRoot":"","sources":["../../../src/api/Sender.ts"],"names":[],"mappings":";;;AASA;;;;;;;GAOG;AACH,MAAa,MAAM;IACjB,YAAoB,UAA+B;QAA/B,eAAU,GAAV,UAAU,CAAqB;IAAG,CAAC;IAEvD;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,MAAM,CAAC,MAA0B;QACrC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAuB,UAAU,EAAE,MAAM,CAAC,CAAC;IACxE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAiB,YAAY,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,IAAI,CAAC,MAA0B;QACnC,MAAM,WAAW,GAA2B,EAAE,CAAC;QAE/C,IAAI,MAAM,EAAE,MAAM,KAAK,SAAS,EAAE,CAAC;YACjC,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QACrC,CAAC;QACD,IAAI,MAAM,EAAE,KAAK,KAAK,SAAS,EAAE,CAAC;YAChC,WAAW,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QAC9C,CAAC;QACD,IAAI,MAAM,EAAE,SAAS,KAAK,SAAS,EAAE,CAAC;YACpC,WAAW,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAC3C,CAAC;QACD,IAAI,MAAM,EAAE,QAAQ,KAAK,SAAS,EAAE,CAAC;YACnC,WAAW,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACpD,CAAC;QACD,IAAI,MAAM,EAAE,KAAK,KAAK,SAAS,EAAE,CAAC;YAChC,WAAW,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QACnC,CAAC;QACD,IAAI,MAAM,EAAE,IAAI,KAAK,SAAS,EAAE,CAAC;YAC/B,WAAW,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACjC,CAAC;QACD,IAAI,MAAM,EAAE,KAAK,KAAK,SAAS,EAAE,CAAC;YAChC,WAAW,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QACnC,CAAC;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAsB,UAAU,EAAE,WAAW,CAAC,CAAC;IAC3E,CAAC;CACF;AA/DD,wBA+DC"}
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sender (Avenia KYC) Types
|
|
3
|
-
*
|
|
4
|
-
* Mirrors the Public API contract for the `senders` resource
|
|
5
|
-
* (POST/GET /v1/senders). The response shapes here are the
|
|
6
|
-
* SDK-facing equivalents of `PublicApiSenderResponse` and its
|
|
7
|
-
* nested types on the backend.
|
|
8
|
-
*/
|
|
9
|
-
export type SenderKycStatus = 'AWAITING_UPLOAD' | 'PROCESSING' | 'APPROVED' | 'REJECTED' | 'EXPIRED';
|
|
10
|
-
/**
|
|
11
|
-
* Selfie upload instructions for a sender's KYC.
|
|
12
|
-
*
|
|
13
|
-
* Both branches carry every key; the off-discriminant fields are `null`.
|
|
14
|
-
* - `liveness`: complete a hosted liveness check at `livenessUrl`
|
|
15
|
-
* (with `livenessSessionId`); `uploadUrl` is null.
|
|
16
|
-
* - `presigned`: PUT the selfie image to `uploadUrl`; liveness fields are null.
|
|
17
|
-
*/
|
|
18
|
-
export interface SenderSelfie {
|
|
19
|
-
method: 'liveness' | 'presigned';
|
|
20
|
-
uploadUrl: string | null;
|
|
21
|
-
livenessUrl: string | null;
|
|
22
|
-
livenessSessionId: string | null;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Presigned upload URLs for the sender's identity document.
|
|
26
|
-
* `uploadUrlBack` is null for single-sided documents (e.g. passport).
|
|
27
|
-
*/
|
|
28
|
-
export interface SenderIdDocument {
|
|
29
|
-
uploadUrlFront: string;
|
|
30
|
-
uploadUrlBack: string | null;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* KYC sub-resource on a sender. `selfie`/`idDocument` are only present while
|
|
34
|
-
* the KYC state permits uploads (AWAITING_UPLOAD, or a retryable REJECTED/EXPIRED).
|
|
35
|
-
*/
|
|
36
|
-
export interface SenderKyc {
|
|
37
|
-
status: SenderKycStatus;
|
|
38
|
-
retryable: boolean | null;
|
|
39
|
-
rejectionReason: string | null;
|
|
40
|
-
selfie: SenderSelfie | null;
|
|
41
|
-
idDocument: SenderIdDocument | null;
|
|
42
|
-
}
|
|
43
|
-
export interface SenderFiatSettlement {
|
|
44
|
-
id: string;
|
|
45
|
-
toCurrency: string;
|
|
46
|
-
method: string;
|
|
47
|
-
pixDetails?: {
|
|
48
|
-
pixKey: string;
|
|
49
|
-
keyType?: string | null;
|
|
50
|
-
} | null;
|
|
51
|
-
ibanDetails?: {
|
|
52
|
-
iban: string;
|
|
53
|
-
bankAccount?: string | null;
|
|
54
|
-
bankBranch?: string | null;
|
|
55
|
-
bankAccountType?: string | null;
|
|
56
|
-
} | null;
|
|
57
|
-
cbuDetails?: {
|
|
58
|
-
cbu: string;
|
|
59
|
-
cvu?: string | null;
|
|
60
|
-
} | null;
|
|
61
|
-
}
|
|
62
|
-
export interface SenderKycInformation {
|
|
63
|
-
taxId: string;
|
|
64
|
-
taxIdCountry: string;
|
|
65
|
-
name: string;
|
|
66
|
-
email: string;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* A sender as returned by the Public API.
|
|
70
|
-
* `createdAt`/`updatedAt` are ISO strings over HTTP (typed as `string | Date`
|
|
71
|
-
* to match the rest of the SDK's response models).
|
|
72
|
-
*/
|
|
73
|
-
export interface SenderResponse {
|
|
74
|
-
id: string;
|
|
75
|
-
name: string | null;
|
|
76
|
-
isActive: boolean;
|
|
77
|
-
projectId: string;
|
|
78
|
-
organizationId: string;
|
|
79
|
-
fromChain?: string | null;
|
|
80
|
-
fromAddress?: string | null;
|
|
81
|
-
fiatSettlement?: SenderFiatSettlement | null;
|
|
82
|
-
kycInformation?: SenderKycInformation | null;
|
|
83
|
-
kyc: SenderKyc | null;
|
|
84
|
-
createdAt: string | Date;
|
|
85
|
-
updatedAt: string | Date;
|
|
86
|
-
}
|
|
87
|
-
export type SenderDocumentType = 'ID' | 'PASSPORT' | 'DRIVERS-LICENSE';
|
|
88
|
-
/**
|
|
89
|
-
* KYC information supplied when creating a sender.
|
|
90
|
-
* `name`, `email`, and `documentType` are required; the remaining fields are
|
|
91
|
-
* optional and may be supplied to satisfy higher KYC levels.
|
|
92
|
-
*/
|
|
93
|
-
export interface SenderKycInformationInput {
|
|
94
|
-
name: string;
|
|
95
|
-
email: string;
|
|
96
|
-
documentType: SenderDocumentType;
|
|
97
|
-
/**
|
|
98
|
-
* Whether the identity document has both a front and a back side to upload.
|
|
99
|
-
* When omitted the backend infers it from `documentType` (passport is
|
|
100
|
-
* single-sided; ID and driver's license are double-sided). Set it explicitly
|
|
101
|
-
* to override that default, e.g. to upload only the front of an ID. It drives
|
|
102
|
-
* whether a back upload URL is minted on the returned `kyc.idDocument`.
|
|
103
|
-
*/
|
|
104
|
-
isDoubleSided?: boolean;
|
|
105
|
-
dateOfBirth?: string;
|
|
106
|
-
documentNumber?: string;
|
|
107
|
-
countryOfDocument?: string;
|
|
108
|
-
country?: string;
|
|
109
|
-
state?: string;
|
|
110
|
-
city?: string;
|
|
111
|
-
zipCode?: string;
|
|
112
|
-
streetAddress?: string;
|
|
113
|
-
phone?: string;
|
|
114
|
-
taxId?: string;
|
|
115
|
-
taxIdCountry?: string;
|
|
116
|
-
}
|
|
117
|
-
export interface CreateSenderParams {
|
|
118
|
-
taxId: string;
|
|
119
|
-
taxIdCountry: string;
|
|
120
|
-
kycInformation: SenderKycInformationInput;
|
|
121
|
-
fiatSettlementDetails?: {
|
|
122
|
-
toCurrency: string;
|
|
123
|
-
pixKey?: string;
|
|
124
|
-
bankAccount?: string;
|
|
125
|
-
bankBranch?: string;
|
|
126
|
-
bankAccountType?: string;
|
|
127
|
-
iban?: string;
|
|
128
|
-
cbuCvu?: string;
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Response from POST /v1/senders.
|
|
133
|
-
*
|
|
134
|
-
* Carries the full sender (with nested `kyc`) plus `wasExisting`:
|
|
135
|
-
* - `wasExisting === false`: a new sender was created (HTTP 201).
|
|
136
|
-
* - `wasExisting === true`: an existing sender was returned/retried (HTTP 200).
|
|
137
|
-
*
|
|
138
|
-
* A terminal-rejection (HTTP 403) is surfaced as a `ForbiddenError`, not
|
|
139
|
-
* returned here.
|
|
140
|
-
*/
|
|
141
|
-
export type CreateSenderResponse = SenderResponse & {
|
|
142
|
-
wasExisting: boolean;
|
|
143
|
-
};
|
|
144
|
-
export interface ListSendersParams {
|
|
145
|
-
cursor?: string;
|
|
146
|
-
limit?: number;
|
|
147
|
-
/** Public KYC status filter. Accepts one value or a comma-separated list. */
|
|
148
|
-
kycStatus?: SenderKycStatus | string;
|
|
149
|
-
isActive?: boolean;
|
|
150
|
-
taxId?: string;
|
|
151
|
-
sort?: 'name' | 'createdAt';
|
|
152
|
-
order?: 'asc' | 'desc';
|
|
153
|
-
}
|
|
154
|
-
export interface ListSendersResponse {
|
|
155
|
-
data: SenderResponse[];
|
|
156
|
-
pagination: {
|
|
157
|
-
nextCursor: string | null;
|
|
158
|
-
hasMore: boolean;
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
//# sourceMappingURL=sender.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sender.d.ts","sourceRoot":"","sources":["../../../src/types/s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@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Sender (Avenia KYC) Types
|
|
4
|
-
*
|
|
5
|
-
* Mirrors the Public API contract for the `senders` resource
|
|
6
|
-
* (POST/GET /v1/senders). The response shapes here are the
|
|
7
|
-
* SDK-facing equivalents of `PublicApiSenderResponse` and its
|
|
8
|
-
* nested types on the backend.
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
//# sourceMappingURL=sender.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sender.js","sourceRoot":"","sources":["../../../src/types/sender.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG"}
|
package/dist/esm/api/Sender.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { UniversalHttpClient } from '../http/client.js';
|
|
2
|
-
import { CreateSenderParams, CreateSenderResponse, ListSendersParams, ListSendersResponse, SenderResponse } from '../types/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* API wrapper for the `senders` resource (Avenia KYC).
|
|
5
|
-
*
|
|
6
|
-
* A sender represents the KYC'd payer in a fiat flow. Use {@link create} to
|
|
7
|
-
* onboard a sender and obtain upload instructions, {@link get} to fetch a
|
|
8
|
-
* sender (including current KYC status), and {@link list} to page through
|
|
9
|
-
* senders for the project.
|
|
10
|
-
*/
|
|
11
|
-
export declare class Sender {
|
|
12
|
-
private httpClient;
|
|
13
|
-
constructor(httpClient: UniversalHttpClient);
|
|
14
|
-
/**
|
|
15
|
-
* Creates a sender, or returns the existing one for the same tax identity.
|
|
16
|
-
*
|
|
17
|
-
* The response includes the sender, its nested `kyc` block (with selfie /
|
|
18
|
-
* id-document upload instructions while uploads are permitted), and a
|
|
19
|
-
* `wasExisting` flag:
|
|
20
|
-
* - `wasExisting === false` — a new sender was created (HTTP 201).
|
|
21
|
-
* - `wasExisting === true` — an existing sender was returned/retried (HTTP 200).
|
|
22
|
-
*
|
|
23
|
-
* A terminal KYC rejection (HTTP 403) is thrown as a `ForbiddenError` whose
|
|
24
|
-
* message is the rejection reason.
|
|
25
|
-
*
|
|
26
|
-
* @param params Sender creation parameters (tax identity + KYC information)
|
|
27
|
-
* @returns The sender with nested `kyc` and a `wasExisting` flag
|
|
28
|
-
*/
|
|
29
|
-
create(params: CreateSenderParams): Promise<CreateSenderResponse>;
|
|
30
|
-
/**
|
|
31
|
-
* Fetches a sender by ID, including its current KYC status.
|
|
32
|
-
* @param id The sender ID
|
|
33
|
-
* @returns The sender
|
|
34
|
-
*/
|
|
35
|
-
get(id: string): Promise<SenderResponse>;
|
|
36
|
-
/**
|
|
37
|
-
* Lists senders for the project with cursor-based pagination and filters.
|
|
38
|
-
* @param params Pagination and filter parameters
|
|
39
|
-
* @returns A page of senders plus the cursor for the next page
|
|
40
|
-
*/
|
|
41
|
-
list(params?: ListSendersParams): Promise<ListSendersResponse>;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=Sender.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Sender.d.ts","sourceRoot":"","sources":["../../../src/api/Sender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACf,MAAM,UAAU,CAAC;AAElB;;;;;;;GAOG;AACH,qBAAa,MAAM;IACL,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,mBAAmB;IAEnD;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAIvE;;;;OAIG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAI9C;;;;OAIG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CA2BrE"}
|