@smoothsend/sdk 2.2.1 → 2.2.2

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/package.json CHANGED
@@ -1,110 +1,121 @@
1
- {
2
- "name": "@smoothsend/sdk",
3
- "version": "2.2.1",
4
- "description": "Multi-chain gasless transaction SDK with C-Address (Soroban Smart Account) support for Stellar, Aptos & more",
5
- "type": "module",
6
- "main": "dist/index.js",
7
- "module": "dist/index.esm.js",
8
- "types": "dist/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "import": "./dist/index.esm.js",
12
- "require": "./dist/index.js",
13
- "types": "./dist/index.d.ts"
14
- }
15
- },
16
- "files": [
17
- "dist",
18
- "README.md"
19
- ],
20
- "scripts": {
21
- "build": "rollup -c",
22
- "dev": "rollup -c -w",
23
- "test": "jest",
24
- "lint": "eslint src --ext .ts",
25
- "lint:fix": "eslint src --ext .ts --fix",
26
- "typecheck": "tsc --noEmit",
27
- "prepublishOnly": "npm run build",
28
- "example:authentication": "ts-node examples/authentication.ts",
29
- "example:health-status": "ts-node examples/health-and-status.ts",
30
- "example:usage-tracking": "ts-node examples/usage-tracking.ts",
31
- "example:token-sender": "cd examples/token-sender && npm run dev",
32
- "example:nft-marketplace": "cd examples/nft-marketplace && npm run dev"
33
- },
34
- "keywords": [
35
- "aptos",
36
- "stellar",
37
- "gasless",
38
- "transactions",
39
- "gas-free",
40
- "sponsored-transactions",
41
- "c-address",
42
- "smart-account",
43
- "soroban",
44
- "wallet-adapter",
45
- "move",
46
- "xlm",
47
- "usdc",
48
- "blockchain",
49
- "dapp",
50
- "web3",
51
- "relayer",
52
- "smoothsend"
53
- ],
54
- "author": "SmoothSend Team",
55
- "license": "MIT",
56
- "repository": {
57
- "type": "git",
58
- "url": "https://github.com/smoothsend-sdk.git"
59
- },
60
- "bugs": {
61
- "url": "https://github.com/smoothsend-sdk/issues"
62
- },
63
- "homepage": "https://smoothsend.xyz",
64
- "peerDependencies": {
65
- "@aptos-labs/ts-sdk": ">=6.0.0",
66
- "@aptos-labs/wallet-adapter-core": ">=3.0.0",
67
- "@aptos-labs/wallet-adapter-react": ">=3.0.0",
68
- "react": ">=17.0.0"
69
- },
70
- "peerDependenciesMeta": {
71
- "@aptos-labs/ts-sdk": {
72
- "optional": false
73
- },
74
- "@aptos-labs/wallet-adapter-core": {
75
- "optional": true
76
- },
77
- "@aptos-labs/wallet-adapter-react": {
78
- "optional": true
79
- },
80
- "react": {
81
- "optional": true
82
- }
83
- },
84
- "dependencies": {
85
- "axios": "^1.6.0"
86
- },
87
- "devDependencies": {
88
- "@aptos-labs/ts-sdk": "^6.3.1",
89
- "@aptos-labs/wallet-adapter-react": "^3.0.0",
90
- "@rollup/plugin-commonjs": "^25.0.7",
91
- "@rollup/plugin-node-resolve": "^15.2.3",
92
- "@rollup/plugin-typescript": "^11.1.5",
93
- "@types/jest": "^29.5.5",
94
- "@types/node": "^20.8.0",
95
- "@types/react": "^18.0.0",
96
- "@typescript-eslint/eslint-plugin": "^6.8.0",
97
- "@typescript-eslint/parser": "^6.8.0",
98
- "eslint": "^8.51.0",
99
- "jest": "^29.7.0",
100
- "react": "^18.0.0",
101
- "rollup": "^4.0.0",
102
- "rollup-plugin-dts": "^6.1.0",
103
- "ts-jest": "^29.1.1",
104
- "tslib": "^2.8.1",
105
- "typescript": "^5.2.2"
106
- },
107
- "engines": {
108
- "node": ">=16.0.0"
109
- }
110
- }
1
+ {
2
+ "name": "@smoothsend/sdk",
3
+ "version": "2.2.2",
4
+ "description": "Multi-chain gasless transaction SDK with C-Address (Soroban Smart Account) support for Stellar,Avax, Aptos & more",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.esm.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.esm.js",
12
+ "require": "./dist/index.js",
13
+ "types": "./dist/index.d.ts"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md"
19
+ ],
20
+ "scripts": {
21
+ "build": "rollup -c",
22
+ "dev": "rollup -c -w",
23
+ "test": "jest",
24
+ "lint": "eslint src --ext .ts",
25
+ "lint:fix": "eslint src --ext .ts --fix",
26
+ "typecheck": "tsc --noEmit",
27
+ "prepublishOnly": "npm run build",
28
+ "example:authentication": "ts-node examples/authentication.ts",
29
+ "example:health-status": "ts-node examples/health-and-status.ts",
30
+ "example:usage-tracking": "ts-node examples/usage-tracking.ts",
31
+ "example:token-sender": "cd examples/token-sender && npm run dev",
32
+ "example:nft-marketplace": "cd examples/nft-marketplace && npm run dev",
33
+ "example:avax-smoke": "tsx examples/avax/01-gateway-smoke.ts",
34
+ "example:avax-backend-sponsored": "tsx examples/avax/02-backend-sponsored-submit.ts",
35
+ "example:avax-backend-erc20": "tsx examples/avax/03-backend-user-pays-erc20.ts",
36
+ "example:avax-low-level": "tsx examples/avax/04-low-level-steps.ts"
37
+ },
38
+ "keywords": [
39
+ "aptos",
40
+ "stellar",
41
+ "gasless",
42
+ "transactions",
43
+ "gas-free",
44
+ "sponsored-transactions",
45
+ "c-address",
46
+ "smart-account",
47
+ "soroban",
48
+ "wallet-adapter",
49
+ "move",
50
+ "xlm",
51
+ "usdc",
52
+ "blockchain",
53
+ "dapp",
54
+ "web3",
55
+ "relayer",
56
+ "smoothsend"
57
+ ],
58
+ "author": "SmoothSend Team",
59
+ "license": "MIT",
60
+ "repository": {
61
+ "type": "git",
62
+ "url": "https://github.com/smoothsend-sdk.git"
63
+ },
64
+ "bugs": {
65
+ "url": "https://github.com/smoothsend-sdk/issues"
66
+ },
67
+ "homepage": "https://smoothsend.xyz",
68
+ "peerDependencies": {
69
+ "@aptos-labs/ts-sdk": ">=6.0.0",
70
+ "@aptos-labs/wallet-adapter-core": ">=3.0.0",
71
+ "@aptos-labs/wallet-adapter-react": ">=3.0.0",
72
+ "react": ">=17.0.0",
73
+ "viem": ">=2.21.0"
74
+ },
75
+ "peerDependenciesMeta": {
76
+ "@aptos-labs/ts-sdk": {
77
+ "optional": false
78
+ },
79
+ "@aptos-labs/wallet-adapter-core": {
80
+ "optional": true
81
+ },
82
+ "@aptos-labs/wallet-adapter-react": {
83
+ "optional": true
84
+ },
85
+ "react": {
86
+ "optional": true
87
+ },
88
+ "viem": {
89
+ "optional": true
90
+ }
91
+ },
92
+ "dependencies": {
93
+ "axios": "^1.6.0"
94
+ },
95
+ "devDependencies": {
96
+ "@aptos-labs/ts-sdk": "^6.3.1",
97
+ "@aptos-labs/wallet-adapter-react": "^3.0.0",
98
+ "@rollup/plugin-commonjs": "^25.0.7",
99
+ "@rollup/plugin-node-resolve": "^15.2.3",
100
+ "@rollup/plugin-typescript": "^11.1.5",
101
+ "@types/jest": "^29.5.5",
102
+ "@types/node": "^20.8.0",
103
+ "@types/react": "^18.0.0",
104
+ "@typescript-eslint/eslint-plugin": "^6.8.0",
105
+ "@typescript-eslint/parser": "^6.8.0",
106
+ "eslint": "^8.51.0",
107
+ "jest": "^29.7.0",
108
+ "react": "^18.0.0",
109
+ "rollup": "^4.0.0",
110
+ "rollup-plugin-dts": "^6.1.0",
111
+ "ts-jest": "^29.1.1",
112
+ "ts-node": "^10.9.2",
113
+ "tslib": "^2.8.1",
114
+ "tsx": "^4.19.2",
115
+ "typescript": "^5.2.2",
116
+ "viem": "^2.21.54"
117
+ },
118
+ "engines": {
119
+ "node": ">=16.0.0"
120
+ }
121
+ }
@@ -1,39 +0,0 @@
1
- import { SupportedChain, IChainAdapter, ChainConfig, TransferRequest, TransferQuote, SignatureData, SignedTransferData, TransferResult, TokenInfo } from '../types';
2
- /**
3
- * EVM Multi-Chain Adapter
4
- * Handles all EVM-compatible chains (Avalanche, Polygon, Ethereum, Arbitrum, Base)
5
- * Routes requests to the appropriate chain endpoint on the EVM relayer
6
- */
7
- export declare class EVMAdapter implements IChainAdapter {
8
- readonly chain: SupportedChain;
9
- readonly config: ChainConfig;
10
- private httpClient;
11
- constructor(chain: SupportedChain, config: ChainConfig, relayerUrl: string);
12
- /**
13
- * Build API path with chain name for EVM relayer
14
- * EVM relayer uses /chains/{chainName} prefix for most endpoints
15
- */
16
- private getApiPath;
17
- getQuote(request: TransferRequest): Promise<TransferQuote>;
18
- prepareTransfer(request: TransferRequest, quote: TransferQuote): Promise<SignatureData>;
19
- executeTransfer(signedData: SignedTransferData): Promise<TransferResult>;
20
- /**
21
- * EVM-specific batch transfer support
22
- * Takes advantage of the EVM relayer's native batch capabilities
23
- */
24
- executeBatchTransfer?(signedTransfers: SignedTransferData[]): Promise<TransferResult[]>;
25
- getTokenInfo(token: string): Promise<TokenInfo>;
26
- getNonce(address: string): Promise<string>;
27
- getTransactionStatus(txHash: string): Promise<any>;
28
- validateAddress(address: string): boolean;
29
- validateAmount(amount: string, token: string): Promise<boolean>;
30
- /**
31
- * EVM-specific gas estimation
32
- */
33
- estimateGas(transfers: any[]): Promise<any>;
34
- /**
35
- * EVM-specific permit support check
36
- */
37
- supportsPermit(tokenAddress: string): Promise<boolean>;
38
- }
39
- //# sourceMappingURL=evm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../src/adapters/evm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,aAAa,EACb,WAAW,EACX,eAAe,EACf,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,cAAc,EAEd,SAAS,EAGV,MAAM,UAAU,CAAC;AAGlB;;;;GAIG;AACH,qBAAa,UAAW,YAAW,aAAa;IAC9C,SAAgB,KAAK,EAAE,cAAc,CAAC;IACtC,SAAgB,MAAM,EAAE,WAAW,CAAC;IACpC,OAAO,CAAC,UAAU,CAAa;gBAEnB,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM;IAe1E;;;OAGG;IACH,OAAO,CAAC,UAAU;IASZ,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC;IA+B1D,eAAe,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAqCvF,eAAe,CAAC,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC;IA4B9E;;;OAGG;IACG,oBAAoB,CAAC,CAAC,eAAe,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAqBvF,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IA8B/C,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAuB1C,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAkBxD,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAKnC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IASrE;;OAEG;IACG,WAAW,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAoBjD;;OAEG;IACG,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAc7D"}
@@ -1,7 +0,0 @@
1
- import { ChainConfig, SupportedChain } from '../types';
2
- export declare const CHAIN_CONFIGS: Record<SupportedChain, ChainConfig>;
3
- export declare function getChainConfig(chain: SupportedChain): ChainConfig;
4
- export declare function getAllChainConfigs(): Record<SupportedChain, ChainConfig>;
5
- export declare const TOKEN_DECIMALS: Record<string, number>;
6
- export declare function getTokenDecimals(token: string): number;
7
- //# sourceMappingURL=chains.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../../src/config/chains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAIvD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,cAAc,EAAE,WAAW,CA2C7D,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,WAAW,CAEjE;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,CAExE;AAID,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAKjD,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtD"}
@@ -1,49 +0,0 @@
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.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