@smoothsend/sdk 2.3.6 → 2.3.8

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 (77) 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/config/chains.d.ts +7 -0
  6. package/dist/config/chains.d.ts.map +1 -0
  7. package/dist/index.esm.js +3 -1846
  8. package/dist/index.esm.js.map +1 -1
  9. package/dist/services/chainConfigService.d.ts +49 -0
  10. package/dist/services/chainConfigService.d.ts.map +1 -0
  11. package/package.json +120 -120
  12. package/dist/aptos-privy/index.cjs +0 -40
  13. package/dist/aptos-privy/index.cjs.map +0 -1
  14. package/dist/aptos-privy/index.js +0 -34
  15. package/dist/aptos-privy/index.js.map +0 -1
  16. package/dist/aptos-privy/normalizePrivyAptosWallet.d.ts +0 -4
  17. package/dist/aptos-privy/normalizePrivyAptosWallet.d.ts.map +0 -1
  18. package/dist/aptos-privy/privyAptosSigner.d.ts +0 -32
  19. package/dist/aptos-privy/privyAptosSigner.d.ts.map +0 -1
  20. package/dist/aptos-privy/useSmoothSendAptosPrivy.d.ts +0 -13
  21. package/dist/aptos-privy/useSmoothSendAptosPrivy.d.ts.map +0 -1
  22. package/dist/aptos-privy-entry.d.ts +0 -9
  23. package/dist/aptos-privy-entry.d.ts.map +0 -1
  24. package/dist/chunks/SmoothSendSDK-C_ofuBkk.cjs +0 -1519
  25. package/dist/chunks/SmoothSendSDK-C_ofuBkk.cjs.map +0 -1
  26. package/dist/chunks/SmoothSendSDK-CaV_PCIG.js +0 -1511
  27. package/dist/chunks/SmoothSendSDK-CaV_PCIG.js.map +0 -1
  28. package/dist/chunks/SmoothSendSDK.d-9GBgZONY.d.ts +0 -262
  29. package/dist/chunks/TrueGaslessClient-DThO4Tpb.cjs +0 -1237
  30. package/dist/chunks/TrueGaslessClient-DThO4Tpb.cjs.map +0 -1
  31. package/dist/chunks/TrueGaslessClient-l2uFvNAa.js +0 -1228
  32. package/dist/chunks/TrueGaslessClient-l2uFvNAa.js.map +0 -1
  33. package/dist/chunks/shared-2xx2VLH3.js +0 -453
  34. package/dist/chunks/shared-2xx2VLH3.js.map +0 -1
  35. package/dist/chunks/shared-B8UdyBTN.d.ts +0 -143
  36. package/dist/chunks/shared-BJv1JV1H.cjs +0 -702
  37. package/dist/chunks/shared-BJv1JV1H.cjs.map +0 -1
  38. package/dist/chunks/shared-BXvqbQ6f.d.ts +0 -262
  39. package/dist/chunks/shared-Bh4xtpHv.js +0 -740
  40. package/dist/chunks/shared-Bh4xtpHv.js.map +0 -1
  41. package/dist/chunks/shared-BlIQttCf.d.ts +0 -1279
  42. package/dist/chunks/shared-BoRfHN1w.js +0 -1511
  43. package/dist/chunks/shared-BoRfHN1w.js.map +0 -1
  44. package/dist/chunks/shared-CNF22ESH.js +0 -557
  45. package/dist/chunks/shared-CNF22ESH.js.map +0 -1
  46. package/dist/chunks/shared-CPpb2n9T.d.ts +0 -780
  47. package/dist/chunks/shared-CaQMAGQR.js +0 -1511
  48. package/dist/chunks/shared-CaQMAGQR.js.map +0 -1
  49. package/dist/chunks/shared-Cgb7mhwI.d.ts +0 -471
  50. package/dist/chunks/shared-Cn4duBJT.d.ts +0 -1279
  51. package/dist/chunks/shared-CzR0rIwZ.cjs +0 -635
  52. package/dist/chunks/shared-CzR0rIwZ.cjs.map +0 -1
  53. package/dist/chunks/shared-DEurKmpI.cjs +0 -1519
  54. package/dist/chunks/shared-DEurKmpI.cjs.map +0 -1
  55. package/dist/chunks/shared-DQbEIiTE.cjs +0 -746
  56. package/dist/chunks/shared-DQbEIiTE.cjs.map +0 -1
  57. package/dist/chunks/shared-DYAVFARB.d.ts +0 -472
  58. package/dist/chunks/shared-DzwYUjQn.cjs +0 -457
  59. package/dist/chunks/shared-DzwYUjQn.cjs.map +0 -1
  60. package/dist/chunks/shared-KUvoQkzf.d.ts +0 -471
  61. package/dist/chunks/shared-RVkwmkG7.d.ts +0 -262
  62. package/dist/chunks/shared-XH1iLZjy.js +0 -629
  63. package/dist/chunks/shared-XH1iLZjy.js.map +0 -1
  64. package/dist/chunks/shared-kovW7ATj.js +0 -694
  65. package/dist/chunks/shared-kovW7ATj.js.map +0 -1
  66. package/dist/chunks/shared-viO0MYao.d.ts +0 -459
  67. package/dist/chunks/shared-x1-VC-Li.cjs +0 -568
  68. package/dist/chunks/shared-x1-VC-Li.cjs.map +0 -1
  69. package/dist/chunks/useSmoothSendAvax-BHeW_6x8.cjs +0 -1865
  70. package/dist/chunks/useSmoothSendAvax-BHeW_6x8.cjs.map +0 -1
  71. package/dist/chunks/useSmoothSendAvax-ZuHw1aYi.js +0 -1848
  72. package/dist/chunks/useSmoothSendAvax-ZuHw1aYi.js.map +0 -1
  73. package/dist/chunks/version-CNF22ESH.js +0 -557
  74. package/dist/chunks/version-CNF22ESH.js.map +0 -1
  75. package/dist/chunks/version-x1-VC-Li.cjs +0 -568
  76. package/dist/chunks/version-x1-VC-Li.cjs.map +0 -1
  77. package/dist/chunks/version.d-Cn4duBJT.d.ts +0 -1279
@@ -0,0 +1,49 @@
1
+ import { ChainConfig, SupportedChain, ChainInfo } from '../types';
2
+ export interface DynamicChainConfig extends ChainConfig {
3
+ tokens: string[];
4
+ contractAddress?: string;
5
+ feeSettings?: {
6
+ baseFeeBps: number;
7
+ minFeeWei: string;
8
+ maxFeeBps: number;
9
+ };
10
+ }
11
+ export interface RelayerChainInfo extends ChainInfo {
12
+ contractAddress?: string;
13
+ rpcUrl?: string;
14
+ }
15
+ export declare class ChainConfigService {
16
+ private configCache;
17
+ private cacheExpiry;
18
+ private readonly CACHE_TTL;
19
+ /**
20
+ * Fetch chain configuration from relayer's API endpoints
21
+ */
22
+ fetchChainConfig(relayerUrl: string, chainName?: string): Promise<DynamicChainConfig[]>;
23
+ /**
24
+ * Get configuration for a specific supported chain
25
+ */
26
+ getChainConfig(chain: SupportedChain, fallbackConfig?: ChainConfig): Promise<DynamicChainConfig>;
27
+ /**
28
+ * Get all available chain configurations
29
+ */
30
+ getAllChainConfigs(fallbackConfigs?: Record<SupportedChain, ChainConfig>): Promise<Record<string, DynamicChainConfig>>;
31
+ /**
32
+ * Clear the configuration cache
33
+ */
34
+ clearCache(): void;
35
+ /**
36
+ * Set custom cache TTL
37
+ */
38
+ setCacheTtl(ttlMs: number): void;
39
+ private mapRelayerChainToConfig;
40
+ private getRelayerUrlForChain;
41
+ private matchesChain;
42
+ private matchesChainName;
43
+ private getChainKey;
44
+ private getDefaultRpcUrl;
45
+ private getNativeCurrencyForChain;
46
+ private getDefaultTokensForChain;
47
+ }
48
+ export declare const chainConfigService: ChainConfigService;
49
+ //# sourceMappingURL=chainConfigService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chainConfigService.d.ts","sourceRoot":"","sources":["../../src/services/chainConfigService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAe,SAAS,EAAE,MAAM,UAAU,CAAC;AAG/E,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE;QACZ,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,WAAW,CAA8C;IACjE,OAAO,CAAC,WAAW,CAAkC;IACrD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiB;IAE3C;;OAEG;IACG,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAyC7F;;OAEG;IACG,cAAc,CAClB,KAAK,EAAE,cAAc,EACrB,cAAc,CAAC,EAAE,WAAW,GAC3B,OAAO,CAAC,kBAAkB,CAAC;IAyB9B;;OAEG;IACG,kBAAkB,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IA0C5H;;OAEG;IACH,UAAU,IAAI,IAAI;IAKlB;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKhC,OAAO,CAAC,uBAAuB;IAc/B,OAAO,CAAC,qBAAqB;IAkB7B,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,yBAAyB;IA4BjC,OAAO,CAAC,wBAAwB;CAUjC;AAGD,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
package/package.json CHANGED
@@ -1,120 +1,120 @@
1
- {
2
- "name": "@smoothsend/sdk",
3
- "version": "2.3.6",
4
- "description": "Multi-chain gasless transaction SDK Aptos, Avax & more support coming soon like stellar or solana",
5
- "type": "module",
6
- "main": "dist/index.cjs",
7
- "module": "dist/index.js",
8
- "types": "dist/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "import": "./dist/index.js",
12
- "require": "./dist/index.cjs",
13
- "types": "./dist/index.d.ts"
14
- },
15
- "./avax": {
16
- "import": "./dist/avax/index.js",
17
- "require": "./dist/avax/index.cjs",
18
- "types": "./dist/avax/index.d.ts"
19
- },
20
- "./aptos": {
21
- "import": "./dist/aptos/index.js",
22
- "require": "./dist/aptos/index.cjs",
23
- "types": "./dist/aptos/index.d.ts"
24
- },
25
- "./stellar": {
26
- "import": "./dist/stellar/index.js",
27
- "require": "./dist/stellar/index.cjs",
28
- "types": "./dist/stellar/index.d.ts"
29
- },
30
- "./package.json": "./package.json"
31
- },
32
- "files": [
33
- "dist",
34
- "README.md"
35
- ],
36
- "scripts": {
37
- "build": "rollup -c",
38
- "dev": "rollup -c -w",
39
- "test": "jest",
40
- "lint": "eslint src --ext .ts",
41
- "lint:fix": "eslint src --ext .ts --fix",
42
- "typecheck": "tsc --noEmit",
43
- "prepublishOnly": "npm run build",
44
- "example:authentication": "ts-node examples/authentication.ts",
45
- "example:health-status": "ts-node examples/health-and-status.ts",
46
- "example:usage-tracking": "ts-node examples/usage-tracking.ts",
47
- "example:token-sender": "cd examples/token-sender && npm run dev",
48
- "example:nft-marketplace": "cd examples/nft-marketplace && npm run dev",
49
- "example:avax-smoke": "tsx examples/avax/01-gateway-smoke.ts",
50
- "example:avax-backend-sponsored": "tsx examples/avax/02-backend-sponsored-submit.ts",
51
- "example:avax-backend-erc20": "tsx examples/avax/03-backend-user-pays-erc20.ts",
52
- "example:avax-low-level": "tsx examples/avax/04-low-level-steps.ts"
53
- },
54
- "keywords": [
55
- "aptos",
56
- "stellar",
57
- "gasless",
58
- "transactions",
59
- "gas-free",
60
- "sponsored-transactions",
61
- "c-address",
62
- "smart-account",
63
- "soroban",
64
- "wallet-adapter",
65
- "move",
66
- "xlm",
67
- "usdc",
68
- "blockchain",
69
- "dapp",
70
- "web3",
71
- "relayer",
72
- "smoothsend"
73
- ],
74
- "author": "SmoothSend Team",
75
- "license": "MIT",
76
- "repository": {
77
- "type": "git",
78
- "url": "https://github.com/smoothsend-sdk.git"
79
- },
80
- "bugs": {
81
- "url": "https://github.com/smoothsend-sdk/issues"
82
- },
83
- "homepage": "https://smoothsend.xyz",
84
- "peerDependencies": {
85
- "@aptos-labs/ts-sdk": ">=6.0.0",
86
- "@aptos-labs/wallet-adapter-core": ">=3.0.0",
87
- "@aptos-labs/wallet-adapter-react": ">=3.0.0",
88
- "react": ">=17.0.0",
89
- "viem": ">=2.21.0"
90
- },
91
- "dependencies": {
92
- "axios": "^1.6.0"
93
- },
94
- "devDependencies": {
95
- "@aptos-labs/ts-sdk": "^6.3.1",
96
- "@aptos-labs/wallet-adapter-react": "^3.0.0",
97
- "@rollup/plugin-commonjs": "^25.0.7",
98
- "@rollup/plugin-node-resolve": "^15.2.3",
99
- "@rollup/plugin-typescript": "^11.1.5",
100
- "@types/jest": "^29.5.5",
101
- "@types/node": "^20.8.0",
102
- "@types/react": "^18.0.0",
103
- "@typescript-eslint/eslint-plugin": "^6.8.0",
104
- "@typescript-eslint/parser": "^6.8.0",
105
- "eslint": "^8.51.0",
106
- "jest": "^29.7.0",
107
- "react": "^18.0.0",
108
- "rollup": "^4.0.0",
109
- "rollup-plugin-dts": "^6.1.0",
110
- "ts-jest": "^29.1.1",
111
- "ts-node": "^10.9.2",
112
- "tslib": "^2.8.1",
113
- "tsx": "^4.19.2",
114
- "typescript": "^5.2.2",
115
- "viem": "^2.21.54"
116
- },
117
- "engines": {
118
- "node": ">=16.0.0"
119
- }
120
- }
1
+ {
2
+ "name": "@smoothsend/sdk",
3
+ "version": "2.3.8",
4
+ "description": "Multi-chain gasless transaction SDK Aptos, Avax & more support coming soon like stellar or solana",
5
+ "type": "module",
6
+ "main": "dist/index.cjs",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.cjs",
13
+ "types": "./dist/index.d.ts"
14
+ },
15
+ "./avax": {
16
+ "import": "./dist/avax/index.js",
17
+ "require": "./dist/avax/index.cjs",
18
+ "types": "./dist/avax/index.d.ts"
19
+ },
20
+ "./aptos": {
21
+ "import": "./dist/aptos/index.js",
22
+ "require": "./dist/aptos/index.cjs",
23
+ "types": "./dist/aptos/index.d.ts"
24
+ },
25
+ "./stellar": {
26
+ "import": "./dist/stellar/index.js",
27
+ "require": "./dist/stellar/index.cjs",
28
+ "types": "./dist/stellar/index.d.ts"
29
+ },
30
+ "./package.json": "./package.json"
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "README.md"
35
+ ],
36
+ "scripts": {
37
+ "build": "rollup -c",
38
+ "dev": "rollup -c -w",
39
+ "test": "jest",
40
+ "lint": "eslint src --ext .ts",
41
+ "lint:fix": "eslint src --ext .ts --fix",
42
+ "typecheck": "tsc --noEmit",
43
+ "prepublishOnly": "npm run build",
44
+ "example:authentication": "ts-node examples/authentication.ts",
45
+ "example:health-status": "ts-node examples/health-and-status.ts",
46
+ "example:usage-tracking": "ts-node examples/usage-tracking.ts",
47
+ "example:token-sender": "cd examples/token-sender && npm run dev",
48
+ "example:nft-marketplace": "cd examples/nft-marketplace && npm run dev",
49
+ "example:avax-smoke": "tsx examples/avax/01-gateway-smoke.ts",
50
+ "example:avax-backend-sponsored": "tsx examples/avax/02-backend-sponsored-submit.ts",
51
+ "example:avax-backend-erc20": "tsx examples/avax/03-backend-user-pays-erc20.ts",
52
+ "example:avax-low-level": "tsx examples/avax/04-low-level-steps.ts"
53
+ },
54
+ "keywords": [
55
+ "aptos",
56
+ "stellar",
57
+ "gasless",
58
+ "transactions",
59
+ "gas-free",
60
+ "sponsored-transactions",
61
+ "c-address",
62
+ "smart-account",
63
+ "soroban",
64
+ "wallet-adapter",
65
+ "move",
66
+ "xlm",
67
+ "usdc",
68
+ "blockchain",
69
+ "dapp",
70
+ "web3",
71
+ "relayer",
72
+ "smoothsend"
73
+ ],
74
+ "author": "SmoothSend Team",
75
+ "license": "MIT",
76
+ "repository": {
77
+ "type": "git",
78
+ "url": "git+https://github.com/SmoothSend/smoothsend-sdk.git"
79
+ },
80
+ "bugs": {
81
+ "url": "https://github.com/SmoothSend/smoothsend-sdk/issues"
82
+ },
83
+ "homepage": "https://smoothsend.xyz",
84
+ "peerDependencies": {
85
+ "@aptos-labs/ts-sdk": ">=6.0.0",
86
+ "@aptos-labs/wallet-adapter-core": ">=3.0.0",
87
+ "@aptos-labs/wallet-adapter-react": ">=3.0.0",
88
+ "react": ">=17.0.0",
89
+ "viem": ">=2.21.0"
90
+ },
91
+ "dependencies": {
92
+ "axios": "^1.6.0"
93
+ },
94
+ "devDependencies": {
95
+ "@aptos-labs/ts-sdk": "^6.3.1",
96
+ "@aptos-labs/wallet-adapter-react": "^3.0.0",
97
+ "@rollup/plugin-commonjs": "^25.0.7",
98
+ "@rollup/plugin-node-resolve": "^15.2.3",
99
+ "@rollup/plugin-typescript": "^11.1.5",
100
+ "@types/jest": "^29.5.5",
101
+ "@types/node": "^20.8.0",
102
+ "@types/react": "^18.0.0",
103
+ "@typescript-eslint/eslint-plugin": "^6.8.0",
104
+ "@typescript-eslint/parser": "^6.8.0",
105
+ "eslint": "^8.51.0",
106
+ "jest": "^29.7.0",
107
+ "react": "^18.0.0",
108
+ "rollup": "^4.0.0",
109
+ "rollup-plugin-dts": "^6.1.0",
110
+ "ts-jest": "^29.1.1",
111
+ "ts-node": "^10.9.2",
112
+ "tslib": "^2.8.1",
113
+ "tsx": "^4.19.2",
114
+ "typescript": "^5.2.2",
115
+ "viem": "^2.21.54"
116
+ },
117
+ "engines": {
118
+ "node": ">=16.0.0"
119
+ }
120
+ }
@@ -1,40 +0,0 @@
1
- 'use strict';
2
-
3
- var privyAptosSigner = require('../chunks/shared-BJv1JV1H.cjs');
4
- var react = require('react');
5
- require('@aptos-labs/ts-sdk');
6
-
7
- /**
8
- * AVAX-style Aptos + Privy hook.
9
- *
10
- * The dApp handles Privy login/wallet creation. SmoothSend starts here: pass
11
- * the Privy Aptos wallet + `useSignRawHash().signRawHash`, then call
12
- * `signAndSubmitTransaction` instead of the raw Aptos SDK submit path.
13
- */
14
- function useSmoothSendPrivyWrite(params) {
15
- const wallet = react.useMemo(() => privyAptosSigner.normalizePrivyAptosWallet(params.wallet), [params.wallet]);
16
- const signer = react.useMemo(() => params.signRawHash
17
- ? privyAptosSigner.createPrivyAptosSigner({
18
- wallet,
19
- signRawHash: params.signRawHash,
20
- })
21
- : undefined, [wallet, params.signRawHash]);
22
- return privyAptosSigner.useSmoothSendAptosPrivy({
23
- apiKey: params.apiKey,
24
- network: params.network,
25
- address: wallet?.address,
26
- publicKey: wallet?.publicKey,
27
- signRawHash: signer,
28
- fullnode: params.fullnode,
29
- aptosApiKey: params.aptosApiKey,
30
- gatewayUrl: params.gatewayUrl,
31
- debug: params.debug,
32
- });
33
- }
34
-
35
- exports.createPrivyAptosSigner = privyAptosSigner.createPrivyAptosSigner;
36
- exports.normalizePrivyAptosPublicKey = privyAptosSigner.normalizePrivyAptosPublicKey;
37
- exports.normalizePrivyAptosWallet = privyAptosSigner.normalizePrivyAptosWallet;
38
- exports.useSmoothSendAptosPrivy = privyAptosSigner.useSmoothSendAptosPrivy;
39
- exports.useSmoothSendPrivyWrite = useSmoothSendPrivyWrite;
40
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sources":["../../src/aptos-privy/useSmoothSendPrivyWrite.tsx"],"sourcesContent":[null],"names":["useMemo","normalizePrivyAptosWallet","createPrivyAptosSigner","useSmoothSendAptosPrivy"],"mappings":";;;;;;AASA;;;;;;AAMG;AACG,SAAU,uBAAuB,CACrC,MAAqC,EAAA;IAErC,MAAM,MAAM,GAAGA,aAAO,CACpB,MAAMC,0CAAyB,CAAC,MAAM,CAAC,MAAM,CAAC,EAC9C,CAAC,MAAM,CAAC,MAAM,CAAC,CAChB;IAED,MAAM,MAAM,GAAGD,aAAO,CACpB,MACE,MAAM,CAAC;UACHE,uCAAsB,CAAC;YACrB,MAAM;YACN,WAAW,EAAE,MAAM,CAAC,WAAW;SAChC;UACD,SAAS,EACf,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,CAC7B;AAED,IAAA,OAAOC,wCAAuB,CAAC;QAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,OAAO,EAAE,MAAM,EAAE,OAAO;QACxB,SAAS,EAAE,MAAM,EAAE,SAAS;AAC5B,QAAA,WAAW,EAAE,MAAM;QACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,KAAK,EAAE,MAAM,CAAC,KAAK;AACpB,KAAA,CAAC;AACJ;;;;;;;;"}
@@ -1,34 +0,0 @@
1
- import { n as normalizePrivyAptosWallet, c as createPrivyAptosSigner, u as useSmoothSendAptosPrivy } from '../chunks/shared-kovW7ATj.js';
2
- export { a as normalizePrivyAptosPublicKey } from '../chunks/shared-kovW7ATj.js';
3
- import { useMemo } from 'react';
4
-
5
- /**
6
- * AVAX-style Aptos + Privy hook.
7
- *
8
- * The dApp handles Privy login/wallet creation. SmoothSend starts here: pass
9
- * the Privy Aptos wallet + `useSignRawHash().signRawHash`, then call
10
- * `signAndSubmitTransaction` instead of the raw Aptos SDK submit path.
11
- */
12
- function useSmoothSendPrivyWrite(params) {
13
- const wallet = useMemo(() => normalizePrivyAptosWallet(params.wallet), [params.wallet]);
14
- const signer = useMemo(() => params.signRawHash
15
- ? createPrivyAptosSigner({
16
- wallet,
17
- signRawHash: params.signRawHash,
18
- })
19
- : undefined, [wallet, params.signRawHash]);
20
- return useSmoothSendAptosPrivy({
21
- apiKey: params.apiKey,
22
- network: params.network,
23
- address: wallet?.address,
24
- publicKey: wallet?.publicKey,
25
- signRawHash: signer,
26
- fullnode: params.fullnode,
27
- aptosApiKey: params.aptosApiKey,
28
- gatewayUrl: params.gatewayUrl,
29
- debug: params.debug,
30
- });
31
- }
32
-
33
- export { createPrivyAptosSigner, normalizePrivyAptosWallet, useSmoothSendAptosPrivy, useSmoothSendPrivyWrite };
34
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../src/aptos-privy/useSmoothSendPrivyWrite.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;AASA;;;;;;AAMG;AACG,SAAU,uBAAuB,CACrC,MAAqC,EAAA;IAErC,MAAM,MAAM,GAAG,OAAO,CACpB,MAAM,yBAAyB,CAAC,MAAM,CAAC,MAAM,CAAC,EAC9C,CAAC,MAAM,CAAC,MAAM,CAAC,CAChB;IAED,MAAM,MAAM,GAAG,OAAO,CACpB,MACE,MAAM,CAAC;UACH,sBAAsB,CAAC;YACrB,MAAM;YACN,WAAW,EAAE,MAAM,CAAC,WAAW;SAChC;UACD,SAAS,EACf,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,CAC7B;AAED,IAAA,OAAO,uBAAuB,CAAC;QAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,OAAO,EAAE,MAAM,EAAE,OAAO;QACxB,SAAS,EAAE,MAAM,EAAE,SAAS;AAC5B,QAAA,WAAW,EAAE,MAAM;QACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,KAAK,EAAE,MAAM,CAAC,KAAK;AACpB,KAAA,CAAC;AACJ;;;;"}
@@ -1,4 +0,0 @@
1
- import type { PrivyAptosWalletInfo } from './types';
2
- export declare function normalizePrivyAptosPublicKey(publicKey?: string | null): string | undefined;
3
- export declare function normalizePrivyAptosWallet(wallet: PrivyAptosWalletInfo | null | undefined): PrivyAptosWalletInfo | undefined;
4
- //# sourceMappingURL=normalizePrivyAptosWallet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalizePrivyAptosWallet.d.ts","sourceRoot":"","sources":["../../src/aptos-privy/normalizePrivyAptosWallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAepD,wBAAgB,4BAA4B,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAyC1F;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,GAC9C,oBAAoB,GAAG,SAAS,CASlC"}
@@ -1,32 +0,0 @@
1
- /**
2
- * Adapter that wraps Privy's `useSignRawHash().signRawHash` (Tier-2 chains)
3
- * into the `PrivyAptosRawSigner` shape expected by `useSmoothSendAptosPrivy`.
4
- *
5
- * The SDK does NOT import `@privy-io/react-auth` directly — the dApp passes
6
- * the function in. This keeps Privy as an optional dependency.
7
- *
8
- * @example
9
- * ```tsx
10
- * import { useSignRawHash } from '@privy-io/react-auth/extended-chains';
11
- * import { createPrivyAptosSigner, useSmoothSendAptosPrivy } from '@smoothsend/sdk/aptos';
12
- *
13
- * const { signRawHash } = useSignRawHash();
14
- * const signer = createPrivyAptosSigner({ wallet: aptosWallet, signRawHash });
15
- *
16
- * const { signAndSubmitTransaction } = useSmoothSendAptosPrivy({
17
- * apiKey, network: 'testnet',
18
- * address: aptosWallet?.address,
19
- * publicKey: aptosWallet?.publicKey,
20
- * signRawHash: signer,
21
- * });
22
- * ```
23
- */
24
- import type { PrivyAptosRawSigner, PrivyAptosSignRawHash, PrivyAptosWalletInfo } from './types';
25
- export interface CreatePrivyAptosSignerParams {
26
- /** Aptos embedded wallet from Privy. Look it up via `user.linkedAccounts`. */
27
- wallet: PrivyAptosWalletInfo | null | undefined;
28
- /** The `signRawHash` function returned by `useSignRawHash()`. */
29
- signRawHash: PrivyAptosSignRawHash;
30
- }
31
- export declare function createPrivyAptosSigner(params: CreatePrivyAptosSignerParams): PrivyAptosRawSigner;
32
- //# sourceMappingURL=privyAptosSigner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"privyAptosSigner.d.ts","sourceRoot":"","sources":["../../src/aptos-privy/privyAptosSigner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEhG,MAAM,WAAW,4BAA4B;IAC3C,8EAA8E;IAC9E,MAAM,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,CAAC;IAChD,iEAAiE;IACjE,WAAW,EAAE,qBAAqB,CAAC;CACpC;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,4BAA4B,GACnC,mBAAmB,CAkBrB"}
@@ -1,13 +0,0 @@
1
- /**
2
- * `useSmoothSendAptosPrivy` — Aptos + Privy gasless writes via SmoothSend.
3
- *
4
- * Privy's embedded ed25519 wallet signs the signing-message hash via
5
- * `signRawHash`. SmoothSend's relayer then adds the fee-payer signature and
6
- * submits, so the end user pays 0 APT gas.
7
- *
8
- * This hook is a thin shell over the existing `SmoothSendTransactionSubmitter`
9
- * — same gasless gateway path used by all other Aptos integrations.
10
- */
11
- import type { UseSmoothSendAptosPrivyParams, UseSmoothSendAptosPrivyResult } from './types';
12
- export declare function useSmoothSendAptosPrivy(params: UseSmoothSendAptosPrivyParams): UseSmoothSendAptosPrivyResult;
13
- //# sourceMappingURL=useSmoothSendAptosPrivy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSmoothSendAptosPrivy.d.ts","sourceRoot":"","sources":["../../src/aptos-privy/useSmoothSendAptosPrivy.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAeH,OAAO,KAAK,EAEV,6BAA6B,EAC7B,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AAcjB,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,6BAA6B,GACpC,6BAA6B,CAkJ/B"}
@@ -1,9 +0,0 @@
1
- /**
2
- * @smoothsend/sdk/aptos-privy
3
- *
4
- * Lightweight Aptos + Privy entrypoint focused on embedded-wallet signing
5
- * and SmoothSend gasless submission, without pulling broader Aptos wallet
6
- * adapter integration surface.
7
- */
8
- export { useSmoothSendAptosPrivy, useSmoothSendPrivyWrite, createPrivyAptosSigner, normalizePrivyAptosPublicKey, normalizePrivyAptosWallet, type CreatePrivyAptosSignerParams, type AptosPrivyHash, type PrivyAptosSignRawHash, type PrivyAptosRawSigner, type PrivyAptosWalletInfo, type SignAndSubmitTransactionInput, type UseSmoothSendAptosPrivyParams, type UseSmoothSendAptosPrivyResult, type UseSmoothSendPrivyWriteParams, type UseSmoothSendPrivyWriteResult, } from './aptos-privy';
9
- //# sourceMappingURL=aptos-privy-entry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"aptos-privy-entry.d.ts","sourceRoot":"","sources":["../src/aptos-privy-entry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAC5B,yBAAyB,EACzB,KAAK,4BAA4B,EACjC,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,GACnC,MAAM,eAAe,CAAC"}