wallaby-cash 3.9.0 → 3.11.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/api.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./r/oci-HLexJTv7.cjs");exports.Api=e.A,Object.defineProperty(exports,"ContentType",{enumerable:!0,get:()=>e.C}),exports.HttpClient=e.H;//# sourceMappingURL=api.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/api.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './generated/api';
package/dist/api.js ADDED
@@ -0,0 +1 @@
1
+ export{A as Api,C as ContentType,H as HttpClient}from"./r/oci-LZP1pL4V.js";//# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/api.mjs ADDED
@@ -0,0 +1 @@
1
+ export{A as Api,C as ContentType,H as HttpClient}from"./r/oci-LZP1pL4V.mjs";//# sourceMappingURL=api.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1435,6 +1435,76 @@ export interface BalanceResponseDto {
1435
1435
  */
1436
1436
  walletId?: string;
1437
1437
  }
1438
+ export interface BatchDeriveAddressesRequestDto {
1439
+ /**
1440
+ * Account indexes to derive addresses for, starting at 1. Each yields 13 addresses. Response order matches request order.
1441
+ * @maxItems 76
1442
+ * @minItems 1
1443
+ * @example [1,2,3]
1444
+ */
1445
+ accountIndexes: number[];
1446
+ /**
1447
+ * Chain to derive addresses for. One chain per request, so derivation stays a single enclave call.
1448
+ * @example "AVALANCHE"
1449
+ */
1450
+ chain: "BITCOIN" | "ETHEREUM" | "ALGORAND" | "AVALANCHE" | "POLYGON" | "BASE" | "BSC" | "SUI" | "INJECTIVE" | "SEI" | "APTOS" | "SOLANA" | "POLYMESH" | "HEDERA" | "CANTON";
1451
+ /** @example "e3421d7f9d6888ea83bef6b28ce0a2ab6eb6fe8a8fbfa3743240992590816b08f9a62edcc63296d056c552054d583fec36d23ef11dffb24c95aaf4a47d50dccc" */
1452
+ clientAuthPubKey: string;
1453
+ /**
1454
+ * Array of encrypted shares used to reconstruct the seed inside the enclave. There is no cached-seed path for this endpoint.
1455
+ * @maxItems 100
1456
+ */
1457
+ encryptedShares: EncryptedDataInterface[];
1458
+ /**
1459
+ * Message retrieved from the backend
1460
+ * @example "717ea458b62a430cb37ced7c22ebec97"
1461
+ */
1462
+ message: string;
1463
+ /**
1464
+ * Signature generated after signing the provided data field
1465
+ * @example "0xb44e88ff3c67de6e6548a6caf006bf6e1cb841119d0b9ea1b7e9b2d36a5e0ed42fd9f5e543243d1d73dc4b7800cc2026f74961f4edc769699678a316abb34e661c"
1466
+ */
1467
+ signature: string;
1468
+ /**
1469
+ * First addressIndex to derive for each account. Each request returns a fixed window of 13 addresses, so an account needing more is served by paging: request 13, then 26, and so on. Response keys are absolute addressIndexes, so pages merge without renumbering.
1470
+ * @min 0
1471
+ * @max 2147483635
1472
+ * @default 0
1473
+ * @example 0
1474
+ */
1475
+ startingAddressIndex?: number;
1476
+ /**
1477
+ * Wallet whose seed the addresses are derived from. accountIndex 0 is this wallet itself — the master custodial account — and is not derivable here.
1478
+ * @example "a4dedb83-4d59-41ca-84b5-4b24a98878d8"
1479
+ */
1480
+ walletId: string;
1481
+ }
1482
+ export interface BatchDeriveAddressesResponseDto {
1483
+ /** Derived addresses grouped by account index, in request order */
1484
+ accounts: BatchDerivedAddressesDto[];
1485
+ /**
1486
+ * Chain the addresses were derived for, echoed from the request.
1487
+ * @example "AVALANCHE"
1488
+ */
1489
+ chain: "BITCOIN" | "ETHEREUM" | "ALGORAND" | "AVALANCHE" | "POLYGON" | "BASE" | "BSC" | "SUI" | "INJECTIVE" | "SEI" | "APTOS" | "SOLANA" | "POLYMESH" | "HEDERA" | "CANTON";
1490
+ /**
1491
+ * Wallet the addresses were derived from, echoed from the request.
1492
+ * @example "a4dedb83-4d59-41ca-84b5-4b24a98878d8"
1493
+ */
1494
+ walletId: string;
1495
+ }
1496
+ export interface BatchDerivedAddressesDto {
1497
+ /**
1498
+ * Account index these addresses were derived for
1499
+ * @example 1
1500
+ */
1501
+ accountIndex: number;
1502
+ /**
1503
+ * Derived addresses keyed by addressIndex, "0" to "12"
1504
+ * @example {"0":"0xf00...","1":"0xba7...","12":"0xdead..."}
1505
+ */
1506
+ addresses: Record<string, string>;
1507
+ }
1438
1508
  export interface BulkBalanceQueryDto {
1439
1509
  /**
1440
1510
  * Array of balance query
@@ -2001,6 +2071,7 @@ export interface CreateWalletV2RequestDto {
2001
2071
  */
2002
2072
  walletOwnershipType: "SINGLE_OWNER";
2003
2073
  }
2074
+ export type DeriveBatchAddressesData = BatchDeriveAddressesResponseDto;
2004
2075
  export interface DetectRestrictionResponseDto {
2005
2076
  /**
2006
2077
  * Returns true if the transfer can proceed
@@ -4646,7 +4717,7 @@ export interface SeedPhraseReconstructRequestDto {
4646
4717
  * @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
4647
4718
  * @example "a4dedb83-4d59-41ca-84b5-4b24a98878d8"
4648
4719
  */
4649
- walletId?: string;
4720
+ walletId: string;
4650
4721
  }
4651
4722
  export interface SeedPhraseReconstructResponseDto {
4652
4723
  /**
@@ -5264,6 +5335,126 @@ export interface Transaction {
5264
5335
  /** User email to be used for notification */
5265
5336
  userEmail: string;
5266
5337
  }
5338
+ export interface TransactionHistoryItem {
5339
+ /**
5340
+ * Transaction amount
5341
+ * @minLength 1
5342
+ * @maxLength 256
5343
+ * @pattern ^-?\d*\.?\d+$
5344
+ * @example "919.381"
5345
+ */
5346
+ amount?: string;
5347
+ /**
5348
+ * Asset symbol
5349
+ * @minLength 2
5350
+ * @maxLength 256
5351
+ * @pattern ^[a-zA-Z0-9]+$
5352
+ * @example "ETH"
5353
+ */
5354
+ assetSymbol?: string;
5355
+ /**
5356
+ * The date and time when the transaction was created
5357
+ * @format date-time
5358
+ * @example "2023-01-01T00:00:00Z"
5359
+ */
5360
+ createdAt: string;
5361
+ /**
5362
+ * Asset valid address
5363
+ * @maxLength 256
5364
+ * @pattern ^[a-zA-Z0-9]+$
5365
+ * @example "0x9bf4001d307dfd62b26a2f1307ee0c0307632d59"
5366
+ */
5367
+ from: string;
5368
+ /**
5369
+ * Transaction gas
5370
+ * @example 56
5371
+ */
5372
+ gas: number;
5373
+ /**
5374
+ * Transaction gas price in base units
5375
+ * @example "1000000000"
5376
+ */
5377
+ gasPrice?: string;
5378
+ /**
5379
+ * Gas used by the transaction. Not populated by every blockchain.
5380
+ * @example 21000
5381
+ */
5382
+ gasUsed?: number;
5383
+ /**
5384
+ * Transaction Hash or Transaction ID
5385
+ * @minLength 32
5386
+ * @maxLength 256
5387
+ * @pattern ^(0x)?[0-9a-fA-F]+$
5388
+ * @example "0xceaa852ad3d76d042d413eedea9572547cc60dea515f0c90130e73fbcaa4af35"
5389
+ */
5390
+ hash: string;
5391
+ /**
5392
+ * @minLength 1
5393
+ * @maxLength 512000
5394
+ * @pattern ^(0x)?[0-9a-fA-F]+$
5395
+ */
5396
+ input?: string;
5397
+ /**
5398
+ * Transaction memo or note data
5399
+ * @minLength 1
5400
+ * @maxLength 256
5401
+ * @pattern ^.*$
5402
+ * @example "TX:Memo"
5403
+ */
5404
+ memo?: string;
5405
+ /**
5406
+ * Transaction nonce value
5407
+ * @example 4
5408
+ */
5409
+ nonce?: number;
5410
+ /**
5411
+ * Optional, only relevant for UTXO chains like BTC which have more than one sender/receiver
5412
+ * @maxItems 1000
5413
+ * @example []
5414
+ */
5415
+ origins?: UTXOFundsMove[];
5416
+ /**
5417
+ * Optional, only relevant for UTXO chains like BTC which have more than one sender/receiver
5418
+ * @maxItems 1000
5419
+ * @example []
5420
+ */
5421
+ recipients?: UTXOFundsMove[];
5422
+ /**
5423
+ * Transaction status
5424
+ * @example "PENDING"
5425
+ */
5426
+ status: "PENDING-APPROVAL" | "PENDING" | "FAILED" | "SUCCESSFUL" | "ABANDONED";
5427
+ /**
5428
+ * Transaction time in unix timestamp
5429
+ * @example 1652116478
5430
+ */
5431
+ timestamp: number;
5432
+ /**
5433
+ * Asset valid address
5434
+ * @maxLength 256
5435
+ * @pattern ^[a-zA-Z0-9]+$
5436
+ * @example "0xb44e88ff3c67de6e6548a6caf006bf6e1cb84111"
5437
+ */
5438
+ to: string;
5439
+ /** Raw chain-specific token transfer payloads attached to the transaction (e.g. Algorand asset-transfer transactions). The shape varies by blockchain and is passed through as-is. */
5440
+ tokenTransfers?: Record<string, any>[];
5441
+ /**
5442
+ * Type of the transaction depending on the blockchain
5443
+ * @minLength 1
5444
+ * @maxLength 256
5445
+ * @pattern ^[a-zA-Z0-9]+$
5446
+ * @example "pay"
5447
+ */
5448
+ transactionType?: string;
5449
+ /**
5450
+ * Transaction value in asset base units
5451
+ * @minLength 1
5452
+ * @maxLength 256
5453
+ * @pattern ^-?\d*\.?\d+$
5454
+ * @example "919.381"
5455
+ */
5456
+ value: string;
5457
+ }
5267
5458
  export interface TransactionHistoryResponse {
5268
5459
  /**
5269
5460
  * Account address
@@ -5276,7 +5467,7 @@ export interface TransactionHistoryResponse {
5276
5467
  * Transaction list response
5277
5468
  * @maxItems 5000
5278
5469
  */
5279
- transactions: Transaction[];
5470
+ transactions: TransactionHistoryItem[];
5280
5471
  }
5281
5472
  export interface TransactionResponse {
5282
5473
  /** Chain Slip 44 Number */
@@ -6923,7 +7114,7 @@ export interface WalletType {
6923
7114
  /** Wallet Type ID */
6924
7115
  id: number;
6925
7116
  /** Roles for this wallet type */
6926
- roles: ("single_sig" | "shares_single_owner" | "contract_admin" | "reserve_admin" | "wallets_admin" | "transfer_admin" | "soft_burn_admin" | "mint_admin" | "automation_admin")[];
7117
+ roles: ("single_sig" | "shares_single_owner" | "pooled_custodial" | "contract_admin" | "reserve_admin" | "wallets_admin" | "transfer_admin" | "soft_burn_admin" | "mint_admin" | "automation_admin")[];
6927
7118
  wallets: Wallet[];
6928
7119
  }
6929
7120
  export type WhitelistApiKeyOriginsData = AddMerchantApiKeyOriginResponseDto;
@@ -8539,6 +8730,24 @@ export declare namespace Wallets {
8539
8730
  };
8540
8731
  type ResponseBody = GenerateMissingAddressesData;
8541
8732
  }
8733
+ /**
8734
+ * No description
8735
+ * @tags Wallets
8736
+ * @name DeriveBatchAddresses
8737
+ * @summary Derives a fixed block of addresses for each requested account index, without persisting them
8738
+ * @request POST:/api/v1/wallets/derive-addresses/batch
8739
+ * @secure
8740
+ */
8741
+ namespace DeriveBatchAddresses {
8742
+ type RequestParams = {};
8743
+ type RequestQuery = {};
8744
+ type RequestBody = BatchDeriveAddressesRequestDto;
8745
+ type RequestHeaders = {
8746
+ /** A unique identifier for the request, used for tracing and debugging */
8747
+ "x-client-request-id"?: string;
8748
+ };
8749
+ type ResponseBody = DeriveBatchAddressesData;
8750
+ }
8542
8751
  /**
8543
8752
  * No description
8544
8753
  * @tags Wallets
@@ -10693,12 +10902,12 @@ export declare class HttpClient<SecurityDataType = unknown> {
10693
10902
  request: <T = any, E = any>({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }: FullRequestParams) => Promise<T>;
10694
10903
  }
10695
10904
  /**
10696
- * @title NCW Wallets Service
10697
- * @version 0.0.1
10905
+ * @title STAGING
10906
+ * @version 1.0
10698
10907
  * @baseUrl https://dev-testnet.wallaby.cash
10699
10908
  * @contact
10700
10909
  *
10701
- * The NCW Wallets Service is an API that manages the wallets of the Republic Crypto
10910
+ * The STAGING is an API that manages the wallets of the Republic Crypto
10702
10911
  */
10703
10912
  export declare class Api<SecurityDataType extends unknown> {
10704
10913
  http: HttpClient<SecurityDataType>;
@@ -11244,6 +11453,16 @@ export declare class Api<SecurityDataType extends unknown> {
11244
11453
  * @secure
11245
11454
  */
11246
11455
  generateMissingAddresses: (data: GenerateMissingAddressRequestDto, params?: RequestParams) => Promise<GenerateMissingAddressResponseDto>;
11456
+ /**
11457
+ * No description
11458
+ *
11459
+ * @tags Wallets
11460
+ * @name DeriveBatchAddresses
11461
+ * @summary Derives a fixed block of addresses for each requested account index, without persisting them
11462
+ * @request POST:/api/v1/wallets/derive-addresses/batch
11463
+ * @secure
11464
+ */
11465
+ deriveBatchAddresses: (data: BatchDeriveAddressesRequestDto, params?: RequestParams) => Promise<BatchDeriveAddressesResponseDto>;
11247
11466
  /**
11248
11467
  * No description
11249
11468
  *
@@ -1,4 +1,22 @@
1
1
  import { WallabyConfig } from '../types';
2
2
  export declare function isValidInput(input: string): boolean;
3
3
  export declare function isValidJwt(token: string): boolean;
4
+ /**
5
+ * BIP-39 only recognises the canonical form: NFKD-normalized, lowercase, single-space separated.
6
+ * Pasted phrases routinely carry newlines, double spaces or capitalization, none of which the
7
+ * enclave accepts, so normalize before validating and before sending. A phrase that only differs
8
+ * in those characters derives the same wallet, so this rescues the input rather than rejecting it.
9
+ */
10
+ export declare function normalizeSeedPhrase(seedPhrase: string): string;
11
+ /**
12
+ * True when the phrase is a valid BIP-39 mnemonic (checksum included) once normalized.
13
+ * Exposed so a UI can validate the field before submitting instead of catching a thrown error.
14
+ */
15
+ export declare function isValidSeedPhrase(seedPhrase: string): boolean;
16
+ /**
17
+ * Returns the normalized phrase, or throws the same 400 the enclave would return for it.
18
+ * Validating here keeps an invalid seed phrase off the wire and gives the caller an error that
19
+ * names the problem, instead of an opaque `Bad Request` from the far side of the API.
20
+ */
21
+ export declare function assertValidSeedPhrase(seedPhrase: string, message?: string): string;
4
22
  export declare function sanitizeConfig(config: WallabyConfig): WallabyConfig;