@smoothsend/sdk 1.0.2 → 2.0.1
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/README.md +45 -8
- package/dist/adapters/aptos.d.ts +1 -0
- package/dist/adapters/aptos.d.ts.map +1 -1
- package/dist/adapters/stellar-c-address.d.ts +179 -0
- package/dist/adapters/stellar-c-address.d.ts.map +1 -0
- package/dist/adapters/stellar.d.ts +31 -0
- package/dist/adapters/stellar.d.ts.map +1 -0
- package/dist/core/SmoothSendSDK.d.ts +16 -17
- package/dist/core/SmoothSendSDK.d.ts.map +1 -1
- package/dist/index.d.ts +288 -39
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +517 -52
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +519 -51
- package/dist/index.js.map +1 -1
- package/dist/shared-constants.d.ts +17 -9
- package/dist/shared-constants.d.ts.map +1 -1
- package/dist/types/index.d.ts +46 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/wallet-adapter/SmoothSendTransactionSubmitter.d.ts +7 -0
- package/dist/wallet-adapter/SmoothSendTransactionSubmitter.d.ts.map +1 -1
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# SmoothSend SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Multi-chain gasless transaction SDK. Enable gas-free transactions with just 3 lines of code. Supports **Aptos** and **Stellar**.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@smoothsend/sdk)
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
@@ -8,11 +8,12 @@ Gasless transaction SDK for Aptos. Enable gas-free transactions with just 3 line
|
|
|
8
8
|
|
|
9
9
|
## 🚀 Features
|
|
10
10
|
|
|
11
|
-
- **Gasless Transactions**: Users don't need APT for gas fees
|
|
12
|
-
- **
|
|
11
|
+
- **Gasless Transactions**: Users don't need APT or XLM for gas fees
|
|
12
|
+
- **Multi-Chain**: Aptos + Stellar (same 3-line API)
|
|
13
|
+
- **3-Line Integration**: Works with Aptos Wallet Adapter and Stellar wallets (Freighter, etc.)
|
|
13
14
|
- **Type-Safe**: Full TypeScript support with comprehensive type definitions
|
|
14
|
-
- **Testnet & Mainnet**: Supports both networks
|
|
15
|
-
- **Fee-in-Token**: On mainnet, tiny fee deducted from token (not APT)
|
|
15
|
+
- **Testnet & Mainnet**: Supports both networks on each chain
|
|
16
|
+
- **Fee-in-Token**: On Aptos mainnet, tiny fee deducted from token (not APT)
|
|
16
17
|
|
|
17
18
|
## 📦 Installation
|
|
18
19
|
|
|
@@ -225,7 +226,7 @@ const smoothSend = new SmoothSendSDK({
|
|
|
225
226
|
retries: 3
|
|
226
227
|
});
|
|
227
228
|
|
|
228
|
-
// Execute transfer from backend
|
|
229
|
+
// Execute Aptos transfer from backend
|
|
229
230
|
const result = await smoothSend.executeGaslessTransfer({
|
|
230
231
|
transactionBytes: signedTx.transactionBytes,
|
|
231
232
|
authenticatorBytes: signedTx.authenticatorBytes,
|
|
@@ -233,15 +234,48 @@ const result = await smoothSend.executeGaslessTransfer({
|
|
|
233
234
|
network: 'mainnet'
|
|
234
235
|
});
|
|
235
236
|
|
|
237
|
+
// Or Stellar - submit signed XDR
|
|
238
|
+
const stellarResult = await smoothSend.submitStellarTransaction(signedXdr);
|
|
239
|
+
|
|
236
240
|
console.log('Transfer successful:', result.txHash);
|
|
237
241
|
```
|
|
238
242
|
|
|
243
|
+
## ⭐ Stellar - Gasless XLM & USDC
|
|
244
|
+
|
|
245
|
+
Same 3-line API for Stellar. Use with Freighter, Stellar Wallets Kit, or any Stellar-compatible wallet.
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
import { SmoothSendSDK } from '@smoothsend/sdk';
|
|
249
|
+
|
|
250
|
+
const sdk = new SmoothSendSDK({ apiKey: 'pk_nogas_xxx', network: 'testnet' });
|
|
251
|
+
|
|
252
|
+
// Option 1: Full transfer (build + sign + submit)
|
|
253
|
+
const result = await sdk.transfer(
|
|
254
|
+
{ from: 'G...', to: 'G...', amount: '100', token: 'XLM', chain: 'stellar-testnet' },
|
|
255
|
+
stellarWallet
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
// Option 2: Submit pre-signed XDR
|
|
259
|
+
const signedXdr = await wallet.signTransaction(tx);
|
|
260
|
+
const result = await sdk.submitStellarTransaction(signedXdr);
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
**Stellar wallet interface:**
|
|
264
|
+
```typescript
|
|
265
|
+
const stellarWallet = {
|
|
266
|
+
buildTransaction: (params) => buildPaymentTransaction(params.from, params.to, params.amount, params.token),
|
|
267
|
+
signTransaction: (tx) => walletKit.signTransaction(tx.toXDR()).then(r => r.signedTxXdr),
|
|
268
|
+
};
|
|
269
|
+
```
|
|
270
|
+
|
|
239
271
|
## 🔧 Supported Networks
|
|
240
272
|
|
|
241
273
|
| Network | Status | Features |
|
|
242
274
|
|---------|--------|----------|
|
|
243
275
|
| Aptos Testnet | ✅ Active | Gasless transactions, Ed25519 signatures |
|
|
244
276
|
| Aptos Mainnet | ✅ Active | Gasless transactions, Fee-in-token option |
|
|
277
|
+
| Stellar Testnet | ✅ Active | Gasless XLM, USDC, EURC via Fee Bump |
|
|
278
|
+
| Stellar Mainnet | ✅ Active | Gasless XLM, USDC, EURC via Fee Bump |
|
|
245
279
|
|
|
246
280
|
## 📚 API Reference
|
|
247
281
|
|
|
@@ -300,7 +334,7 @@ const result = await client.submitSignedTransaction({
|
|
|
300
334
|
|
|
301
335
|
### SmoothSendSDK (Classic)
|
|
302
336
|
|
|
303
|
-
Direct SDK usage for more control.
|
|
337
|
+
Direct SDK usage for more control. Works for both Aptos and Stellar.
|
|
304
338
|
|
|
305
339
|
```typescript
|
|
306
340
|
import { SmoothSendSDK } from '@smoothsend/sdk';
|
|
@@ -312,13 +346,16 @@ const smoothSend = new SmoothSendSDK({
|
|
|
312
346
|
retries: 3
|
|
313
347
|
});
|
|
314
348
|
|
|
315
|
-
//
|
|
349
|
+
// Aptos - execute gasless transfer
|
|
316
350
|
const result = await smoothSend.executeGaslessTransfer({
|
|
317
351
|
transactionBytes: signedTx.transactionBytes,
|
|
318
352
|
authenticatorBytes: signedTx.authenticatorBytes,
|
|
319
353
|
chain: 'aptos-testnet',
|
|
320
354
|
network: 'testnet'
|
|
321
355
|
});
|
|
356
|
+
|
|
357
|
+
// Stellar - submit signed XDR
|
|
358
|
+
const stellarResult = await smoothSend.submitStellarTransaction(signedXdr);
|
|
322
359
|
```
|
|
323
360
|
|
|
324
361
|
## 🔐 Security
|
package/dist/adapters/aptos.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aptos.d.ts","sourceRoot":"","sources":["../../src/adapters/aptos.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,aAAa,EACb,WAAW,EACX,eAAe,EACf,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,SAAS,EACT,WAAW,EACX,cAAc,EAKf,MAAM,UAAU,CAAC;AAGlB;;;;;GAKG;AACH,qBAAa,YAAa,YAAW,aAAa;IAChD,SAAgB,KAAK,EAAE,cAAc,CAAC;IACtC,SAAgB,MAAM,EAAE,WAAW,CAAC;IACpC,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAwB;gBAGrC,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,SAAS,GAAG,SAAqB,EAC1C,aAAa,GAAE,OAAe;IA2BhC;;;OAGG;IACH,OAAO,CAAC,UAAU;IAIlB;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,IAAI;IAKhD;;OAEG;IACH,UAAU,IAAI,SAAS,GAAG,SAAS;IAInC;;;OAGG;IACG,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,O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MAAM,GAAG,OAAO;IASvC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IA+B5B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAQ7B;;;OAGG;IACH,OAAO,CAAC,iCAAiC;IA0CzC;;;;OAIG;IACH,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAuB/C;;;;;;OAMG;IACG,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAkB1F;;;;;OAKG;IACG,uBAAuB,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,GAAG;QAAE,QAAQ,EAAE,GAAG,CAAA;KAAE,CAAC;IAmBzH;;OAEG;IACG,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CAuBxE"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { HttpClient } from '../utils/http';
|
|
2
|
+
/**
|
|
3
|
+
* C-Address (Soroban Smart Account) response types
|
|
4
|
+
*/
|
|
5
|
+
export interface CAddressCreateResult {
|
|
6
|
+
cAddress: string;
|
|
7
|
+
txHash: string;
|
|
8
|
+
alreadyExisted: boolean;
|
|
9
|
+
explorerUrl: string;
|
|
10
|
+
}
|
|
11
|
+
export interface CAddressLookupResult {
|
|
12
|
+
ownerGAddress: string;
|
|
13
|
+
cAddress: string | null;
|
|
14
|
+
hasAccount: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface CAddressBalance {
|
|
17
|
+
asset: string;
|
|
18
|
+
balance: string;
|
|
19
|
+
symbol: string;
|
|
20
|
+
}
|
|
21
|
+
export interface CAddressBalanceResult {
|
|
22
|
+
cAddress: string;
|
|
23
|
+
balances: CAddressBalance[];
|
|
24
|
+
}
|
|
25
|
+
export interface CAddressBuildTransferResult {
|
|
26
|
+
unsignedXDR: string;
|
|
27
|
+
networkPassphrase: string;
|
|
28
|
+
}
|
|
29
|
+
export interface CAddressSubmitResult {
|
|
30
|
+
txHash: string;
|
|
31
|
+
explorerUrl: string;
|
|
32
|
+
}
|
|
33
|
+
export interface CAddressTransaction {
|
|
34
|
+
type: 'sent' | 'received';
|
|
35
|
+
asset: string;
|
|
36
|
+
amount: string;
|
|
37
|
+
counterparty: string;
|
|
38
|
+
txHash: string;
|
|
39
|
+
timestamp: string;
|
|
40
|
+
ledger: number;
|
|
41
|
+
}
|
|
42
|
+
export interface CAddressHistoryResult {
|
|
43
|
+
cAddress: string;
|
|
44
|
+
transactions: CAddressTransaction[];
|
|
45
|
+
count: number;
|
|
46
|
+
}
|
|
47
|
+
export interface CAddressHealthResult {
|
|
48
|
+
service: string;
|
|
49
|
+
relayerPublicKey: string;
|
|
50
|
+
factoryContractId: string;
|
|
51
|
+
isReady: boolean;
|
|
52
|
+
network: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Stellar C-Address Adapter — SDK for Soroban Smart Account operations
|
|
56
|
+
*
|
|
57
|
+
* Provides a clean interface for:
|
|
58
|
+
* - Creating C-addresses (smart accounts) from G-addresses
|
|
59
|
+
* - Looking up existing C-addresses by owner
|
|
60
|
+
* - Querying token balances (XLM, USDC, EURC)
|
|
61
|
+
* - Building bridge transfers (G→C)
|
|
62
|
+
* - Building smart account transfers (C→G, C→C)
|
|
63
|
+
* - Submitting user-signed transactions via fee-bump
|
|
64
|
+
* - Getting transaction history
|
|
65
|
+
*
|
|
66
|
+
* All transactions are gasless — the relayer covers fees via fee-bump.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* import { SmoothSendSDK } from '@smoothsend/sdk';
|
|
71
|
+
*
|
|
72
|
+
* const sdk = new SmoothSendSDK({ apiKey: 'pk_nogas_xxx', network: 'testnet' });
|
|
73
|
+
*
|
|
74
|
+
* // Create a C-address for a G-address owner
|
|
75
|
+
* const { cAddress } = await sdk.stellar.cAddress.create('GABCD...');
|
|
76
|
+
*
|
|
77
|
+
* // Get balances
|
|
78
|
+
* const { balances } = await sdk.stellar.cAddress.getBalances(cAddress);
|
|
79
|
+
*
|
|
80
|
+
* // Build a bridge transfer (G→C), user signs, relayer fee-bumps
|
|
81
|
+
* const { unsignedXDR } = await sdk.stellar.cAddress.buildBridgeTransfer({
|
|
82
|
+
* from: 'GABCD...',
|
|
83
|
+
* destination: cAddress,
|
|
84
|
+
* asset: 'USDC',
|
|
85
|
+
* amount: '10.5',
|
|
86
|
+
* });
|
|
87
|
+
* // Sign with wallet (e.g., Freighter)
|
|
88
|
+
* const signedXDR = await wallet.signTransaction(unsignedXDR);
|
|
89
|
+
* // Submit — relayer wraps in fee-bump
|
|
90
|
+
* const { txHash } = await sdk.stellar.cAddress.submitTransfer(signedXDR);
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare class StellarCAddressAdapter {
|
|
94
|
+
private httpClient;
|
|
95
|
+
private basePath;
|
|
96
|
+
constructor(httpClient: HttpClient, network?: 'testnet' | 'mainnet');
|
|
97
|
+
/**
|
|
98
|
+
* Create a new C-address (Soroban Smart Account) for a G-address owner.
|
|
99
|
+
* If the owner already has a C-address, returns the existing one.
|
|
100
|
+
*
|
|
101
|
+
* The relayer pays all deployment fees — completely gasless for the user.
|
|
102
|
+
*
|
|
103
|
+
* @param ownerGAddress - The G-address that will control this smart account
|
|
104
|
+
* @returns The new C-address, tx hash, and whether it already existed
|
|
105
|
+
*/
|
|
106
|
+
create(ownerGAddress: string): Promise<CAddressCreateResult>;
|
|
107
|
+
/**
|
|
108
|
+
* Look up the C-address for a given G-address owner.
|
|
109
|
+
* Returns null if no C-address exists for this owner.
|
|
110
|
+
*
|
|
111
|
+
* @param ownerGAddress - The G-address to look up
|
|
112
|
+
*/
|
|
113
|
+
lookup(ownerGAddress: string): Promise<CAddressLookupResult>;
|
|
114
|
+
/**
|
|
115
|
+
* Get token balances for a C-address.
|
|
116
|
+
* Returns balances for XLM, USDC, and EURC.
|
|
117
|
+
*
|
|
118
|
+
* @param cAddress - The C-address to query
|
|
119
|
+
*/
|
|
120
|
+
getBalances(cAddress: string): Promise<CAddressBalanceResult>;
|
|
121
|
+
/**
|
|
122
|
+
* Build a bridge transfer (G→C) using SAC.transfer.
|
|
123
|
+
* Returns unsigned XDR for the user to sign with their wallet.
|
|
124
|
+
* After signing, submit via submitTransfer().
|
|
125
|
+
*
|
|
126
|
+
* @param params.from - Sender G-address (signs the tx)
|
|
127
|
+
* @param params.destination - Recipient C-address (or G-address)
|
|
128
|
+
* @param params.asset - Asset to transfer: 'XLM', 'USDC', or 'EURC'
|
|
129
|
+
* @param params.amount - Human-readable amount (e.g., '10.5')
|
|
130
|
+
*/
|
|
131
|
+
buildBridgeTransfer(params: {
|
|
132
|
+
from: string;
|
|
133
|
+
destination: string;
|
|
134
|
+
asset: string;
|
|
135
|
+
amount: string;
|
|
136
|
+
}): Promise<CAddressBuildTransferResult>;
|
|
137
|
+
/**
|
|
138
|
+
* Build a transfer from a C-address (SmartAccount.send).
|
|
139
|
+
* Returns unsigned XDR for the owner to sign.
|
|
140
|
+
* After signing, submit via submitTransfer().
|
|
141
|
+
*
|
|
142
|
+
* @param params.from - Owner G-address (signs auth)
|
|
143
|
+
* @param params.cAddress - Source C-address (holds the funds)
|
|
144
|
+
* @param params.destination - Recipient (G or C address)
|
|
145
|
+
* @param params.asset - Asset: 'XLM', 'USDC', or 'EURC'
|
|
146
|
+
* @param params.amount - Human-readable amount
|
|
147
|
+
*/
|
|
148
|
+
buildTransfer(params: {
|
|
149
|
+
from: string;
|
|
150
|
+
cAddress: string;
|
|
151
|
+
destination: string;
|
|
152
|
+
asset: string;
|
|
153
|
+
amount: string;
|
|
154
|
+
}): Promise<CAddressBuildTransferResult>;
|
|
155
|
+
/**
|
|
156
|
+
* Submit a user-signed transaction.
|
|
157
|
+
* The relayer wraps it in a fee-bump transaction and submits to the network.
|
|
158
|
+
* The user pays zero fees — the relayer covers everything.
|
|
159
|
+
*
|
|
160
|
+
* @param signedXDR - The user-signed transaction XDR (base64)
|
|
161
|
+
*/
|
|
162
|
+
submitTransfer(signedXDR: string): Promise<CAddressSubmitResult>;
|
|
163
|
+
/**
|
|
164
|
+
* Get transaction history for a C-address.
|
|
165
|
+
* Returns recent transfer events (sent/received) across all supported tokens.
|
|
166
|
+
*
|
|
167
|
+
* @param cAddress - The C-address to query
|
|
168
|
+
* @param limit - Maximum number of transactions to return (default: 20)
|
|
169
|
+
*/
|
|
170
|
+
getHistory(cAddress: string, limit?: number): Promise<CAddressHistoryResult>;
|
|
171
|
+
/**
|
|
172
|
+
* Health check for the C-address bridge service.
|
|
173
|
+
*/
|
|
174
|
+
health(): Promise<CAddressHealthResult>;
|
|
175
|
+
validateGAddress(address: string): void;
|
|
176
|
+
validateCAddress(address: string): void;
|
|
177
|
+
validateAddress(address: string): boolean;
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=stellar-c-address.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stellar-c-address.d.ts","sourceRoot":"","sources":["../../src/adapters/stellar-c-address.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;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G,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAwBnE;;;;;;;;;OASG;IACG,mBAAmB,CAAC,MAAM,EAAE;QAChC,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA6BxC;;;;;;;;;;OAUG;IACG,aAAa,CAAC,MAAM,EAAE;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA8BxC;;;;;;OAMG;IACG,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA+BtE;;;;;;OAMG;IACG,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAyBtF;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,oBAAoB,CAAC;IA6B7C,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAUvC,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAUvC,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;CAO1C"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SupportedChain, IChainAdapter, ChainConfig, TransferRequest, FeeEstimate, SignedTransferData, TransferResult, HealthResponse } from '../types';
|
|
2
|
+
import { StellarCAddressAdapter } from './stellar-c-address';
|
|
3
|
+
/**
|
|
4
|
+
* Stellar Adapter - Gasless transactions via Fee Bump
|
|
5
|
+
* Routes through proxy.smoothsend.xyz with API key authentication
|
|
6
|
+
* Supports XLM, USDC, EURC and other Stellar assets
|
|
7
|
+
*/
|
|
8
|
+
export declare class StellarAdapter implements IChainAdapter {
|
|
9
|
+
readonly chain: SupportedChain;
|
|
10
|
+
readonly config: ChainConfig;
|
|
11
|
+
/** C-Address (Soroban Smart Account) operations */
|
|
12
|
+
readonly cAddress: StellarCAddressAdapter;
|
|
13
|
+
private httpClient;
|
|
14
|
+
private network;
|
|
15
|
+
constructor(chain: SupportedChain, config: ChainConfig, apiKey: string, network?: 'testnet' | 'mainnet', includeOrigin?: boolean);
|
|
16
|
+
setNetwork(network: 'testnet' | 'mainnet'): void;
|
|
17
|
+
getNetwork(): 'testnet' | 'mainnet';
|
|
18
|
+
/**
|
|
19
|
+
* Stellar gasless: relayer pays fee. Returns 0 for user.
|
|
20
|
+
*/
|
|
21
|
+
estimateFee(_request: TransferRequest): Promise<FeeEstimate>;
|
|
22
|
+
/**
|
|
23
|
+
* Submit signed XDR to relayer for Fee Bump wrapping
|
|
24
|
+
*/
|
|
25
|
+
executeGaslessTransfer(signedData: SignedTransferData): Promise<TransferResult>;
|
|
26
|
+
getTransactionStatus(txHash: string): Promise<any>;
|
|
27
|
+
getHealth(): Promise<HealthResponse>;
|
|
28
|
+
validateAddress(address: string): boolean;
|
|
29
|
+
validateAmount(amount: string): boolean;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=stellar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stellar.d.ts","sourceRoot":"","sources":["../../src/adapters/stellar.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,aAAa,EACb,WAAW,EACX,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,cAAc,EAKf,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAK7D;;;;GAIG;AACH,qBAAa,cAAe,YAAW,aAAa;IAClD,SAAgB,KAAK,EAAE,cAAc,CAAC;IACtC,SAAgB,MAAM,EAAE,WAAW,CAAC;IACpC,mDAAmD;IACnD,SAAgB,QAAQ,EAAE,sBAAsB,CAAC;IACjD,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,OAAO,CAAwB;gBAGrC,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,SAAS,GAAG,SAAqB,EAC1C,aAAa,GAAE,OAAe;IA2BhC,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,IAAI;IAKhD,UAAU,IAAI,SAAS,GAAG,SAAS;IAInC;;OAEG;IACG,WAAW,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAUlE;;OAEG;IACG,sBAAsB,CAAC,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC;IA4C/E,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAkBlD,SAAS,IAAI,OAAO,CAAC,cAAc,CAAC;IAuB1C,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAKzC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;CAQxC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SupportedChain, ChainEcosystem, TransferRequest, SignedTransferData, TransferResult, SmoothSendConfig, EventListener, HealthResponse, FeeEstimate, UsageMetadata } from '../types';
|
|
1
|
+
import { SupportedChain, ChainEcosystem, TransferRequest, SignedTransferData, TransferResult, SmoothSendConfig, EventListener, HealthResponse, FeeEstimate, UsageMetadata, AptosWallet, StellarWallet } from '../types';
|
|
2
2
|
export declare class SmoothSendSDK {
|
|
3
3
|
private adapters;
|
|
4
4
|
private eventListeners;
|
|
@@ -36,30 +36,29 @@ export declare class SmoothSendSDK {
|
|
|
36
36
|
estimateFee(request: TransferRequest): Promise<FeeEstimate & {
|
|
37
37
|
metadata?: UsageMetadata;
|
|
38
38
|
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Submit a signed Stellar transaction (XDR) for gasless relay.
|
|
41
|
+
* Use when you've already built and signed the transaction.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* const signedXdr = await stellarWallet.signTransaction(tx);
|
|
45
|
+
* const result = await sdk.submitStellarTransaction(signedXdr);
|
|
46
|
+
*/
|
|
47
|
+
submitStellarTransaction(signedXdr: string): Promise<TransferResult>;
|
|
39
48
|
executeGaslessTransfer(signedData: SignedTransferData): Promise<TransferResult>;
|
|
40
49
|
/**
|
|
41
50
|
* Convenience method for complete transfer flow
|
|
42
|
-
*
|
|
51
|
+
* Works for both Aptos and Stellar - same 3-line API.
|
|
43
52
|
*
|
|
44
53
|
* @param request Transfer request with from, to, token, amount, chain
|
|
45
|
-
* @param wallet
|
|
54
|
+
* @param wallet Aptos or Stellar wallet provider
|
|
46
55
|
* @returns Transfer result with transaction hash and usage metadata
|
|
47
56
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* - signTransaction(transaction): Sign and serialize transaction
|
|
51
|
-
*
|
|
52
|
-
* The wallet's signTransaction should return an object with:
|
|
53
|
-
* - transactionBytes: number[] - Serialized transaction
|
|
54
|
-
* - authenticatorBytes: number[] - Serialized authenticator
|
|
57
|
+
* Aptos wallet: signTransaction returns { transactionBytes, authenticatorBytes }
|
|
58
|
+
* Stellar wallet: signTransaction returns string (signed XDR)
|
|
55
59
|
*/
|
|
56
|
-
transfer(request: TransferRequest, wallet:
|
|
57
|
-
|
|
58
|
-
signTransaction: (transaction: any) => Promise<{
|
|
59
|
-
transactionBytes: number[];
|
|
60
|
-
authenticatorBytes: number[];
|
|
61
|
-
}>;
|
|
62
|
-
}): Promise<TransferResult>;
|
|
60
|
+
transfer(request: TransferRequest, wallet: AptosWallet | StellarWallet): Promise<TransferResult>;
|
|
61
|
+
private transferStellar;
|
|
63
62
|
/**
|
|
64
63
|
* Get transaction status for a specific transaction
|
|
65
64
|
* Routes through proxy to chain-specific status endpoint
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmoothSendSDK.d.ts","sourceRoot":"","sources":["../../src/core/SmoothSendSDK.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EAEd,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAGhB,aAAa,EAEb,cAAc,EACd,WAAW,EACX,aAAa,EACd,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"SmoothSendSDK.d.ts","sourceRoot":"","sources":["../../src/core/SmoothSendSDK.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EAEd,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAGhB,aAAa,EAEb,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACX,aAAa,EACd,MAAM,UAAU,CAAC;AAIlB,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAiD;IACjE,OAAO,CAAC,cAAc,CAAuB;IAC7C,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,uBAAuB,CAAkB;gBAErC,MAAM,EAAE,gBAAgB;IAiCpC;;;OAGG;IACH,OAAO,CAAC,aAAa;IAgBrB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAI5B;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAgBhC;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAsEnB,gBAAgB,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAI/C,mBAAmB,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAOzD,OAAO,CAAC,SAAS;IAWJ,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,aAAa,CAAA;KAAE,CAAC;IAyBvG;;;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