@smoothsend/sdk 2.3.5 → 2.3.7

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 (100) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +349 -349
  3. package/dist/adapters/evm.d.ts +39 -0
  4. package/dist/adapters/evm.d.ts.map +1 -0
  5. package/dist/aptos/index.cjs +2 -2
  6. package/dist/aptos/index.d.ts +3 -3
  7. package/dist/aptos/index.js +3 -3
  8. package/dist/avax/SmoothSendAvaxSubmitter.d.ts +2 -2
  9. package/dist/avax/SmoothSendAvaxSubmitter.d.ts.map +1 -1
  10. package/dist/avax/index.cjs +52 -14
  11. package/dist/avax/index.cjs.map +1 -1
  12. package/dist/avax/index.d.ts +3 -3
  13. package/dist/avax/index.d.ts.map +1 -1
  14. package/dist/avax/index.js +53 -15
  15. package/dist/avax/index.js.map +1 -1
  16. package/dist/avax/publicAaDefaults.d.ts +26 -0
  17. package/dist/avax/publicAaDefaults.d.ts.map +1 -1
  18. package/dist/avax/useSmoothSendAvax.d.ts +2 -0
  19. package/dist/avax/useSmoothSendAvax.d.ts.map +1 -1
  20. package/dist/chunks/{shared-CNF22ESH.js → shared-BQ9u3lrN.js} +2 -2
  21. package/dist/chunks/{shared-CNF22ESH.js.map → shared-BQ9u3lrN.js.map} +1 -1
  22. package/dist/chunks/{shared-Cgb7mhwI.d.ts → shared-BcSSEWv8.d.ts} +5 -2
  23. package/dist/chunks/{shared-x1-VC-Li.cjs → shared-BlhOY1v3.cjs} +2 -2
  24. package/dist/chunks/{shared-x1-VC-Li.cjs.map → shared-BlhOY1v3.cjs.map} +1 -1
  25. package/dist/chunks/{shared-CaQMAGQR.js → shared-CWbQR_je.js} +4 -4
  26. package/dist/chunks/{shared-CaQMAGQR.js.map → shared-CWbQR_je.js.map} +1 -1
  27. package/dist/chunks/{shared-Cn4duBJT.d.ts → shared-DMOh_aLU.d.ts} +1 -1
  28. package/dist/chunks/{shared-DEurKmpI.cjs → shared-EuyoZgP8.cjs} +4 -4
  29. package/dist/chunks/{shared-DEurKmpI.cjs.map → shared-EuyoZgP8.cjs.map} +1 -1
  30. package/dist/chunks/{shared-RVkwmkG7.d.ts → shared-W7k9S_GY.d.ts} +1 -1
  31. package/dist/chunks/{shared-CPpb2n9T.d.ts → shared-vFCAUg0m.d.ts} +1 -1
  32. package/dist/config/chains.d.ts +7 -0
  33. package/dist/config/chains.d.ts.map +1 -0
  34. package/dist/index.cjs +52 -14
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.ts +4 -4
  37. package/dist/index.esm.js +3 -1846
  38. package/dist/index.esm.js.map +1 -1
  39. package/dist/index.js +52 -14
  40. package/dist/index.js.map +1 -1
  41. package/dist/services/chainConfigService.d.ts +49 -0
  42. package/dist/services/chainConfigService.d.ts.map +1 -0
  43. package/dist/stellar/index.cjs +2 -2
  44. package/dist/stellar/index.d.ts +3 -3
  45. package/dist/stellar/index.js +2 -2
  46. package/dist/version.d.ts +1 -1
  47. package/package.json +120 -120
  48. package/dist/aptos-privy/index.cjs +0 -40
  49. package/dist/aptos-privy/index.cjs.map +0 -1
  50. package/dist/aptos-privy/index.js +0 -34
  51. package/dist/aptos-privy/index.js.map +0 -1
  52. package/dist/aptos-privy/normalizePrivyAptosWallet.d.ts +0 -4
  53. package/dist/aptos-privy/normalizePrivyAptosWallet.d.ts.map +0 -1
  54. package/dist/aptos-privy/privyAptosSigner.d.ts +0 -32
  55. package/dist/aptos-privy/privyAptosSigner.d.ts.map +0 -1
  56. package/dist/aptos-privy/useSmoothSendAptosPrivy.d.ts +0 -13
  57. package/dist/aptos-privy/useSmoothSendAptosPrivy.d.ts.map +0 -1
  58. package/dist/aptos-privy-entry.d.ts +0 -9
  59. package/dist/aptos-privy-entry.d.ts.map +0 -1
  60. package/dist/chunks/SmoothSendSDK-C_ofuBkk.cjs +0 -1519
  61. package/dist/chunks/SmoothSendSDK-C_ofuBkk.cjs.map +0 -1
  62. package/dist/chunks/SmoothSendSDK-CaV_PCIG.js +0 -1511
  63. package/dist/chunks/SmoothSendSDK-CaV_PCIG.js.map +0 -1
  64. package/dist/chunks/SmoothSendSDK.d-9GBgZONY.d.ts +0 -262
  65. package/dist/chunks/TrueGaslessClient-DThO4Tpb.cjs +0 -1237
  66. package/dist/chunks/TrueGaslessClient-DThO4Tpb.cjs.map +0 -1
  67. package/dist/chunks/TrueGaslessClient-l2uFvNAa.js +0 -1228
  68. package/dist/chunks/TrueGaslessClient-l2uFvNAa.js.map +0 -1
  69. package/dist/chunks/shared-2xx2VLH3.js +0 -453
  70. package/dist/chunks/shared-2xx2VLH3.js.map +0 -1
  71. package/dist/chunks/shared-B8UdyBTN.d.ts +0 -143
  72. package/dist/chunks/shared-BJv1JV1H.cjs +0 -702
  73. package/dist/chunks/shared-BJv1JV1H.cjs.map +0 -1
  74. package/dist/chunks/shared-BXvqbQ6f.d.ts +0 -262
  75. package/dist/chunks/shared-Bh4xtpHv.js +0 -740
  76. package/dist/chunks/shared-Bh4xtpHv.js.map +0 -1
  77. package/dist/chunks/shared-BlIQttCf.d.ts +0 -1279
  78. package/dist/chunks/shared-BoRfHN1w.js +0 -1511
  79. package/dist/chunks/shared-BoRfHN1w.js.map +0 -1
  80. package/dist/chunks/shared-CzR0rIwZ.cjs +0 -635
  81. package/dist/chunks/shared-CzR0rIwZ.cjs.map +0 -1
  82. package/dist/chunks/shared-DQbEIiTE.cjs +0 -746
  83. package/dist/chunks/shared-DQbEIiTE.cjs.map +0 -1
  84. package/dist/chunks/shared-DzwYUjQn.cjs +0 -457
  85. package/dist/chunks/shared-DzwYUjQn.cjs.map +0 -1
  86. package/dist/chunks/shared-KUvoQkzf.d.ts +0 -471
  87. package/dist/chunks/shared-XH1iLZjy.js +0 -629
  88. package/dist/chunks/shared-XH1iLZjy.js.map +0 -1
  89. package/dist/chunks/shared-kovW7ATj.js +0 -694
  90. package/dist/chunks/shared-kovW7ATj.js.map +0 -1
  91. package/dist/chunks/shared-viO0MYao.d.ts +0 -459
  92. package/dist/chunks/useSmoothSendAvax-BHeW_6x8.cjs +0 -1865
  93. package/dist/chunks/useSmoothSendAvax-BHeW_6x8.cjs.map +0 -1
  94. package/dist/chunks/useSmoothSendAvax-ZuHw1aYi.js +0 -1848
  95. package/dist/chunks/useSmoothSendAvax-ZuHw1aYi.js.map +0 -1
  96. package/dist/chunks/version-CNF22ESH.js +0 -557
  97. package/dist/chunks/version-CNF22ESH.js.map +0 -1
  98. package/dist/chunks/version-x1-VC-Li.cjs +0 -568
  99. package/dist/chunks/version-x1-VC-Li.cjs.map +0 -1
  100. package/dist/chunks/version.d-Cn4duBJT.d.ts +0 -1279
@@ -1,143 +0,0 @@
1
- import { EntryFunctionArgumentTypes, SimpleEntryFunctionArgumentTypes, PendingTransactionResponse } from '@aptos-labs/ts-sdk';
2
-
3
- /**
4
- * Types for `useSmoothSendAptosPrivy` and the Privy raw-sign adapter.
5
- *
6
- * The hook is wallet-agnostic: it accepts the Privy embedded-wallet address +
7
- * public key + a `signRawHash` adapter, so the SDK never needs `@privy-io/*`
8
- * as a peer dependency.
9
- */
10
-
11
- type AptosPrivyHash = string;
12
- /** Internal contract: takes the Aptos signing-message bytes (hex) and returns
13
- * a 64-byte ed25519 signature as a hex string. */
14
- interface PrivyAptosRawSigner {
15
- (input: {
16
- hash: AptosPrivyHash;
17
- }): Promise<string>;
18
- }
19
- /** Shape extracted from a Privy embedded wallet for Aptos. */
20
- interface PrivyAptosWalletInfo {
21
- /** Aptos address from Privy embedded wallet (e.g. `0x123...`) */
22
- address: string;
23
- /** 32-byte Ed25519 public key. Accepts hex, `ed25519:` prefix, base64/base64url, or byte-array string. */
24
- publicKey?: string;
25
- /** Privy's API/linked-account field name for the public key. */
26
- public_key?: string;
27
- type?: string;
28
- chainType?: string;
29
- }
30
- interface PrivyAptosSignRawHash {
31
- (input: {
32
- address: string;
33
- chainType: 'aptos';
34
- hash: `0x${string}`;
35
- }): Promise<{
36
- signature: string;
37
- }>;
38
- }
39
- interface UseSmoothSendAptosPrivyParams {
40
- /** SmoothSend API key. Use `pk_nogas_*` for browser usage. */
41
- apiKey: string;
42
- /** SmoothSend network. Defaults to `'testnet'`. */
43
- network?: 'testnet' | 'mainnet';
44
- /** Privy Aptos wallet address (find via `user.linkedAccounts`). */
45
- address?: string;
46
- /** Privy Aptos wallet ed25519 public key (hex, 32 bytes). */
47
- publicKey?: string;
48
- /**
49
- * Adapter that calls Privy's `signRawHash({ chainType: 'aptos', address, hash })`
50
- * and returns the hex signature string.
51
- */
52
- signRawHash?: PrivyAptosRawSigner;
53
- /** Optional Aptos fullnode URL override (e.g. dedicated/private RPC). */
54
- fullnode?: string;
55
- /** Optional Aptos API key for fullnode/indexer (sticky-routing key). */
56
- aptosApiKey?: string;
57
- /** Override SmoothSend gateway URL (default: `https://proxy.smoothsend.xyz`). */
58
- gatewayUrl?: string;
59
- /** Enable verbose `[SmoothSend Aptos+Privy]` logs. */
60
- debug?: boolean;
61
- }
62
- interface UseSmoothSendPrivyWriteParams extends Omit<UseSmoothSendAptosPrivyParams, 'address' | 'publicKey' | 'signRawHash'> {
63
- /** Aptos wallet from Privy's `user.linkedAccounts`. */
64
- wallet?: PrivyAptosWalletInfo | null;
65
- /** Privy's `useSignRawHash().signRawHash`. */
66
- signRawHash?: PrivyAptosSignRawHash;
67
- }
68
- /** Minimal Aptos entry-function payload. Mirrors the shape used by the
69
- * existing wallet-adapter integration. */
70
- interface SignAndSubmitTransactionInput {
71
- function: `${string}::${string}::${string}`;
72
- typeArguments?: string[];
73
- functionArguments: Array<EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes>;
74
- /** Optional max gas amount override (in gas units). */
75
- maxGasAmount?: number;
76
- }
77
- interface UseSmoothSendAptosPrivyResult {
78
- /**
79
- * Build a sponsored Aptos transaction (`withFeePayer: true`), have Privy
80
- * sign the signing-message via `signRawHash`, then submit through the
81
- * SmoothSend gateway. The user pays 0 APT gas.
82
- */
83
- signAndSubmitTransaction: (input: SignAndSubmitTransactionInput) => Promise<PendingTransactionResponse>;
84
- isPending: boolean;
85
- isIdle: boolean;
86
- status: 'idle' | 'pending' | 'success' | 'error';
87
- data: PendingTransactionResponse | undefined;
88
- error: Error | null;
89
- /** Privy Aptos wallet address (echoed for convenience). */
90
- address: string | undefined;
91
- /** True when address + publicKey + signRawHash are all available. */
92
- isReady: boolean;
93
- reset: () => void;
94
- }
95
- type UseSmoothSendPrivyWriteResult = UseSmoothSendAptosPrivyResult;
96
-
97
- /**
98
- * `useSmoothSendAptosPrivy` — Aptos + Privy gasless writes via SmoothSend.
99
- *
100
- * Privy's embedded ed25519 wallet signs the signing-message hash via
101
- * `signRawHash`. SmoothSend's relayer then adds the fee-payer signature and
102
- * submits, so the end user pays 0 APT gas.
103
- *
104
- * This hook is a thin shell over the existing `SmoothSendTransactionSubmitter`
105
- * — same gasless gateway path used by all other Aptos integrations.
106
- */
107
-
108
- declare function useSmoothSendAptosPrivy(params: UseSmoothSendAptosPrivyParams): UseSmoothSendAptosPrivyResult;
109
-
110
- /**
111
- * Adapter that wraps Privy's `useSignRawHash().signRawHash` (Tier-2 chains)
112
- * into the `PrivyAptosRawSigner` shape expected by `useSmoothSendAptosPrivy`.
113
- *
114
- * The SDK does NOT import `@privy-io/react-auth` directly — the dApp passes
115
- * the function in. This keeps Privy as an optional dependency.
116
- *
117
- * @example
118
- * ```tsx
119
- * import { useSignRawHash } from '@privy-io/react-auth/extended-chains';
120
- * import { createPrivyAptosSigner, useSmoothSendAptosPrivy } from '@smoothsend/sdk/aptos';
121
- *
122
- * const { signRawHash } = useSignRawHash();
123
- * const signer = createPrivyAptosSigner({ wallet: aptosWallet, signRawHash });
124
- *
125
- * const { signAndSubmitTransaction } = useSmoothSendAptosPrivy({
126
- * apiKey, network: 'testnet',
127
- * address: aptosWallet?.address,
128
- * publicKey: aptosWallet?.publicKey,
129
- * signRawHash: signer,
130
- * });
131
- * ```
132
- */
133
-
134
- interface CreatePrivyAptosSignerParams {
135
- /** Aptos embedded wallet from Privy. Look it up via `user.linkedAccounts`. */
136
- wallet: PrivyAptosWalletInfo | null | undefined;
137
- /** The `signRawHash` function returned by `useSignRawHash()`. */
138
- signRawHash: PrivyAptosSignRawHash;
139
- }
140
- declare function createPrivyAptosSigner(params: CreatePrivyAptosSignerParams): PrivyAptosRawSigner;
141
-
142
- export { createPrivyAptosSigner as c, useSmoothSendAptosPrivy as u };
143
- export type { AptosPrivyHash as A, CreatePrivyAptosSignerParams as C, PrivyAptosRawSigner as P, SignAndSubmitTransactionInput as S, UseSmoothSendAptosPrivyParams as U, PrivyAptosWalletInfo as a, UseSmoothSendAptosPrivyResult as b, UseSmoothSendPrivyWriteParams as d, UseSmoothSendPrivyWriteResult as e, PrivyAptosSignRawHash as f };