@piprail/sdk 1.1.1 → 1.3.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
@@ -838,7 +838,7 @@ declare const CHAINS: {
838
838
  gasPrice: bigint;
839
839
  maxFeePerBlobGas?: undefined | undefined;
840
840
  maxFeePerGas?: undefined | undefined;
841
- maxPriorityFeePerGas?: undefined | undefined;
841
+ maxPriorityFeePerGas? /** Native coin metadata. Defaults to 18-decimal ETH. */: undefined | undefined;
842
842
  isSystemTx?: undefined | undefined;
843
843
  mint?: undefined | undefined;
844
844
  sourceHash?: undefined | undefined;
@@ -1580,7 +1580,7 @@ declare const CHAINS: {
1580
1580
  yParity: number;
1581
1581
  accessList: viem.AccessList;
1582
1582
  authorizationList?: undefined | undefined;
1583
- blobVersionedHashes? /** EVM chain id, e.g. 5000 for Mantle. */: undefined | undefined;
1583
+ blobVersionedHashes?: undefined | undefined;
1584
1584
  chainId: number;
1585
1585
  type: "eip1559";
1586
1586
  gasPrice?: undefined | undefined;
@@ -2982,7 +2982,7 @@ declare const CHAINS: {
2982
2982
  } | {
2983
2983
  blockHash: `0x${string}` | null;
2984
2984
  blockNumber: bigint | null;
2985
- blockTimestamp? /** JSON-RPC endpoint. */: bigint | undefined;
2985
+ blockTimestamp?: bigint | undefined;
2986
2986
  from: abitype.Address;
2987
2987
  gas: bigint;
2988
2988
  hash: viem.Hash;
@@ -3340,7 +3340,9 @@ declare const CHAINS: {
3340
3340
  value: bigint;
3341
3341
  yParity: number;
3342
3342
  accessList: viem.AccessList;
3343
- authorizationList?: undefined | undefined;
3343
+ authorizationList
3344
+ /** JSON-RPC endpoint. */
3345
+ ? /** JSON-RPC endpoint. */: undefined | undefined;
3344
3346
  blobVersionedHashes?: undefined | undefined;
3345
3347
  chainId: number;
3346
3348
  type: "eip2930";
@@ -3614,6 +3616,122 @@ declare const CHAINS: {
3614
3616
  };
3615
3617
  };
3616
3618
  };
3619
+ hyperevm: {
3620
+ chain: {
3621
+ blockExplorers: {
3622
+ readonly default: {
3623
+ readonly name: "HyperEVMScan";
3624
+ readonly url: "https://hyperevmscan.io";
3625
+ };
3626
+ };
3627
+ blockTime?: number | undefined | undefined;
3628
+ contracts: {
3629
+ readonly multicall3: {
3630
+ readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
3631
+ readonly blockCreated: 13051;
3632
+ };
3633
+ };
3634
+ ensTlds?: readonly string[] | undefined;
3635
+ id: 999;
3636
+ name: "HyperEVM";
3637
+ nativeCurrency: {
3638
+ readonly name: "HYPE";
3639
+ readonly symbol: "HYPE";
3640
+ readonly decimals: 18;
3641
+ };
3642
+ experimental_preconfirmationTime?: number | undefined | undefined;
3643
+ rpcUrls: {
3644
+ readonly default: {
3645
+ readonly http: readonly ["https://rpc.hyperliquid.xyz/evm"];
3646
+ };
3647
+ };
3648
+ sourceId?: number | undefined | undefined;
3649
+ testnet: false;
3650
+ custom?: Record<string, unknown> | undefined;
3651
+ extendSchema?: Record<string, unknown> | undefined;
3652
+ fees?: viem.ChainFees<undefined> | undefined;
3653
+ formatters?: undefined;
3654
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
3655
+ client: viem.Client;
3656
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
3657
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
3658
+ client: viem.Client;
3659
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
3660
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
3661
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
3662
+ }] | undefined;
3663
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
3664
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
3665
+ };
3666
+ tokens: {
3667
+ USDC: {
3668
+ address: "0xb88339CB7199b77E23DB6E890353E22632Ba630f";
3669
+ decimals: number;
3670
+ symbol: string;
3671
+ };
3672
+ };
3673
+ };
3674
+ monad: {
3675
+ chain: {
3676
+ blockExplorers: {
3677
+ readonly default: {
3678
+ readonly name: "MonadVision";
3679
+ readonly url: "https://monadvision.com";
3680
+ };
3681
+ readonly monadscan: {
3682
+ readonly name: "Monadscan";
3683
+ readonly url: "https://monadscan.com";
3684
+ readonly apiUrl: "https://api.monadscan.com/api";
3685
+ };
3686
+ };
3687
+ blockTime: 400;
3688
+ contracts: {
3689
+ readonly multicall3: {
3690
+ readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
3691
+ readonly blockCreated: 9248132;
3692
+ };
3693
+ };
3694
+ ensTlds?: readonly string[] | undefined;
3695
+ id: 143;
3696
+ name: "Monad";
3697
+ nativeCurrency: {
3698
+ readonly name: "Monad";
3699
+ readonly symbol: "MON";
3700
+ readonly decimals: 18;
3701
+ };
3702
+ experimental_preconfirmationTime?: number | undefined | undefined;
3703
+ rpcUrls: {
3704
+ readonly default: {
3705
+ readonly http: readonly ["https://rpc.monad.xyz", "https://rpc1.monad.xyz"];
3706
+ readonly webSocket: readonly ["wss://rpc.monad.xyz", "wss://rpc1.monad.xyz"];
3707
+ };
3708
+ };
3709
+ sourceId?: number | undefined | undefined;
3710
+ testnet: false;
3711
+ custom?: Record<string, unknown> | undefined;
3712
+ extendSchema?: Record<string, unknown> | undefined;
3713
+ fees?: viem.ChainFees<undefined> | undefined;
3714
+ formatters?: undefined;
3715
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
3716
+ client: viem.Client;
3717
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
3718
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
3719
+ client: viem.Client;
3720
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
3721
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
3722
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
3723
+ }] | undefined;
3724
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
3725
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
3726
+ };
3727
+ tokens: {
3728
+ USDC: {
3729
+ address: "0x754704Bc059F8C67012fEd69BC8A327a5aafb603";
3730
+ decimals: number;
3731
+ symbol: string;
3732
+ };
3733
+ };
3734
+ };
3617
3735
  };
3618
3736
  /** A built-in EVM chain name. */
3619
3737
  type ChainName = keyof typeof CHAINS;
@@ -3659,9 +3777,9 @@ declare function resolveChain(input: ChainInput, rpcUrlOverride?: string): Resol
3659
3777
  */
3660
3778
 
3661
3779
  /** The chain families the SDK knows about. */
3662
- type ChainFamily = 'evm' | 'solana' | 'ton' | 'stellar' | 'xrpl' | 'tron' | 'sui' | 'near';
3780
+ type ChainFamily = 'evm' | 'solana' | 'ton' | 'stellar' | 'xrpl' | 'tron' | 'sui' | 'near' | 'aptos';
3663
3781
  /** What chain to use: an EVM name/Chain/{id,rpcUrl}, or a non-EVM family name. */
3664
- type ChainSelector = ChainInput | 'solana' | 'ton' | 'stellar' | 'xrpl' | 'tron' | 'sui' | 'near';
3782
+ type ChainSelector = ChainInput | 'solana' | 'ton' | 'stellar' | 'xrpl' | 'tron' | 'sui' | 'near' | 'aptos';
3665
3783
  /** An EVM ERC-20 token, by contract address. */
3666
3784
  interface EvmToken {
3667
3785
  address: `0x${string}`;
@@ -3713,6 +3831,12 @@ interface NearToken {
3713
3831
  decimals: number;
3714
3832
  symbol?: string;
3715
3833
  }
3834
+ /** An Aptos Fungible Asset, by its metadata object address. */
3835
+ interface AptosToken {
3836
+ metadata: string;
3837
+ decimals: number;
3838
+ symbol?: string;
3839
+ }
3716
3840
  /**
3717
3841
  * What to be paid in. Each driver validates the forms it accepts:
3718
3842
  * - 'native' the chain's native coin (ETH, BNB, SOL, TON, XLM, XRP)
@@ -3725,8 +3849,9 @@ interface NearToken {
3725
3849
  * - TronToken any TRC-20 (Tron)
3726
3850
  * - SuiToken any coin (Sui)
3727
3851
  * - NearToken any NEP-141 (NEAR)
3852
+ * - AptosToken any Fungible Asset (Aptos)
3728
3853
  */
3729
- type TokenInput = 'native' | (string & {}) | EvmToken | SolanaToken | TonToken | StellarToken | XrplToken | TronToken | SuiToken | NearToken;
3854
+ type TokenInput = 'native' | (string & {}) | EvmToken | SolanaToken | TonToken | StellarToken | XrplToken | TronToken | SuiToken | NearToken | AptosToken;
3730
3855
  /** What a driver resolves a TokenInput into. `asset`: 0x | base58 mint | 'native'. */
3731
3856
  interface ResolvedToken {
3732
3857
  asset: string;
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  parseUnits,
21
21
  rejectForeignToken,
22
22
  toInsufficientFundsError
23
- } from "./chunk-DTIJYDG6.js";
23
+ } from "./chunk-AGKC3C7Y.js";
24
24
 
25
25
  // src/drivers/registry.ts
26
26
  var byFamily = /* @__PURE__ */ new Map();
@@ -39,6 +39,7 @@ function familyForChain(chain) {
39
39
  if (chain.startsWith("tron")) return "tron";
40
40
  if (chain.startsWith("sui")) return "sui";
41
41
  if (chain.startsWith("near")) return "near";
42
+ if (chain.startsWith("aptos")) return "aptos";
42
43
  return "evm";
43
44
  }
44
45
  return "evm";
@@ -71,10 +72,12 @@ import {
71
72
  base,
72
73
  bsc,
73
74
  celo,
75
+ hyperEvm,
74
76
  injective,
75
77
  linea,
76
78
  mainnet,
77
79
  mantle,
80
+ monad,
78
81
  optimism,
79
82
  polygon,
80
83
  scroll,
@@ -210,6 +213,28 @@ var CHAINS = {
210
213
  USDC: { address: "0xa00C59fF5a080D2b954d0c75e46E22a0c371235a", decimals: 6, symbol: "USDC" },
211
214
  USDT: { address: "0x88f7F2b685F9692caf8c478f5BADF09eE9B1Cc13", decimals: 6, symbol: "USDT" }
212
215
  }
216
+ },
217
+ // HyperEVM (Hyperliquid, chainId 999) — native Circle USDC, verified on-chain
218
+ // 2026-06-04 (eth_chainId 0x3e7; USDC symbol "USDC", decimals 6). HyperEVM's
219
+ // "USDT" is USDT0 (LayerZero/omnichain), not Circle/Tether-native, so it's
220
+ // intentionally omitted; pass it as a custom { address, decimals } if needed.
221
+ // The highest-activity EVM venue of 2025–26 (perps DEX + on-chain agent vaults).
222
+ hyperevm: {
223
+ chain: hyperEvm,
224
+ tokens: {
225
+ USDC: { address: "0xb88339CB7199b77E23DB6E890353E22632Ba630f", decimals: 6, symbol: "USDC" }
226
+ }
227
+ },
228
+ // Monad (chainId 143) — native Circle USDC, verified on-chain 2026-06-04
229
+ // (eth_chainId 0x8f; USDC symbol "USDC", decimals 6; CCTP V2). Monad's "USDT"
230
+ // is USDT0 (LayerZero/omnichain), not Circle/Tether-native, so it's
231
+ // intentionally omitted; pass it as a custom { address, decimals } if needed.
232
+ // The biggest new EVM L1 of 2025 (parallel EVM, ~10k TPS).
233
+ monad: {
234
+ chain: monad,
235
+ tokens: {
236
+ USDC: { address: "0x754704Bc059F8C67012fEd69BC8A327a5aafb603", decimals: 6, symbol: "USDC" }
237
+ }
213
238
  }
214
239
  };
215
240
  function isViemChain(input) {
@@ -713,7 +738,7 @@ var loaders = {
713
738
  solana: async () => {
714
739
  let mod;
715
740
  try {
716
- mod = await import("./solana-USZHRZFN.js");
741
+ mod = await import("./solana-37F2PR5H.js");
717
742
  } catch (cause) {
718
743
  throw new MissingDriverError(
719
744
  `Solana selected, but its packages aren't installed. Run: npm install @solana/web3.js @solana/spl-token bs58`,
@@ -725,7 +750,7 @@ var loaders = {
725
750
  ton: async () => {
726
751
  let mod;
727
752
  try {
728
- mod = await import("./ton-2N74GKNB.js");
753
+ mod = await import("./ton-NIDWF77T.js");
729
754
  } catch (cause) {
730
755
  throw new MissingDriverError(
731
756
  `TON selected, but its packages aren't installed. Run: npm install @ton/ton @ton/core @ton/crypto`,
@@ -737,7 +762,7 @@ var loaders = {
737
762
  stellar: async () => {
738
763
  let mod;
739
764
  try {
740
- mod = await import("./stellar-JZBVCLNV.js");
765
+ mod = await import("./stellar-ALOVOMFD.js");
741
766
  } catch (cause) {
742
767
  throw new MissingDriverError(
743
768
  `Stellar selected, but its package isn't installed. Run: npm install @stellar/stellar-sdk`,
@@ -749,7 +774,7 @@ var loaders = {
749
774
  xrpl: async () => {
750
775
  let mod;
751
776
  try {
752
- mod = await import("./xrpl-RTT3UOLX.js");
777
+ mod = await import("./xrpl-6ODQS7JR.js");
753
778
  } catch (cause) {
754
779
  throw new MissingDriverError(
755
780
  `XRPL selected, but its package isn't installed. Run: npm install xrpl`,
@@ -761,7 +786,7 @@ var loaders = {
761
786
  tron: async () => {
762
787
  let mod;
763
788
  try {
764
- mod = await import("./tron-N3EAAKU7.js");
789
+ mod = await import("./tron-LPMK57H7.js");
765
790
  } catch (cause) {
766
791
  throw new MissingDriverError(
767
792
  `Tron selected, but its package isn't installed. Run: npm install tronweb`,
@@ -773,7 +798,7 @@ var loaders = {
773
798
  sui: async () => {
774
799
  let mod;
775
800
  try {
776
- mod = await import("./sui-UBDATSQV.js");
801
+ mod = await import("./sui-OLC5ID4X.js");
777
802
  } catch (cause) {
778
803
  throw new MissingDriverError(
779
804
  `Sui selected, but its package isn't installed. Run: npm install @mysten/sui`,
@@ -785,7 +810,7 @@ var loaders = {
785
810
  near: async () => {
786
811
  let mod;
787
812
  try {
788
- mod = await import("./near-RJUETWY3.js");
813
+ mod = await import("./near-YX3XOASO.js");
789
814
  } catch (cause) {
790
815
  throw new MissingDriverError(
791
816
  `NEAR selected, but its package isn't installed. Run: npm install near-api-js`,
@@ -793,6 +818,18 @@ var loaders = {
793
818
  );
794
819
  }
795
820
  registerDriver(mod.nearDriver);
821
+ },
822
+ aptos: async () => {
823
+ let mod;
824
+ try {
825
+ mod = await import("./aptos-MQY7KOOJ.js");
826
+ } catch (cause) {
827
+ throw new MissingDriverError(
828
+ `Aptos selected, but its package isn't installed. Run: npm install @aptos-labs/ts-sdk`,
829
+ { cause }
830
+ );
831
+ }
832
+ registerDriver(mod.aptosDriver);
796
833
  }
797
834
  };
798
835
  var inFlight = /* @__PURE__ */ new Map();
@@ -7,7 +7,7 @@
7
7
 
8
8
 
9
9
 
10
- var _chunkNK64H3RMcjs = require('./chunk-NK64H3RM.cjs');
10
+ var _chunkYJPWIK5Lcjs = require('./chunk-YJPWIK5L.cjs');
11
11
 
12
12
  // src/drivers/near/index.ts
13
13
  var _nearapijs = require('near-api-js');
@@ -53,18 +53,18 @@ async function payNear(params) {
53
53
  return res.hash;
54
54
  } catch (err) {
55
55
  if (isNearRegistrationError(err)) {
56
- throw new (0, _chunkNK64H3RMcjs.RecipientNotReadyError)(
56
+ throw new (0, _chunkYJPWIK5Lcjs.RecipientNotReadyError)(
57
57
  `NEAR recipient ${accept.payTo} isn't registered on token ${accept.asset} (NEP-145 storage_deposit) \u2014 register it once (\u22480.00125 NEAR) before it can receive. (NEAR: not registered)`,
58
58
  { cause: err }
59
59
  );
60
60
  }
61
61
  if (isNearAffordability(err)) {
62
- throw new (0, _chunkNK64H3RMcjs.InsufficientFundsError)(
62
+ throw new (0, _chunkYJPWIK5Lcjs.InsufficientFundsError)(
63
63
  err instanceof Error ? err.message : "Insufficient NEAR balance for the payment.",
64
64
  { cause: err }
65
65
  );
66
66
  }
67
- throw _nullishCoalesce(_chunkNK64H3RMcjs.toInsufficientFundsError.call(void 0, err), () => ( err));
67
+ throw _nullishCoalesce(_chunkYJPWIK5Lcjs.toInsufficientFundsError.call(void 0, err), () => ( err));
68
68
  }
69
69
  }
70
70
  async function payNearNative(params) {
@@ -74,12 +74,12 @@ async function payNearNative(params) {
74
74
  return res.hash;
75
75
  } catch (err) {
76
76
  if (isNearAffordability(err)) {
77
- throw new (0, _chunkNK64H3RMcjs.InsufficientFundsError)(
77
+ throw new (0, _chunkYJPWIK5Lcjs.InsufficientFundsError)(
78
78
  err instanceof Error ? err.message : "Insufficient NEAR balance for the payment.",
79
79
  { cause: err }
80
80
  );
81
81
  }
82
- throw _nullishCoalesce(_chunkNK64H3RMcjs.toInsufficientFundsError.call(void 0, err), () => ( err));
82
+ throw _nullishCoalesce(_chunkYJPWIK5Lcjs.toInsufficientFundsError.call(void 0, err), () => ( err));
83
83
  }
84
84
  }
85
85
  function isNearRegistrationError(err) {
@@ -216,22 +216,22 @@ function txNotFound(hash) {
216
216
 
217
217
  function assertNearWallet(wallet, network) {
218
218
  if (typeof wallet !== "object" || wallet === null) {
219
- throw new (0, _chunkNK64H3RMcjs.WrongFamilyError)(
219
+ throw new (0, _chunkYJPWIK5Lcjs.WrongFamilyError)(
220
220
  `chain ${network} is NEAR; wallet must be { accountId, privateKey } (privateKey = ed25519:\u2026).`
221
221
  );
222
222
  }
223
223
  if ("walletClient" in wallet) {
224
- throw new (0, _chunkNK64H3RMcjs.WrongFamilyError)(
224
+ throw new (0, _chunkYJPWIK5Lcjs.WrongFamilyError)(
225
225
  `chain ${network} is NEAR; a viem { walletClient } can't be used \u2014 pass { accountId, privateKey }.`
226
226
  );
227
227
  }
228
228
  if ("secretKey" in wallet || "signer" in wallet || "mnemonic" in wallet || "keyPair" in wallet || "secret" in wallet || "seed" in wallet || "keypair" in wallet) {
229
- throw new (0, _chunkNK64H3RMcjs.WrongFamilyError)(
229
+ throw new (0, _chunkYJPWIK5Lcjs.WrongFamilyError)(
230
230
  `chain ${network} is NEAR; that looks like another family's wallet \u2014 pass { accountId, privateKey }.`
231
231
  );
232
232
  }
233
233
  if (!("accountId" in wallet) || !("privateKey" in wallet)) {
234
- throw new (0, _chunkNK64H3RMcjs.WrongFamilyError)(
234
+ throw new (0, _chunkYJPWIK5Lcjs.WrongFamilyError)(
235
235
  `chain ${network} is NEAR; wallet must be { accountId, privateKey } (privateKey = ed25519:\u2026).`
236
236
  );
237
237
  }
@@ -239,13 +239,13 @@ function assertNearWallet(wallet, network) {
239
239
  }
240
240
  function resolveNearWallet(config) {
241
241
  if (!config.accountId || !config.privateKey) {
242
- throw new (0, _chunkNK64H3RMcjs.WrongFamilyError)("NEAR wallet needs { accountId, privateKey } (privateKey = ed25519:\u2026).");
242
+ throw new (0, _chunkYJPWIK5Lcjs.WrongFamilyError)("NEAR wallet needs { accountId, privateKey } (privateKey = ed25519:\u2026).");
243
243
  }
244
244
  let signer;
245
245
  try {
246
246
  signer = _nearapijs.KeyPairSigner.fromSecretKey(config.privateKey);
247
247
  } catch (cause) {
248
- throw new (0, _chunkNK64H3RMcjs.WrongFamilyError)("NEAR wallet { privateKey } is not a valid ed25519:\u2026 secret key.", {
248
+ throw new (0, _chunkYJPWIK5Lcjs.WrongFamilyError)("NEAR wallet { privateKey } is not a valid ed25519:\u2026 secret key.", {
249
249
  cause
250
250
  });
251
251
  }
@@ -312,16 +312,16 @@ function makeNearNetwork(preset, rpcUrl) {
312
312
  const info = preset.tokens[token.toUpperCase()];
313
313
  if (!info) {
314
314
  const known = Object.keys(preset.tokens).join(", ") || "(none built in)";
315
- throw new (0, _chunkNK64H3RMcjs.UnknownTokenError)(
315
+ throw new (0, _chunkYJPWIK5Lcjs.UnknownTokenError)(
316
316
  `token "${token}" isn't built in for NEAR (known: ${known}). Pass { contractId, decimals } for a custom NEP-141.`
317
317
  );
318
318
  }
319
319
  return { asset: info.contractId, decimals: info.decimals, symbol: info.symbol };
320
320
  }
321
- _chunkNK64H3RMcjs.rejectForeignToken.call(void 0, token, "near", network);
321
+ _chunkYJPWIK5Lcjs.rejectForeignToken.call(void 0, token, "near", network);
322
322
  const t = token;
323
323
  if (!t.contractId || typeof t.decimals !== "number") {
324
- throw new (0, _chunkNK64H3RMcjs.WrongFamilyError)(
324
+ throw new (0, _chunkYJPWIK5Lcjs.WrongFamilyError)(
325
325
  `chain ${network} is NEAR; a custom token must be { contractId, decimals }.`
326
326
  );
327
327
  }
@@ -340,12 +340,12 @@ function makeNearNetwork(preset, rpcUrl) {
340
340
  },
341
341
  assertValidPayTo(payTo) {
342
342
  if (payTo.startsWith("0x")) {
343
- throw new (0, _chunkNK64H3RMcjs.WrongFamilyError)(
343
+ throw new (0, _chunkYJPWIK5Lcjs.WrongFamilyError)(
344
344
  `chain ${network} is NEAR, but payTo "${payTo}" looks like an EVM/Sui 0x address.`
345
345
  );
346
346
  }
347
347
  if (!isValidNearAccountId(payTo)) {
348
- throw new (0, _chunkNK64H3RMcjs.WrongFamilyError)(
348
+ throw new (0, _chunkYJPWIK5Lcjs.WrongFamilyError)(
349
349
  `chain ${network} is NEAR, but payTo "${payTo}" is not a valid NEAR account id.`
350
350
  );
351
351
  }
@@ -389,10 +389,10 @@ function makeNearNetwork(preset, rpcUrl) {
389
389
  if (tx && tx.success) return { height: "0" };
390
390
  } catch (e6) {
391
391
  }
392
- throw new (0, _chunkNK64H3RMcjs.ConfirmationTimeoutError)(`NEAR tx ${hash} not confirmed in time.`);
392
+ throw new (0, _chunkYJPWIK5Lcjs.ConfirmationTimeoutError)(`NEAR tx ${hash} not confirmed in time.`);
393
393
  },
394
394
  async estimateCost() {
395
- return _chunkNK64H3RMcjs.nativeCost.call(void 0, {
395
+ return _chunkYJPWIK5Lcjs.nativeCost.call(void 0, {
396
396
  symbol: "NEAR",
397
397
  decimals: NEAR_DECIMALS,
398
398
  fee: 1500000000000000000000n,
@@ -7,7 +7,7 @@ import {
7
7
  nativeCost,
8
8
  rejectForeignToken,
9
9
  toInsufficientFundsError
10
- } from "./chunk-DTIJYDG6.js";
10
+ } from "./chunk-AGKC3C7Y.js";
11
11
 
12
12
  // src/drivers/near/index.ts
13
13
  import { JsonRpcProvider, Account, actions } from "near-api-js";
@@ -5,7 +5,7 @@ import {
5
5
  nativeCost,
6
6
  rejectForeignToken,
7
7
  toInsufficientFundsError
8
- } from "./chunk-DTIJYDG6.js";
8
+ } from "./chunk-AGKC3C7Y.js";
9
9
 
10
10
  // src/drivers/solana/index.ts
11
11
  import { Connection, PublicKey as PublicKey2 } from "@solana/web3.js";
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkNK64H3RMcjs = require('./chunk-NK64H3RM.cjs');
8
+ var _chunkYJPWIK5Lcjs = require('./chunk-YJPWIK5L.cjs');
9
9
 
10
10
  // src/drivers/solana/index.ts
11
11
  var _web3js = require('@solana/web3.js');
@@ -199,12 +199,12 @@ function notFound(signature) {
199
199
  var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);
200
200
  function toKeypair(wallet, network) {
201
201
  if (typeof wallet !== "object" || wallet === null) {
202
- throw new (0, _chunkNK64H3RMcjs.WrongFamilyError)(
202
+ throw new (0, _chunkYJPWIK5Lcjs.WrongFamilyError)(
203
203
  `chain ${network} is Solana; wallet must be { secretKey } or { signer }.`
204
204
  );
205
205
  }
206
206
  if ("privateKey" in wallet || "walletClient" in wallet) {
207
- throw new (0, _chunkNK64H3RMcjs.WrongFamilyError)(
207
+ throw new (0, _chunkYJPWIK5Lcjs.WrongFamilyError)(
208
208
  `chain ${network} is Solana; an EVM wallet can't be used \u2014 pass { secretKey } or { signer }.`
209
209
  );
210
210
  }
@@ -216,7 +216,7 @@ function toKeypair(wallet, network) {
216
216
  const bytes = typeof sk === "string" ? _bs582.default.decode(sk) : sk;
217
217
  return _web3js.Keypair.fromSecretKey(bytes);
218
218
  }
219
- throw new (0, _chunkNK64H3RMcjs.WrongFamilyError)(
219
+ throw new (0, _chunkYJPWIK5Lcjs.WrongFamilyError)(
220
220
  `chain ${network} is Solana; wallet must be { secretKey } or { signer }.`
221
221
  );
222
222
  }
@@ -245,15 +245,15 @@ function makeSolanaNetwork(preset, rpcUrl) {
245
245
  const info = preset.tokens[token.toUpperCase()];
246
246
  if (!info) {
247
247
  const known = Object.keys(preset.tokens).join(", ") || "(none built in)";
248
- throw new (0, _chunkNK64H3RMcjs.UnknownTokenError)(
248
+ throw new (0, _chunkYJPWIK5Lcjs.UnknownTokenError)(
249
249
  `token "${token}" isn't built in for Solana (known: ${known}). Pass { mint, decimals } instead, or use 'native'.`
250
250
  );
251
251
  }
252
252
  return { asset: info.mint, decimals: info.decimals, symbol: info.symbol };
253
253
  }
254
- _chunkNK64H3RMcjs.rejectForeignToken.call(void 0, token, "solana", network);
254
+ _chunkYJPWIK5Lcjs.rejectForeignToken.call(void 0, token, "solana", network);
255
255
  if (!("mint" in token)) {
256
- throw new (0, _chunkNK64H3RMcjs.WrongFamilyError)(
256
+ throw new (0, _chunkYJPWIK5Lcjs.WrongFamilyError)(
257
257
  `chain ${network} is Solana; a custom token must be { mint, decimals }.`
258
258
  );
259
259
  }
@@ -272,14 +272,14 @@ function makeSolanaNetwork(preset, rpcUrl) {
272
272
  },
273
273
  assertValidPayTo(payTo) {
274
274
  if (payTo.startsWith("0x")) {
275
- throw new (0, _chunkNK64H3RMcjs.WrongFamilyError)(
275
+ throw new (0, _chunkYJPWIK5Lcjs.WrongFamilyError)(
276
276
  `chain ${network} is Solana, but payTo "${payTo}" looks like an EVM address.`
277
277
  );
278
278
  }
279
279
  try {
280
280
  new (0, _web3js.PublicKey)(payTo);
281
281
  } catch (e2) {
282
- throw new (0, _chunkNK64H3RMcjs.WrongFamilyError)(
282
+ throw new (0, _chunkYJPWIK5Lcjs.WrongFamilyError)(
283
283
  `chain ${network} is Solana, but payTo "${payTo}" is not a base58 address.`
284
284
  );
285
285
  }
@@ -291,7 +291,7 @@ function makeSolanaNetwork(preset, rpcUrl) {
291
291
  try {
292
292
  return await paySolana({ connection, keypair: wallet._native, accept });
293
293
  } catch (err) {
294
- throw _nullishCoalesce(_chunkNK64H3RMcjs.toInsufficientFundsError.call(void 0, err), () => ( err));
294
+ throw _nullishCoalesce(_chunkYJPWIK5Lcjs.toInsufficientFundsError.call(void 0, err), () => ( err));
295
295
  }
296
296
  },
297
297
  async confirm(ref) {
@@ -302,20 +302,20 @@ function makeSolanaNetwork(preset, rpcUrl) {
302
302
  });
303
303
  info = value[0];
304
304
  } catch (err) {
305
- throw new (0, _chunkNK64H3RMcjs.ConfirmationTimeoutError)(
305
+ throw new (0, _chunkYJPWIK5Lcjs.ConfirmationTimeoutError)(
306
306
  `Solana payment ${ref} could not be confirmed (RPC read failed).`,
307
307
  { cause: err }
308
308
  );
309
309
  }
310
310
  if (!info || info.err || info.confirmationStatus !== "confirmed" && info.confirmationStatus !== "finalized") {
311
- throw new (0, _chunkNK64H3RMcjs.ConfirmationTimeoutError)(`Solana payment ${ref} did not confirm in time.`);
311
+ throw new (0, _chunkYJPWIK5Lcjs.ConfirmationTimeoutError)(`Solana payment ${ref} did not confirm in time.`);
312
312
  }
313
313
  return { height: String(info.slot) };
314
314
  },
315
315
  async estimateCost(accept) {
316
316
  const base = 5000n;
317
317
  if (accept.asset === "native") {
318
- return _chunkNK64H3RMcjs.nativeCost.call(void 0, {
318
+ return _chunkYJPWIK5Lcjs.nativeCost.call(void 0, {
319
319
  symbol: "SOL",
320
320
  decimals: SOL_DECIMALS,
321
321
  fee: base,
@@ -324,7 +324,7 @@ function makeSolanaNetwork(preset, rpcUrl) {
324
324
  });
325
325
  }
326
326
  const ataRent = 2039280n;
327
- return _chunkNK64H3RMcjs.nativeCost.call(void 0, {
327
+ return _chunkYJPWIK5Lcjs.nativeCost.call(void 0, {
328
328
  symbol: "SOL",
329
329
  decimals: SOL_DECIMALS,
330
330
  fee: base + ataRent,
@@ -11,7 +11,7 @@ import {
11
11
  parseUnits,
12
12
  rejectForeignToken,
13
13
  toInsufficientFundsError
14
- } from "./chunk-DTIJYDG6.js";
14
+ } from "./chunk-AGKC3C7Y.js";
15
15
 
16
16
  // src/drivers/stellar/index.ts
17
17
  import { Horizon, StrKey as StrKey2 } from "@stellar/stellar-sdk";