@idos-network/kwil-infra 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/.turbo/turbo-build.log +47 -0
  2. package/.turbo/turbo-test.log +126 -0
  3. package/.turbo/turbo-typecheck.log +5 -0
  4. package/CHANGELOG.md +20 -0
  5. package/LICENSE +21 -0
  6. package/README.md +63 -0
  7. package/dist/actions/index.d.mts +2 -0
  8. package/dist/actions/index.mjs +1371 -0
  9. package/dist/actions/index.mjs.map +1 -0
  10. package/dist/facesign/index.d.mts +2 -0
  11. package/dist/facesign/index.mjs +2 -0
  12. package/dist/facesign-signer-ADd4EASX.d.mts +29 -0
  13. package/dist/facesign-signer-ADd4EASX.d.mts.map +1 -0
  14. package/dist/facesign-signer-BY9Nti9F.mjs +244 -0
  15. package/dist/facesign-signer-BY9Nti9F.mjs.map +1 -0
  16. package/dist/index-Ci6QhKJo.d.mts +644 -0
  17. package/dist/index-Ci6QhKJo.d.mts.map +1 -0
  18. package/dist/index.d.mts +2 -0
  19. package/dist/index.mjs +429 -0
  20. package/dist/index.mjs.map +1 -0
  21. package/dist/signature-verification/index.d.mts +14 -0
  22. package/dist/signature-verification/index.d.mts.map +1 -0
  23. package/dist/signature-verification/index.mjs +140 -0
  24. package/dist/signature-verification/index.mjs.map +1 -0
  25. package/dist/xrp/utils.d.mts +1165 -0
  26. package/dist/xrp/utils.d.mts.map +1 -0
  27. package/dist/xrp/utils.mjs +105 -0
  28. package/dist/xrp/utils.mjs.map +1 -0
  29. package/dist/xrpl-credentials/index.d.mts +179 -0
  30. package/dist/xrpl-credentials/index.d.mts.map +1 -0
  31. package/dist/xrpl-credentials/index.mjs +224 -0
  32. package/dist/xrpl-credentials/index.mjs.map +1 -0
  33. package/package.json +93 -0
  34. package/src/actions/actions.ts +2197 -0
  35. package/src/actions/index.ts +55 -0
  36. package/src/create-kwil-client.ts +144 -0
  37. package/src/create-kwil-signer.ts +270 -0
  38. package/src/facesign/facesign-signer.ts +327 -0
  39. package/src/facesign/index.ts +2 -0
  40. package/src/index.ts +7 -0
  41. package/src/near/create-near-wallet-kwil-signer.ts +245 -0
  42. package/src/near/get-config.ts +43 -0
  43. package/src/near/nep413.ts +62 -0
  44. package/src/near/signature-verification.ts +85 -0
  45. package/src/signature-verification/evm.ts +33 -0
  46. package/src/signature-verification/facesign.ts +19 -0
  47. package/src/signature-verification/index.test.ts +110 -0
  48. package/src/signature-verification/index.ts +72 -0
  49. package/src/signature-verification/stellar.ts +31 -0
  50. package/src/xrp/signature-verification.ts +18 -0
  51. package/src/xrp/signer.ts +43 -0
  52. package/src/xrp/utils.ts +178 -0
  53. package/src/xrpl-credentials/accept.ts +143 -0
  54. package/src/xrpl-credentials/create.ts +199 -0
  55. package/src/xrpl-credentials/index.ts +12 -0
  56. package/tsconfig.json +33 -0
  57. package/tsdown.config.ts +13 -0
  58. package/vitest.config.ts +6 -0
@@ -0,0 +1,1165 @@
1
+ /// <reference types="node" />
2
+ import { AccountSetAsfFlags, AccountSetFlagsInterface, NFTokenCreateOfferFlagsInterface, NFTokenMintFlagsInterface, OfferCreateFlagsInterface, Path, PaymentFlagsInterface, SubmittableTransaction, TrustSetFlagsInterface } from "xrpl";
3
+ import { Amount, Amount as Amount$1, IssuedCurrencyAmount } from "xrpl/dist/npm/models/common/index.js";
4
+ import { w3cwebsocket } from "websocket";
5
+ import { EventEmitter } from "events";
6
+
7
+ //#region \0rolldown/runtime.js
8
+ //#endregion
9
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/_constants/network/network.constant.d.ts
10
+ declare enum XRPLNetwork {
11
+ MAINNET = "Mainnet",
12
+ TESTNET = "Testnet",
13
+ DEVNET = "Devnet",
14
+ CUSTOM = "Custom"
15
+ }
16
+ declare enum XahauNetwork {
17
+ XAHAU_MAINNET = "Mainnet",
18
+ XAHAU_TESTNET = "Testnet",
19
+ CUSTOM = "Custom"
20
+ }
21
+ type Network = XRPLNetwork | XahauNetwork;
22
+ //#endregion
23
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/_constants/xrpl/hooks.types.d.ts
24
+ interface Hook {
25
+ Hook: {
26
+ CreateCode: string;
27
+ Flags: number;
28
+ HookApiVersion: number;
29
+ HookOn: string;
30
+ HookNamespace: string;
31
+ HookParameters?: HookParameter[];
32
+ HookGrants?: HookGrant[];
33
+ };
34
+ }
35
+ interface HookParameter {
36
+ HookParameter: {
37
+ HookParameterName: string;
38
+ HookParameterValue: string;
39
+ };
40
+ }
41
+ interface HookGrant {
42
+ HookGrant: {
43
+ HookHash: string;
44
+ Authorize?: string;
45
+ };
46
+ }
47
+ //#endregion
48
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/_constants/xrpl/basic.types.d.ts
49
+ interface Memo {
50
+ memo: {
51
+ memoType?: string;
52
+ memoData?: string;
53
+ memoFormat?: string;
54
+ };
55
+ }
56
+ interface Signer {
57
+ signer: {
58
+ account: string;
59
+ txnSignature: string;
60
+ signingPubKey: string;
61
+ };
62
+ }
63
+ type TrustSetFlags = TrustSetFlagsInterface | number;
64
+ type PaymentFlags = PaymentFlagsInterface | number;
65
+ type MintNFTFlags = NFTokenMintFlagsInterface | number;
66
+ type CreateNFTOfferFlags = NFTokenCreateOfferFlagsInterface | number;
67
+ type SetAccountFlags = AccountSetFlagsInterface | number;
68
+ type CreateOfferFlags = OfferCreateFlagsInterface | number;
69
+ //#endregion
70
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/_constants/xrpl/nft.types.d.ts
71
+ interface AccountNFToken {
72
+ Flags: number;
73
+ Issuer: string;
74
+ NFTokenID: string;
75
+ NFTokenTaxon: number;
76
+ URI?: string;
77
+ nft_serial: number;
78
+ }
79
+ interface AccountNFTokenResponse {
80
+ account_nfts: AccountNFToken[];
81
+ marker?: unknown;
82
+ }
83
+ interface NFTokenIDResponse {
84
+ hash: string;
85
+ NFTokenID: string;
86
+ }
87
+ //#endregion
88
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/_constants/payload/payload.types.d.ts
89
+ interface GetNetworkRequest {
90
+ id: number | undefined;
91
+ }
92
+ interface BaseTransactionRequest {
93
+ fee?: string;
94
+ sequence?: number;
95
+ accountTxnID?: string;
96
+ lastLedgerSequence?: number;
97
+ memos?: Memo[];
98
+ networkID?: number;
99
+ signers?: Signer[];
100
+ sourceTag?: number;
101
+ signingPubKey?: string;
102
+ ticketSequence?: number;
103
+ txnSignature?: string;
104
+ }
105
+ interface SendPaymentRequest extends BaseTransactionRequest {
106
+ amount: Amount;
107
+ destination: string;
108
+ destinationTag?: number;
109
+ invoiceID?: string;
110
+ paths?: Path[];
111
+ sendMax?: Amount;
112
+ deliverMin?: Amount;
113
+ flags?: PaymentFlags;
114
+ }
115
+ interface SetTrustlineRequest extends BaseTransactionRequest {
116
+ limitAmount: IssuedCurrencyAmount;
117
+ qualityIn?: number;
118
+ qualityOut?: number;
119
+ flags?: TrustSetFlags;
120
+ }
121
+ interface MintNFTRequest extends BaseTransactionRequest {
122
+ flags?: MintNFTFlags;
123
+ issuer?: string;
124
+ NFTokenTaxon: number;
125
+ transferFee?: number;
126
+ URI?: string;
127
+ }
128
+ interface CreateNFTOfferRequest extends BaseTransactionRequest {
129
+ NFTokenID: string;
130
+ amount: Amount;
131
+ owner?: string;
132
+ expiration?: number;
133
+ destination?: string;
134
+ flags?: CreateNFTOfferFlags;
135
+ }
136
+ interface CancelNFTOfferRequest extends BaseTransactionRequest {
137
+ NFTokenOffers: string[];
138
+ }
139
+ interface AcceptNFTOfferRequest extends BaseTransactionRequest {
140
+ NFTokenSellOffer?: string;
141
+ NFTokenBuyOffer?: string;
142
+ NFTokenBrokerFee?: Amount;
143
+ }
144
+ interface BurnNFTRequest extends BaseTransactionRequest {
145
+ NFTokenID: string;
146
+ owner?: string;
147
+ }
148
+ interface GetNFTRequest {
149
+ limit?: number;
150
+ marker?: unknown;
151
+ }
152
+ interface SignMessageRequest {
153
+ url: string;
154
+ title: string;
155
+ favicon: string | null | undefined;
156
+ message: string;
157
+ isHex?: boolean;
158
+ }
159
+ interface SetAccountRequest extends BaseTransactionRequest {
160
+ flags?: SetAccountFlags;
161
+ clearFlag?: number;
162
+ domain?: string;
163
+ emailHash?: string;
164
+ messageKey?: string;
165
+ NFTokenMinter?: string;
166
+ setFlag?: AccountSetAsfFlags;
167
+ transferRate?: number;
168
+ tickSize?: number;
169
+ }
170
+ interface SetRegularKeyRequest extends BaseTransactionRequest {
171
+ regularKey?: string;
172
+ }
173
+ interface CreateOfferRequest extends BaseTransactionRequest {
174
+ flags?: CreateOfferFlags;
175
+ expiration?: number;
176
+ offerSequence?: number;
177
+ takerGets: Amount;
178
+ takerPays: Amount;
179
+ }
180
+ interface CancelOfferRequest extends BaseTransactionRequest {
181
+ offerSequence: number;
182
+ }
183
+ interface SubmitTransactionRequest {
184
+ transaction: SubmittableTransaction;
185
+ }
186
+ interface SignTransactionRequest {
187
+ transaction: SubmittableTransaction;
188
+ }
189
+ type TransactionWithID = SubmittableTransaction & {
190
+ ID?: string;
191
+ };
192
+ type TransactionErrorHandling = 'abort' | 'continue';
193
+ interface BaseBulkTransactionsRequest {
194
+ waitForHashes?: boolean;
195
+ onError?: TransactionErrorHandling;
196
+ }
197
+ interface SubmitBulkTransactionsRequest extends BaseBulkTransactionsRequest {
198
+ transactions: TransactionWithID[];
199
+ }
200
+ interface SetHookRequest extends BaseTransactionRequest {
201
+ hooks: Hook[];
202
+ }
203
+ declare const enum ResponseType {
204
+ Response = "response",
205
+ Reject = "reject"
206
+ }
207
+ interface BaseResponse<T> {
208
+ type: ResponseType;
209
+ result?: T;
210
+ }
211
+ interface GetNetworkResponse extends BaseResponse<{
212
+ chain: string;
213
+ network: Network;
214
+ websocket: string;
215
+ }> {}
216
+ interface GetAddressResponse extends BaseResponse<{
217
+ address: string;
218
+ }> {}
219
+ interface GetPublicKeyResponse extends BaseResponse<{
220
+ address: string;
221
+ publicKey: string;
222
+ }> {}
223
+ interface SignMessageResponse extends BaseResponse<{
224
+ signedMessage: string;
225
+ }> {}
226
+ interface SubmitTransactionResponse extends BaseResponse<{
227
+ hash: string;
228
+ }> {}
229
+ interface SignTransactionResponse extends BaseResponse<{
230
+ signature: string | null | undefined;
231
+ }> {}
232
+ type TransactionBulkResponse = {
233
+ id?: string;
234
+ accepted?: boolean;
235
+ hash?: string;
236
+ error?: string;
237
+ };
238
+ interface SubmitBulkTransactionsResponse extends BaseResponse<{
239
+ transactions: TransactionBulkResponse[];
240
+ }> {}
241
+ interface IsInstalledResponse {
242
+ result: {
243
+ isInstalled: boolean;
244
+ };
245
+ }
246
+ interface SendPaymentResponse extends BaseResponse<{
247
+ hash: string;
248
+ }> {}
249
+ interface SetTrustlineResponse extends BaseResponse<{
250
+ hash: string;
251
+ }> {}
252
+ interface GetNFTResponse extends BaseResponse<AccountNFTokenResponse> {}
253
+ interface MintNFTResponse extends BaseResponse<NFTokenIDResponse> {}
254
+ interface CreateNFTOfferResponse extends BaseResponse<{
255
+ hash: string;
256
+ }> {}
257
+ interface CancelNFTOfferResponse extends BaseResponse<{
258
+ hash: string;
259
+ }> {}
260
+ interface AcceptNFTOfferResponse extends BaseResponse<{
261
+ hash: string;
262
+ }> {}
263
+ interface BurnNFTResponse extends BaseResponse<{
264
+ hash: string;
265
+ }> {}
266
+ interface SetAccountResponse extends BaseResponse<{
267
+ hash: string;
268
+ }> {}
269
+ interface SetRegularKeyResponse extends BaseResponse<{
270
+ hash: string;
271
+ }> {}
272
+ interface CreateOfferResponse extends BaseResponse<{
273
+ hash: string;
274
+ }> {}
275
+ interface CancelOfferResponse extends BaseResponse<{
276
+ hash: string;
277
+ }> {}
278
+ interface SetHookResponse extends BaseResponse<{
279
+ hash: string;
280
+ }> {}
281
+ //#endregion
282
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/acceptNFTOffer/acceptNFTOffer.d.ts
283
+ declare const acceptNFTOffer: (payload: AcceptNFTOfferRequest) => Promise<AcceptNFTOfferResponse>;
284
+ //#endregion
285
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/burnNFT/burnNFT.d.ts
286
+ declare const burnNFT: (payload: BurnNFTRequest) => Promise<BurnNFTResponse>;
287
+ //#endregion
288
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/cancelNFTOffer/cancelNFTOffer.d.ts
289
+ declare const cancelNFTOffer: (payload: CancelNFTOfferRequest) => Promise<CancelNFTOfferResponse>;
290
+ //#endregion
291
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/cancelOffer/cancelOffer.d.ts
292
+ declare const cancelOffer: (payload: CancelOfferRequest) => Promise<CancelOfferResponse>;
293
+ //#endregion
294
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/createNFTOffer/createNFTOffer.d.ts
295
+ declare const createNFTOffer: (payload: CreateNFTOfferRequest) => Promise<CreateNFTOfferResponse>;
296
+ //#endregion
297
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/createOffer/createOffer.d.ts
298
+ declare const createOffer: (payload: CreateOfferRequest) => Promise<CreateOfferResponse>;
299
+ //#endregion
300
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/on/on.d.ts
301
+ declare const on: (eventType: string, callback: (payload: any) => void) => void;
302
+ //#endregion
303
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/getAddress/getAddress.d.ts
304
+ declare const getAddress: () => Promise<GetAddressResponse>;
305
+ //#endregion
306
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/getNetwork/getNetwork.d.ts
307
+ declare const getNetwork: () => Promise<GetNetworkResponse>;
308
+ //#endregion
309
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/getNFT/getNFT.d.ts
310
+ declare const getNFT: (payload?: GetNFTRequest) => Promise<GetNFTResponse>;
311
+ //#endregion
312
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/getPublicKey/getPublicKey.d.ts
313
+ declare const getPublicKey: () => Promise<GetPublicKeyResponse>;
314
+ //#endregion
315
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/isInstalled/isInstalled.d.ts
316
+ declare const isInstalled: () => Promise<IsInstalledResponse>;
317
+ //#endregion
318
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/mintNFT/mintNFT.d.ts
319
+ declare const mintNFT: (payload: MintNFTRequest) => Promise<MintNFTResponse>;
320
+ //#endregion
321
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/sendPayment/sendPayment.d.ts
322
+ declare const sendPayment: (paymentPayload: SendPaymentRequest) => Promise<SendPaymentResponse>;
323
+ //#endregion
324
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/setAccount/setAccount.d.ts
325
+ declare const setAccount: (payload: SetAccountRequest) => Promise<SetAccountResponse>;
326
+ //#endregion
327
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/setHook/setHook.d.ts
328
+ declare const setHook: (payload: SetHookRequest) => Promise<SetHookResponse>;
329
+ //#endregion
330
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/setRegularKey/setRegularKey.d.ts
331
+ declare const setRegularKey: (payload: SetRegularKeyRequest) => Promise<SetRegularKeyResponse>;
332
+ //#endregion
333
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/setTrustline/setTrustline.d.ts
334
+ declare const setTrustline: (payload: SetTrustlineRequest) => Promise<SetTrustlineResponse>;
335
+ //#endregion
336
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/signMessage/signMessage.d.ts
337
+ declare const signMessage: (message: string, isHex?: boolean) => Promise<SignMessageResponse>;
338
+ //#endregion
339
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/signTransaction/signTransaction.d.ts
340
+ declare const signTransaction: (payload: SignTransactionRequest) => Promise<SignTransactionResponse>;
341
+ //#endregion
342
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/submitTransaction/submitTransaction.d.ts
343
+ declare const submitTransaction: (payload: SubmitTransactionRequest) => Promise<SubmitTransactionResponse>;
344
+ //#endregion
345
+ //#region ../../node_modules/.pnpm/@gemwallet+api@3.8.0/node_modules/@gemwallet/api/submitBulkTransactions/submitBulkTransactions.d.ts
346
+ declare const submitBulkTransactions: (payload: SubmitBulkTransactionsRequest) => Promise<SubmitBulkTransactionsResponse>;
347
+ declare namespace index_d_exports {
348
+ export { AcceptNFTOfferRequest, AcceptNFTOfferResponse, AccountNFToken, Amount$1 as Amount, BurnNFTRequest, BurnNFTResponse, CancelNFTOfferRequest, CancelNFTOfferResponse, CancelOfferRequest, CancelOfferResponse, CreateNFTOfferRequest, CreateNFTOfferResponse, CreateOfferRequest, CreateOfferResponse, GetAddressResponse, GetNFTRequest, GetNFTResponse, GetNetworkRequest, GetNetworkResponse, GetPublicKeyResponse, Hook, HookGrant, HookParameter, IsInstalledResponse, Memo, MintNFTRequest, MintNFTResponse, Network, PaymentFlags, SendPaymentRequest, SendPaymentResponse, SetAccountRequest, SetAccountResponse, SetHookRequest, SetHookResponse, SetRegularKeyRequest, SetRegularKeyResponse, SetTrustlineRequest, SetTrustlineResponse, SignMessageRequest, SignMessageResponse, SignTransactionRequest, SignTransactionResponse, SubmitBulkTransactionsRequest, SubmitBulkTransactionsResponse, SubmitTransactionRequest, SubmitTransactionResponse, TransactionBulkResponse, TrustSetFlags, acceptNFTOffer, burnNFT, cancelNFTOffer, cancelOffer, createNFTOffer, createOffer, getAddress, getNFT, getNetwork, getPublicKey, isInstalled, mintNFT, on, sendPayment, setAccount, setHook, setRegularKey, setTrustline, signMessage, signTransaction, submitBulkTransactions, submitTransaction };
349
+ }
350
+ //#endregion
351
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/xumm-api/index.d.ts
352
+ declare const XummTxTypes: readonly ["SignIn", "PaymentChannelAuthorize"];
353
+ declare const XrplTxTypes: readonly ["AccountDelete", "AccountSet", "CheckCancel", "CheckCash", "CheckCreate", "ClaimReward", "DepositPreauth", "EscrowCancel", "EscrowCreate", "EscrowFinish", "Import", "Invoke", "NFTokenAcceptOffer", "NFTokenBurn", "NFTokenCancelOffer", "NFTokenCreateOffer", "NFTokenMint", "OfferCancel", "OfferCreate", "Payment", "PaymentChannelClaim", "PaymentChannelCreate", "PaymentChannelFund", "Remit", "SetHook", "SetRegularKey", "SignerListSet", "TicketCreate", "TrustSet", "URITokenBurn", "URITokenBuy", "URITokenCancelSellOffer", "URITokenCreateSellOffer", "URITokenMint"];
354
+ declare type XummTransactionType = typeof XummTxTypes[number];
355
+ declare type XrplTransactionType = typeof XrplTxTypes[number];
356
+ declare type XummCancelReason = 'OK' | 'ALREADY_CANCELLED' | 'ALREADY_RESOLVED' | 'ALREADY_OPENED' | 'ALREADY_EXPIRED';
357
+ declare type XummTransactionApprovalType = 'PIN' | 'BIOMETRIC' | 'PASSPHRASE' | 'OTHER';
358
+ declare type XummQrQuality = 'm' | 'q' | 'h';
359
+ interface XummJsonTransaction extends Record<string, unknown> {
360
+ TransactionType: XummTransactionType | XrplTransactionType;
361
+ }
362
+ interface XummCustomMeta {
363
+ identifier?: string | null;
364
+ blob?: Record<string, unknown> | null;
365
+ instruction?: string | null;
366
+ }
367
+ interface XummPayloadMeta {
368
+ exists: boolean;
369
+ uuid: string;
370
+ multisign: boolean;
371
+ submit: boolean;
372
+ pathfinding: boolean;
373
+ pathfinding_fallback: boolean;
374
+ force_network?: string;
375
+ destination: string;
376
+ resolved_destination: string;
377
+ resolved: boolean;
378
+ signed: boolean;
379
+ cancelled: boolean;
380
+ expired: boolean;
381
+ pushed: boolean;
382
+ app_opened: boolean;
383
+ opened_by_deeplink: boolean | null;
384
+ immutable?: boolean;
385
+ forceAccount?: boolean;
386
+ return_url_app: string | null;
387
+ return_url_web: string | null;
388
+ is_xapp: boolean;
389
+ signers: string[] | null;
390
+ }
391
+ interface XummPayloadBodyBase {
392
+ options?: {
393
+ submit?: boolean;
394
+ pathfinding?: boolean;
395
+ pathfinding_fallback?: boolean;
396
+ multisign?: boolean;
397
+ expire?: number;
398
+ signers?: string[];
399
+ force_network?: string;
400
+ return_url?: {
401
+ app?: string;
402
+ web?: string;
403
+ };
404
+ };
405
+ custom_meta?: XummCustomMeta;
406
+ user_token?: string;
407
+ }
408
+ interface XummPostPayloadBodyJson extends XummPayloadBodyBase {
409
+ txjson: XummJsonTransaction;
410
+ }
411
+ interface XummPostPayloadBodyBlob extends XummPayloadBodyBase {
412
+ txblob: string;
413
+ }
414
+ declare type CreatePayload = XummPostPayloadBodyJson | XummPostPayloadBodyBlob;
415
+ interface XummPostPayloadResponse {
416
+ uuid: string;
417
+ next: {
418
+ always: string;
419
+ no_push_msg_received?: string;
420
+ };
421
+ refs: {
422
+ qr_png: string;
423
+ qr_matrix: string;
424
+ qr_uri_quality_opts: XummQrQuality[];
425
+ websocket_status: string;
426
+ };
427
+ pushed: boolean;
428
+ }
429
+ interface XummGetPayloadResponse {
430
+ meta: XummPayloadMeta;
431
+ application: {
432
+ name: string;
433
+ description: string;
434
+ disabled: 0 | 1;
435
+ uuidv4: string;
436
+ icon_url: string;
437
+ issued_user_token: string | null;
438
+ };
439
+ payload: {
440
+ tx_type: XummTransactionType | XrplTransactionType;
441
+ tx_destination: string;
442
+ tx_destination_tag: number | null;
443
+ request_json: XummJsonTransaction;
444
+ origintype: string | null;
445
+ signmethod: string | null;
446
+ created_at: string;
447
+ expires_at: string;
448
+ expires_in_seconds: number;
449
+ computed?: Record<string, unknown>;
450
+ };
451
+ response: {
452
+ signer_pubkey?: string;
453
+ hex: string | null;
454
+ txid: string | null;
455
+ resolved_at: string | null;
456
+ dispatched_nodetype: string | null;
457
+ dispatched_to: string | null;
458
+ dispatched_result: string | null;
459
+ dispatched_to_node: boolean | null;
460
+ environment_nodeuri: string | null;
461
+ environment_nodetype: string | null;
462
+ environment_networkid: number | null;
463
+ multisign_account: string | null;
464
+ account: string | null;
465
+ signer: string | null;
466
+ approved_with?: XummTransactionApprovalType;
467
+ user: string | null;
468
+ };
469
+ custom_meta: XummCustomMeta;
470
+ }
471
+ interface XummDeletePayloadResponse {
472
+ result: {
473
+ cancelled: boolean;
474
+ reason: XummCancelReason;
475
+ };
476
+ meta: XummPayloadMeta;
477
+ custom_meta: XummCustomMeta;
478
+ }
479
+ //#endregion
480
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Meta/AnyJson.d.ts
481
+ declare type AnyJson$1 = Record<string, any>;
482
+ //#endregion
483
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Meta/ApplicationDetails.d.ts
484
+ interface ApplicationDetails {
485
+ quota?: Record<string, unknown>;
486
+ application: {
487
+ uuidv4: string;
488
+ name: string;
489
+ webhookurl?: string;
490
+ disabled?: number;
491
+ };
492
+ call?: {
493
+ uuidv4: string;
494
+ };
495
+ jwtData?: xAppJwtPong | JwtPong;
496
+ }
497
+ //#endregion
498
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Meta/CuratedAssetsResponse.d.ts
499
+ interface CuratedAssetsResponse {
500
+ issuers: string[];
501
+ currencies: string[];
502
+ details: {
503
+ [issuer: string]: {
504
+ id: number;
505
+ name: string;
506
+ domain?: string;
507
+ avatar?: string;
508
+ shortlist: number;
509
+ currencies: {
510
+ [currencyCode: string]: {
511
+ id: number;
512
+ issuer_id: number;
513
+ currency: string;
514
+ name: string;
515
+ avatar?: string;
516
+ shortlist: number;
517
+ };
518
+ };
519
+ };
520
+ };
521
+ }
522
+ //#endregion
523
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Meta/KycStatusResponse.d.ts
524
+ interface PossibleKycStatuses {
525
+ NONE: string;
526
+ IN_PROGRESS: string;
527
+ REJECTED: string;
528
+ SUCCESSFUL: string;
529
+ }
530
+ //#endregion
531
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Meta/XrplTransaction.d.ts
532
+ interface XrplTransaction {
533
+ txid: string;
534
+ balanceChanges: {
535
+ [account: string]: {
536
+ counterparty: string;
537
+ currency: string;
538
+ value: string;
539
+ }[];
540
+ };
541
+ node: string;
542
+ transaction: AnyJson$1;
543
+ }
544
+ //#endregion
545
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Meta/NftokenDetail.d.ts
546
+ interface NftokenDetail {
547
+ issuer?: string;
548
+ token?: string;
549
+ owner?: string;
550
+ name?: string;
551
+ image?: string;
552
+ }
553
+ //#endregion
554
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Meta/RatesResponse.d.ts
555
+ interface RatesResponse {
556
+ USD: number;
557
+ XRP: number;
558
+ __meta: {
559
+ currency: {
560
+ en: string;
561
+ code: string;
562
+ symbol?: string;
563
+ };
564
+ };
565
+ }
566
+ //#endregion
567
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Meta/UserTokens.d.ts
568
+ interface UserTokenValidity {
569
+ 'user_token': string;
570
+ active: boolean;
571
+ issued?: number;
572
+ expires?: number;
573
+ }
574
+ //#endregion
575
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Meta/JwtPong.d.ts
576
+ interface JwtPong {
577
+ pong: boolean;
578
+ 'client_id': string;
579
+ state?: string;
580
+ scope?: string;
581
+ nonce?: string;
582
+ aud: string;
583
+ sub: string;
584
+ 'app_uuidv4': string;
585
+ 'app_name': string;
586
+ 'payload_uuidv4': string;
587
+ 'usertoken_uuidv4': string;
588
+ iat: number;
589
+ exp: number;
590
+ iss: string;
591
+ }
592
+ //#endregion
593
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Meta/HookHash.d.ts
594
+ interface HookHash {
595
+ name: string;
596
+ description: string;
597
+ creator?: {
598
+ name?: string;
599
+ mail?: string;
600
+ site?: string;
601
+ };
602
+ xapp?: string;
603
+ appuuid?: string;
604
+ icon?: string;
605
+ verifiedAccounts?: string[];
606
+ audits?: string[];
607
+ }
608
+ //#endregion
609
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Meta/HookHashes.d.ts
610
+ interface HookHashes {
611
+ [hash: string]: HookHash;
612
+ }
613
+ //#endregion
614
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Meta/Rails.d.ts
615
+ interface Endpoint {
616
+ name: string;
617
+ url: string;
618
+ }
619
+ interface Explorer {
620
+ name: string;
621
+ 'url_tx': string;
622
+ 'url_account'?: string;
623
+ 'url_ctid'?: string;
624
+ }
625
+ interface Rails {
626
+ [networkKey: string]: {
627
+ chain_id: number;
628
+ color: string;
629
+ name: string;
630
+ is_livenet: boolean;
631
+ native_asset: string;
632
+ endpoints: Endpoint[];
633
+ explorers: Explorer[];
634
+ rpc?: string;
635
+ definitions?: string;
636
+ icons: {
637
+ icon_square: string;
638
+ icon_asset: string;
639
+ };
640
+ };
641
+ }
642
+ //#endregion
643
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Payload/SubscriptionCallbackParams.d.ts
644
+ interface SubscriptionCallbackParams {
645
+ uuid: string;
646
+ data: AnyJson$1;
647
+ resolve: (resolveData?: unknown) => void;
648
+ payload: XummGetPayloadResponse;
649
+ }
650
+ //#endregion
651
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Payload/onPayloadEvent.d.ts
652
+ declare type onPayloadEvent = (subscriptionCallback: SubscriptionCallbackParams) => unknown | Promise<unknown> | void;
653
+ //#endregion
654
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Payload/PayloadAndSubscription.d.ts
655
+ interface PayloadAndSubscription extends PayloadSubscription {
656
+ created: XummPostPayloadResponse;
657
+ }
658
+ //#endregion
659
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Payload/PayloadSubscription.d.ts
660
+ interface PayloadSubscription {
661
+ payload: XummGetPayloadResponse;
662
+ resolved: Promise<unknown> | undefined;
663
+ resolve: (resolveData?: unknown) => void;
664
+ websocket: w3cwebsocket;
665
+ }
666
+ //#endregion
667
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Push/EventResponse.d.ts
668
+ interface EventResponse {
669
+ pushed: boolean;
670
+ uuid: string;
671
+ }
672
+ //#endregion
673
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Push/PushResponse.d.ts
674
+ interface PushResponse {
675
+ pushed: boolean;
676
+ }
677
+ //#endregion
678
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/Push/EventPushPostBody.d.ts
679
+ interface EventPushPostBody extends AnyJson$1 {
680
+ 'user_token'?: string;
681
+ 'user_uuid'?: string;
682
+ 'user_account'?: string;
683
+ subtitle?: string;
684
+ body?: string;
685
+ data?: AnyJson$1;
686
+ silent?: boolean;
687
+ }
688
+ //#endregion
689
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/xApp/xAppOttData.d.ts
690
+ interface xAppUserDeviceData extends AnyJson$1 {
691
+ currency: string;
692
+ platform: string;
693
+ }
694
+ interface xAppOriginData extends AnyJson$1 {
695
+ payload?: string;
696
+ }
697
+ interface xAppOrigin extends AnyJson$1 {
698
+ type?: string;
699
+ data?: xAppOriginData;
700
+ }
701
+ interface xAppAccountInfo extends AnyJson$1 {
702
+ account: string;
703
+ name?: string;
704
+ domain?: string;
705
+ blocked: boolean;
706
+ source: string;
707
+ kycApproved: boolean;
708
+ proSubscription: boolean;
709
+ profile?: {
710
+ slug: string | null;
711
+ profileUrl: string | null;
712
+ accountSlug: string | null;
713
+ payString: string | null;
714
+ };
715
+ }
716
+ interface xAppOttData extends AnyJson$1 {
717
+ locale?: string;
718
+ version?: string;
719
+ account?: string;
720
+ accountaccess?: string;
721
+ accounttype?: string;
722
+ style?: string;
723
+ origin?: xAppOrigin;
724
+ user: string;
725
+ user_device?: xAppUserDeviceData;
726
+ account_info: xAppAccountInfo;
727
+ nodetype?: string;
728
+ nodewss?: string;
729
+ networkid?: number;
730
+ currency?: string;
731
+ subscriptions?: string[];
732
+ }
733
+ //#endregion
734
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/xApp/xAppJwtOtt.d.ts
735
+ interface xAppJwtOttApp extends AnyJson$1 {
736
+ name: string;
737
+ }
738
+ interface xAppJwtOtt {
739
+ ott: xAppOttData;
740
+ app: xAppJwtOttApp;
741
+ jwt: string;
742
+ }
743
+ //#endregion
744
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/types/xApp/xAppJwtPong.d.ts
745
+ interface xAppJwtPong extends AnyJson$1 {
746
+ pong: boolean;
747
+ ott_uuidv4: string;
748
+ app_uuidv4: string;
749
+ app_name: string;
750
+ iat: number;
751
+ exp: number;
752
+ }
753
+ //#endregion
754
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/Meta.d.ts
755
+ declare class Meta {
756
+ private apiKey;
757
+ private apiSecret;
758
+ private isBrowser;
759
+ private jwtFlow;
760
+ private jwt?;
761
+ private injected;
762
+ private invoker?;
763
+ private authPromise?;
764
+ private authPromiseResolve?;
765
+ endpoint: string;
766
+ constructor(apiKey: string, apiSecret: string);
767
+ setEndpoint(endpoint: string): boolean;
768
+ private authorize;
769
+ call<T>(endpoint: string, httpMethod?: string, data?: CreatePayload | AnyJson$1): Promise<T> | never;
770
+ ping(): Promise<ApplicationDetails>;
771
+ getCuratedAssets(): Promise<CuratedAssetsResponse>;
772
+ getRates(currencyCode: string): Promise<RatesResponse>;
773
+ getKycStatus(userTokenOrAccount: string): Promise<keyof PossibleKycStatuses>;
774
+ getRails(): Promise<Rails>;
775
+ getHookHash(hookHash: string): Promise<HookHash>;
776
+ getHookHashes(): Promise<HookHashes>;
777
+ getTransaction(txHash: string): Promise<XrplTransaction>;
778
+ getNftokenDetail(tokenId: string): Promise<NftokenDetail> | never;
779
+ verifyUserTokens(userTokens: string[]): Promise<UserTokenValidity[]>;
780
+ _inject(Invoker: XummSdk): void;
781
+ }
782
+ //#endregion
783
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/Storage.d.ts
784
+ declare class Storage$1 {
785
+ private Meta;
786
+ constructor(MetaObject: Meta);
787
+ get(): Promise<AnyJson$1 | null>;
788
+ set(data?: AnyJson$1): Promise<boolean>;
789
+ delete(): Promise<boolean>;
790
+ }
791
+ //#endregion
792
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/Payload.d.ts
793
+ declare class Payload {
794
+ private Meta;
795
+ constructor(MetaObject: Meta);
796
+ resolvePayload(payload: string | XummGetPayloadResponse | XummPostPayloadResponse): Promise<XummGetPayloadResponse | null>;
797
+ create(payload: XummPostPayloadBodyJson | XummPostPayloadBodyBlob | XummJsonTransaction, returnErrors?: boolean): Promise<XummPostPayloadResponse | null>;
798
+ get(payload: string | XummPostPayloadResponse, returnErrors?: boolean): Promise<XummGetPayloadResponse | null>;
799
+ subscribe(payload: string | XummGetPayloadResponse | XummPostPayloadResponse, callback?: onPayloadEvent): Promise<PayloadSubscription>;
800
+ cancel(payload: string | XummGetPayloadResponse | XummPostPayloadResponse, returnErrors?: boolean): Promise<XummDeletePayloadResponse | null>;
801
+ createAndSubscribe(payload: XummPostPayloadBodyJson | XummPostPayloadBodyBlob | XummJsonTransaction, callback?: onPayloadEvent): Promise<PayloadAndSubscription>;
802
+ }
803
+ //#endregion
804
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/xApp.d.ts
805
+ declare class xApp$1 {
806
+ private Meta;
807
+ private userdata;
808
+ constructor(MetaObject: Meta);
809
+ get(ott: string): Promise<xAppOttData | null>;
810
+ }
811
+ //#endregion
812
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/Push.d.ts
813
+ declare class Push {
814
+ private Meta;
815
+ private userdata;
816
+ constructor(MetaObject: Meta);
817
+ event(data: EventPushPostBody): Promise<EventResponse>;
818
+ notification(data: EventPushPostBody): Promise<PushResponse>;
819
+ }
820
+ //#endregion
821
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/JwtUserdata.d.ts
822
+ declare class JwtUserdata {
823
+ private Meta;
824
+ constructor(MetaObject: Meta);
825
+ list(): Promise<string[]>;
826
+ get(key: string | string[]): Promise<AnyJson$1>;
827
+ delete(key: string): Promise<boolean>;
828
+ set(key: string, data: AnyJson$1): Promise<boolean>;
829
+ }
830
+ //#endregion
831
+ //#region ../../node_modules/.pnpm/xumm-sdk@1.11.2/node_modules/xumm-sdk/dist/src/index.d.ts
832
+ declare class XummSdk {
833
+ private Meta;
834
+ storage: Storage$1;
835
+ payload: Payload;
836
+ jwtUserdata: JwtUserdata;
837
+ Push: Push;
838
+ xApp: xApp$1;
839
+ constructor(apiKey?: string, apiSecret?: string);
840
+ private getEnv;
841
+ /**
842
+ * Proxy methods to Meta class below
843
+ */
844
+ ping(): Promise<ApplicationDetails>;
845
+ getCuratedAssets(): Promise<CuratedAssetsResponse>;
846
+ getRails(): Promise<Rails>;
847
+ getHookHashes(): Promise<HookHashes>;
848
+ getHookHash(hookHash: string): Promise<HookHash>;
849
+ getRates(currencyCode: string): Promise<RatesResponse>;
850
+ getKycStatus(userTokenOrAccount: string): Promise<"NONE" | "IN_PROGRESS" | "REJECTED" | "SUCCESSFUL">;
851
+ getTransaction(txHash: string): Promise<XrplTransaction>;
852
+ getNftokenDetail(tokenId: string): Promise<NftokenDetail>;
853
+ verifyUserTokens(userTokens: string[]): Promise<UserTokenValidity[]>;
854
+ verifyUserToken(token: string): Promise<UserTokenValidity | null>;
855
+ setEndpoint(endpoint: string): boolean;
856
+ caught(error: Error): void;
857
+ }
858
+ interface XummJwtOptionsStore {
859
+ get: (ott: string) => xAppJwtOtt | void;
860
+ set: (ott: string, ottData: xAppJwtOtt) => void;
861
+ }
862
+ interface XummSdkJwtOptions {
863
+ store?: XummJwtOptionsStore;
864
+ fatalHandler?: (error: Error) => void;
865
+ noAutoRetrieve?: boolean;
866
+ }
867
+ declare class XummSdkJwt extends XummSdk {
868
+ private ottResolved;
869
+ private jwt?;
870
+ private resolve;
871
+ private reject;
872
+ fatalHandler?: (error: Error) => void;
873
+ private store;
874
+ constructor(apiKeyOrJwt: string, ott?: string, options?: XummSdkJwtOptions);
875
+ _jwtStore(invoker: Meta, persistJwt: (jwt: string) => void): XummJwtOptionsStore;
876
+ getOttData(): Promise<xAppOttData>;
877
+ getJwt(): Promise<string | undefined>;
878
+ caught(error: Error): void;
879
+ }
880
+ //#endregion
881
+ //#region ../../node_modules/.pnpm/xumm-oauth2-pkce@2.8.7/node_modules/xumm-oauth2-pkce/dist/index.d.ts
882
+ interface XummProfile {
883
+ slug: string;
884
+ profileUrl: string;
885
+ accountSlug: string | null;
886
+ payString: string | null;
887
+ }
888
+ interface ResolvedFlow {
889
+ sdk: XummSdkJwt;
890
+ jwt: string;
891
+ me: {
892
+ sub: string;
893
+ picture: string;
894
+ account: string;
895
+ name?: string | null;
896
+ domain?: string | null;
897
+ blocked: boolean;
898
+ source: string;
899
+ kycApproved: boolean;
900
+ proSubscription: boolean;
901
+ profile?: XummProfile;
902
+ networkType?: string;
903
+ networkId?: number;
904
+ networkEndpoint?: string;
905
+ email?: string;
906
+ };
907
+ }
908
+ interface XummPkceEvent {
909
+ retrieved: () => void;
910
+ error: (error: Error) => void;
911
+ success: () => void;
912
+ loggedout: () => void;
913
+ }
914
+ //#endregion
915
+ //#region ../../node_modules/.pnpm/xumm-xapp-sdk@1.7.2/node_modules/xumm-xapp-sdk/dist/types.d.ts
916
+ declare type AnyJson = Record<string, any>;
917
+ interface qrEventData {
918
+ qrContents?: null;
919
+ reason: "USER_CLOSE" | "INVALID_QR" | "SCANNED";
920
+ }
921
+ interface payloadEventData {
922
+ reason: "DECLINED" | "SIGNED";
923
+ uuid: string;
924
+ }
925
+ interface destinationEventData {
926
+ destination?: {
927
+ address: string;
928
+ tag?: number;
929
+ name?: string;
930
+ };
931
+ info?: {
932
+ blackHole: boolean;
933
+ disallowIncomingXRP: false;
934
+ exist: boolean;
935
+ possibleExchange: false;
936
+ requireDestinationTag: boolean;
937
+ risk: "ERROR" | "UNKNOWS" | "PROBABLE" | "HIGH_PROBABILITY" | "CONFIRMED";
938
+ };
939
+ reason: "SELECTED" | "USER_CLOSE";
940
+ }
941
+ interface xAppEvent {
942
+ qr: (data: qrEventData) => void;
943
+ payload: (data: payloadEventData) => void;
944
+ destination: (data: destinationEventData) => void;
945
+ networkswitch: (data: xAppNetworkSwitch) => void;
946
+ }
947
+ interface xAppActionNavigate extends AnyJson {
948
+ xApp: string;
949
+ }
950
+ interface xAppActionOpenSignRequest extends AnyJson {
951
+ uuid: string;
952
+ }
953
+ interface xAppActionOpenBrowser extends AnyJson {
954
+ url: string;
955
+ }
956
+ interface xAppActionShare {
957
+ text?: string;
958
+ }
959
+ interface xAppActionClose {
960
+ refreshEvents?: boolean;
961
+ }
962
+ interface xAppActionTxDetails {
963
+ tx: string;
964
+ account: string;
965
+ }
966
+ interface xAppActionSelectDestination {
967
+ ignoreDestinationTag?: boolean;
968
+ }
969
+ interface xAppNetworkSwitch {
970
+ network?: string;
971
+ }
972
+ interface xAppEnvironment {
973
+ version: string;
974
+ ott: string;
975
+ }
976
+ //#endregion
977
+ //#region ../../node_modules/.pnpm/xumm-xapp-sdk@1.7.2/node_modules/xumm-xapp-sdk/dist/index.d.ts
978
+ declare interface xApp {
979
+ on<U extends keyof xAppEvent>(event: U, listener: xAppEvent[U]): this;
980
+ off<U extends keyof xAppEvent>(event: U, listener: xAppEvent[U]): this;
981
+ }
982
+ declare class xApp {
983
+ private xummEnvironment;
984
+ constructor();
985
+ getEnvironment(): xAppEnvironment;
986
+ navigate(navigateOptions: xAppActionNavigate): Promise<boolean | Error> | void;
987
+ openSignRequest(openSignRequestOptions: xAppActionOpenSignRequest | null | undefined): Promise<boolean | Error> | void;
988
+ selectDestination(selectDestinationOptions?: xAppActionSelectDestination): Promise<boolean | Error> | void;
989
+ openBrowser(openBrowserOptions: xAppActionOpenBrowser): Promise<boolean | Error> | void;
990
+ share(shareOptions: xAppActionShare): Promise<boolean | Error> | void;
991
+ scanQr(): Promise<boolean | Error> | void;
992
+ tx(txOptions: xAppActionTxDetails): Promise<boolean | Error> | void;
993
+ close(closeOptions?: xAppActionClose): Promise<boolean | Error> | void;
994
+ ready(): Promise<boolean | Error> | void;
995
+ customCommand(customCommand: string, customCommandOptions?: AnyJson): Promise<boolean | Error> | void;
996
+ }
997
+ //#endregion
998
+ //#region ../../node_modules/.pnpm/xumm@1.8.0/node_modules/xumm/dist/index.d.ts
999
+ interface UniversalSdkEvent {
1000
+ logout: () => void;
1001
+ ready: () => void;
1002
+ retrieving: () => void;
1003
+ }
1004
+ /**
1005
+ * Development?
1006
+ * npm run watch (tsc in watch mode)
1007
+ * npm run browserify-watch (watch, browserify tsc output)
1008
+ * npm run serve (webserver, :3001)
1009
+ * npm run dev (watch, nodemon dist/samples/index.js)
1010
+ * ngrok start dev (local :3001 to https:// dev URL)
1011
+ * > https://.../sample/
1012
+ */
1013
+ declare enum Runtimes {
1014
+ cli = "cli",
1015
+ browser = "browser",
1016
+ xapp = "xapp"
1017
+ }
1018
+ type Runtime = Record<Runtimes, boolean>;
1019
+ declare interface Xumm {
1020
+ on<U extends keyof UniversalSdkEvent>(event: U, listener: UniversalSdkEvent[U]): this;
1021
+ on<U extends keyof xAppEvent>(event: U, listener: xAppEvent[U]): this;
1022
+ on<U extends keyof XummPkceEvent>(event: U, listener: XummPkceEvent[U]): this;
1023
+ off<U extends keyof UniversalSdkEvent>(event: U, listener: UniversalSdkEvent[U]): this;
1024
+ off<U extends keyof xAppEvent>(event: U, listener: xAppEvent[U]): this;
1025
+ off<U extends keyof XummPkceEvent>(event: U, listener: XummPkceEvent[U]): this;
1026
+ }
1027
+ /**
1028
+ * The Promisified type takes an entire class and expects all methods
1029
+ * to return a Promise of their method's native return values
1030
+ */
1031
+ type Promisified<T> = { [K in keyof T]: T[K] extends ((...args: infer A) => infer R) ? (...args: A) => Promise<R> : T[K] };
1032
+ interface Environment {
1033
+ ott?: Promise<xAppOttData | undefined>;
1034
+ jwt?: Promise<{
1035
+ client_id: string;
1036
+ scope?: string;
1037
+ state?: string;
1038
+ aud: string;
1039
+ sub: string;
1040
+ email?: string;
1041
+ app_uuidv4: string;
1042
+ app_name: string;
1043
+ payload_uuidv4?: string;
1044
+ usertoken_uuidv4?: string;
1045
+ network_type?: string;
1046
+ network_endpoint?: string;
1047
+ network_id?: number;
1048
+ iat: number;
1049
+ exp: number;
1050
+ iss: string;
1051
+ usr?: string;
1052
+ net?: string;
1053
+ [key: string]: any;
1054
+ } | undefined>;
1055
+ openid?: Promise<{
1056
+ sub: string;
1057
+ email: string;
1058
+ picture: string;
1059
+ account: string;
1060
+ name: string;
1061
+ domain?: string;
1062
+ blocked: boolean;
1063
+ source?: string;
1064
+ kycApproved: boolean;
1065
+ proSubscription: boolean;
1066
+ networkType: string;
1067
+ networkEndpoint: string;
1068
+ networkId?: number;
1069
+ profile?: XummProfile;
1070
+ [key: string]: any;
1071
+ } | undefined>;
1072
+ bearer?: Promise<string>;
1073
+ retrieving: Promise<void>;
1074
+ ready: Promise<void>;
1075
+ success: Promise<void>;
1076
+ retrieved: Promise<void>;
1077
+ }
1078
+ declare class UnifiedUserData {
1079
+ account: Promise<string | undefined>;
1080
+ picture: Promise<string | undefined>;
1081
+ name: Promise<string | undefined>;
1082
+ domain: Promise<string | undefined>;
1083
+ source: Promise<string | undefined>;
1084
+ networkType: Promise<string | undefined>;
1085
+ networkEndpoint: Promise<string | undefined>;
1086
+ networkId: Promise<number | undefined>;
1087
+ blocked: Promise<boolean | undefined>;
1088
+ kycApproved: Promise<boolean | undefined>;
1089
+ proSubscription: Promise<boolean | undefined>;
1090
+ profile: Promise<XummProfile | undefined>;
1091
+ token: Promise<string | null>;
1092
+ }
1093
+ /**
1094
+ * This is where the magic happens
1095
+ */
1096
+ declare class Xumm extends EventEmitter {
1097
+ private instance;
1098
+ private jwtCredential;
1099
+ runtime: Runtime;
1100
+ state: {
1101
+ account: string;
1102
+ signedIn: boolean;
1103
+ };
1104
+ user: UnifiedUserData;
1105
+ environment: Environment;
1106
+ payload?: Promisified<Payload>;
1107
+ xapp?: xApp;
1108
+ userstore?: Promisified<JwtUserdata>;
1109
+ backendstore?: Promisified<Storage$1>;
1110
+ helpers?: Promisified<Pick<XummSdkJwt, "ping" | "getCuratedAssets" | "getKycStatus" | "getTransaction" | "verifyUserTokens" | "getRates" | "getNftokenDetail">>;
1111
+ push?: Promisified<Push>;
1112
+ private apiKeyOrJwt;
1113
+ private apiSecretOrOtt?;
1114
+ constructor(apiKeyOrJwt: string, apiSecretOrOtt?: string);
1115
+ private initialize;
1116
+ /**
1117
+ * PKCE
1118
+ */
1119
+ authorize(): Promise<ResolvedFlow | undefined | Error>;
1120
+ /**
1121
+ * TODO: CHECK IF EVENTS ARE NOT REGISTERED AND FIRING TWICE
1122
+ */
1123
+ private handlePkceEvents;
1124
+ logout(): Promise<void>;
1125
+ /**
1126
+ * SDK
1127
+ */
1128
+ ping(): Promise<ReturnType<XummSdk["ping"]> | undefined>;
1129
+ }
1130
+ //#endregion
1131
+ //#region src/xrp/utils.d.ts
1132
+ type WalletName = "XAMAN" | "GEM";
1133
+ interface WalletConfig {
1134
+ name: WalletName;
1135
+ instance: Xumm | typeof index_d_exports;
1136
+ }
1137
+ type XamanConfig = {
1138
+ name: "XAMAN";
1139
+ instance: Xumm;
1140
+ };
1141
+ type GemConfig = {
1142
+ name: "GEM";
1143
+ instance: typeof index_d_exports;
1144
+ };
1145
+ type WalletInitConfig = XamanConfig | GemConfig;
1146
+ type XrpWallet = "Xumm" | "GemWallet";
1147
+ declare function createXummPayload(message: string): Record<string, unknown>;
1148
+ declare function signXummTx(xummInstance: Xumm, payload: Record<string, unknown>): Promise<string>;
1149
+ declare function getXummPublicKey(wallet: Xumm): Promise<string | undefined>;
1150
+ declare function signGemWalletTx(gemWalletInstance: typeof index_d_exports, message: string): Promise<string | undefined>;
1151
+ declare function getGemWalletPublicKey(wallet: typeof index_d_exports): Promise<{
1152
+ address: string;
1153
+ publicKey: string;
1154
+ } | undefined>;
1155
+ declare function getXrpAddress(wallet: Xumm | typeof index_d_exports): Promise<string | undefined>;
1156
+ declare function looksLikeXrpWallet(wallet: unknown): wallet is Xumm | typeof index_d_exports;
1157
+ declare function getXrpWalletType(object: Record<string, unknown>): Promise<XrpWallet>;
1158
+ declare function getXrpTxHash(message: string | Uint8Array, wallet: Xumm | typeof index_d_exports): Promise<string | undefined>;
1159
+ declare function getXrpPublicKey(wallet: Xumm | typeof index_d_exports): Promise<{
1160
+ address: string;
1161
+ publicKey: string;
1162
+ } | undefined>;
1163
+ //#endregion
1164
+ export { GemConfig, WalletConfig, WalletInitConfig, WalletName, XamanConfig, createXummPayload, getGemWalletPublicKey, getXrpAddress, getXrpPublicKey, getXrpTxHash, getXrpWalletType, getXummPublicKey, looksLikeXrpWallet, signGemWalletTx, signXummTx };
1165
+ //# sourceMappingURL=utils.d.mts.map