@pollar/core 0.4.4 → 0.5.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/dist/index.d.mts +1543 -381
- package/dist/index.d.ts +1543 -381
- package/dist/index.js +775 -581
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +765 -579
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,310 @@
|
|
|
1
1
|
import * as openapi_fetch from 'openapi-fetch';
|
|
2
2
|
|
|
3
|
+
type StellarNetwork = 'mainnet' | 'testnet';
|
|
4
|
+
type StellarClientConfig = StellarNetwork | {
|
|
5
|
+
horizonUrl: string;
|
|
6
|
+
};
|
|
7
|
+
interface StellarBalance {
|
|
8
|
+
asset: string;
|
|
9
|
+
balance: string;
|
|
10
|
+
assetIssuer?: string;
|
|
11
|
+
}
|
|
12
|
+
declare class StellarClient {
|
|
13
|
+
private readonly horizonUrl;
|
|
14
|
+
constructor(config: StellarClientConfig);
|
|
15
|
+
submitTransaction(signedXdr: string): Promise<{
|
|
16
|
+
success: true;
|
|
17
|
+
hash: string;
|
|
18
|
+
} | {
|
|
19
|
+
success: false;
|
|
20
|
+
errorCode: string;
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare enum WalletType {
|
|
25
|
+
FREIGHTER = "freighter",
|
|
26
|
+
ALBEDO = "albedo"
|
|
27
|
+
}
|
|
28
|
+
interface ConnectWalletResponse {
|
|
29
|
+
address: string;
|
|
30
|
+
publicKey: string;
|
|
31
|
+
}
|
|
32
|
+
interface SignTransactionOptions {
|
|
33
|
+
network?: string;
|
|
34
|
+
networkPassphrase?: string;
|
|
35
|
+
accountToSign?: string;
|
|
36
|
+
}
|
|
37
|
+
interface SignAuthEntryOptions {
|
|
38
|
+
accountToSign?: string;
|
|
39
|
+
}
|
|
40
|
+
interface SignTransactionResponse {
|
|
41
|
+
signedTxXdr: string;
|
|
42
|
+
}
|
|
43
|
+
interface SignAuthEntryResponse {
|
|
44
|
+
signedAuthEntry: string;
|
|
45
|
+
}
|
|
46
|
+
interface WalletAdapter {
|
|
47
|
+
type: WalletType;
|
|
48
|
+
isAvailable(): Promise<boolean>;
|
|
49
|
+
connect(): Promise<ConnectWalletResponse>;
|
|
50
|
+
disconnect(): Promise<void>;
|
|
51
|
+
getPublicKey(): Promise<string | null>;
|
|
52
|
+
signTransaction(xdr: string, options?: SignTransactionOptions): Promise<SignTransactionResponse>;
|
|
53
|
+
signAuthEntry(entryXdr: string, options?: SignAuthEntryOptions): Promise<SignAuthEntryResponse>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare class FreighterAdapter implements WalletAdapter {
|
|
57
|
+
readonly type = WalletType.FREIGHTER;
|
|
58
|
+
isAvailable(): Promise<boolean>;
|
|
59
|
+
connect(): Promise<ConnectWalletResponse>;
|
|
60
|
+
disconnect(): Promise<void>;
|
|
61
|
+
getPublicKey(): Promise<string | null>;
|
|
62
|
+
getNetwork(): Promise<string>;
|
|
63
|
+
signTransaction(xdr: string, options?: SignTransactionOptions): Promise<SignTransactionResponse>;
|
|
64
|
+
signAuthEntry(entryXdr: string, options?: SignAuthEntryOptions): Promise<SignAuthEntryResponse>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
declare class AlbedoAdapter implements WalletAdapter {
|
|
68
|
+
readonly type = WalletType.ALBEDO;
|
|
69
|
+
isAvailable(): Promise<boolean>;
|
|
70
|
+
connect(): Promise<ConnectWalletResponse>;
|
|
71
|
+
disconnect(): Promise<void>;
|
|
72
|
+
getPublicKey(): Promise<string | null>;
|
|
73
|
+
getNetwork(): Promise<string>;
|
|
74
|
+
signTransaction(xdr: string, _options?: SignTransactionOptions): Promise<SignTransactionResponse>;
|
|
75
|
+
signAuthEntry(entryXdr: string, _options?: SignAuthEntryOptions): Promise<SignAuthEntryResponse>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
type PollarApplicationConfigResponse = paths['/auth/login']['post']['responses'][200]['content']['application/json'];
|
|
79
|
+
type PollarApplicationConfigContent = PollarApplicationConfigResponse['content'];
|
|
80
|
+
interface PollarClientConfig {
|
|
81
|
+
stellarNetwork?: StellarNetwork;
|
|
82
|
+
baseUrl?: string;
|
|
83
|
+
apiKey: string;
|
|
84
|
+
}
|
|
85
|
+
type TxBuildBody = NonNullable<paths['/tx/build']['post']['requestBody']>['content']['application/json'];
|
|
86
|
+
type TxBuildResponse = paths['/tx/build']['post']['responses'][200]['content']['application/json'];
|
|
87
|
+
type TxSignAndSendBody = NonNullable<paths['/tx/sign-and-send']['post']['requestBody']>['content']['application/json'];
|
|
88
|
+
type TxSignSendResponse = paths['/tx/sign-and-send']['post']['responses'][200]['content']['application/json'];
|
|
89
|
+
type PollarLoginOptions = {
|
|
90
|
+
provider: 'google';
|
|
91
|
+
} | {
|
|
92
|
+
provider: 'github';
|
|
93
|
+
} | {
|
|
94
|
+
provider: 'email';
|
|
95
|
+
email: string;
|
|
96
|
+
} | {
|
|
97
|
+
provider: 'wallet';
|
|
98
|
+
type: WalletType;
|
|
99
|
+
};
|
|
100
|
+
type TxBuildContent = TxBuildResponse['content'];
|
|
101
|
+
type TransactionState = {
|
|
102
|
+
step: 'idle';
|
|
103
|
+
} | {
|
|
104
|
+
step: 'building';
|
|
105
|
+
} | {
|
|
106
|
+
step: 'built';
|
|
107
|
+
buildData: TxBuildContent;
|
|
108
|
+
} | {
|
|
109
|
+
step: 'signing';
|
|
110
|
+
buildData: TxBuildContent;
|
|
111
|
+
} | {
|
|
112
|
+
step: 'success';
|
|
113
|
+
buildData: TxBuildContent;
|
|
114
|
+
hash: string;
|
|
115
|
+
} | {
|
|
116
|
+
step: 'error';
|
|
117
|
+
details?: string;
|
|
118
|
+
buildData?: TxBuildContent;
|
|
119
|
+
};
|
|
120
|
+
declare const AUTH_ERROR_CODES: {
|
|
121
|
+
readonly SESSION_CREATE_FAILED: "SESSION_CREATE_FAILED";
|
|
122
|
+
readonly EMAIL_SEND_FAILED: "EMAIL_SEND_FAILED";
|
|
123
|
+
readonly EMAIL_VERIFY_FAILED: "EMAIL_VERIFY_FAILED";
|
|
124
|
+
readonly EMAIL_CODE_EXPIRED: "EMAIL_CODE_EXPIRED";
|
|
125
|
+
readonly EMAIL_CODE_INVALID: "EMAIL_CODE_INVALID";
|
|
126
|
+
readonly AUTH_FAILED: "AUTH_FAILED";
|
|
127
|
+
readonly WALLET_CONNECT_FAILED: "WALLET_CONNECT_FAILED";
|
|
128
|
+
readonly WALLET_AUTH_FAILED: "WALLET_AUTH_FAILED";
|
|
129
|
+
readonly UNEXPECTED_ERROR: "UNEXPECTED_ERROR";
|
|
130
|
+
};
|
|
131
|
+
type AuthErrorCode = (typeof AUTH_ERROR_CODES)[keyof typeof AUTH_ERROR_CODES];
|
|
132
|
+
type AuthState = {
|
|
133
|
+
step: 'idle';
|
|
134
|
+
} | {
|
|
135
|
+
step: 'creating_session';
|
|
136
|
+
} | {
|
|
137
|
+
step: 'entering_email';
|
|
138
|
+
clientSessionId: string;
|
|
139
|
+
} | {
|
|
140
|
+
step: 'sending_email';
|
|
141
|
+
email: string;
|
|
142
|
+
} | {
|
|
143
|
+
step: 'entering_code';
|
|
144
|
+
clientSessionId: string;
|
|
145
|
+
email: string;
|
|
146
|
+
} | {
|
|
147
|
+
step: 'verifying_email_code';
|
|
148
|
+
clientSessionId: string;
|
|
149
|
+
email: string;
|
|
150
|
+
} | {
|
|
151
|
+
step: 'opening_oauth';
|
|
152
|
+
provider: 'google' | 'github';
|
|
153
|
+
} | {
|
|
154
|
+
step: 'connecting_wallet';
|
|
155
|
+
walletType: WalletType;
|
|
156
|
+
} | {
|
|
157
|
+
step: 'wallet_not_installed';
|
|
158
|
+
walletType: WalletType;
|
|
159
|
+
} | {
|
|
160
|
+
step: 'authenticating_wallet';
|
|
161
|
+
} | {
|
|
162
|
+
step: 'authenticating';
|
|
163
|
+
} | {
|
|
164
|
+
step: 'authenticated';
|
|
165
|
+
session: PollarApplicationConfigContent;
|
|
166
|
+
} | {
|
|
167
|
+
step: 'error';
|
|
168
|
+
previousStep: string;
|
|
169
|
+
message: string;
|
|
170
|
+
errorCode: AuthErrorCode;
|
|
171
|
+
clientSessionId?: string;
|
|
172
|
+
email?: string;
|
|
173
|
+
};
|
|
174
|
+
type NetworkState = {
|
|
175
|
+
step: 'idle';
|
|
176
|
+
} | {
|
|
177
|
+
step: 'connected';
|
|
178
|
+
network: StellarNetwork;
|
|
179
|
+
};
|
|
180
|
+
declare class PollarFlowError extends Error {
|
|
181
|
+
readonly code: "INVALID_FLOW";
|
|
182
|
+
constructor(message: string);
|
|
183
|
+
}
|
|
184
|
+
type WalletBalanceContent = paths['/wallet/balance']['get']['responses'][200]['content']['application/json']['content'];
|
|
185
|
+
type WalletBalanceRecord = WalletBalanceContent['balances'][number];
|
|
186
|
+
type TxHistoryRecord = paths['/tx/history']['get']['responses'][200]['content']['application/json']['content']['records'][number];
|
|
187
|
+
type TxHistoryParams = NonNullable<paths['/tx/history']['get']['parameters']['query']>;
|
|
188
|
+
type TxHistoryContent = paths['/tx/history']['get']['responses'][200]['content']['application/json']['content'];
|
|
189
|
+
type TxHistoryState = {
|
|
190
|
+
step: 'idle';
|
|
191
|
+
} | {
|
|
192
|
+
step: 'loading';
|
|
193
|
+
params: TxHistoryParams;
|
|
194
|
+
} | {
|
|
195
|
+
step: 'loaded';
|
|
196
|
+
params: TxHistoryParams;
|
|
197
|
+
data: TxHistoryContent;
|
|
198
|
+
} | {
|
|
199
|
+
step: 'error';
|
|
200
|
+
params: TxHistoryParams;
|
|
201
|
+
message: string;
|
|
202
|
+
};
|
|
203
|
+
type KycLevel = 'basic' | 'intermediate' | 'enhanced';
|
|
204
|
+
type KycStatus = 'none' | 'pending' | 'approved' | 'rejected';
|
|
205
|
+
type KycFlow = 'iframe' | 'form' | 'redirect';
|
|
206
|
+
type KycProvider = paths['/kyc/providers']['get']['responses'][200]['content']['application/json']['content']['providers'][number];
|
|
207
|
+
type KycStartBody = NonNullable<paths['/kyc/start']['post']['requestBody']>['content']['application/json'];
|
|
208
|
+
type KycStartResponse = paths['/kyc/start']['post']['responses'][200]['content']['application/json']['content'];
|
|
209
|
+
type RampsQuoteQuery = NonNullable<paths['/ramps/quote']['get']['parameters']['query']>;
|
|
210
|
+
type RampQuote = paths['/ramps/quote']['get']['responses'][200]['content']['application/json']['content']['quotes'][number];
|
|
211
|
+
type RampsQuoteResponse = paths['/ramps/quote']['get']['responses'][200]['content']['application/json']['content'];
|
|
212
|
+
type RampsOnrampBody = NonNullable<paths['/ramps/onramp']['post']['requestBody']>['content']['application/json'];
|
|
213
|
+
type RampsOnrampResponse = paths['/ramps/onramp']['post']['responses'][200]['content']['application/json']['content'];
|
|
214
|
+
type RampsOfframpBody = NonNullable<paths['/ramps/offramp']['post']['requestBody']>['content']['application/json'];
|
|
215
|
+
type RampsOfframpResponse = paths['/ramps/offramp']['post']['responses'][200]['content']['application/json']['content'];
|
|
216
|
+
type RampsTransactionResponse = paths['/ramps/transaction/{txId}']['get']['responses'][200]['content']['application/json']['content'];
|
|
217
|
+
type RampTxStatus = RampsTransactionResponse['status'];
|
|
218
|
+
type RampDirection = RampsTransactionResponse['direction'];
|
|
219
|
+
type PaymentInstructions = RampsOnrampResponse['paymentInstructions'];
|
|
220
|
+
|
|
221
|
+
declare class PollarClient {
|
|
222
|
+
readonly apiKey: string;
|
|
223
|
+
readonly id: string;
|
|
224
|
+
readonly basePath: string;
|
|
225
|
+
private readonly _api;
|
|
226
|
+
private _session;
|
|
227
|
+
private _transactionState;
|
|
228
|
+
private _transactionStateListeners;
|
|
229
|
+
private _txHistoryState;
|
|
230
|
+
private _txHistoryStateListeners;
|
|
231
|
+
private _authState;
|
|
232
|
+
private _authStateListeners;
|
|
233
|
+
private _networkState;
|
|
234
|
+
private _networkStateListeners;
|
|
235
|
+
private _walletAdapter;
|
|
236
|
+
private _loginController;
|
|
237
|
+
constructor(config: PollarClientConfig);
|
|
238
|
+
getAuthState(): AuthState;
|
|
239
|
+
onAuthStateChange(cb: (state: AuthState) => void): () => void;
|
|
240
|
+
login(options: PollarLoginOptions): void;
|
|
241
|
+
beginEmailLogin(): void;
|
|
242
|
+
sendEmailCode(email: string): void;
|
|
243
|
+
verifyEmailCode(code: string): void;
|
|
244
|
+
loginWallet(type: WalletType): void;
|
|
245
|
+
cancelLogin(): void;
|
|
246
|
+
logout(): void;
|
|
247
|
+
getNetwork(): StellarNetwork;
|
|
248
|
+
getNetworkState(): NetworkState;
|
|
249
|
+
setNetwork(network: StellarNetwork): void;
|
|
250
|
+
onNetworkStateChange(cb: (state: NetworkState) => void): () => void;
|
|
251
|
+
getTransactionState(): TransactionState | null;
|
|
252
|
+
onTransactionStateChange(cb: (state: TransactionState) => void): () => void;
|
|
253
|
+
private _setTxHistoryState;
|
|
254
|
+
getTxHistoryState(): TxHistoryState;
|
|
255
|
+
onTxHistoryStateChange(cb: (state: TxHistoryState) => void): () => void;
|
|
256
|
+
fetchTxHistory(params?: TxHistoryParams): Promise<void>;
|
|
257
|
+
getWalletBalance(publicKey?: string): Promise<WalletBalanceContent | null>;
|
|
258
|
+
buildTx(operation: TxBuildBody['operation'], params: TxBuildBody['params'], options?: TxBuildBody['options']): Promise<void>;
|
|
259
|
+
signAndSubmitTx(unsignedXdr: string): Promise<void>;
|
|
260
|
+
getAppConfig(): Promise<unknown>;
|
|
261
|
+
getKycStatus(providerId?: string): Promise<{
|
|
262
|
+
status: KycStatus;
|
|
263
|
+
level?: KycLevel | undefined;
|
|
264
|
+
providerId: string;
|
|
265
|
+
expiresAt?: string;
|
|
266
|
+
}>;
|
|
267
|
+
getKycProviders(country: string): Promise<{
|
|
268
|
+
providers: KycProvider[];
|
|
269
|
+
}>;
|
|
270
|
+
startKyc(body: KycStartBody): Promise<KycStartResponse>;
|
|
271
|
+
resolveKyc(providerId: string, level?: KycLevel): Promise<{
|
|
272
|
+
alreadyApproved: boolean;
|
|
273
|
+
} & Partial<{
|
|
274
|
+
sessionId: string;
|
|
275
|
+
kycUrl?: string;
|
|
276
|
+
fields?: {
|
|
277
|
+
name: string;
|
|
278
|
+
type: string;
|
|
279
|
+
required: boolean;
|
|
280
|
+
}[];
|
|
281
|
+
}>>;
|
|
282
|
+
pollKycStatus(providerId: string, opts?: {
|
|
283
|
+
intervalMs?: number;
|
|
284
|
+
timeoutMs?: number;
|
|
285
|
+
}): Promise<KycStatus>;
|
|
286
|
+
getRampsQuote(query: RampsQuoteQuery): Promise<RampsQuoteResponse>;
|
|
287
|
+
createOnRamp(body: RampsOnrampBody): Promise<RampsOnrampResponse>;
|
|
288
|
+
createOffRamp(body: RampsOfframpBody): Promise<RampsOfframpResponse>;
|
|
289
|
+
getRampTransaction(txId: string): Promise<RampsTransactionResponse>;
|
|
290
|
+
pollRampTransaction(txId: string, opts?: {
|
|
291
|
+
intervalMs?: number;
|
|
292
|
+
timeoutMs?: number;
|
|
293
|
+
}): Promise<RampTxStatus>;
|
|
294
|
+
/** Creates a new AbortController, cancelling any existing flow first. */
|
|
295
|
+
private _newController;
|
|
296
|
+
/** Builds the deps object passed to flow functions via bind pattern. */
|
|
297
|
+
private _flowDeps;
|
|
298
|
+
private _handleFlowError;
|
|
299
|
+
private _restoreSession;
|
|
300
|
+
private _storeSession;
|
|
301
|
+
private _clearSession;
|
|
302
|
+
private _networkPassphrase;
|
|
303
|
+
private _setNetworkState;
|
|
304
|
+
private _setAuthState;
|
|
305
|
+
private _setTransactionState;
|
|
306
|
+
}
|
|
307
|
+
|
|
3
308
|
/**
|
|
4
309
|
* This file was auto-generated by openapi-typescript.
|
|
5
310
|
* Do not make direct changes to the file.
|
|
@@ -244,8 +549,8 @@ interface paths {
|
|
|
244
549
|
get?: never;
|
|
245
550
|
put?: never;
|
|
246
551
|
/**
|
|
247
|
-
*
|
|
248
|
-
* @description
|
|
552
|
+
* Sign and submit transaction
|
|
553
|
+
* @description Sends an unsigned XDR to the wallet service for signing, then submits the signed transaction to the Stellar network.
|
|
249
554
|
*/
|
|
250
555
|
post: operations["postTxSignAndSend"];
|
|
251
556
|
delete?: never;
|
|
@@ -274,112 +579,292 @@ interface paths {
|
|
|
274
579
|
patch?: never;
|
|
275
580
|
trace?: never;
|
|
276
581
|
};
|
|
277
|
-
|
|
278
|
-
interface operations {
|
|
279
|
-
getHealth: {
|
|
582
|
+
"/tx/history": {
|
|
280
583
|
parameters: {
|
|
281
584
|
query?: never;
|
|
282
585
|
header?: never;
|
|
283
586
|
path?: never;
|
|
284
587
|
cookie?: never;
|
|
285
588
|
};
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
success: true;
|
|
299
|
-
content: {
|
|
300
|
-
/** @constant */
|
|
301
|
-
status: "ok";
|
|
302
|
-
version: string;
|
|
303
|
-
};
|
|
304
|
-
};
|
|
305
|
-
};
|
|
306
|
-
};
|
|
307
|
-
};
|
|
589
|
+
/**
|
|
590
|
+
* Get transaction history
|
|
591
|
+
* @description Returns paginated transaction history for the authenticated SDK user. Only includes transactions submitted through Pollar. Transactions appear as PENDING immediately after /tx/build and are updated to SUCCESS or FAILED after /tx/sign-and-send.
|
|
592
|
+
*/
|
|
593
|
+
get: operations["getTxHistory"];
|
|
594
|
+
put?: never;
|
|
595
|
+
post?: never;
|
|
596
|
+
delete?: never;
|
|
597
|
+
options?: never;
|
|
598
|
+
head?: never;
|
|
599
|
+
patch?: never;
|
|
600
|
+
trace?: never;
|
|
308
601
|
};
|
|
309
|
-
|
|
602
|
+
"/wallet/balance": {
|
|
310
603
|
parameters: {
|
|
311
604
|
query?: never;
|
|
312
605
|
header?: never;
|
|
313
606
|
path?: never;
|
|
314
607
|
cookie?: never;
|
|
315
608
|
};
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
/** @description Unauthorized */
|
|
336
|
-
401: {
|
|
337
|
-
headers: {
|
|
338
|
-
[name: string]: unknown;
|
|
339
|
-
};
|
|
340
|
-
content: {
|
|
341
|
-
"application/json": {
|
|
342
|
-
/** @constant */
|
|
343
|
-
success: false;
|
|
344
|
-
error: string;
|
|
345
|
-
};
|
|
346
|
-
};
|
|
347
|
-
};
|
|
348
|
-
/** @description Forbidden */
|
|
349
|
-
403: {
|
|
350
|
-
headers: {
|
|
351
|
-
[name: string]: unknown;
|
|
352
|
-
};
|
|
353
|
-
content: {
|
|
354
|
-
"application/json": {
|
|
355
|
-
/** @constant */
|
|
356
|
-
success: false;
|
|
357
|
-
error: string;
|
|
358
|
-
};
|
|
359
|
-
};
|
|
360
|
-
};
|
|
361
|
-
/** @description Not found */
|
|
362
|
-
404: {
|
|
363
|
-
headers: {
|
|
364
|
-
[name: string]: unknown;
|
|
365
|
-
};
|
|
366
|
-
content: {
|
|
367
|
-
"application/json": {
|
|
368
|
-
/** @constant */
|
|
369
|
-
success: false;
|
|
370
|
-
error: string;
|
|
371
|
-
};
|
|
372
|
-
};
|
|
373
|
-
};
|
|
609
|
+
/**
|
|
610
|
+
* Get wallet balances
|
|
611
|
+
* @description Returns XLM and configured asset balances for a Stellar account using Soroban RPC (no Horizon). The asset list is derived from the application's enabled assets. "available" reflects the spendable amount after minimum reserve (XLM) and selling liabilities.
|
|
612
|
+
*/
|
|
613
|
+
get: operations["getWalletBalance"];
|
|
614
|
+
put?: never;
|
|
615
|
+
post?: never;
|
|
616
|
+
delete?: never;
|
|
617
|
+
options?: never;
|
|
618
|
+
head?: never;
|
|
619
|
+
patch?: never;
|
|
620
|
+
trace?: never;
|
|
621
|
+
};
|
|
622
|
+
"/kyc/status": {
|
|
623
|
+
parameters: {
|
|
624
|
+
query?: never;
|
|
625
|
+
header?: never;
|
|
626
|
+
path?: never;
|
|
627
|
+
cookie?: never;
|
|
374
628
|
};
|
|
629
|
+
/**
|
|
630
|
+
* Get KYC status
|
|
631
|
+
* @description Returns the KYC verification status of the authenticated end-user. Optionally filter by a specific provider. If no providerId is given, returns the first active verification found across all providers configured for the application.
|
|
632
|
+
*/
|
|
633
|
+
get: operations["getKycStatus"];
|
|
634
|
+
put?: never;
|
|
635
|
+
post?: never;
|
|
636
|
+
delete?: never;
|
|
637
|
+
options?: never;
|
|
638
|
+
head?: never;
|
|
639
|
+
patch?: never;
|
|
640
|
+
trace?: never;
|
|
375
641
|
};
|
|
376
|
-
|
|
642
|
+
"/kyc/providers": {
|
|
377
643
|
parameters: {
|
|
378
644
|
query?: never;
|
|
379
645
|
header?: never;
|
|
380
|
-
path
|
|
381
|
-
|
|
382
|
-
|
|
646
|
+
path?: never;
|
|
647
|
+
cookie?: never;
|
|
648
|
+
};
|
|
649
|
+
/**
|
|
650
|
+
* List available KYC providers
|
|
651
|
+
* @description Returns the KYC providers enabled for the application, filtered by the given country (ISO 3166-1 alpha-2). Use this to show the user which KYC options are available before calling POST /kyc/start.
|
|
652
|
+
*/
|
|
653
|
+
get: operations["getKycProviders"];
|
|
654
|
+
put?: never;
|
|
655
|
+
post?: never;
|
|
656
|
+
delete?: never;
|
|
657
|
+
options?: never;
|
|
658
|
+
head?: never;
|
|
659
|
+
patch?: never;
|
|
660
|
+
trace?: never;
|
|
661
|
+
};
|
|
662
|
+
"/kyc/start": {
|
|
663
|
+
parameters: {
|
|
664
|
+
query?: never;
|
|
665
|
+
header?: never;
|
|
666
|
+
path?: never;
|
|
667
|
+
cookie?: never;
|
|
668
|
+
};
|
|
669
|
+
get?: never;
|
|
670
|
+
put?: never;
|
|
671
|
+
/**
|
|
672
|
+
* Start a KYC session
|
|
673
|
+
* @description Initiates a KYC verification session with the specified provider and level. Returns a sessionId and either a kycUrl (for iframe/redirect flows) or a fields array (for form flows). The session expires in 30 minutes.
|
|
674
|
+
*/
|
|
675
|
+
post: operations["postKycStart"];
|
|
676
|
+
delete?: never;
|
|
677
|
+
options?: never;
|
|
678
|
+
head?: never;
|
|
679
|
+
patch?: never;
|
|
680
|
+
trace?: never;
|
|
681
|
+
};
|
|
682
|
+
"/ramps/quote": {
|
|
683
|
+
parameters: {
|
|
684
|
+
query?: never;
|
|
685
|
+
header?: never;
|
|
686
|
+
path?: never;
|
|
687
|
+
cookie?: never;
|
|
688
|
+
};
|
|
689
|
+
/**
|
|
690
|
+
* Get ramp quotes
|
|
691
|
+
* @description Returns available quotes for converting fiat to crypto (onramp) or crypto to fiat (offramp) for a given country, amount, and currency. Each quote includes a quoteId valid for 15 minutes. Pass the quoteId to POST /ramps/onramp or POST /ramps/offramp to execute the transaction.
|
|
692
|
+
*/
|
|
693
|
+
get: operations["getRampsQuote"];
|
|
694
|
+
put?: never;
|
|
695
|
+
post?: never;
|
|
696
|
+
delete?: never;
|
|
697
|
+
options?: never;
|
|
698
|
+
head?: never;
|
|
699
|
+
patch?: never;
|
|
700
|
+
trace?: never;
|
|
701
|
+
};
|
|
702
|
+
"/ramps/onramp": {
|
|
703
|
+
parameters: {
|
|
704
|
+
query?: never;
|
|
705
|
+
header?: never;
|
|
706
|
+
path?: never;
|
|
707
|
+
cookie?: never;
|
|
708
|
+
};
|
|
709
|
+
get?: never;
|
|
710
|
+
put?: never;
|
|
711
|
+
/**
|
|
712
|
+
* Create onramp transaction
|
|
713
|
+
* @description Initiates a fiat-to-crypto onramp transaction using a previously obtained quoteId. Returns payment instructions (CLABE, PIX key, etc.) the user must use to send funds. The quote expires in 15 minutes — a new one must be requested after expiry.
|
|
714
|
+
*/
|
|
715
|
+
post: operations["postRampsOnramp"];
|
|
716
|
+
delete?: never;
|
|
717
|
+
options?: never;
|
|
718
|
+
head?: never;
|
|
719
|
+
patch?: never;
|
|
720
|
+
trace?: never;
|
|
721
|
+
};
|
|
722
|
+
"/ramps/offramp": {
|
|
723
|
+
parameters: {
|
|
724
|
+
query?: never;
|
|
725
|
+
header?: never;
|
|
726
|
+
path?: never;
|
|
727
|
+
cookie?: never;
|
|
728
|
+
};
|
|
729
|
+
get?: never;
|
|
730
|
+
put?: never;
|
|
731
|
+
/**
|
|
732
|
+
* Create offramp transaction
|
|
733
|
+
* @description Initiates a crypto-to-fiat offramp transaction using a previously obtained quoteId. Funds will be sent from the user's wallet to the provided bank account. The quote expires in 15 minutes.
|
|
734
|
+
*/
|
|
735
|
+
post: operations["postRampsOfframp"];
|
|
736
|
+
delete?: never;
|
|
737
|
+
options?: never;
|
|
738
|
+
head?: never;
|
|
739
|
+
patch?: never;
|
|
740
|
+
trace?: never;
|
|
741
|
+
};
|
|
742
|
+
"/ramps/transaction/{txId}": {
|
|
743
|
+
parameters: {
|
|
744
|
+
query?: never;
|
|
745
|
+
header?: never;
|
|
746
|
+
path?: never;
|
|
747
|
+
cookie?: never;
|
|
748
|
+
};
|
|
749
|
+
/**
|
|
750
|
+
* Get ramp transaction status
|
|
751
|
+
* @description Returns the current status of an onramp or offramp transaction. Use this endpoint to poll for status updates. Only the authenticated user who created the transaction can access it.
|
|
752
|
+
*/
|
|
753
|
+
get: operations["getRampsTransactionByTxId"];
|
|
754
|
+
put?: never;
|
|
755
|
+
post?: never;
|
|
756
|
+
delete?: never;
|
|
757
|
+
options?: never;
|
|
758
|
+
head?: never;
|
|
759
|
+
patch?: never;
|
|
760
|
+
trace?: never;
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
interface operations {
|
|
764
|
+
getHealth: {
|
|
765
|
+
parameters: {
|
|
766
|
+
query?: never;
|
|
767
|
+
header?: never;
|
|
768
|
+
path?: never;
|
|
769
|
+
cookie?: never;
|
|
770
|
+
};
|
|
771
|
+
requestBody?: never;
|
|
772
|
+
responses: {
|
|
773
|
+
/** @description Service is healthy */
|
|
774
|
+
200: {
|
|
775
|
+
headers: {
|
|
776
|
+
[name: string]: unknown;
|
|
777
|
+
};
|
|
778
|
+
content: {
|
|
779
|
+
"application/json": {
|
|
780
|
+
/** @constant */
|
|
781
|
+
code: "SDK_API_HEALTH_OK";
|
|
782
|
+
/** @constant */
|
|
783
|
+
success: true;
|
|
784
|
+
content: {
|
|
785
|
+
/** @constant */
|
|
786
|
+
status: "ok";
|
|
787
|
+
version: string;
|
|
788
|
+
};
|
|
789
|
+
};
|
|
790
|
+
};
|
|
791
|
+
};
|
|
792
|
+
};
|
|
793
|
+
};
|
|
794
|
+
postAuthSession: {
|
|
795
|
+
parameters: {
|
|
796
|
+
query?: never;
|
|
797
|
+
header?: never;
|
|
798
|
+
path?: never;
|
|
799
|
+
cookie?: never;
|
|
800
|
+
};
|
|
801
|
+
requestBody?: never;
|
|
802
|
+
responses: {
|
|
803
|
+
/** @description Session created */
|
|
804
|
+
201: {
|
|
805
|
+
headers: {
|
|
806
|
+
[name: string]: unknown;
|
|
807
|
+
};
|
|
808
|
+
content: {
|
|
809
|
+
"application/json": {
|
|
810
|
+
/** @constant */
|
|
811
|
+
code: "SDK_SESSION_CREATED";
|
|
812
|
+
/** @constant */
|
|
813
|
+
success: true;
|
|
814
|
+
content: {
|
|
815
|
+
clientSessionId: string;
|
|
816
|
+
};
|
|
817
|
+
};
|
|
818
|
+
};
|
|
819
|
+
};
|
|
820
|
+
/** @description Unauthorized */
|
|
821
|
+
401: {
|
|
822
|
+
headers: {
|
|
823
|
+
[name: string]: unknown;
|
|
824
|
+
};
|
|
825
|
+
content: {
|
|
826
|
+
"application/json": {
|
|
827
|
+
/** @constant */
|
|
828
|
+
success: false;
|
|
829
|
+
error: string;
|
|
830
|
+
};
|
|
831
|
+
};
|
|
832
|
+
};
|
|
833
|
+
/** @description Forbidden */
|
|
834
|
+
403: {
|
|
835
|
+
headers: {
|
|
836
|
+
[name: string]: unknown;
|
|
837
|
+
};
|
|
838
|
+
content: {
|
|
839
|
+
"application/json": {
|
|
840
|
+
/** @constant */
|
|
841
|
+
success: false;
|
|
842
|
+
error: string;
|
|
843
|
+
};
|
|
844
|
+
};
|
|
845
|
+
};
|
|
846
|
+
/** @description Not found */
|
|
847
|
+
404: {
|
|
848
|
+
headers: {
|
|
849
|
+
[name: string]: unknown;
|
|
850
|
+
};
|
|
851
|
+
content: {
|
|
852
|
+
"application/json": {
|
|
853
|
+
/** @constant */
|
|
854
|
+
success: false;
|
|
855
|
+
error: string;
|
|
856
|
+
};
|
|
857
|
+
};
|
|
858
|
+
};
|
|
859
|
+
};
|
|
860
|
+
};
|
|
861
|
+
getAuthSessionStatusByClientSessionId: {
|
|
862
|
+
parameters: {
|
|
863
|
+
query?: never;
|
|
864
|
+
header?: never;
|
|
865
|
+
path: {
|
|
866
|
+
clientSessionId: string;
|
|
867
|
+
};
|
|
383
868
|
cookie?: never;
|
|
384
869
|
};
|
|
385
870
|
requestBody?: never;
|
|
@@ -576,7 +1061,7 @@ interface operations {
|
|
|
576
1061
|
path?: never;
|
|
577
1062
|
cookie?: never;
|
|
578
1063
|
};
|
|
579
|
-
requestBody
|
|
1064
|
+
requestBody: {
|
|
580
1065
|
content: {
|
|
581
1066
|
"application/json": {
|
|
582
1067
|
clientSessionId: string;
|
|
@@ -665,7 +1150,7 @@ interface operations {
|
|
|
665
1150
|
path?: never;
|
|
666
1151
|
cookie?: never;
|
|
667
1152
|
};
|
|
668
|
-
requestBody
|
|
1153
|
+
requestBody: {
|
|
669
1154
|
content: {
|
|
670
1155
|
"application/json": {
|
|
671
1156
|
clientSessionId: string;
|
|
@@ -752,7 +1237,7 @@ interface operations {
|
|
|
752
1237
|
path?: never;
|
|
753
1238
|
cookie?: never;
|
|
754
1239
|
};
|
|
755
|
-
requestBody
|
|
1240
|
+
requestBody: {
|
|
756
1241
|
content: {
|
|
757
1242
|
"application/json": {
|
|
758
1243
|
clientSessionId: string;
|
|
@@ -840,7 +1325,7 @@ interface operations {
|
|
|
840
1325
|
path?: never;
|
|
841
1326
|
cookie?: never;
|
|
842
1327
|
};
|
|
843
|
-
requestBody
|
|
1328
|
+
requestBody: {
|
|
844
1329
|
content: {
|
|
845
1330
|
"application/json": {
|
|
846
1331
|
clientSessionId: string;
|
|
@@ -1080,12 +1565,26 @@ interface operations {
|
|
|
1080
1565
|
path?: never;
|
|
1081
1566
|
cookie?: never;
|
|
1082
1567
|
};
|
|
1083
|
-
requestBody
|
|
1568
|
+
requestBody: {
|
|
1084
1569
|
content: {
|
|
1085
1570
|
"application/json": {
|
|
1086
1571
|
/** @enum {string} */
|
|
1087
|
-
network: "testnet" | "
|
|
1572
|
+
network: "testnet" | "mainnet";
|
|
1088
1573
|
publicKey: string;
|
|
1574
|
+
options?: {
|
|
1575
|
+
timeoutSec?: number;
|
|
1576
|
+
memo?: {
|
|
1577
|
+
/** @constant */
|
|
1578
|
+
type: "text";
|
|
1579
|
+
value: string;
|
|
1580
|
+
} | {
|
|
1581
|
+
/** @constant */
|
|
1582
|
+
type: "id";
|
|
1583
|
+
value: string;
|
|
1584
|
+
};
|
|
1585
|
+
maxFeeStroops?: number;
|
|
1586
|
+
};
|
|
1587
|
+
} & ({
|
|
1089
1588
|
/** @constant */
|
|
1090
1589
|
operation: "payment";
|
|
1091
1590
|
params: {
|
|
@@ -1099,43 +1598,196 @@ interface operations {
|
|
|
1099
1598
|
type: "credit_alphanum4";
|
|
1100
1599
|
code: string;
|
|
1101
1600
|
issuer: string;
|
|
1601
|
+
} | {
|
|
1602
|
+
/** @constant */
|
|
1603
|
+
type: "credit_alphanum12";
|
|
1604
|
+
code: string;
|
|
1605
|
+
issuer: string;
|
|
1102
1606
|
};
|
|
1103
1607
|
};
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1608
|
+
} | {
|
|
1609
|
+
/** @constant */
|
|
1610
|
+
operation: "change_trust";
|
|
1611
|
+
params: {
|
|
1612
|
+
asset: {
|
|
1107
1613
|
/** @constant */
|
|
1108
|
-
type: "
|
|
1109
|
-
|
|
1614
|
+
type: "credit_alphanum4";
|
|
1615
|
+
code: string;
|
|
1616
|
+
issuer: string;
|
|
1110
1617
|
} | {
|
|
1111
1618
|
/** @constant */
|
|
1112
|
-
type: "
|
|
1113
|
-
|
|
1619
|
+
type: "credit_alphanum12";
|
|
1620
|
+
code: string;
|
|
1621
|
+
issuer: string;
|
|
1622
|
+
} | {
|
|
1623
|
+
/** @constant */
|
|
1624
|
+
type: "liquidity_pool_shares";
|
|
1625
|
+
assetA: {
|
|
1626
|
+
/** @constant */
|
|
1627
|
+
type: "native";
|
|
1628
|
+
} | {
|
|
1629
|
+
/** @constant */
|
|
1630
|
+
type: "credit_alphanum4";
|
|
1631
|
+
code: string;
|
|
1632
|
+
issuer: string;
|
|
1633
|
+
} | {
|
|
1634
|
+
/** @constant */
|
|
1635
|
+
type: "credit_alphanum12";
|
|
1636
|
+
code: string;
|
|
1637
|
+
issuer: string;
|
|
1638
|
+
};
|
|
1639
|
+
assetB: {
|
|
1640
|
+
/** @constant */
|
|
1641
|
+
type: "native";
|
|
1642
|
+
} | {
|
|
1643
|
+
/** @constant */
|
|
1644
|
+
type: "credit_alphanum4";
|
|
1645
|
+
code: string;
|
|
1646
|
+
issuer: string;
|
|
1647
|
+
} | {
|
|
1648
|
+
/** @constant */
|
|
1649
|
+
type: "credit_alphanum12";
|
|
1650
|
+
code: string;
|
|
1651
|
+
issuer: string;
|
|
1652
|
+
};
|
|
1114
1653
|
};
|
|
1654
|
+
limit?: string;
|
|
1115
1655
|
};
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1656
|
+
} | {
|
|
1657
|
+
/** @constant */
|
|
1658
|
+
operation: "path_payment_strict_send";
|
|
1659
|
+
params: {
|
|
1660
|
+
destination: string;
|
|
1661
|
+
sendAsset: {
|
|
1662
|
+
/** @constant */
|
|
1663
|
+
type: "native";
|
|
1664
|
+
} | {
|
|
1665
|
+
/** @constant */
|
|
1666
|
+
type: "credit_alphanum4";
|
|
1667
|
+
code: string;
|
|
1668
|
+
issuer: string;
|
|
1669
|
+
} | {
|
|
1670
|
+
/** @constant */
|
|
1671
|
+
type: "credit_alphanum12";
|
|
1672
|
+
code: string;
|
|
1673
|
+
issuer: string;
|
|
1674
|
+
};
|
|
1675
|
+
sendAmount: string;
|
|
1676
|
+
destAsset: {
|
|
1677
|
+
/** @constant */
|
|
1678
|
+
type: "native";
|
|
1679
|
+
} | {
|
|
1680
|
+
/** @constant */
|
|
1681
|
+
type: "credit_alphanum4";
|
|
1682
|
+
code: string;
|
|
1683
|
+
issuer: string;
|
|
1684
|
+
} | {
|
|
1685
|
+
/** @constant */
|
|
1686
|
+
type: "credit_alphanum12";
|
|
1687
|
+
code: string;
|
|
1688
|
+
issuer: string;
|
|
1689
|
+
};
|
|
1690
|
+
destMin: string;
|
|
1691
|
+
/** @default [] */
|
|
1692
|
+
path?: ({
|
|
1693
|
+
/** @constant */
|
|
1694
|
+
type: "native";
|
|
1695
|
+
} | {
|
|
1696
|
+
/** @constant */
|
|
1697
|
+
type: "credit_alphanum4";
|
|
1698
|
+
code: string;
|
|
1699
|
+
issuer: string;
|
|
1700
|
+
} | {
|
|
1701
|
+
/** @constant */
|
|
1702
|
+
type: "credit_alphanum12";
|
|
1703
|
+
code: string;
|
|
1704
|
+
issuer: string;
|
|
1705
|
+
})[];
|
|
1706
|
+
};
|
|
1707
|
+
} | {
|
|
1708
|
+
/** @constant */
|
|
1709
|
+
operation: "create_account";
|
|
1710
|
+
params: {
|
|
1711
|
+
destination: string;
|
|
1712
|
+
startingBalance: string;
|
|
1713
|
+
};
|
|
1714
|
+
} | {
|
|
1715
|
+
/** @constant */
|
|
1716
|
+
operation: "invoke_contract";
|
|
1717
|
+
params: {
|
|
1718
|
+
contractId: string;
|
|
1719
|
+
method: string;
|
|
1720
|
+
/** @default [] */
|
|
1721
|
+
args?: ({
|
|
1722
|
+
/** @constant */
|
|
1723
|
+
type: "bool";
|
|
1724
|
+
value: boolean;
|
|
1725
|
+
} | {
|
|
1726
|
+
/** @constant */
|
|
1727
|
+
type: "i32";
|
|
1728
|
+
value: number;
|
|
1729
|
+
} | {
|
|
1730
|
+
/** @constant */
|
|
1731
|
+
type: "u32";
|
|
1732
|
+
value: number;
|
|
1733
|
+
} | {
|
|
1734
|
+
/** @enum {string} */
|
|
1735
|
+
type: "i64" | "u64" | "i128" | "u128" | "i256" | "u256";
|
|
1736
|
+
value: string;
|
|
1737
|
+
} | {
|
|
1738
|
+
/** @constant */
|
|
1739
|
+
type: "address";
|
|
1740
|
+
value: string;
|
|
1741
|
+
} | {
|
|
1742
|
+
/** @enum {string} */
|
|
1743
|
+
type: "string" | "symbol";
|
|
1744
|
+
value: string;
|
|
1745
|
+
} | {
|
|
1746
|
+
/** @constant */
|
|
1747
|
+
type: "bytes";
|
|
1748
|
+
/** @description Base64-encoded bytes */
|
|
1749
|
+
value: string;
|
|
1750
|
+
} | {
|
|
1751
|
+
/** @constant */
|
|
1752
|
+
type: "vec";
|
|
1753
|
+
/** @description Array of ScValArg items */
|
|
1754
|
+
value: unknown[];
|
|
1755
|
+
} | {
|
|
1756
|
+
/** @constant */
|
|
1757
|
+
type: "map";
|
|
1758
|
+
/** @description Array of {key, val} ScValArg pairs */
|
|
1759
|
+
value: {
|
|
1760
|
+
key: unknown;
|
|
1761
|
+
val: unknown;
|
|
1762
|
+
}[];
|
|
1763
|
+
} | {
|
|
1764
|
+
/** @constant */
|
|
1765
|
+
type: "void";
|
|
1766
|
+
})[];
|
|
1767
|
+
};
|
|
1768
|
+
});
|
|
1769
|
+
};
|
|
1770
|
+
};
|
|
1771
|
+
responses: {
|
|
1772
|
+
/** @description Unsigned XDR and summary */
|
|
1773
|
+
200: {
|
|
1774
|
+
headers: {
|
|
1775
|
+
[name: string]: unknown;
|
|
1776
|
+
};
|
|
1777
|
+
content: {
|
|
1778
|
+
"application/json": {
|
|
1779
|
+
/** @constant */
|
|
1780
|
+
code: "SDK_TX_BUILT";
|
|
1781
|
+
/** @constant */
|
|
1782
|
+
success: true;
|
|
1783
|
+
content: {
|
|
1784
|
+
unsignedXdr: string;
|
|
1785
|
+
networkPassphrase: string;
|
|
1786
|
+
estimatedFee: string;
|
|
1787
|
+
summary: {
|
|
1788
|
+
title: string;
|
|
1789
|
+
lines: string[];
|
|
1790
|
+
network: string;
|
|
1139
1791
|
fee: string;
|
|
1140
1792
|
};
|
|
1141
1793
|
};
|
|
@@ -1190,12 +1842,13 @@ interface operations {
|
|
|
1190
1842
|
path?: never;
|
|
1191
1843
|
cookie?: never;
|
|
1192
1844
|
};
|
|
1193
|
-
requestBody
|
|
1845
|
+
requestBody: {
|
|
1194
1846
|
content: {
|
|
1195
1847
|
"application/json": {
|
|
1196
1848
|
/** @enum {string} */
|
|
1197
|
-
network: "testnet" | "
|
|
1198
|
-
|
|
1849
|
+
network: "testnet" | "mainnet";
|
|
1850
|
+
publicKey: string;
|
|
1851
|
+
unsignedXdr: string;
|
|
1199
1852
|
};
|
|
1200
1853
|
};
|
|
1201
1854
|
};
|
|
@@ -1252,7 +1905,7 @@ interface operations {
|
|
|
1252
1905
|
getTxStatus: {
|
|
1253
1906
|
parameters: {
|
|
1254
1907
|
query: {
|
|
1255
|
-
network: "testnet" | "
|
|
1908
|
+
network: "testnet" | "mainnet";
|
|
1256
1909
|
hash: string;
|
|
1257
1910
|
};
|
|
1258
1911
|
header?: never;
|
|
@@ -1311,263 +1964,772 @@ interface operations {
|
|
|
1311
1964
|
};
|
|
1312
1965
|
};
|
|
1313
1966
|
};
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
};
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1967
|
+
getTxHistory: {
|
|
1968
|
+
parameters: {
|
|
1969
|
+
query?: {
|
|
1970
|
+
network?: "testnet" | "mainnet";
|
|
1971
|
+
limit?: number;
|
|
1972
|
+
offset?: number;
|
|
1973
|
+
};
|
|
1974
|
+
header?: never;
|
|
1975
|
+
path?: never;
|
|
1976
|
+
cookie?: never;
|
|
1977
|
+
};
|
|
1978
|
+
requestBody?: never;
|
|
1979
|
+
responses: {
|
|
1980
|
+
/** @description Paginated list of transactions */
|
|
1981
|
+
200: {
|
|
1982
|
+
headers: {
|
|
1983
|
+
[name: string]: unknown;
|
|
1984
|
+
};
|
|
1985
|
+
content: {
|
|
1986
|
+
"application/json": {
|
|
1987
|
+
/** @constant */
|
|
1988
|
+
code: "SDK_TX_HISTORY";
|
|
1989
|
+
/** @constant */
|
|
1990
|
+
success: true;
|
|
1991
|
+
content: {
|
|
1992
|
+
records: {
|
|
1993
|
+
id: string;
|
|
1994
|
+
hash: string;
|
|
1995
|
+
/** @enum {string} */
|
|
1996
|
+
network: "testnet" | "mainnet";
|
|
1997
|
+
/** @enum {string} */
|
|
1998
|
+
status: "PENDING" | "SUCCESS" | "FAILED";
|
|
1999
|
+
operation: string;
|
|
2000
|
+
feeXlm?: string;
|
|
2001
|
+
resultCode?: string;
|
|
2002
|
+
details: {
|
|
2003
|
+
[key: string]: unknown;
|
|
2004
|
+
};
|
|
2005
|
+
summary: string;
|
|
2006
|
+
createdAt: string;
|
|
2007
|
+
}[];
|
|
2008
|
+
total: number;
|
|
2009
|
+
limit: number;
|
|
2010
|
+
offset: number;
|
|
2011
|
+
};
|
|
2012
|
+
};
|
|
2013
|
+
};
|
|
2014
|
+
};
|
|
2015
|
+
/** @description Validation error */
|
|
2016
|
+
400: {
|
|
2017
|
+
headers: {
|
|
2018
|
+
[name: string]: unknown;
|
|
2019
|
+
};
|
|
2020
|
+
content: {
|
|
2021
|
+
"application/json": {
|
|
2022
|
+
/** @constant */
|
|
2023
|
+
success: false;
|
|
2024
|
+
error: string;
|
|
2025
|
+
};
|
|
2026
|
+
};
|
|
2027
|
+
};
|
|
2028
|
+
/** @description Unauthorized */
|
|
2029
|
+
401: {
|
|
2030
|
+
headers: {
|
|
2031
|
+
[name: string]: unknown;
|
|
2032
|
+
};
|
|
2033
|
+
content: {
|
|
2034
|
+
"application/json": {
|
|
2035
|
+
/** @constant */
|
|
2036
|
+
success: false;
|
|
2037
|
+
error: string;
|
|
2038
|
+
};
|
|
2039
|
+
};
|
|
2040
|
+
};
|
|
2041
|
+
};
|
|
1379
2042
|
};
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
2043
|
+
getWalletBalance: {
|
|
2044
|
+
parameters: {
|
|
2045
|
+
query: {
|
|
2046
|
+
network: "testnet" | "mainnet";
|
|
2047
|
+
publicKey: string;
|
|
2048
|
+
};
|
|
2049
|
+
header?: never;
|
|
2050
|
+
path?: never;
|
|
2051
|
+
cookie?: never;
|
|
2052
|
+
};
|
|
2053
|
+
requestBody?: never;
|
|
2054
|
+
responses: {
|
|
2055
|
+
/** @description Account balances */
|
|
2056
|
+
200: {
|
|
2057
|
+
headers: {
|
|
2058
|
+
[name: string]: unknown;
|
|
2059
|
+
};
|
|
2060
|
+
content: {
|
|
2061
|
+
"application/json": {
|
|
2062
|
+
/** @constant */
|
|
2063
|
+
code: "SDK_WALLET_BALANCE";
|
|
2064
|
+
/** @constant */
|
|
2065
|
+
success: true;
|
|
2066
|
+
content: {
|
|
2067
|
+
publicKey: string;
|
|
2068
|
+
/** @enum {string} */
|
|
2069
|
+
network: "testnet" | "mainnet";
|
|
2070
|
+
exists: boolean;
|
|
2071
|
+
balances: {
|
|
2072
|
+
/** @enum {string} */
|
|
2073
|
+
type: "native" | "credit_alphanum4" | "credit_alphanum12";
|
|
2074
|
+
code: string;
|
|
2075
|
+
issuer?: string;
|
|
2076
|
+
balance: string;
|
|
2077
|
+
available: string;
|
|
2078
|
+
limit?: string;
|
|
2079
|
+
}[];
|
|
2080
|
+
};
|
|
2081
|
+
};
|
|
2082
|
+
};
|
|
2083
|
+
};
|
|
2084
|
+
/** @description Validation error */
|
|
2085
|
+
400: {
|
|
2086
|
+
headers: {
|
|
2087
|
+
[name: string]: unknown;
|
|
2088
|
+
};
|
|
2089
|
+
content: {
|
|
2090
|
+
"application/json": {
|
|
2091
|
+
/** @constant */
|
|
2092
|
+
success: false;
|
|
2093
|
+
error: string;
|
|
2094
|
+
};
|
|
2095
|
+
};
|
|
2096
|
+
};
|
|
2097
|
+
/** @description Unauthorized */
|
|
2098
|
+
401: {
|
|
2099
|
+
headers: {
|
|
2100
|
+
[name: string]: unknown;
|
|
2101
|
+
};
|
|
2102
|
+
content: {
|
|
2103
|
+
"application/json": {
|
|
2104
|
+
/** @constant */
|
|
2105
|
+
success: false;
|
|
2106
|
+
error: string;
|
|
2107
|
+
};
|
|
2108
|
+
};
|
|
2109
|
+
};
|
|
2110
|
+
};
|
|
1383
2111
|
};
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
}
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
}
|
|
1454
|
-
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
};
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
2112
|
+
getKycStatus: {
|
|
2113
|
+
parameters: {
|
|
2114
|
+
query?: {
|
|
2115
|
+
providerId?: string;
|
|
2116
|
+
};
|
|
2117
|
+
header?: never;
|
|
2118
|
+
path?: never;
|
|
2119
|
+
cookie?: never;
|
|
2120
|
+
};
|
|
2121
|
+
requestBody?: never;
|
|
2122
|
+
responses: {
|
|
2123
|
+
/** @description KYC status for the authenticated user */
|
|
2124
|
+
200: {
|
|
2125
|
+
headers: {
|
|
2126
|
+
[name: string]: unknown;
|
|
2127
|
+
};
|
|
2128
|
+
content: {
|
|
2129
|
+
"application/json": {
|
|
2130
|
+
/** @constant */
|
|
2131
|
+
code: "SDK_KYC_STATUS";
|
|
2132
|
+
/** @constant */
|
|
2133
|
+
success: true;
|
|
2134
|
+
content: {
|
|
2135
|
+
/** @enum {string} */
|
|
2136
|
+
status: "none" | "pending" | "approved" | "rejected";
|
|
2137
|
+
/** @enum {string} */
|
|
2138
|
+
level?: "basic" | "intermediate" | "enhanced";
|
|
2139
|
+
providerId: string;
|
|
2140
|
+
expiresAt?: string;
|
|
2141
|
+
};
|
|
2142
|
+
};
|
|
2143
|
+
};
|
|
2144
|
+
};
|
|
2145
|
+
/** @description Validation error */
|
|
2146
|
+
400: {
|
|
2147
|
+
headers: {
|
|
2148
|
+
[name: string]: unknown;
|
|
2149
|
+
};
|
|
2150
|
+
content: {
|
|
2151
|
+
"application/json": {
|
|
2152
|
+
/** @constant */
|
|
2153
|
+
success: false;
|
|
2154
|
+
error: string;
|
|
2155
|
+
};
|
|
2156
|
+
};
|
|
2157
|
+
};
|
|
2158
|
+
/** @description Unauthorized */
|
|
2159
|
+
401: {
|
|
2160
|
+
headers: {
|
|
2161
|
+
[name: string]: unknown;
|
|
2162
|
+
};
|
|
2163
|
+
content: {
|
|
2164
|
+
"application/json": {
|
|
2165
|
+
/** @constant */
|
|
2166
|
+
success: false;
|
|
2167
|
+
error: string;
|
|
2168
|
+
};
|
|
2169
|
+
};
|
|
2170
|
+
};
|
|
2171
|
+
/** @description Not found */
|
|
2172
|
+
404: {
|
|
2173
|
+
headers: {
|
|
2174
|
+
[name: string]: unknown;
|
|
2175
|
+
};
|
|
2176
|
+
content: {
|
|
2177
|
+
"application/json": {
|
|
2178
|
+
/** @constant */
|
|
2179
|
+
success: false;
|
|
2180
|
+
error: string;
|
|
2181
|
+
};
|
|
2182
|
+
};
|
|
2183
|
+
};
|
|
2184
|
+
};
|
|
2185
|
+
};
|
|
2186
|
+
getKycProviders: {
|
|
2187
|
+
parameters: {
|
|
2188
|
+
query: {
|
|
2189
|
+
country: string;
|
|
2190
|
+
};
|
|
2191
|
+
header?: never;
|
|
2192
|
+
path?: never;
|
|
2193
|
+
cookie?: never;
|
|
2194
|
+
};
|
|
2195
|
+
requestBody?: never;
|
|
2196
|
+
responses: {
|
|
2197
|
+
/** @description List of KYC providers available for the country */
|
|
2198
|
+
200: {
|
|
2199
|
+
headers: {
|
|
2200
|
+
[name: string]: unknown;
|
|
2201
|
+
};
|
|
2202
|
+
content: {
|
|
2203
|
+
"application/json": {
|
|
2204
|
+
/** @constant */
|
|
2205
|
+
code: "SDK_KYC_PROVIDERS";
|
|
2206
|
+
/** @constant */
|
|
2207
|
+
success: true;
|
|
2208
|
+
content: {
|
|
2209
|
+
providers: {
|
|
2210
|
+
id: string;
|
|
2211
|
+
name: string;
|
|
2212
|
+
/** @enum {string} */
|
|
2213
|
+
flow: "iframe" | "form" | "redirect";
|
|
2214
|
+
levels: ("basic" | "intermediate" | "enhanced")[];
|
|
2215
|
+
}[];
|
|
2216
|
+
};
|
|
2217
|
+
};
|
|
2218
|
+
};
|
|
2219
|
+
};
|
|
2220
|
+
/** @description Validation error */
|
|
2221
|
+
400: {
|
|
2222
|
+
headers: {
|
|
2223
|
+
[name: string]: unknown;
|
|
2224
|
+
};
|
|
2225
|
+
content: {
|
|
2226
|
+
"application/json": {
|
|
2227
|
+
/** @constant */
|
|
2228
|
+
success: false;
|
|
2229
|
+
error: string;
|
|
2230
|
+
};
|
|
2231
|
+
};
|
|
2232
|
+
};
|
|
2233
|
+
/** @description Unauthorized */
|
|
2234
|
+
401: {
|
|
2235
|
+
headers: {
|
|
2236
|
+
[name: string]: unknown;
|
|
2237
|
+
};
|
|
2238
|
+
content: {
|
|
2239
|
+
"application/json": {
|
|
2240
|
+
/** @constant */
|
|
2241
|
+
success: false;
|
|
2242
|
+
error: string;
|
|
2243
|
+
};
|
|
2244
|
+
};
|
|
2245
|
+
};
|
|
2246
|
+
};
|
|
2247
|
+
};
|
|
2248
|
+
postKycStart: {
|
|
2249
|
+
parameters: {
|
|
2250
|
+
query?: never;
|
|
2251
|
+
header?: never;
|
|
2252
|
+
path?: never;
|
|
2253
|
+
cookie?: never;
|
|
2254
|
+
};
|
|
2255
|
+
requestBody: {
|
|
2256
|
+
content: {
|
|
2257
|
+
"application/json": {
|
|
2258
|
+
providerId: string;
|
|
2259
|
+
/** @enum {string} */
|
|
2260
|
+
level: "basic" | "intermediate" | "enhanced";
|
|
2261
|
+
};
|
|
2262
|
+
};
|
|
2263
|
+
};
|
|
2264
|
+
responses: {
|
|
2265
|
+
/** @description KYC session created */
|
|
2266
|
+
200: {
|
|
2267
|
+
headers: {
|
|
2268
|
+
[name: string]: unknown;
|
|
2269
|
+
};
|
|
2270
|
+
content: {
|
|
2271
|
+
"application/json": {
|
|
2272
|
+
/** @constant */
|
|
2273
|
+
code: "SDK_KYC_STARTED";
|
|
2274
|
+
/** @constant */
|
|
2275
|
+
success: true;
|
|
2276
|
+
content: {
|
|
2277
|
+
sessionId: string;
|
|
2278
|
+
kycUrl?: string;
|
|
2279
|
+
fields?: {
|
|
2280
|
+
name: string;
|
|
2281
|
+
type: string;
|
|
2282
|
+
required: boolean;
|
|
2283
|
+
}[];
|
|
2284
|
+
};
|
|
2285
|
+
};
|
|
2286
|
+
};
|
|
2287
|
+
};
|
|
2288
|
+
/** @description Validation error */
|
|
2289
|
+
400: {
|
|
2290
|
+
headers: {
|
|
2291
|
+
[name: string]: unknown;
|
|
2292
|
+
};
|
|
2293
|
+
content: {
|
|
2294
|
+
"application/json": {
|
|
2295
|
+
/** @constant */
|
|
2296
|
+
success: false;
|
|
2297
|
+
error: string;
|
|
2298
|
+
};
|
|
2299
|
+
};
|
|
2300
|
+
};
|
|
2301
|
+
/** @description Unauthorized */
|
|
2302
|
+
401: {
|
|
2303
|
+
headers: {
|
|
2304
|
+
[name: string]: unknown;
|
|
2305
|
+
};
|
|
2306
|
+
content: {
|
|
2307
|
+
"application/json": {
|
|
2308
|
+
/** @constant */
|
|
2309
|
+
success: false;
|
|
2310
|
+
error: string;
|
|
2311
|
+
};
|
|
2312
|
+
};
|
|
2313
|
+
};
|
|
2314
|
+
/** @description Provider not found or not enabled for this application */
|
|
2315
|
+
404: {
|
|
2316
|
+
headers: {
|
|
2317
|
+
[name: string]: unknown;
|
|
2318
|
+
};
|
|
2319
|
+
content: {
|
|
2320
|
+
"application/json": {
|
|
2321
|
+
/** @constant */
|
|
2322
|
+
success: false;
|
|
2323
|
+
error: string;
|
|
2324
|
+
};
|
|
2325
|
+
};
|
|
2326
|
+
};
|
|
2327
|
+
};
|
|
2328
|
+
};
|
|
2329
|
+
getRampsQuote: {
|
|
2330
|
+
parameters: {
|
|
2331
|
+
query: {
|
|
2332
|
+
country: string;
|
|
2333
|
+
amount: number;
|
|
2334
|
+
currency: string;
|
|
2335
|
+
direction: "onramp" | "offramp";
|
|
2336
|
+
};
|
|
2337
|
+
header?: never;
|
|
2338
|
+
path?: never;
|
|
2339
|
+
cookie?: never;
|
|
2340
|
+
};
|
|
2341
|
+
requestBody?: never;
|
|
2342
|
+
responses: {
|
|
2343
|
+
/** @description List of available quotes sorted by recommendation. First item is the best option. */
|
|
2344
|
+
200: {
|
|
2345
|
+
headers: {
|
|
2346
|
+
[name: string]: unknown;
|
|
2347
|
+
};
|
|
2348
|
+
content: {
|
|
2349
|
+
"application/json": {
|
|
2350
|
+
/** @constant */
|
|
2351
|
+
code: "SDK_RAMPS_QUOTES";
|
|
2352
|
+
/** @constant */
|
|
2353
|
+
success: true;
|
|
2354
|
+
content: {
|
|
2355
|
+
quotes: {
|
|
2356
|
+
quoteId: string;
|
|
2357
|
+
provider: string;
|
|
2358
|
+
fee: number;
|
|
2359
|
+
feeCurrency: string;
|
|
2360
|
+
rate: number;
|
|
2361
|
+
/** @enum {string} */
|
|
2362
|
+
rail: "SPEI" | "PIX" | "PSE" | "ACH";
|
|
2363
|
+
/** @enum {string} */
|
|
2364
|
+
protocol: "SEP-24" | "REST";
|
|
2365
|
+
estimatedTime: string;
|
|
2366
|
+
recommended: boolean;
|
|
2367
|
+
}[];
|
|
2368
|
+
};
|
|
2369
|
+
};
|
|
2370
|
+
};
|
|
2371
|
+
};
|
|
2372
|
+
/** @description Validation error */
|
|
2373
|
+
400: {
|
|
2374
|
+
headers: {
|
|
2375
|
+
[name: string]: unknown;
|
|
2376
|
+
};
|
|
2377
|
+
content: {
|
|
2378
|
+
"application/json": {
|
|
2379
|
+
/** @constant */
|
|
2380
|
+
success: false;
|
|
2381
|
+
error: string;
|
|
2382
|
+
};
|
|
2383
|
+
};
|
|
2384
|
+
};
|
|
2385
|
+
/** @description Unauthorized */
|
|
2386
|
+
401: {
|
|
2387
|
+
headers: {
|
|
2388
|
+
[name: string]: unknown;
|
|
2389
|
+
};
|
|
2390
|
+
content: {
|
|
2391
|
+
"application/json": {
|
|
2392
|
+
/** @constant */
|
|
2393
|
+
success: false;
|
|
2394
|
+
error: string;
|
|
2395
|
+
};
|
|
2396
|
+
};
|
|
2397
|
+
};
|
|
2398
|
+
};
|
|
1531
2399
|
};
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
2400
|
+
postRampsOnramp: {
|
|
2401
|
+
parameters: {
|
|
2402
|
+
query?: never;
|
|
2403
|
+
header?: never;
|
|
2404
|
+
path?: never;
|
|
2405
|
+
cookie?: never;
|
|
2406
|
+
};
|
|
2407
|
+
requestBody: {
|
|
2408
|
+
content: {
|
|
2409
|
+
"application/json": {
|
|
2410
|
+
quoteId: string;
|
|
2411
|
+
amount: number;
|
|
2412
|
+
currency: string;
|
|
2413
|
+
country: string;
|
|
2414
|
+
walletAddress: string;
|
|
2415
|
+
};
|
|
2416
|
+
};
|
|
2417
|
+
};
|
|
2418
|
+
responses: {
|
|
2419
|
+
/** @description Onramp transaction created with payment instructions */
|
|
2420
|
+
200: {
|
|
2421
|
+
headers: {
|
|
2422
|
+
[name: string]: unknown;
|
|
2423
|
+
};
|
|
2424
|
+
content: {
|
|
2425
|
+
"application/json": {
|
|
2426
|
+
/** @constant */
|
|
2427
|
+
code: "SDK_RAMPS_ONRAMP_CREATED";
|
|
2428
|
+
/** @constant */
|
|
2429
|
+
success: true;
|
|
2430
|
+
content: {
|
|
2431
|
+
txId: string;
|
|
2432
|
+
provider: string;
|
|
2433
|
+
/** @enum {string} */
|
|
2434
|
+
status: "pending" | "processing" | "completed" | "failed";
|
|
2435
|
+
paymentInstructions: {
|
|
2436
|
+
/** @enum {string} */
|
|
2437
|
+
type: "CLABE" | "PIX" | "PSE" | "ACH";
|
|
2438
|
+
value: string;
|
|
2439
|
+
amount: number;
|
|
2440
|
+
currency: string;
|
|
2441
|
+
expiresAt?: string;
|
|
2442
|
+
};
|
|
2443
|
+
};
|
|
2444
|
+
};
|
|
2445
|
+
};
|
|
2446
|
+
};
|
|
2447
|
+
/** @description Validation error or quote expired */
|
|
2448
|
+
400: {
|
|
2449
|
+
headers: {
|
|
2450
|
+
[name: string]: unknown;
|
|
2451
|
+
};
|
|
2452
|
+
content: {
|
|
2453
|
+
"application/json": {
|
|
2454
|
+
/** @constant */
|
|
2455
|
+
success: false;
|
|
2456
|
+
error: string;
|
|
2457
|
+
};
|
|
2458
|
+
};
|
|
2459
|
+
};
|
|
2460
|
+
/** @description Unauthorized */
|
|
2461
|
+
401: {
|
|
2462
|
+
headers: {
|
|
2463
|
+
[name: string]: unknown;
|
|
2464
|
+
};
|
|
2465
|
+
content: {
|
|
2466
|
+
"application/json": {
|
|
2467
|
+
/** @constant */
|
|
2468
|
+
success: false;
|
|
2469
|
+
error: string;
|
|
2470
|
+
};
|
|
2471
|
+
};
|
|
2472
|
+
};
|
|
2473
|
+
/** @description Quote not found */
|
|
2474
|
+
404: {
|
|
2475
|
+
headers: {
|
|
2476
|
+
[name: string]: unknown;
|
|
2477
|
+
};
|
|
2478
|
+
content: {
|
|
2479
|
+
"application/json": {
|
|
2480
|
+
/** @constant */
|
|
2481
|
+
success: false;
|
|
2482
|
+
error: string;
|
|
2483
|
+
};
|
|
2484
|
+
};
|
|
2485
|
+
};
|
|
2486
|
+
};
|
|
2487
|
+
};
|
|
2488
|
+
postRampsOfframp: {
|
|
2489
|
+
parameters: {
|
|
2490
|
+
query?: never;
|
|
2491
|
+
header?: never;
|
|
2492
|
+
path?: never;
|
|
2493
|
+
cookie?: never;
|
|
2494
|
+
};
|
|
2495
|
+
requestBody: {
|
|
2496
|
+
content: {
|
|
2497
|
+
"application/json": {
|
|
2498
|
+
quoteId: string;
|
|
2499
|
+
amount: number;
|
|
2500
|
+
currency: string;
|
|
2501
|
+
country: string;
|
|
2502
|
+
walletAddress: string;
|
|
2503
|
+
bankDetails: {
|
|
2504
|
+
/** @enum {string} */
|
|
2505
|
+
type: "CLABE" | "PIX" | "PSE" | "ACH";
|
|
2506
|
+
value: string;
|
|
2507
|
+
};
|
|
2508
|
+
};
|
|
2509
|
+
};
|
|
2510
|
+
};
|
|
2511
|
+
responses: {
|
|
2512
|
+
/** @description Offramp transaction created */
|
|
2513
|
+
200: {
|
|
2514
|
+
headers: {
|
|
2515
|
+
[name: string]: unknown;
|
|
2516
|
+
};
|
|
2517
|
+
content: {
|
|
2518
|
+
"application/json": {
|
|
2519
|
+
/** @constant */
|
|
2520
|
+
code: "SDK_RAMPS_OFFRAMP_CREATED";
|
|
2521
|
+
/** @constant */
|
|
2522
|
+
success: true;
|
|
2523
|
+
content: {
|
|
2524
|
+
txId: string;
|
|
2525
|
+
provider: string;
|
|
2526
|
+
/** @enum {string} */
|
|
2527
|
+
status: "pending" | "processing" | "completed" | "failed";
|
|
2528
|
+
};
|
|
2529
|
+
};
|
|
2530
|
+
};
|
|
2531
|
+
};
|
|
2532
|
+
/** @description Validation error or quote expired */
|
|
2533
|
+
400: {
|
|
2534
|
+
headers: {
|
|
2535
|
+
[name: string]: unknown;
|
|
2536
|
+
};
|
|
2537
|
+
content: {
|
|
2538
|
+
"application/json": {
|
|
2539
|
+
/** @constant */
|
|
2540
|
+
success: false;
|
|
2541
|
+
error: string;
|
|
2542
|
+
};
|
|
2543
|
+
};
|
|
2544
|
+
};
|
|
2545
|
+
/** @description Unauthorized */
|
|
2546
|
+
401: {
|
|
2547
|
+
headers: {
|
|
2548
|
+
[name: string]: unknown;
|
|
2549
|
+
};
|
|
2550
|
+
content: {
|
|
2551
|
+
"application/json": {
|
|
2552
|
+
/** @constant */
|
|
2553
|
+
success: false;
|
|
2554
|
+
error: string;
|
|
2555
|
+
};
|
|
2556
|
+
};
|
|
2557
|
+
};
|
|
2558
|
+
/** @description Quote not found */
|
|
2559
|
+
404: {
|
|
2560
|
+
headers: {
|
|
2561
|
+
[name: string]: unknown;
|
|
2562
|
+
};
|
|
2563
|
+
content: {
|
|
2564
|
+
"application/json": {
|
|
2565
|
+
/** @constant */
|
|
2566
|
+
success: false;
|
|
2567
|
+
error: string;
|
|
2568
|
+
};
|
|
2569
|
+
};
|
|
2570
|
+
};
|
|
2571
|
+
};
|
|
2572
|
+
};
|
|
2573
|
+
getRampsTransactionByTxId: {
|
|
2574
|
+
parameters: {
|
|
2575
|
+
query?: never;
|
|
2576
|
+
header?: never;
|
|
2577
|
+
path: {
|
|
2578
|
+
/** @description Transaction ID returned by POST /ramps/onramp or POST /ramps/offramp */
|
|
2579
|
+
txId: string;
|
|
2580
|
+
};
|
|
2581
|
+
cookie?: never;
|
|
2582
|
+
};
|
|
2583
|
+
requestBody?: never;
|
|
2584
|
+
responses: {
|
|
2585
|
+
/** @description Transaction status and details */
|
|
2586
|
+
200: {
|
|
2587
|
+
headers: {
|
|
2588
|
+
[name: string]: unknown;
|
|
2589
|
+
};
|
|
2590
|
+
content: {
|
|
2591
|
+
"application/json": {
|
|
2592
|
+
/** @constant */
|
|
2593
|
+
code: "SDK_RAMPS_TX_STATUS";
|
|
2594
|
+
/** @constant */
|
|
2595
|
+
success: true;
|
|
2596
|
+
content: {
|
|
2597
|
+
txId: string;
|
|
2598
|
+
provider: string;
|
|
2599
|
+
/** @enum {string} */
|
|
2600
|
+
status: "pending" | "processing" | "completed" | "failed";
|
|
2601
|
+
/** @enum {string} */
|
|
2602
|
+
direction: "onramp" | "offramp";
|
|
2603
|
+
amount: number;
|
|
2604
|
+
currency: string;
|
|
2605
|
+
updatedAt: string;
|
|
2606
|
+
};
|
|
2607
|
+
};
|
|
2608
|
+
};
|
|
2609
|
+
};
|
|
2610
|
+
/** @description Unauthorized */
|
|
2611
|
+
401: {
|
|
2612
|
+
headers: {
|
|
2613
|
+
[name: string]: unknown;
|
|
2614
|
+
};
|
|
2615
|
+
content: {
|
|
2616
|
+
"application/json": {
|
|
2617
|
+
/** @constant */
|
|
2618
|
+
success: false;
|
|
2619
|
+
error: string;
|
|
2620
|
+
};
|
|
2621
|
+
};
|
|
2622
|
+
};
|
|
2623
|
+
/** @description Forbidden */
|
|
2624
|
+
403: {
|
|
2625
|
+
headers: {
|
|
2626
|
+
[name: string]: unknown;
|
|
2627
|
+
};
|
|
2628
|
+
content: {
|
|
2629
|
+
"application/json": {
|
|
2630
|
+
/** @constant */
|
|
2631
|
+
success: false;
|
|
2632
|
+
error: string;
|
|
2633
|
+
};
|
|
2634
|
+
};
|
|
2635
|
+
};
|
|
2636
|
+
/** @description Not found */
|
|
2637
|
+
404: {
|
|
2638
|
+
headers: {
|
|
2639
|
+
[name: string]: unknown;
|
|
2640
|
+
};
|
|
2641
|
+
content: {
|
|
2642
|
+
"application/json": {
|
|
2643
|
+
/** @constant */
|
|
2644
|
+
success: false;
|
|
2645
|
+
error: string;
|
|
2646
|
+
};
|
|
2647
|
+
};
|
|
2648
|
+
};
|
|
2649
|
+
};
|
|
1535
2650
|
};
|
|
1536
|
-
onStateChange(cb: (state: PollarStateEntry) => void): () => void;
|
|
1537
|
-
verifyEmailCode(clientSessionId: string, code: string): Promise<void>;
|
|
1538
|
-
getNetwork(): "testnet" | "public";
|
|
1539
|
-
buildTx(operation: TxBuildBody['operation'], params: TxBuildBody['params'], options?: TxBuildBody['options']): Promise<void>;
|
|
1540
|
-
submitTx(signedXdr: string): Promise<void>;
|
|
1541
|
-
logout(): void;
|
|
1542
|
-
private _readStore;
|
|
1543
|
-
private _storeSession;
|
|
1544
|
-
private _clearSession;
|
|
1545
|
-
private _emitState;
|
|
1546
2651
|
}
|
|
1547
2652
|
|
|
2653
|
+
type PollarApiClient = ReturnType<typeof createApiClient>;
|
|
2654
|
+
declare function createApiClient(baseUrl: string): openapi_fetch.Client<paths, `${string}/${string}`>;
|
|
2655
|
+
|
|
1548
2656
|
declare function isValidSession(value: unknown): value is PollarApplicationConfigContent;
|
|
1549
2657
|
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
2658
|
+
/**
|
|
2659
|
+
* GET /kyc/status
|
|
2660
|
+
* Returns the current user's KYC status for a given provider.
|
|
2661
|
+
* Requires a valid auth token in the API client.
|
|
2662
|
+
*/
|
|
2663
|
+
declare function getKycStatus(api: PollarApiClient, providerId?: string): Promise<{
|
|
2664
|
+
status: KycStatus;
|
|
2665
|
+
level?: KycLevel | undefined;
|
|
2666
|
+
providerId: string;
|
|
2667
|
+
expiresAt?: string;
|
|
2668
|
+
}>;
|
|
2669
|
+
/**
|
|
2670
|
+
* GET /kyc/providers
|
|
2671
|
+
* Returns available KYC providers for a given country.
|
|
2672
|
+
*/
|
|
2673
|
+
declare function getKycProviders(api: PollarApiClient, country: string): Promise<{
|
|
2674
|
+
providers: KycProvider[];
|
|
2675
|
+
}>;
|
|
2676
|
+
/**
|
|
2677
|
+
* POST /kyc/start
|
|
2678
|
+
* Starts a KYC session.
|
|
2679
|
+
* - flow=iframe/redirect: returns kycUrl to embed or redirect to
|
|
2680
|
+
* - flow=form: returns fields[] to render a custom form
|
|
2681
|
+
*/
|
|
2682
|
+
declare function startKyc(api: PollarApiClient, body: KycStartBody): Promise<KycStartResponse>;
|
|
2683
|
+
/**
|
|
2684
|
+
* Orchestrates the full KYC resolution flow:
|
|
2685
|
+
* 1. Checks current status
|
|
2686
|
+
* 2. If already approved, returns early
|
|
2687
|
+
* 3. Otherwise starts KYC and returns the session (kycUrl or fields)
|
|
2688
|
+
*/
|
|
2689
|
+
declare function resolveKyc(api: PollarApiClient, providerId: string, level?: KycLevel): Promise<{
|
|
2690
|
+
alreadyApproved: boolean;
|
|
2691
|
+
} & Partial<KycStartResponse>>;
|
|
2692
|
+
/**
|
|
2693
|
+
* Polls GET /kyc/status every intervalMs until status is 'approved' or 'rejected'.
|
|
2694
|
+
* Throws if timeoutMs is exceeded.
|
|
2695
|
+
*/
|
|
2696
|
+
declare function pollKycStatus(api: PollarApiClient, providerId: string, { intervalMs, timeoutMs }?: {
|
|
2697
|
+
intervalMs?: number;
|
|
2698
|
+
timeoutMs?: number;
|
|
2699
|
+
}): Promise<KycStatus>;
|
|
2700
|
+
|
|
2701
|
+
/**
|
|
2702
|
+
* GET /ramps/quote
|
|
2703
|
+
* Returns available quotes for an onramp or offramp.
|
|
2704
|
+
* The backend ranks providers by country, amount, fee and availability.
|
|
2705
|
+
* The first quote in the array is the recommended one.
|
|
2706
|
+
*/
|
|
2707
|
+
declare function getRampsQuote(api: PollarApiClient, query: RampsQuoteQuery): Promise<RampsQuoteResponse>;
|
|
2708
|
+
/**
|
|
2709
|
+
* POST /ramps/onramp
|
|
2710
|
+
* Creates an onramp transaction.
|
|
2711
|
+
* For custodial users: backend orchestrates the full SEP-24 flow and returns payment instructions.
|
|
2712
|
+
* For non-custodial: backend may return an unsigned XDR that the client must sign via a wallet adapter.
|
|
2713
|
+
*/
|
|
2714
|
+
declare function createOnRamp(api: PollarApiClient, body: RampsOnrampBody): Promise<RampsOnrampResponse>;
|
|
2715
|
+
/**
|
|
2716
|
+
* POST /ramps/offramp
|
|
2717
|
+
* Creates an offramp transaction.
|
|
2718
|
+
* Backend initiates the bank transfer once the Stellar transaction is confirmed.
|
|
2719
|
+
*/
|
|
2720
|
+
declare function createOffRamp(api: PollarApiClient, body: RampsOfframpBody): Promise<RampsOfframpResponse>;
|
|
2721
|
+
/**
|
|
2722
|
+
* GET /ramps/transaction/{txId}
|
|
2723
|
+
* Returns the current status of a ramp transaction.
|
|
2724
|
+
*/
|
|
2725
|
+
declare function getRampTransaction(api: PollarApiClient, txId: string): Promise<RampsTransactionResponse>;
|
|
2726
|
+
/**
|
|
2727
|
+
* Polls GET /ramps/transaction/{txId} every intervalMs until status is 'completed' or 'failed'.
|
|
2728
|
+
* Throws if timeoutMs is exceeded.
|
|
2729
|
+
*/
|
|
2730
|
+
declare function pollRampTransaction(api: PollarApiClient, txId: string, { intervalMs, timeoutMs }?: {
|
|
2731
|
+
intervalMs?: number;
|
|
2732
|
+
timeoutMs?: number;
|
|
2733
|
+
}): Promise<RampTxStatus>;
|
|
1572
2734
|
|
|
1573
|
-
export { AlbedoAdapter, type ConnectWalletResponse, FreighterAdapter, type
|
|
2735
|
+
export { AUTH_ERROR_CODES, AlbedoAdapter, type AuthErrorCode, type AuthState, type ConnectWalletResponse, FreighterAdapter, type KycFlow, type KycLevel, type KycProvider, type KycStartBody, type KycStartResponse, type KycStatus, type NetworkState, type PaymentInstructions, type PollarApiClient, type PollarApplicationConfigContent, type PollarApplicationConfigResponse, PollarClient, type PollarClientConfig, PollarFlowError, type PollarLoginOptions, type RampDirection, type RampQuote, type RampTxStatus, type RampsOfframpBody, type RampsOfframpResponse, type RampsOnrampBody, type RampsOnrampResponse, type RampsQuoteQuery, type RampsQuoteResponse, type RampsTransactionResponse, type SignAuthEntryOptions, type SignAuthEntryResponse, type SignTransactionOptions, type SignTransactionResponse, type StellarBalance, StellarClient, type StellarClientConfig, type StellarNetwork, type TransactionState, type TxBuildBody, type TxBuildContent, type TxBuildResponse, type TxHistoryContent, type TxHistoryParams, type TxHistoryRecord, type TxHistoryState, type TxSignAndSendBody, type TxSignSendResponse, type WalletAdapter, type WalletBalanceContent, type WalletBalanceRecord, WalletType, createOffRamp, createOnRamp, getKycProviders, getKycStatus, getRampTransaction, getRampsQuote, isValidSession, pollKycStatus, pollRampTransaction, type paths as pollarPaths, resolveKyc, startKyc };
|