@smoothsend/sdk 2.3.6 → 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.
- package/LICENSE +22 -22
- package/README.md +349 -349
- package/dist/adapters/evm.d.ts +39 -0
- package/dist/adapters/evm.d.ts.map +1 -0
- package/dist/config/chains.d.ts +7 -0
- package/dist/config/chains.d.ts.map +1 -0
- package/dist/index.esm.js +3 -1846
- package/dist/index.esm.js.map +1 -1
- package/dist/services/chainConfigService.d.ts +49 -0
- package/dist/services/chainConfigService.d.ts.map +1 -0
- package/package.json +120 -120
- package/dist/aptos-privy/index.cjs +0 -40
- package/dist/aptos-privy/index.cjs.map +0 -1
- package/dist/aptos-privy/index.js +0 -34
- package/dist/aptos-privy/index.js.map +0 -1
- package/dist/aptos-privy/normalizePrivyAptosWallet.d.ts +0 -4
- package/dist/aptos-privy/normalizePrivyAptosWallet.d.ts.map +0 -1
- package/dist/aptos-privy/privyAptosSigner.d.ts +0 -32
- package/dist/aptos-privy/privyAptosSigner.d.ts.map +0 -1
- package/dist/aptos-privy/useSmoothSendAptosPrivy.d.ts +0 -13
- package/dist/aptos-privy/useSmoothSendAptosPrivy.d.ts.map +0 -1
- package/dist/aptos-privy-entry.d.ts +0 -9
- package/dist/aptos-privy-entry.d.ts.map +0 -1
- package/dist/chunks/SmoothSendSDK-C_ofuBkk.cjs +0 -1519
- package/dist/chunks/SmoothSendSDK-C_ofuBkk.cjs.map +0 -1
- package/dist/chunks/SmoothSendSDK-CaV_PCIG.js +0 -1511
- package/dist/chunks/SmoothSendSDK-CaV_PCIG.js.map +0 -1
- package/dist/chunks/SmoothSendSDK.d-9GBgZONY.d.ts +0 -262
- package/dist/chunks/TrueGaslessClient-DThO4Tpb.cjs +0 -1237
- package/dist/chunks/TrueGaslessClient-DThO4Tpb.cjs.map +0 -1
- package/dist/chunks/TrueGaslessClient-l2uFvNAa.js +0 -1228
- package/dist/chunks/TrueGaslessClient-l2uFvNAa.js.map +0 -1
- package/dist/chunks/shared-2xx2VLH3.js +0 -453
- package/dist/chunks/shared-2xx2VLH3.js.map +0 -1
- package/dist/chunks/shared-B8UdyBTN.d.ts +0 -143
- package/dist/chunks/shared-BJv1JV1H.cjs +0 -702
- package/dist/chunks/shared-BJv1JV1H.cjs.map +0 -1
- package/dist/chunks/shared-BXvqbQ6f.d.ts +0 -262
- package/dist/chunks/shared-Bh4xtpHv.js +0 -740
- package/dist/chunks/shared-Bh4xtpHv.js.map +0 -1
- package/dist/chunks/shared-BlIQttCf.d.ts +0 -1279
- package/dist/chunks/shared-BoRfHN1w.js +0 -1511
- package/dist/chunks/shared-BoRfHN1w.js.map +0 -1
- package/dist/chunks/shared-CNF22ESH.js +0 -557
- package/dist/chunks/shared-CNF22ESH.js.map +0 -1
- package/dist/chunks/shared-CPpb2n9T.d.ts +0 -780
- package/dist/chunks/shared-CaQMAGQR.js +0 -1511
- package/dist/chunks/shared-CaQMAGQR.js.map +0 -1
- package/dist/chunks/shared-Cgb7mhwI.d.ts +0 -471
- package/dist/chunks/shared-Cn4duBJT.d.ts +0 -1279
- package/dist/chunks/shared-CzR0rIwZ.cjs +0 -635
- package/dist/chunks/shared-CzR0rIwZ.cjs.map +0 -1
- package/dist/chunks/shared-DEurKmpI.cjs +0 -1519
- package/dist/chunks/shared-DEurKmpI.cjs.map +0 -1
- package/dist/chunks/shared-DQbEIiTE.cjs +0 -746
- package/dist/chunks/shared-DQbEIiTE.cjs.map +0 -1
- package/dist/chunks/shared-DYAVFARB.d.ts +0 -472
- package/dist/chunks/shared-DzwYUjQn.cjs +0 -457
- package/dist/chunks/shared-DzwYUjQn.cjs.map +0 -1
- package/dist/chunks/shared-KUvoQkzf.d.ts +0 -471
- package/dist/chunks/shared-RVkwmkG7.d.ts +0 -262
- package/dist/chunks/shared-XH1iLZjy.js +0 -629
- package/dist/chunks/shared-XH1iLZjy.js.map +0 -1
- package/dist/chunks/shared-kovW7ATj.js +0 -694
- package/dist/chunks/shared-kovW7ATj.js.map +0 -1
- package/dist/chunks/shared-viO0MYao.d.ts +0 -459
- package/dist/chunks/shared-x1-VC-Li.cjs +0 -568
- package/dist/chunks/shared-x1-VC-Li.cjs.map +0 -1
- package/dist/chunks/useSmoothSendAvax-BHeW_6x8.cjs +0 -1865
- package/dist/chunks/useSmoothSendAvax-BHeW_6x8.cjs.map +0 -1
- package/dist/chunks/useSmoothSendAvax-ZuHw1aYi.js +0 -1848
- package/dist/chunks/useSmoothSendAvax-ZuHw1aYi.js.map +0 -1
- package/dist/chunks/version-CNF22ESH.js +0 -557
- package/dist/chunks/version-CNF22ESH.js.map +0 -1
- package/dist/chunks/version-x1-VC-Li.cjs +0 -568
- package/dist/chunks/version-x1-VC-Li.cjs.map +0 -1
- 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 };
|