@veil-cash/sdk 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -99,6 +99,7 @@ interface NetworkAddresses {
99
99
  usdcPool: `0x${string}`;
100
100
  usdcQueue: `0x${string}`;
101
101
  usdcToken: `0x${string}`;
102
+ forwarderFactory: `0x${string}`;
102
103
  chainId: number;
103
104
  relayUrl: string;
104
105
  }
@@ -349,6 +350,124 @@ interface UtxoSelectionResult {
349
350
  /** Change amount to return to sender (wei) */
350
351
  changeAmount: bigint;
351
352
  }
353
+ /**
354
+ * Supported subaccount assets
355
+ */
356
+ type SubaccountAsset = 'eth' | 'usdc';
357
+ /**
358
+ * Deterministically derived subaccount slot metadata
359
+ */
360
+ interface SubaccountSlot {
361
+ slot: number;
362
+ childOwner: `0x${string}`;
363
+ childDepositKey: string;
364
+ salt: `0x${string}`;
365
+ forwarderAddress: `0x${string}`;
366
+ }
367
+ /**
368
+ * Relay-backed forwarder deploy request
369
+ */
370
+ interface SubaccountDeployRequest {
371
+ rootPrivateKey: `0x${string}`;
372
+ slot: number;
373
+ relayUrl?: string;
374
+ rpcUrl?: string;
375
+ }
376
+ /**
377
+ * Relay-backed forwarder sweep request
378
+ */
379
+ interface SubaccountSweepRequest {
380
+ forwarderAddress: `0x${string}`;
381
+ asset: SubaccountAsset;
382
+ relayUrl?: string;
383
+ }
384
+ /**
385
+ * Relay response for subaccount deploy/sweep operations
386
+ */
387
+ interface SubaccountRelayResult {
388
+ success: boolean;
389
+ transactionHash: string;
390
+ blockNumber: string;
391
+ gasUsed: string;
392
+ status: string;
393
+ network: string;
394
+ }
395
+ /**
396
+ * Human-readable and wei-denominated balance
397
+ */
398
+ interface SubaccountAssetBalance {
399
+ balance: string;
400
+ balanceWei: string;
401
+ }
402
+ /**
403
+ * Forwarder wallet balances for both supported assets
404
+ */
405
+ interface SubaccountBalances {
406
+ eth: SubaccountAssetBalance;
407
+ usdc: SubaccountAssetBalance;
408
+ }
409
+ /**
410
+ * Queue status for a specific asset
411
+ */
412
+ interface SubaccountQueueStatus {
413
+ asset: SubaccountAsset;
414
+ queueBalance: string;
415
+ queueBalanceWei: string;
416
+ pendingCount: number;
417
+ pendingDeposits: PendingDeposit[];
418
+ }
419
+ /**
420
+ * Combined subaccount status result
421
+ */
422
+ interface SubaccountStatusResult {
423
+ slot: SubaccountSlot;
424
+ deployed: boolean;
425
+ balances: SubaccountBalances;
426
+ queues: {
427
+ eth: SubaccountQueueStatus;
428
+ usdc: SubaccountQueueStatus;
429
+ };
430
+ }
431
+ /**
432
+ * Typed data for forwarder withdraw signing
433
+ */
434
+ interface SubaccountWithdrawTypedData {
435
+ domain: {
436
+ name: 'VeilForwarder';
437
+ version: string;
438
+ chainId: number;
439
+ verifyingContract: `0x${string}`;
440
+ };
441
+ types: {
442
+ Withdraw: Array<{
443
+ name: 'token' | 'to' | 'amount' | 'nonce' | 'deadline';
444
+ type: 'address' | 'uint256';
445
+ }>;
446
+ };
447
+ primaryType: 'Withdraw';
448
+ message: {
449
+ token: `0x${string}`;
450
+ to: `0x${string}`;
451
+ amount: bigint;
452
+ nonce: bigint;
453
+ deadline: bigint;
454
+ };
455
+ }
456
+ /**
457
+ * Built recovery transaction and signing metadata
458
+ */
459
+ interface SubaccountRecoveryResult {
460
+ transaction: TransactionData;
461
+ forwarderAddress: `0x${string}`;
462
+ asset: SubaccountAsset;
463
+ amount: string;
464
+ amountWei: string;
465
+ nonce: string;
466
+ deadline: string;
467
+ recipient: `0x${string}`;
468
+ tokenAddress: `0x${string}`;
469
+ signature: `0x${string}`;
470
+ }
352
471
 
353
472
  /**
354
473
  * Veil Keypair class
@@ -1015,6 +1134,10 @@ declare function selectCircuit(inputCount: number): string;
1015
1134
  * Contract addresses for Base mainnet
1016
1135
  */
1017
1136
  declare const ADDRESSES: NetworkAddresses;
1137
+ /**
1138
+ * Veil forwarder EIP-712 contract version
1139
+ */
1140
+ declare const FORWARDER_CONTRACT_VERSION: "1";
1018
1141
  /**
1019
1142
  * Pool configuration (decimals, symbols, etc.)
1020
1143
  */
@@ -1049,6 +1172,11 @@ declare function getPoolAddress(pool: RelayPool): `0x${string}`;
1049
1172
  * @returns Queue contract address
1050
1173
  */
1051
1174
  declare function getQueueAddress(pool: RelayPool): `0x${string}`;
1175
+ /**
1176
+ * Get the forwarder factory contract address
1177
+ * @returns Forwarder factory address for Base mainnet
1178
+ */
1179
+ declare function getForwarderFactoryAddress(): `0x${string}`;
1052
1180
  /**
1053
1181
  * Get Relay URL
1054
1182
  * @returns Relay URL for Base mainnet
@@ -2142,6 +2270,363 @@ declare const ERC20_ABI: readonly [{
2142
2270
  readonly stateMutability: "view";
2143
2271
  readonly type: "function";
2144
2272
  }];
2273
+ /**
2274
+ * Veil Forwarder Factory ABI
2275
+ */
2276
+ declare const FORWARDER_FACTORY_ABI: readonly [{
2277
+ readonly inputs: readonly [];
2278
+ readonly name: "CONTRACT_VERSION";
2279
+ readonly outputs: readonly [{
2280
+ readonly internalType: "string";
2281
+ readonly name: "";
2282
+ readonly type: "string";
2283
+ }];
2284
+ readonly stateMutability: "view";
2285
+ readonly type: "function";
2286
+ }, {
2287
+ readonly inputs: readonly [{
2288
+ readonly internalType: "bytes32";
2289
+ readonly name: "_salt";
2290
+ readonly type: "bytes32";
2291
+ }, {
2292
+ readonly internalType: "bytes";
2293
+ readonly name: "_childDepositKey";
2294
+ readonly type: "bytes";
2295
+ }, {
2296
+ readonly internalType: "address";
2297
+ readonly name: "_owner";
2298
+ readonly type: "address";
2299
+ }];
2300
+ readonly name: "computeAddress";
2301
+ readonly outputs: readonly [{
2302
+ readonly internalType: "address";
2303
+ readonly name: "";
2304
+ readonly type: "address";
2305
+ }];
2306
+ readonly stateMutability: "view";
2307
+ readonly type: "function";
2308
+ }, {
2309
+ readonly inputs: readonly [{
2310
+ readonly internalType: "bytes32";
2311
+ readonly name: "_salt";
2312
+ readonly type: "bytes32";
2313
+ }, {
2314
+ readonly internalType: "bytes";
2315
+ readonly name: "_childDepositKey";
2316
+ readonly type: "bytes";
2317
+ }, {
2318
+ readonly internalType: "address";
2319
+ readonly name: "_owner";
2320
+ readonly type: "address";
2321
+ }];
2322
+ readonly name: "deploy";
2323
+ readonly outputs: readonly [{
2324
+ readonly internalType: "address";
2325
+ readonly name: "forwarder";
2326
+ readonly type: "address";
2327
+ }];
2328
+ readonly stateMutability: "nonpayable";
2329
+ readonly type: "function";
2330
+ }, {
2331
+ readonly inputs: readonly [];
2332
+ readonly name: "relayer";
2333
+ readonly outputs: readonly [{
2334
+ readonly internalType: "address";
2335
+ readonly name: "";
2336
+ readonly type: "address";
2337
+ }];
2338
+ readonly stateMutability: "view";
2339
+ readonly type: "function";
2340
+ }, {
2341
+ readonly inputs: readonly [];
2342
+ readonly name: "veilEntry";
2343
+ readonly outputs: readonly [{
2344
+ readonly internalType: "address payable";
2345
+ readonly name: "";
2346
+ readonly type: "address";
2347
+ }];
2348
+ readonly stateMutability: "view";
2349
+ readonly type: "function";
2350
+ }, {
2351
+ readonly inputs: readonly [];
2352
+ readonly name: "usdc";
2353
+ readonly outputs: readonly [{
2354
+ readonly internalType: "address";
2355
+ readonly name: "";
2356
+ readonly type: "address";
2357
+ }];
2358
+ readonly stateMutability: "view";
2359
+ readonly type: "function";
2360
+ }, {
2361
+ readonly inputs: readonly [];
2362
+ readonly name: "owner";
2363
+ readonly outputs: readonly [{
2364
+ readonly internalType: "address";
2365
+ readonly name: "";
2366
+ readonly type: "address";
2367
+ }];
2368
+ readonly stateMutability: "view";
2369
+ readonly type: "function";
2370
+ }];
2371
+ /**
2372
+ * Veil Forwarder ABI
2373
+ */
2374
+ declare const FORWARDER_ABI: readonly [{
2375
+ readonly inputs: readonly [];
2376
+ readonly name: "CONTRACT_VERSION";
2377
+ readonly outputs: readonly [{
2378
+ readonly internalType: "string";
2379
+ readonly name: "";
2380
+ readonly type: "string";
2381
+ }];
2382
+ readonly stateMutability: "view";
2383
+ readonly type: "function";
2384
+ }, {
2385
+ readonly inputs: readonly [{
2386
+ readonly internalType: "address";
2387
+ readonly name: "_token";
2388
+ readonly type: "address";
2389
+ }, {
2390
+ readonly internalType: "address";
2391
+ readonly name: "_to";
2392
+ readonly type: "address";
2393
+ }, {
2394
+ readonly internalType: "uint256";
2395
+ readonly name: "_amount";
2396
+ readonly type: "uint256";
2397
+ }, {
2398
+ readonly internalType: "uint256";
2399
+ readonly name: "_nonce";
2400
+ readonly type: "uint256";
2401
+ }, {
2402
+ readonly internalType: "uint256";
2403
+ readonly name: "_deadline";
2404
+ readonly type: "uint256";
2405
+ }, {
2406
+ readonly internalType: "bytes";
2407
+ readonly name: "_signature";
2408
+ readonly type: "bytes";
2409
+ }];
2410
+ readonly name: "withdraw";
2411
+ readonly outputs: readonly [];
2412
+ readonly stateMutability: "nonpayable";
2413
+ readonly type: "function";
2414
+ }, {
2415
+ readonly inputs: readonly [{
2416
+ readonly internalType: "uint256";
2417
+ readonly name: "";
2418
+ readonly type: "uint256";
2419
+ }];
2420
+ readonly name: "usedNonces";
2421
+ readonly outputs: readonly [{
2422
+ readonly internalType: "bool";
2423
+ readonly name: "";
2424
+ readonly type: "bool";
2425
+ }];
2426
+ readonly stateMutability: "view";
2427
+ readonly type: "function";
2428
+ }, {
2429
+ readonly inputs: readonly [];
2430
+ readonly name: "owner";
2431
+ readonly outputs: readonly [{
2432
+ readonly internalType: "address";
2433
+ readonly name: "";
2434
+ readonly type: "address";
2435
+ }];
2436
+ readonly stateMutability: "view";
2437
+ readonly type: "function";
2438
+ }, {
2439
+ readonly inputs: readonly [];
2440
+ readonly name: "factory";
2441
+ readonly outputs: readonly [{
2442
+ readonly internalType: "address";
2443
+ readonly name: "";
2444
+ readonly type: "address";
2445
+ }];
2446
+ readonly stateMutability: "view";
2447
+ readonly type: "function";
2448
+ }, {
2449
+ readonly inputs: readonly [];
2450
+ readonly name: "childDepositKey";
2451
+ readonly outputs: readonly [{
2452
+ readonly internalType: "bytes";
2453
+ readonly name: "";
2454
+ readonly type: "bytes";
2455
+ }];
2456
+ readonly stateMutability: "view";
2457
+ readonly type: "function";
2458
+ }, {
2459
+ readonly inputs: readonly [];
2460
+ readonly name: "entry";
2461
+ readonly outputs: readonly [{
2462
+ readonly internalType: "address";
2463
+ readonly name: "";
2464
+ readonly type: "address";
2465
+ }];
2466
+ readonly stateMutability: "view";
2467
+ readonly type: "function";
2468
+ }, {
2469
+ readonly inputs: readonly [];
2470
+ readonly name: "usdc";
2471
+ readonly outputs: readonly [{
2472
+ readonly internalType: "address";
2473
+ readonly name: "";
2474
+ readonly type: "address";
2475
+ }];
2476
+ readonly stateMutability: "view";
2477
+ readonly type: "function";
2478
+ }, {
2479
+ readonly inputs: readonly [];
2480
+ readonly name: "sweepETH";
2481
+ readonly outputs: readonly [];
2482
+ readonly stateMutability: "nonpayable";
2483
+ readonly type: "function";
2484
+ }, {
2485
+ readonly inputs: readonly [];
2486
+ readonly name: "sweepUSDC";
2487
+ readonly outputs: readonly [];
2488
+ readonly stateMutability: "nonpayable";
2489
+ readonly type: "function";
2490
+ }, {
2491
+ readonly inputs: readonly [];
2492
+ readonly name: "eip712Domain";
2493
+ readonly outputs: readonly [{
2494
+ readonly internalType: "bytes1";
2495
+ readonly name: "fields";
2496
+ readonly type: "bytes1";
2497
+ }, {
2498
+ readonly internalType: "string";
2499
+ readonly name: "name";
2500
+ readonly type: "string";
2501
+ }, {
2502
+ readonly internalType: "string";
2503
+ readonly name: "version";
2504
+ readonly type: "string";
2505
+ }, {
2506
+ readonly internalType: "uint256";
2507
+ readonly name: "chainId";
2508
+ readonly type: "uint256";
2509
+ }, {
2510
+ readonly internalType: "address";
2511
+ readonly name: "verifyingContract";
2512
+ readonly type: "address";
2513
+ }, {
2514
+ readonly internalType: "bytes32";
2515
+ readonly name: "salt";
2516
+ readonly type: "bytes32";
2517
+ }, {
2518
+ readonly internalType: "uint256[]";
2519
+ readonly name: "extensions";
2520
+ readonly type: "uint256[]";
2521
+ }];
2522
+ readonly stateMutability: "view";
2523
+ readonly type: "function";
2524
+ }, {
2525
+ readonly type: "error";
2526
+ readonly name: "ZeroAddress";
2527
+ readonly inputs: readonly [];
2528
+ }, {
2529
+ readonly type: "error";
2530
+ readonly name: "ZeroAmount";
2531
+ readonly inputs: readonly [];
2532
+ }, {
2533
+ readonly type: "error";
2534
+ readonly name: "InvalidDepositKey";
2535
+ readonly inputs: readonly [];
2536
+ }, {
2537
+ readonly type: "error";
2538
+ readonly name: "NotRelayer";
2539
+ readonly inputs: readonly [];
2540
+ }, {
2541
+ readonly type: "error";
2542
+ readonly name: "NoETHBalance";
2543
+ readonly inputs: readonly [];
2544
+ }, {
2545
+ readonly type: "error";
2546
+ readonly name: "NoTokenBalance";
2547
+ readonly inputs: readonly [];
2548
+ }, {
2549
+ readonly type: "error";
2550
+ readonly name: "TokenApproveFailed";
2551
+ readonly inputs: readonly [];
2552
+ }, {
2553
+ readonly type: "error";
2554
+ readonly name: "ETHTransferFailed";
2555
+ readonly inputs: readonly [];
2556
+ }, {
2557
+ readonly type: "error";
2558
+ readonly name: "NonceUsed";
2559
+ readonly inputs: readonly [];
2560
+ }, {
2561
+ readonly type: "error";
2562
+ readonly name: "Unauthorized";
2563
+ readonly inputs: readonly [];
2564
+ }, {
2565
+ readonly type: "error";
2566
+ readonly name: "DeadlineExpired";
2567
+ readonly inputs: readonly [];
2568
+ }];
2569
+
2570
+ declare const MAX_SUBACCOUNT_SLOTS = 3;
2571
+ declare function deriveSubaccountChildPrivateKey(rootPrivateKey: string, slot: number): `0x${string}`;
2572
+ declare function deriveSubaccountSalt(rootPrivateKey: string, slot: number): `0x${string}`;
2573
+ declare function deriveSubaccountChildOwner(childPrivateKey: string): `0x${string}`;
2574
+ declare function deriveSubaccountChildDepositKey(childPrivateKey: string): string;
2575
+ declare function predictSubaccountForwarder(options: {
2576
+ salt: `0x${string}`;
2577
+ childDepositKey: string;
2578
+ childOwner: `0x${string}`;
2579
+ rpcUrl?: string;
2580
+ }): Promise<`0x${string}`>;
2581
+ declare function deriveSubaccountSlot(options: {
2582
+ rootPrivateKey: `0x${string}`;
2583
+ slot: number;
2584
+ rpcUrl?: string;
2585
+ }): Promise<SubaccountSlot>;
2586
+ declare function isSubaccountForwarderDeployed(options: {
2587
+ forwarderAddress: `0x${string}`;
2588
+ rpcUrl?: string;
2589
+ }): Promise<boolean>;
2590
+ declare function deploySubaccountForwarder(options: SubaccountDeployRequest): Promise<SubaccountRelayResult>;
2591
+ declare function sweepSubaccountForwarder(options: SubaccountSweepRequest): Promise<SubaccountRelayResult>;
2592
+ declare function getSubaccountStatus(options: {
2593
+ rootPrivateKey: `0x${string}`;
2594
+ slot: number;
2595
+ rpcUrl?: string;
2596
+ }): Promise<SubaccountStatusResult>;
2597
+ declare function buildSubaccountWithdrawTypedData(options: {
2598
+ forwarderAddress: `0x${string}`;
2599
+ token: `0x${string}`;
2600
+ to: `0x${string}`;
2601
+ amount: bigint;
2602
+ nonce: bigint;
2603
+ deadline: bigint;
2604
+ }): SubaccountWithdrawTypedData;
2605
+ declare function signSubaccountWithdraw(options: {
2606
+ childPrivateKey: `0x${string}`;
2607
+ typedData: SubaccountWithdrawTypedData;
2608
+ }): Promise<`0x${string}`>;
2609
+ declare function isSubaccountWithdrawNonceUsed(options: {
2610
+ forwarderAddress: `0x${string}`;
2611
+ nonce: bigint | number;
2612
+ rpcUrl?: string;
2613
+ }): Promise<boolean>;
2614
+ declare function findNextSubaccountWithdrawNonce(options: {
2615
+ forwarderAddress: `0x${string}`;
2616
+ startNonce?: bigint | number;
2617
+ maxScan?: bigint | number;
2618
+ rpcUrl?: string;
2619
+ }): Promise<bigint>;
2620
+ declare function buildSubaccountRecoveryTx(options: {
2621
+ rootPrivateKey: `0x${string}`;
2622
+ slot: number;
2623
+ asset: SubaccountAsset;
2624
+ to: `0x${string}`;
2625
+ amount: string;
2626
+ nonce?: bigint | number;
2627
+ deadline?: bigint | number;
2628
+ rpcUrl?: string;
2629
+ }): Promise<SubaccountRecoveryResult>;
2145
2630
 
2146
2631
  /**
2147
2632
  * Crypto utilities for Veil SDK
@@ -2212,4 +2697,4 @@ declare function getExtDataHash(extData: ExtDataInput): bigint;
2212
2697
  */
2213
2698
  declare function shuffle<T>(array: T[]): T[];
2214
2699
 
2215
- export { ADDRESSES, type BuildTransferProofOptions, type BuildWithdrawProofOptions, CIRCUIT_CONFIG, type DepositTxOptions, ENTRY_ABI, ERC20_ABI, type EncryptedMessage, type ExtData, type ExtDataInput, FIELD_SIZE, Keypair, MERKLE_TREE_HEIGHT, type MessageSigner, type NetworkAddresses, POOL_ABI, POOL_CONFIG, type PendingDeposit, type PoolConfig, type PrepareTransactionParams, type PrivateBalanceResult, type ProgressCallback, type ProofArgs, type ProofBuildResult, type ProofInput, QUEUE_ABI, type QueueBalanceResult, type RegisterTxOptions, RelayError, type RelayErrorResponse, type RelayExtData, type RelayMetadata, type RelayPool, type RelayProofArgs, type RelayRequest, type RelayResponse, type RelayType, type SubmitRelayOptions, type Token, type TransactionData, type TransactionResult, type TransferResult, Utxo, type UtxoInfo, type UtxoParams, type UtxoSelectionResult, VEIL_SIGNED_MESSAGE, type WithdrawResult, buildApproveUSDCTx, buildChangeDepositKeyTx, buildDepositETHTx, buildDepositTx, buildDepositUSDCTx, buildMerkleTree, buildRegisterTx, buildTransferProof, buildWithdrawProof, checkRecipientRegistration, checkRelayHealth, getAddresses, getExtDataHash, getMerklePath, getPoolAddress, getPrivateBalance, getQueueAddress, getQueueBalance, getRelayInfo, getRelayUrl, mergeUtxos, packEncryptedMessage, poseidonHash, poseidonHash2, prepareTransaction, prove, randomBN, selectCircuit, selectUtxosForWithdraw, shuffle, submitRelay, toBuffer, toFixedHex, transfer, unpackEncryptedMessage, withdraw };
2700
+ export { ADDRESSES, type BuildTransferProofOptions, type BuildWithdrawProofOptions, CIRCUIT_CONFIG, type DepositTxOptions, ENTRY_ABI, ERC20_ABI, type EncryptedMessage, type ExtData, type ExtDataInput, FIELD_SIZE, FORWARDER_ABI, FORWARDER_CONTRACT_VERSION, FORWARDER_FACTORY_ABI, Keypair, MAX_SUBACCOUNT_SLOTS, MERKLE_TREE_HEIGHT, type MessageSigner, type NetworkAddresses, POOL_ABI, POOL_CONFIG, type PendingDeposit, type PoolConfig, type PrepareTransactionParams, type PrivateBalanceResult, type ProgressCallback, type ProofArgs, type ProofBuildResult, type ProofInput, QUEUE_ABI, type QueueBalanceResult, type RegisterTxOptions, RelayError, type RelayErrorResponse, type RelayExtData, type RelayMetadata, type RelayPool, type RelayProofArgs, type RelayRequest, type RelayResponse, type RelayType, type SubaccountAsset, type SubaccountAssetBalance, type SubaccountBalances, type SubaccountDeployRequest, type SubaccountQueueStatus, type SubaccountRecoveryResult, type SubaccountRelayResult, type SubaccountSlot, type SubaccountStatusResult, type SubaccountSweepRequest, type SubaccountWithdrawTypedData, type SubmitRelayOptions, type Token, type TransactionData, type TransactionResult, type TransferResult, Utxo, type UtxoInfo, type UtxoParams, type UtxoSelectionResult, VEIL_SIGNED_MESSAGE, type WithdrawResult, buildApproveUSDCTx, buildChangeDepositKeyTx, buildDepositETHTx, buildDepositTx, buildDepositUSDCTx, buildMerkleTree, buildRegisterTx, buildSubaccountRecoveryTx, buildSubaccountWithdrawTypedData, buildTransferProof, buildWithdrawProof, checkRecipientRegistration, checkRelayHealth, deploySubaccountForwarder, deriveSubaccountChildDepositKey, deriveSubaccountChildOwner, deriveSubaccountChildPrivateKey, deriveSubaccountSalt, deriveSubaccountSlot, findNextSubaccountWithdrawNonce, getAddresses, getExtDataHash, getForwarderFactoryAddress, getMerklePath, getPoolAddress, getPrivateBalance, getQueueAddress, getQueueBalance, getRelayInfo, getRelayUrl, getSubaccountStatus, isSubaccountForwarderDeployed, isSubaccountWithdrawNonceUsed, mergeUtxos, packEncryptedMessage, poseidonHash, poseidonHash2, predictSubaccountForwarder, prepareTransaction, prove, randomBN, selectCircuit, selectUtxosForWithdraw, shuffle, signSubaccountWithdraw, submitRelay, sweepSubaccountForwarder, toBuffer, toFixedHex, transfer, unpackEncryptedMessage, withdraw };