wallaby-cash 3.17.0 → 3.19.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 (51) hide show
  1. package/README.md +52 -0
  2. package/dist/api.cjs +1 -1
  3. package/dist/api.js +1 -1
  4. package/dist/api.mjs +1 -1
  5. package/dist/base.d.ts +6 -0
  6. package/dist/generated/api.d.ts +296 -17
  7. package/dist/index.cjs +11 -11
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.ts +12 -1
  10. package/dist/index.js +11 -11
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.mjs +11 -11
  13. package/dist/index.mjs.map +1 -1
  14. package/dist/lib/attestation/attestation.service.d.ts +95 -0
  15. package/dist/lib/attestation/crypto.d.ts +2 -2
  16. package/dist/lib/attestation/errors.d.ts +19 -2
  17. package/dist/lib/attestation/identity-signature.d.ts +61 -0
  18. package/dist/lib/attestation/index.d.ts +12 -5
  19. package/dist/lib/attestation/pcr-allowlist.d.ts +25 -0
  20. package/dist/lib/attestation/verify-key-derivation-signature.d.ts +69 -0
  21. package/dist/lib/attestation/verify-transaction-signature.d.ts +77 -0
  22. package/dist/lib/attestation/verify.d.ts +12 -7
  23. package/dist/lib/attestation/x509.d.ts +3 -7
  24. package/dist/lib/enclave/constants.d.ts +21 -0
  25. package/dist/lib/enclave/errors.d.ts +32 -0
  26. package/dist/lib/enclave/index.d.ts +7 -0
  27. package/dist/lib/enclave/manifest.d.ts +70 -0
  28. package/dist/lib/enclave/spki.d.ts +10 -0
  29. package/dist/lib/enclave/verify.d.ts +15 -0
  30. package/dist/lib/transactions/index.d.ts +6 -5
  31. package/dist/lib/utils/cipher.service.d.ts +21 -3
  32. package/dist/lib/wallet/wallet-data.service.d.ts +2 -2
  33. package/dist/lib/wallet/wallet-handlers.service.d.ts +24 -4
  34. package/dist/lib/wallet/wallet.service.d.ts +3 -1
  35. package/dist/package.json +13 -20
  36. package/dist/r/{oci-al0xoD5i.cjs → oci-41IbhfX7.cjs} +1 -1
  37. package/dist/r/{oci-al0xoD5i.cjs.map → oci-41IbhfX7.cjs.map} +1 -1
  38. package/dist/r/oci-DDfN2lh2.js +1 -0
  39. package/dist/r/{oci-DzAn0PLg.js.map → oci-DDfN2lh2.js.map} +1 -1
  40. package/dist/r/oci-DDfN2lh2.mjs +1 -0
  41. package/dist/r/{oci-DzAn0PLg.mjs.map → oci-DDfN2lh2.mjs.map} +1 -1
  42. package/dist/types/attestation.d.ts +36 -2
  43. package/dist/types/base.d.ts +13 -0
  44. package/dist/types/error-response-codes.d.ts +1 -0
  45. package/dist/types/transactions.d.ts +0 -4
  46. package/dist/types/wallet.d.ts +2 -8
  47. package/dist/verification/polymesh/verify.d.ts +1 -2
  48. package/package.json +13 -20
  49. package/dist/lib/attestation/pinned-measurements.d.ts +0 -37
  50. package/dist/r/oci-DzAn0PLg.js +0 -1
  51. package/dist/r/oci-DzAn0PLg.mjs +0 -1
package/README.md CHANGED
@@ -180,6 +180,58 @@ discriminant (`'api' | 'network' | 'validation' | 'sdk'`) and a `toJSON()` for l
180
180
  See [RUNTIME_VALIDATION.md](./RUNTIME_VALIDATION.md) for how it works, what's covered, and what's
181
181
  still in progress.
182
182
 
183
+ ## Enclave attestation verification (opt-in)
184
+
185
+ > **Opt-in and not yet load-bearing.** This is off by default, so existing integrations see no
186
+ > behavior change. Its presence is **not** the attestation guarantee having landed: the production
187
+ > manifest-signing keys (until they are embedded, a production SDK fails closed with an
188
+ > `EnclaveManifestError` whose `reason` is `keys-not-configured`) and the binding between the attested
189
+ > identity and the keys seed material is encrypted to are still being rolled out. Don't treat enabling
190
+ > it as a security boundary yet.
191
+
192
+ `options.attestationVerification` makes the SDK verify the enclave's image **before** it decrypts
193
+ and re-encrypts any seed material for transport to it:
194
+
195
+ ```javascript
196
+ const wallaby = new Wallaby({
197
+ ...config,
198
+ options: { attestationVerification: 'throw' }, // 'throw' | 'warn' | 'off' — default 'off'
199
+ });
200
+ ```
201
+
202
+ - **`'off'`** (default): nothing is fetched or checked.
203
+ - **`'warn'`**: the enclave is verified; a failure is logged via the SDK logger and the request proceeds.
204
+ - **`'throw'`**: the enclave is verified; a failure aborts the request before any seed material is prepared.
205
+
206
+ On each guarded request the SDK fetches a fresh attestation document (a new CSPRNG nonce per call,
207
+ verified on echo) and runs the five checks: decode, certificate chain to the pinned AWS Nitro root,
208
+ ES384 signature, PCR0/1/2 triple against the enclave manifest's permitted builds, and nonce.
209
+
210
+ The permitted PCR triples are not baked into the SDK. They come from a signed manifest fetched from
211
+ a hardcoded endpoint (`https://enclave-manifest.wallaby.cash/manifest.json`, or the `dev-` host unless
212
+ `options.environment` is `'production'`) shaped `{ payload, signatures }`. The SDK base64-decodes the
213
+ payload, verifies a secp256k1 signature over `sha256(payload)` against the trusted keys embedded in the
214
+ SDK, and only then reads its `builds`. Any failure raises an `EnclaveManifestError` (fail closed). You can
215
+ read the verified PCRs yourself with `getEnclavePcrs({ isProduction })`.
216
+
217
+ The same service is public as `wallaby.attestation`, for callers that want to verify on demand rather than
218
+ gate requests: `await wallaby.attestation.verify()` fetches an attestation document (fresh nonce) and the
219
+ signed manifest, runs all five checks, and returns `{ verified: true, documentInfo }` — the decoded, verified
220
+ attestation document, including its PCRs and the enclave identity public key — or throws as below.
221
+
222
+ In `'throw'` mode a failed check is raised as the matching `AttestationVerificationError` subclass
223
+ (`AttestationDecodeError`, `AttestationChainError`, `AttestationSignatureError`, `AttestationPcrError`,
224
+ `AttestationNonceError`), whose `step` and `reason` name what failed.
225
+
226
+ The gate currently covers operations that go through `prepareTransactionAuth` /
227
+ `prepareWalletOperationAuth` (transfers, allowances, pending-transaction resolution, address
228
+ generation, access verification, adding tokens), and `wallet.export()` when it has to send the primary
229
+ key share to the enclave to reconstruct the seed phrase (an export served from a locally stored seed
230
+ phrase or key shares never contacts the enclave, so it is not gated). It does **not** yet cover swaps,
231
+ wallet import, or wallet creation/recovery.
232
+
233
+ Each guarded request costs one extra round trip plus a certificate-chain verification.
234
+
183
235
  ## Generated API
184
236
 
185
237
  The `wallaby-sdk-js` includes automatically generated TypeScript types from the API Swagger specification:
package/dist/api.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./r/oci-al0xoD5i.cjs");exports.Api=e.A,exports.HttpClient=e.H;//# sourceMappingURL=api.cjs.map
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./r/oci-41IbhfX7.cjs");exports.Api=e.A,exports.HttpClient=e.H;//# sourceMappingURL=api.cjs.map
package/dist/api.js CHANGED
@@ -1 +1 @@
1
- export{A as Api,H as HttpClient}from"./r/oci-DzAn0PLg.js";//# sourceMappingURL=api.js.map
1
+ export{A as Api,H as HttpClient}from"./r/oci-DDfN2lh2.js";//# sourceMappingURL=api.js.map
package/dist/api.mjs CHANGED
@@ -1 +1 @@
1
- export{A as Api,H as HttpClient}from"./r/oci-DzAn0PLg.mjs";//# sourceMappingURL=api.mjs.map
1
+ export{A as Api,H as HttpClient}from"./r/oci-DDfN2lh2.mjs";//# sourceMappingURL=api.mjs.map
package/dist/base.d.ts CHANGED
@@ -30,6 +30,12 @@ export declare abstract class Base {
30
30
  * }
31
31
  */
32
32
  get deviceLocalStorage(): LocalStorage;
33
+ get attestationVerificationMode(): import("./types").AttestationVerificationMode;
34
+ /**
35
+ * Whether the SDK is configured for production (`options.environment`, defaulting to `NODE_ENV`, is `'production'`).
36
+ * Selects which signed enclave manifest — and which trusted signing keys — apply.
37
+ */
38
+ protected get isProductionEnvironment(): boolean;
33
39
  private get validationMode();
34
40
  /**
35
41
  * @private
@@ -295,6 +295,47 @@ export interface AdminForceClaimRequestDto {
295
295
  */
296
296
  walletId: string;
297
297
  }
298
+ export interface AdminForceTransferRequestDto {
299
+ /**
300
+ * Asset symbol
301
+ * @minLength 1
302
+ * @maxLength 50
303
+ * @example "SUI"
304
+ */
305
+ assetSymbol: string;
306
+ /**
307
+ * Blockchain name
308
+ * @example "ETHEREUM"
309
+ */
310
+ blockchainName: "BITCOIN" | "ETHEREUM" | "ALGORAND" | "AVALANCHE" | "POLYGON" | "BASE" | "BSC" | "SUI" | "INJECTIVE" | "SEI" | "APTOS" | "SOLANA" | "POLYMESH" | "HEDERA" | "CANTON";
311
+ /** @example "e3421d7f9d6888ea83bef6b28ce0a2ab6eb6fe8a8fbfa3743240992590816b08f9a62edcc63296d056c552054d583fec36d23ef11dffb24c95aaf4a47d50dccc" */
312
+ clientAuthPubKey: string;
313
+ /** Seed encrypted symmetrically by the enclave master key */
314
+ encryptedSeed: SymmetricEncryptedDto;
315
+ /**
316
+ * Message retrieved from the backend
317
+ * @pattern /^[0-9a-fA-F]{32,128}$/
318
+ * @example "717ea458b62a430cb37ced7c22ebec97"
319
+ */
320
+ message: string;
321
+ /**
322
+ * Signature generated after signing the provided data field
323
+ * @example "0xb44e88ff3c67de6e6548a6caf006bf6e1cb841119d0b9ea1b7e9b2d36a5e0ed42fd9f5e543243d1d73dc4b7800cc2026f74961f4edc769699678a316abb34e661c"
324
+ */
325
+ signature: string;
326
+ /**
327
+ * List of force transfers to perform. Each entry is relayed as its own transaction
328
+ * @maxItems 5000
329
+ * @minItems 1
330
+ */
331
+ transfers: ForceTransferItemDto[];
332
+ /**
333
+ * Wallet ID of the reserve admin wallet signing the transfer(s)
334
+ * @format uuid
335
+ * @example "123e4567-e89b-12d3-a456-426614174000"
336
+ */
337
+ walletId: string;
338
+ }
298
339
  export interface AdminMintRequestDto {
299
340
  /**
300
341
  * Asset symbol
@@ -708,8 +749,14 @@ export interface AllowanceTransactionRequestDto {
708
749
  walletId: string;
709
750
  }
710
751
  export interface AllowanceTransactionResponseDto {
752
+ /** The enclave's raw signing response for this transaction, so a caller can verify the signature came from a genuine enclave without trusting the transport. See TransactionResponseDto.signingReceipt. */
753
+ signingReceipt?: SignTransactionResponse;
711
754
  /** The transaction's details */
712
755
  transaction: Transaction;
756
+ /** Every unsigned transaction the API built and sent to the enclave in this call, in signing order, so a caller can recompute each digest offline and check its fields against the original intent. Usually one entry; more when a flow signs several transactions at once (e.g. an allowance plus a swap). */
757
+ unsignedTxBundles: UnsignedTxBundleEntryDto[];
758
+ /** The exact digest(s) sent to the enclave for signing, in signing order. Equals the `messages` of every entry in `unsignedTxBundles`, concatenated in order. */
759
+ unsignedTxDigests: string[];
713
760
  }
714
761
  export interface ApiKey {
715
762
  /** Whether the API key allows mobile access */
@@ -874,7 +921,7 @@ export interface AppOptInRequestDto {
874
921
  */
875
922
  walletId: string;
876
923
  }
877
- export type AppOptInTransactionData = TransactionResponseDto;
924
+ export type AppOptInTransactionData = OptInTransactionResponseDto;
878
925
  export type ArchiveAssetData = VerifyAssetConfigResponseDto;
879
926
  export interface ArchiveAssetParams {
880
927
  /**
@@ -901,20 +948,20 @@ export interface AssetConfig {
901
948
  chainName: "BITCOIN" | "ETHEREUM" | "ALGORAND" | "AVALANCHE" | "POLYGON" | "BASE" | "BSC" | "SUI" | "INJECTIVE" | "SEI" | "APTOS" | "SOLANA" | "POLYMESH" | "HEDERA" | "CANTON";
902
949
  contractAddress?: string | null;
903
950
  /** The version of the RestrictedLockupToken contract */
904
- contractVersion?: string | null;
951
+ contractVersion?: string;
905
952
  /** The merchant who created the asset */
906
- createdByMerchant?: AssetConfigMerchantDto | null;
953
+ createdByMerchant?: AssetConfigMerchantDto;
907
954
  /** The merchant id who created the asset */
908
955
  createdByMerchantId?: string | null;
909
- createdByUser?: User | null;
956
+ createdByUser?: User;
910
957
  /** The user id who created the asset */
911
958
  createdByUserId?: string | null;
912
959
  /** @example 18 */
913
960
  decimals: number;
914
961
  description?: string | null;
915
962
  /** Chain-specific extended configuration for the asset (arbitrary key-value pairs) */
916
- extendedConfiguration?: Record<string, any> | null;
917
- iconUrl?: string | null;
963
+ extendedConfiguration?: Record<string, any>;
964
+ iconUrl?: string;
918
965
  /** Asset ID */
919
966
  id: string;
920
967
  /**
@@ -935,7 +982,7 @@ export interface AssetConfig {
935
982
  /** This field specify if an asset owned by a single wallet or requires multiple signatures to broadcast a transaction */
936
983
  ownershipType?: "SINGLE_OWNER" | "MULTI_SIG";
937
984
  /** The address of the forwarder contract to use with this token */
938
- relayerAddress?: string | null;
985
+ relayerAddress?: string;
939
986
  /**
940
987
  * Whether the asset requires KYC verification
941
988
  * @example false
@@ -1049,7 +1096,7 @@ export interface AssetOptInRequestDto {
1049
1096
  */
1050
1097
  walletId: string;
1051
1098
  }
1052
- export type AssetOptInTransactionData = TransactionResponseDto;
1099
+ export type AssetOptInTransactionData = OptInTransactionResponseDto;
1053
1100
  export interface AssetPriceData {
1054
1101
  /**
1055
1102
  * Change percentage in the last 24 hours
@@ -1476,6 +1523,30 @@ export interface BalanceResponseDto {
1476
1523
  */
1477
1524
  walletId?: string;
1478
1525
  }
1526
+ export interface BatchDerivationSignatureDto {
1527
+ /**
1528
+ * Path whose public key is `chainPublicKey`, echoed verbatim from the enclave response. Part of what the signature covers.
1529
+ * @example "m/44'/60'/0'/0/0"
1530
+ */
1531
+ chainPath: string;
1532
+ /** Public key derived from `chainPath`, echoed verbatim from the enclave response. */
1533
+ chainPublicKey: string;
1534
+ /** Raw per-path public keys the signature covers, in enclave order — the same data `accounts` is built from, kept verbatim so a verifier can rebuild exactly what was signed without recomputing addresses. */
1535
+ publicKeys: DerivedPublicKeyDto[];
1536
+ /** Signature scheme used for this batch, echoed verbatim from the enclave response. */
1537
+ scheme: "secp256k1" | "ed25519" | "sr25519";
1538
+ /**
1539
+ * The `sessionId` the derivation was requested under, echoed back by the enclave so a caller can check it against the value it sent. Covered by the signature.
1540
+ * @pattern /^[0-9a-fA-F]{32,128}$/
1541
+ */
1542
+ sessionId: string;
1543
+ /**
1544
+ * Enclave identity-key signature over `sessionId` and the payload fields of this object (with `chain` and `walletId` where the response carries them), so a caller can verify these public keys came from a genuine enclave rather than a substituted transport. Verify it against an identity pub taken from a verified attestation document — see docs/identity-key-signature-format.md in the crypto-control-enclave repo for the construction.
1545
+ * @pattern ^0x[0-9a-f]{130}$
1546
+ * @example "0xababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab"
1547
+ */
1548
+ signature: string;
1549
+ }
1479
1550
  export interface BatchDeriveAddressesRequestDto {
1480
1551
  /**
1481
1552
  * Account indexes to derive addresses for, starting at 1. Each yields 13 addresses. Response order matches request order.
@@ -1529,6 +1600,8 @@ export interface BatchDeriveAddressesResponseDto {
1529
1600
  * @example "AVALANCHE"
1530
1601
  */
1531
1602
  chain: "BITCOIN" | "ETHEREUM" | "ALGORAND" | "AVALANCHE" | "POLYGON" | "BASE" | "BSC" | "SUI" | "INJECTIVE" | "SEI" | "APTOS" | "SOLANA" | "POLYMESH" | "HEDERA" | "CANTON";
1603
+ /** Enclave identity-key signature over this batch, so a caller can verify it without trusting the transport. Same envelope as `derivationSignature` on generateMissingAddresses (`sessionId` + `signature`), with the batch payload the signature covers. Absent when the enclave did not sign the response. */
1604
+ derivationSignature?: BatchDerivationSignatureDto;
1532
1605
  /**
1533
1606
  * Wallet the addresses were derived from, echoed from the request.
1534
1607
  * @example "a4dedb83-4d59-41ca-84b5-4b24a98878d8"
@@ -1561,6 +1634,8 @@ export interface BulkBalanceResponseDto {
1561
1634
  */
1562
1635
  balances: BalanceResponseDto[];
1563
1636
  }
1637
+ /** What this transaction is. Determines how a client should reconstruct and verify `bundle`. */
1638
+ export type BundleTxType = "TRANSFER_TX" | "OPTIN_TX" | "ALLOWANCE_TX" | "SWAP_ALLOWANCE_TX" | "SWAP_TX" | "CLAIM_DIVIDEND_TX" | "APPROVE_PENDING_TX" | "DENY_PENDING_TX" | "AUTO_ACCEPT_TX";
1564
1639
  export type BurnData = AdminTxResponseWrapper;
1565
1640
  export interface BurnRequestItemDto {
1566
1641
  /**
@@ -2123,7 +2198,50 @@ export interface CreateWalletV2RequestDto {
2123
2198
  */
2124
2199
  walletOwnershipType?: "SINGLE_OWNER";
2125
2200
  }
2201
+ export interface DerivationSignatureDto {
2202
+ /** Raw derivation results the signature covers, in enclave order — the same data the derived addresses/keys above are built from, kept verbatim so a verifier can rebuild exactly what was signed. */
2203
+ derivations: DerivedChainKeyDto[];
2204
+ /**
2205
+ * The `sessionId` the derivation was requested under, echoed back by the enclave so a caller can check it against the value it sent. Covered by the signature.
2206
+ * @pattern /^[0-9a-fA-F]{32,128}$/
2207
+ */
2208
+ sessionId: string;
2209
+ /**
2210
+ * Enclave identity-key signature over `sessionId` and the payload fields of this object (with `chain` and `walletId` where the response carries them), so a caller can verify these public keys came from a genuine enclave rather than a substituted transport. Verify it against an identity pub taken from a verified attestation document — see docs/identity-key-signature-format.md in the crypto-control-enclave repo for the construction.
2211
+ * @pattern ^0x[0-9a-f]{130}$
2212
+ * @example "0xababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab"
2213
+ */
2214
+ signature: string;
2215
+ }
2126
2216
  export type DeriveBatchAddressesData = BatchDeriveAddressesResponseDto;
2217
+ export interface DerivedChainKeyDto {
2218
+ /** Chain identifier (e.g. ETH, BTC, SOL) */
2219
+ chain: string;
2220
+ /**
2221
+ * Derivation path this public key was derived from, echoed verbatim from the request. Absent only for SR25519, where the path is optional and an absent path means the root key.
2222
+ * @example "m/44'/60'/0'/0/0"
2223
+ */
2224
+ derivationPath?: string;
2225
+ /**
2226
+ * Derived public key. SECP256K1: compressed 33-byte hex, no prefix. ED25519: 32-byte hex with 0x prefix.
2227
+ * @pattern /^(0x)?[0-9a-fA-F]+$/
2228
+ */
2229
+ publicKey: string;
2230
+ /** Signature scheme this public key was derived under. */
2231
+ scheme: "secp256k1" | "ed25519" | "sr25519";
2232
+ }
2233
+ export interface DerivedPublicKeyDto {
2234
+ /**
2235
+ * Derivation path this public key was derived from.
2236
+ * @example "m/44'/501'/0'/0'"
2237
+ */
2238
+ derivationPath: string;
2239
+ /**
2240
+ * Derived public key. SECP256K1: compressed 33-byte hex, no prefix. ED25519: 32-byte hex with 0x prefix.
2241
+ * @pattern /^(0x)?[0-9a-fA-F]+$/
2242
+ */
2243
+ publicKey: string;
2244
+ }
2127
2245
  export interface DetectRestrictionResponseDto {
2128
2246
  /**
2129
2247
  * Returns true if the transfer can proceed
@@ -2325,6 +2443,8 @@ export interface ExecuteSwapResponseDto {
2325
2443
  * @example "provider.scan/txn_abc123"
2326
2444
  */
2327
2445
  explorerLink: string;
2446
+ /** The enclave's raw signing response for this swap, so a caller can verify the signature(s) came from a genuine enclave without trusting the transport. See TransactionResponseDto.signingReceipt. */
2447
+ signingReceipt?: SignTransactionResponse;
2328
2448
  /**
2329
2449
  * The status of the swap execution
2330
2450
  * @example "in_progress"
@@ -2340,6 +2460,10 @@ export interface ExecuteSwapResponseDto {
2340
2460
  * @example "0x2767143ab32e685e9f6b44e9b539ac0b8396f83b2505419e0056e501a193f19d"
2341
2461
  */
2342
2462
  transactionHash: string;
2463
+ /** Every unsigned transaction the API built and sent to the enclave in this call, in signing order, so a caller can recompute each digest offline and check its fields against the original intent. Usually one entry; more when a flow signs several transactions at once (e.g. an allowance plus a swap). */
2464
+ unsignedTxBundles: UnsignedTxBundleEntryDto[];
2465
+ /** The exact digest(s) sent to the enclave for signing, in signing order. Equals the `messages` of every entry in `unsignedTxBundles`, concatenated in order. */
2466
+ unsignedTxDigests: string[];
2343
2467
  }
2344
2468
  export interface FeeEstimatesResponseDto {
2345
2469
  /**
@@ -2562,6 +2686,30 @@ export interface FetchTransactionsParams {
2562
2686
  export type FetchWalletBulkBalanceData = BulkBalanceResponseDto;
2563
2687
  export type ForceClaimData = AdminTxResponse;
2564
2688
  export type ForceClaimPrincipalData = AdminTxResponse;
2689
+ export type ForceTransferData = AdminTxResponseWrapper;
2690
+ export interface ForceTransferItemDto {
2691
+ /**
2692
+ * Amount of the asset to transfer, in the base unit of the token
2693
+ * @example "1000"
2694
+ */
2695
+ amount: string;
2696
+ /**
2697
+ * The address to transfer the tokens from. Must match the address format of the blockchain
2698
+ * @minLength 1
2699
+ * @maxLength 100
2700
+ * @pattern ^(0x[0-9a-fA-F]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
2701
+ * @example "0xFf07a12eE165F0fAC3048ADb409ab314fCFb142C"
2702
+ */
2703
+ from: string;
2704
+ /**
2705
+ * The address to transfer the tokens to. Must already have a holder record on the token contract, and must match the address format of the blockchain
2706
+ * @minLength 1
2707
+ * @maxLength 100
2708
+ * @pattern ^(0x[0-9a-fA-F]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
2709
+ * @example "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"
2710
+ */
2711
+ to: string;
2712
+ }
2565
2713
  export type GenerateExternalSignatureMessageData = AuthSignatureMessageResponseDto;
2566
2714
  export interface GenerateMissingAddressRequestDto {
2567
2715
  /**
@@ -2597,6 +2745,8 @@ export interface GenerateMissingAddressRequestDto {
2597
2745
  walletId: string;
2598
2746
  }
2599
2747
  export interface GenerateMissingAddressResponseDto {
2748
+ /** Enclave identity-key signature over the keys just derived, so a caller can verify them without trusting the transport. Absent when no addresses needed generating (nothing was derived, nothing was signed). */
2749
+ derivationSignature?: DerivationSignatureDto;
2600
2750
  /**
2601
2751
  * Wallet addresses (with their type) that were generated or already existed for the wallet
2602
2752
  * @maxItems 100
@@ -4451,6 +4601,21 @@ export interface ObjectType {
4451
4601
  */
4452
4602
  updatedAt: string;
4453
4603
  }
4604
+ export interface OptInTransactionResponseDto {
4605
+ /**
4606
+ * Transaction reference supplied in the request
4607
+ * @example "a4dedb83-4d59-41ca-84b5-4b24a98878d8"
4608
+ */
4609
+ reference: string;
4610
+ /** The enclave's raw signing response for this transaction, so a caller can verify the signature came from a genuine enclave without trusting the transport. See TransactionResponseDto.signingReceipt. */
4611
+ signingReceipt?: SignTransactionResponse;
4612
+ /** Transaction hash of the broadcasted opt-in transaction */
4613
+ transactionHash: string;
4614
+ /** Every unsigned transaction the API built and sent to the enclave in this call, in signing order, so a caller can recompute each digest offline and check its fields against the original intent. Usually one entry; more when a flow signs several transactions at once (e.g. an allowance plus a swap). */
4615
+ unsignedTxBundles: UnsignedTxBundleEntryDto[];
4616
+ /** The exact digest(s) sent to the enclave for signing, in signing order. Equals the `messages` of every entry in `unsignedTxBundles`, concatenated in order. */
4617
+ unsignedTxDigests: string[];
4618
+ }
4454
4619
  export interface PaginationDto {
4455
4620
  currentPage: number;
4456
4621
  nextPage: number | null;
@@ -4713,11 +4878,17 @@ export interface ResolvePendingTransactionResponseDto {
4713
4878
  * @maxLength 256
4714
4879
  */
4715
4880
  id: string;
4881
+ /** The enclave's raw signing response for this transaction, so a caller can verify the signature(s) came from a genuine enclave without trusting the transport. See TransactionResponseDto.signingReceipt. */
4882
+ signingReceipt?: SignTransactionResponse;
4716
4883
  /**
4717
4884
  * Final status of the transaction
4718
4885
  * @example "confirmed"
4719
4886
  */
4720
4887
  status: "confirmed" | "denied";
4888
+ /** Every unsigned transaction the API built and sent to the enclave in this call, in signing order, so a caller can recompute each digest offline and check its fields against the original intent. Usually one entry; more when a flow signs several transactions at once (e.g. an allowance plus a swap). */
4889
+ unsignedTxBundles: UnsignedTxBundleEntryDto[];
4890
+ /** The exact digest(s) sent to the enclave for signing, in signing order. Equals the `messages` of every entry in `unsignedTxBundles`, concatenated in order. */
4891
+ unsignedTxDigests: string[];
4721
4892
  }
4722
4893
  export interface RevokeMerchantAdminResponseDto {
4723
4894
  /**
@@ -4817,6 +4988,44 @@ export interface ShowMerchantAssetResponseDto {
4817
4988
  }
4818
4989
  export type ShowMerchantAssetToWalletHoldersData = ShowMerchantAssetResponseDto;
4819
4990
  export type SignInData = AuthResponseDto;
4991
+ export interface SignResultDto {
4992
+ /**
4993
+ * The original message that was signed
4994
+ * @maxLength 4096
4995
+ */
4996
+ message: string;
4997
+ /**
4998
+ * The signature of the message as a hex string (optionally 0x-prefixed)
4999
+ * @maxLength 4096
5000
+ * @pattern /^(0x)?[0-9a-fA-F]+$/
5001
+ */
5002
+ signature: string;
5003
+ }
5004
+ export interface SignTransactionResponse {
5005
+ /**
5006
+ * The derivation path used for signing
5007
+ * @maxLength 256
5008
+ */
5009
+ derivationPath: string;
5010
+ /**
5011
+ * Signing results, one per input message
5012
+ * @maxItems 200
5013
+ */
5014
+ results: SignResultDto[];
5015
+ /** Signature scheme used for signing */
5016
+ scheme: "secp256k1" | "ed25519" | "sr25519";
5017
+ /**
5018
+ * An ephemeral identifier for the current session
5019
+ * @maxLength 128
5020
+ * @pattern /^[0-9a-fA-F]{32,128}$/
5021
+ */
5022
+ sessionId: string;
5023
+ /**
5024
+ * Enclave identity-key signature over this response, so a client can detect a substituted result without trusting the transport. Covers sessionId, scheme, derivationPath and every entry of results, as one signature over the whole ordered batch. Verify it against an identity pub taken from a verified attestation document, and take walletId from local state rather than from this response - see docs/identity-key-signature-format.md for the construction.
5025
+ * @pattern ^0x[0-9a-f]{130}$
5026
+ */
5027
+ signature: string;
5028
+ }
4820
5029
  export type SignUpData = AuthResponseDto;
4821
5030
  export type SignUpExternalData = AuthResponseDto;
4822
5031
  export interface SigninRequestDto {
@@ -5649,8 +5858,14 @@ export interface TransactionResponseDto {
5649
5858
  * @example "Transaction successfully broadcasted"
5650
5859
  */
5651
5860
  message?: string;
5861
+ /** The enclave's raw signing response for this transaction (sessionId, scheme, derivationPath, per-message results, and the enclave identity-key signature over all of it), so a caller can verify the signatures came from a genuine enclave without trusting the transport. Verify `signature` against an identity pub taken from a verified attestation document; `walletId` should come from local state, never from this response. Optional: not every signing path populates it yet. */
5862
+ signingReceipt?: SignTransactionResponse;
5652
5863
  /** Transaction hash of the broadcasted transaction */
5653
5864
  transaction: Transaction;
5865
+ /** Every unsigned transaction the API built and sent to the enclave in this call, in signing order, so a caller can recompute each digest offline and check its fields against the original intent. Usually one entry; more when a flow signs several transactions at once (e.g. an allowance plus a swap). */
5866
+ unsignedTxBundles: UnsignedTxBundleEntryDto[];
5867
+ /** The exact digest(s) sent to the enclave for signing, in signing order. Equals the `messages` of every entry in `unsignedTxBundles`, concatenated in order. */
5868
+ unsignedTxDigests: string[];
5654
5869
  }
5655
5870
  export interface TransactionStatusDataResponseDto {
5656
5871
  /**
@@ -5869,6 +6084,39 @@ export interface UnarchiveAssetParams {
5869
6084
  */
5870
6085
  assetConfigId: string;
5871
6086
  }
6087
+ export interface UnsignedTxBundleDto {
6088
+ /** Public key of the address that signs the transaction */
6089
+ addressPublicKey: string;
6090
+ /**
6091
+ * SLIP-44 coin type of the chain the transaction was built for
6092
+ * @example 60
6093
+ */
6094
+ chainSlip: 0 | 60 | 283 | 9000 | 966 | 519 | 8453 | 784 | 2525 | 19000118 | 637 | 501 | 595 | 3030 | 6767;
6095
+ /** The exact message(s) sent to the enclave for signing. Order matches the order signatures are applied to the transaction. */
6096
+ messages: string[];
6097
+ /** Signing metadata used to call the enclave */
6098
+ signing: UnsignedTxSigningDto;
6099
+ /** The serialized unsigned transaction exactly as the chain adapter built it. Encoding depends on the chain (e.g. RLP hex for EVM, PSBT for Bitcoin, base64 message for Solana). */
6100
+ unsignedTx: string;
6101
+ }
6102
+ export interface UnsignedTxBundleEntryDto {
6103
+ /** The unsigned transaction exactly as the chain adapter built it */
6104
+ bundle: UnsignedTxBundleDto;
6105
+ /**
6106
+ * What this transaction is. Determines how a client should reconstruct and verify `bundle`.
6107
+ * @example "TRANSFER_TX"
6108
+ */
6109
+ txType: BundleTxType;
6110
+ }
6111
+ export interface UnsignedTxSigningDto {
6112
+ /**
6113
+ * The derivation path the enclave signs with
6114
+ * @maxLength 256
6115
+ */
6116
+ derivationPath: string;
6117
+ /** Signature scheme the enclave signs the digest(s) with */
6118
+ scheme: "secp256k1" | "ed25519" | "sr25519";
6119
+ }
5872
6120
  export type UnverifyAssetData = VerifyAssetConfigResponseDto;
5873
6121
  export interface UnverifyAssetParams {
5874
6122
  /**
@@ -6293,12 +6541,12 @@ export interface User {
6293
6541
  * User first name
6294
6542
  * @example "Bryan"
6295
6543
  */
6296
- firstName?: string | null;
6544
+ firstName?: string;
6297
6545
  /**
6298
6546
  * User roles with full permissions
6299
6547
  * @example true
6300
6548
  */
6301
- hasFullPermissions?: boolean;
6549
+ hasFullPermissions: boolean;
6302
6550
  /** User primary key */
6303
6551
  id: string;
6304
6552
  /**
@@ -6322,7 +6570,7 @@ export interface User {
6322
6570
  * User Role ID
6323
6571
  * @example "merchant_admin"
6324
6572
  */
6325
- role: "super_admin" | "merchant_admin" | "merchant_user" | "wallet_user" | "contract_admin" | "reserve_admin" | "wallets_admin" | "transfer_admin" | "soft_burn_admin" | "mint_admin" | "automation_admin" | null;
6573
+ role: "super_admin" | "merchant_admin" | "merchant_user" | "wallet_user" | "contract_admin" | "reserve_admin" | "wallets_admin" | "transfer_admin" | "soft_burn_admin" | "mint_admin" | "automation_admin";
6326
6574
  /**
6327
6575
  * Updated at
6328
6576
  * @format date-time
@@ -6405,6 +6653,8 @@ export interface UserAsset {
6405
6653
  claimablePaymentTokenAssetConfigId?: string | null;
6406
6654
  /** Asset Payment Token Contract Address */
6407
6655
  claimablePaymentTokenContractAddress?: string | null;
6656
+ /** Configuration of the asset */
6657
+ config: AssetConfig;
6408
6658
  /** Asset ID */
6409
6659
  configId: string;
6410
6660
  /**
@@ -6524,6 +6774,7 @@ export interface UserAssetDto {
6524
6774
  claimablePaymentTokenAssetConfigId?: string | null;
6525
6775
  /** Asset Payment Token Contract Address */
6526
6776
  claimablePaymentTokenContractAddress?: string | null;
6777
+ /** Configuration of the asset */
6527
6778
  config: AssetConfig;
6528
6779
  /** Asset ID */
6529
6780
  configId: string;
@@ -6635,7 +6886,7 @@ export interface UserDto {
6635
6886
  * User first name
6636
6887
  * @example "Bryan"
6637
6888
  */
6638
- firstName?: string | null;
6889
+ firstName?: string;
6639
6890
  /** User primary key */
6640
6891
  id: string;
6641
6892
  /**
@@ -6647,9 +6898,9 @@ export interface UserDto {
6647
6898
  * User's Polymesh identity
6648
6899
  * @example "0x73ecca5cf1ecaa365a7d1f1e5dbc91737c73fe0a96b41386f574dfb915a913a7"
6649
6900
  */
6650
- polymeshDID?: string | null;
6901
+ polymeshDID?: string;
6651
6902
  /** @example "wallet_user" */
6652
- role?: "super_admin" | "merchant_admin" | "merchant_user" | "wallet_user" | "contract_admin" | "reserve_admin" | "wallets_admin" | "transfer_admin" | "soft_burn_admin" | "mint_admin" | "automation_admin" | null;
6903
+ role?: "super_admin" | "merchant_admin" | "merchant_user" | "wallet_user" | "contract_admin" | "reserve_admin" | "wallets_admin" | "transfer_admin" | "soft_burn_admin" | "mint_admin" | "automation_admin";
6653
6904
  /**
6654
6905
  * Updated at
6655
6906
  * @format date-time
@@ -10623,6 +10874,24 @@ export declare namespace AdminTransactions {
10623
10874
  };
10624
10875
  type ResponseBody = BurnData;
10625
10876
  }
10877
+ /**
10878
+ * No description
10879
+ * @tags Admin-Transactions
10880
+ * @name ForceTransfer
10881
+ * @summary Request the transfer of an asset between address(es), ignoring transfer restrictions
10882
+ * @request POST:/api/v1/transactions/admin/force-transfer
10883
+ * @secure
10884
+ */
10885
+ namespace ForceTransfer {
10886
+ type RequestParams = {};
10887
+ type RequestQuery = {};
10888
+ type RequestBody = AdminForceTransferRequestDto;
10889
+ type RequestHeaders = {
10890
+ /** A unique identifier for the request, used for tracing and debugging */
10891
+ "x-client-request-id"?: string;
10892
+ };
10893
+ type ResponseBody = ForceTransferData;
10894
+ }
10626
10895
  /**
10627
10896
  * No description
10628
10897
  * @tags Admin-Transactions
@@ -10932,7 +11201,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
10932
11201
  /**
10933
11202
  * @title NCW Wallets Service
10934
11203
  * @version 0.0.1
10935
- * @baseUrl https://dev-testnet.wallaby.cash
11204
+ * @baseUrl http://staging-testnet.wallaby.cash
10936
11205
  * @contact
10937
11206
  *
10938
11207
  * The NCW Wallets Service is an API that manages the wallets of the Republic Crypto
@@ -11652,7 +11921,7 @@ export declare class Api<SecurityDataType extends unknown> {
11652
11921
  * @request POST:/api/v1/transactions/asset-optin
11653
11922
  * @secure
11654
11923
  */
11655
- assetOptInTransaction: (data: AssetOptInRequestDto, params?: RequestParams) => Promise<TransactionResponseDto>;
11924
+ assetOptInTransaction: (data: AssetOptInRequestDto, params?: RequestParams) => Promise<OptInTransactionResponseDto>;
11656
11925
  /**
11657
11926
  * No description
11658
11927
  *
@@ -11662,7 +11931,7 @@ export declare class Api<SecurityDataType extends unknown> {
11662
11931
  * @request POST:/api/v1/transactions/app-optin
11663
11932
  * @secure
11664
11933
  */
11665
- appOptInTransaction: (data: AppOptInRequestDto, params?: RequestParams) => Promise<TransactionResponseDto>;
11934
+ appOptInTransaction: (data: AppOptInRequestDto, params?: RequestParams) => Promise<OptInTransactionResponseDto>;
11666
11935
  /**
11667
11936
  * No description
11668
11937
  *
@@ -12004,6 +12273,16 @@ export declare class Api<SecurityDataType extends unknown> {
12004
12273
  * @secure
12005
12274
  */
12006
12275
  burn: (data: AdminBurnRequestDto, params?: RequestParams) => Promise<AdminTxResponseWrapper>;
12276
+ /**
12277
+ * No description
12278
+ *
12279
+ * @tags Admin-Transactions
12280
+ * @name ForceTransfer
12281
+ * @summary Request the transfer of an asset between address(es), ignoring transfer restrictions
12282
+ * @request POST:/api/v1/transactions/admin/force-transfer
12283
+ * @secure
12284
+ */
12285
+ forceTransfer: (data: AdminForceTransferRequestDto, params?: RequestParams) => Promise<AdminTxResponseWrapper>;
12007
12286
  /**
12008
12287
  * No description
12009
12288
  *