@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/dist/index.d.ts
CHANGED
|
@@ -225,15 +225,16 @@ declare function createNetworkError(error: any): NetworkError;
|
|
|
225
225
|
* - `aptos-testnet`: Aptos testnet
|
|
226
226
|
* - `aptos-mainnet`: Aptos mainnet
|
|
227
227
|
*/
|
|
228
|
-
type SupportedChain = 'avalanche' | 'aptos-testnet' | 'aptos-mainnet';
|
|
228
|
+
type SupportedChain = 'avalanche' | 'aptos-testnet' | 'aptos-mainnet' | 'stellar-testnet' | 'stellar-mainnet';
|
|
229
229
|
/**
|
|
230
230
|
* Chain ecosystem types for routing to correct relayers
|
|
231
231
|
*
|
|
232
232
|
* @remarks
|
|
233
233
|
* - `evm`: Ethereum Virtual Machine compatible chains (Avalanche, Base, Arbitrum, etc.)
|
|
234
234
|
* - `aptos`: Aptos blockchain ecosystem
|
|
235
|
+
* - `stellar`: Stellar blockchain ecosystem
|
|
235
236
|
*/
|
|
236
|
-
type ChainEcosystem = 'evm' | 'aptos';
|
|
237
|
+
type ChainEcosystem = 'evm' | 'aptos' | 'stellar';
|
|
237
238
|
/**
|
|
238
239
|
* Mapping of supported chains to their respective ecosystems
|
|
239
240
|
* Used internally for adapter selection and routing
|
|
@@ -621,9 +622,11 @@ interface SignatureData {
|
|
|
621
622
|
*/
|
|
622
623
|
interface SignedTransferData {
|
|
623
624
|
/** Serialized transaction (Aptos) */
|
|
624
|
-
transactionBytes
|
|
625
|
+
transactionBytes?: number[];
|
|
625
626
|
/** Serialized authenticator (Aptos) */
|
|
626
|
-
authenticatorBytes
|
|
627
|
+
authenticatorBytes?: number[];
|
|
628
|
+
/** Signed XDR transaction (Stellar) */
|
|
629
|
+
signedTransaction?: string;
|
|
627
630
|
/** Target blockchain */
|
|
628
631
|
chain: SupportedChain;
|
|
629
632
|
/** Optional network override (testnet or mainnet) */
|
|
@@ -878,6 +881,16 @@ declare const APTOS_ERROR_CODES: {
|
|
|
878
881
|
* Ensures type safety when using error codes
|
|
879
882
|
*/
|
|
880
883
|
type AptosErrorCode = typeof APTOS_ERROR_CODES[keyof typeof APTOS_ERROR_CODES];
|
|
884
|
+
/**
|
|
885
|
+
* Stellar adapter error codes
|
|
886
|
+
*/
|
|
887
|
+
declare const STELLAR_ERROR_CODES: {
|
|
888
|
+
readonly MISSING_SIGNED_TRANSACTION: "STELLAR_MISSING_SIGNED_TRANSACTION";
|
|
889
|
+
readonly GASLESS_TRANSACTION_ERROR: "STELLAR_GASLESS_TRANSACTION_ERROR";
|
|
890
|
+
readonly STATUS_ERROR: "STELLAR_STATUS_ERROR";
|
|
891
|
+
readonly HEALTH_ERROR: "STELLAR_HEALTH_ERROR";
|
|
892
|
+
readonly INVALID_ADDRESS_FORMAT: "STELLAR_INVALID_ADDRESS_FORMAT";
|
|
893
|
+
};
|
|
881
894
|
/**
|
|
882
895
|
* Generic API response structure
|
|
883
896
|
* Used for all API responses with optional data payload
|
|
@@ -982,6 +995,35 @@ interface UsageMetadata {
|
|
|
982
995
|
/** Unique request identifier for debugging */
|
|
983
996
|
requestId: string;
|
|
984
997
|
}
|
|
998
|
+
/**
|
|
999
|
+
* Aptos wallet interface for sdk.transfer()
|
|
1000
|
+
*/
|
|
1001
|
+
interface AptosWallet {
|
|
1002
|
+
buildTransaction: (params: {
|
|
1003
|
+
sender: string;
|
|
1004
|
+
recipient: string;
|
|
1005
|
+
amount: string;
|
|
1006
|
+
coinType: string;
|
|
1007
|
+
relayerFee: string;
|
|
1008
|
+
}) => Promise<any>;
|
|
1009
|
+
signTransaction: (transaction: any) => Promise<{
|
|
1010
|
+
transactionBytes: number[];
|
|
1011
|
+
authenticatorBytes: number[];
|
|
1012
|
+
}>;
|
|
1013
|
+
}
|
|
1014
|
+
/**
|
|
1015
|
+
* Stellar wallet interface for sdk.transfer()
|
|
1016
|
+
* Use with Freighter, Stellar Wallets Kit, or any Stellar-compatible wallet
|
|
1017
|
+
*/
|
|
1018
|
+
interface StellarWallet {
|
|
1019
|
+
buildTransaction: (params: {
|
|
1020
|
+
from: string;
|
|
1021
|
+
to: string;
|
|
1022
|
+
amount: string;
|
|
1023
|
+
token: string;
|
|
1024
|
+
}) => Promise<any>;
|
|
1025
|
+
signTransaction: (transaction: any) => Promise<string>;
|
|
1026
|
+
}
|
|
985
1027
|
/**
|
|
986
1028
|
* Transfer event types
|
|
987
1029
|
* Emitted during transfer lifecycle for monitoring and debugging
|
|
@@ -1192,30 +1234,29 @@ declare class SmoothSendSDK {
|
|
|
1192
1234
|
estimateFee(request: TransferRequest): Promise<FeeEstimate & {
|
|
1193
1235
|
metadata?: UsageMetadata;
|
|
1194
1236
|
}>;
|
|
1237
|
+
/**
|
|
1238
|
+
* Submit a signed Stellar transaction (XDR) for gasless relay.
|
|
1239
|
+
* Use when you've already built and signed the transaction.
|
|
1240
|
+
*
|
|
1241
|
+
* @example
|
|
1242
|
+
* const signedXdr = await stellarWallet.signTransaction(tx);
|
|
1243
|
+
* const result = await sdk.submitStellarTransaction(signedXdr);
|
|
1244
|
+
*/
|
|
1245
|
+
submitStellarTransaction(signedXdr: string): Promise<TransferResult>;
|
|
1195
1246
|
executeGaslessTransfer(signedData: SignedTransferData): Promise<TransferResult>;
|
|
1196
1247
|
/**
|
|
1197
1248
|
* Convenience method for complete transfer flow
|
|
1198
|
-
*
|
|
1249
|
+
* Works for both Aptos and Stellar - same 3-line API.
|
|
1199
1250
|
*
|
|
1200
1251
|
* @param request Transfer request with from, to, token, amount, chain
|
|
1201
|
-
* @param wallet
|
|
1252
|
+
* @param wallet Aptos or Stellar wallet provider
|
|
1202
1253
|
* @returns Transfer result with transaction hash and usage metadata
|
|
1203
1254
|
*
|
|
1204
|
-
*
|
|
1205
|
-
*
|
|
1206
|
-
* - signTransaction(transaction): Sign and serialize transaction
|
|
1207
|
-
*
|
|
1208
|
-
* The wallet's signTransaction should return an object with:
|
|
1209
|
-
* - transactionBytes: number[] - Serialized transaction
|
|
1210
|
-
* - authenticatorBytes: number[] - Serialized authenticator
|
|
1255
|
+
* Aptos wallet: signTransaction returns { transactionBytes, authenticatorBytes }
|
|
1256
|
+
* Stellar wallet: signTransaction returns string (signed XDR)
|
|
1211
1257
|
*/
|
|
1212
|
-
transfer(request: TransferRequest, wallet:
|
|
1213
|
-
|
|
1214
|
-
signTransaction: (transaction: any) => Promise<{
|
|
1215
|
-
transactionBytes: number[];
|
|
1216
|
-
authenticatorBytes: number[];
|
|
1217
|
-
}>;
|
|
1218
|
-
}): Promise<TransferResult>;
|
|
1258
|
+
transfer(request: TransferRequest, wallet: AptosWallet | StellarWallet): Promise<TransferResult>;
|
|
1259
|
+
private transferStellar;
|
|
1219
1260
|
/**
|
|
1220
1261
|
* Get transaction status for a specific transaction
|
|
1221
1262
|
* Routes through proxy to chain-specific status endpoint
|
|
@@ -1469,6 +1510,12 @@ interface SmoothSendTransactionSubmitterConfig {
|
|
|
1469
1510
|
* @default 30000
|
|
1470
1511
|
*/
|
|
1471
1512
|
timeout?: number;
|
|
1513
|
+
/**
|
|
1514
|
+
* A function that returns a captcha token (e.g. from Cloudflare Turnstile or reCAPTCHA).
|
|
1515
|
+
* Called before each transaction if the project requires captcha verification.
|
|
1516
|
+
* Return null/undefined to skip captcha.
|
|
1517
|
+
*/
|
|
1518
|
+
getCaptchaToken?: () => Promise<string | null | undefined>;
|
|
1472
1519
|
/**
|
|
1473
1520
|
* Enable debug logging
|
|
1474
1521
|
* @default false
|
|
@@ -1502,6 +1549,7 @@ declare class SmoothSendTransactionSubmitter implements TransactionSubmitter {
|
|
|
1502
1549
|
private readonly network;
|
|
1503
1550
|
private readonly gatewayUrl;
|
|
1504
1551
|
private readonly timeout;
|
|
1552
|
+
private readonly getCaptchaToken?;
|
|
1505
1553
|
private readonly debug;
|
|
1506
1554
|
constructor(config: SmoothSendTransactionSubmitterConfig);
|
|
1507
1555
|
/**
|
|
@@ -1858,6 +1906,7 @@ declare class AptosAdapter implements IChainAdapter {
|
|
|
1858
1906
|
validateAmount(amount: string): boolean;
|
|
1859
1907
|
/**
|
|
1860
1908
|
* Get Aptos token address from symbol
|
|
1909
|
+
* Mirrors aptosrelayer/config/chains.json
|
|
1861
1910
|
*/
|
|
1862
1911
|
private getAptosTokenAddress;
|
|
1863
1912
|
/**
|
|
@@ -1973,6 +2022,213 @@ declare class HttpClient {
|
|
|
1973
2022
|
getNetwork(): 'testnet' | 'mainnet';
|
|
1974
2023
|
}
|
|
1975
2024
|
|
|
2025
|
+
/**
|
|
2026
|
+
* C-Address (Soroban Smart Account) response types
|
|
2027
|
+
*/
|
|
2028
|
+
interface CAddressCreateResult {
|
|
2029
|
+
cAddress: string;
|
|
2030
|
+
txHash: string;
|
|
2031
|
+
alreadyExisted: boolean;
|
|
2032
|
+
explorerUrl: string;
|
|
2033
|
+
}
|
|
2034
|
+
interface CAddressLookupResult {
|
|
2035
|
+
ownerGAddress: string;
|
|
2036
|
+
cAddress: string | null;
|
|
2037
|
+
hasAccount: boolean;
|
|
2038
|
+
}
|
|
2039
|
+
interface CAddressBalance {
|
|
2040
|
+
asset: string;
|
|
2041
|
+
balance: string;
|
|
2042
|
+
symbol: string;
|
|
2043
|
+
}
|
|
2044
|
+
interface CAddressBalanceResult {
|
|
2045
|
+
cAddress: string;
|
|
2046
|
+
balances: CAddressBalance[];
|
|
2047
|
+
}
|
|
2048
|
+
interface CAddressBuildTransferResult {
|
|
2049
|
+
unsignedXDR: string;
|
|
2050
|
+
networkPassphrase: string;
|
|
2051
|
+
}
|
|
2052
|
+
interface CAddressSubmitResult {
|
|
2053
|
+
txHash: string;
|
|
2054
|
+
explorerUrl: string;
|
|
2055
|
+
}
|
|
2056
|
+
interface CAddressTransaction {
|
|
2057
|
+
type: 'sent' | 'received';
|
|
2058
|
+
asset: string;
|
|
2059
|
+
amount: string;
|
|
2060
|
+
counterparty: string;
|
|
2061
|
+
txHash: string;
|
|
2062
|
+
timestamp: string;
|
|
2063
|
+
ledger: number;
|
|
2064
|
+
}
|
|
2065
|
+
interface CAddressHistoryResult {
|
|
2066
|
+
cAddress: string;
|
|
2067
|
+
transactions: CAddressTransaction[];
|
|
2068
|
+
count: number;
|
|
2069
|
+
}
|
|
2070
|
+
interface CAddressHealthResult {
|
|
2071
|
+
service: string;
|
|
2072
|
+
relayerPublicKey: string;
|
|
2073
|
+
factoryContractId: string;
|
|
2074
|
+
isReady: boolean;
|
|
2075
|
+
network: string;
|
|
2076
|
+
}
|
|
2077
|
+
/**
|
|
2078
|
+
* Stellar C-Address Adapter — SDK for Soroban Smart Account operations
|
|
2079
|
+
*
|
|
2080
|
+
* Provides a clean interface for:
|
|
2081
|
+
* - Creating C-addresses (smart accounts) from G-addresses
|
|
2082
|
+
* - Looking up existing C-addresses by owner
|
|
2083
|
+
* - Querying token balances (XLM, USDC, EURC)
|
|
2084
|
+
* - Building bridge transfers (G→C)
|
|
2085
|
+
* - Building smart account transfers (C→G, C→C)
|
|
2086
|
+
* - Submitting user-signed transactions via fee-bump
|
|
2087
|
+
* - Getting transaction history
|
|
2088
|
+
*
|
|
2089
|
+
* All transactions are gasless — the relayer covers fees via fee-bump.
|
|
2090
|
+
*
|
|
2091
|
+
* @example
|
|
2092
|
+
* ```typescript
|
|
2093
|
+
* import { SmoothSendSDK } from '@smoothsend/sdk';
|
|
2094
|
+
*
|
|
2095
|
+
* const sdk = new SmoothSendSDK({ apiKey: 'pk_nogas_xxx', network: 'testnet' });
|
|
2096
|
+
*
|
|
2097
|
+
* // Create a C-address for a G-address owner
|
|
2098
|
+
* const { cAddress } = await sdk.stellar.cAddress.create('GABCD...');
|
|
2099
|
+
*
|
|
2100
|
+
* // Get balances
|
|
2101
|
+
* const { balances } = await sdk.stellar.cAddress.getBalances(cAddress);
|
|
2102
|
+
*
|
|
2103
|
+
* // Build a bridge transfer (G→C), user signs, relayer fee-bumps
|
|
2104
|
+
* const { unsignedXDR } = await sdk.stellar.cAddress.buildBridgeTransfer({
|
|
2105
|
+
* from: 'GABCD...',
|
|
2106
|
+
* destination: cAddress,
|
|
2107
|
+
* asset: 'USDC',
|
|
2108
|
+
* amount: '10.5',
|
|
2109
|
+
* });
|
|
2110
|
+
* // Sign with wallet (e.g., Freighter)
|
|
2111
|
+
* const signedXDR = await wallet.signTransaction(unsignedXDR);
|
|
2112
|
+
* // Submit — relayer wraps in fee-bump
|
|
2113
|
+
* const { txHash } = await sdk.stellar.cAddress.submitTransfer(signedXDR);
|
|
2114
|
+
* ```
|
|
2115
|
+
*/
|
|
2116
|
+
declare class StellarCAddressAdapter {
|
|
2117
|
+
private httpClient;
|
|
2118
|
+
private basePath;
|
|
2119
|
+
constructor(httpClient: HttpClient, network?: 'testnet' | 'mainnet');
|
|
2120
|
+
/**
|
|
2121
|
+
* Create a new C-address (Soroban Smart Account) for a G-address owner.
|
|
2122
|
+
* If the owner already has a C-address, returns the existing one.
|
|
2123
|
+
*
|
|
2124
|
+
* The relayer pays all deployment fees — completely gasless for the user.
|
|
2125
|
+
*
|
|
2126
|
+
* @param ownerGAddress - The G-address that will control this smart account
|
|
2127
|
+
* @returns The new C-address, tx hash, and whether it already existed
|
|
2128
|
+
*/
|
|
2129
|
+
create(ownerGAddress: string): Promise<CAddressCreateResult>;
|
|
2130
|
+
/**
|
|
2131
|
+
* Look up the C-address for a given G-address owner.
|
|
2132
|
+
* Returns null if no C-address exists for this owner.
|
|
2133
|
+
*
|
|
2134
|
+
* @param ownerGAddress - The G-address to look up
|
|
2135
|
+
*/
|
|
2136
|
+
lookup(ownerGAddress: string): Promise<CAddressLookupResult>;
|
|
2137
|
+
/**
|
|
2138
|
+
* Get token balances for a C-address.
|
|
2139
|
+
* Returns balances for XLM, USDC, and EURC.
|
|
2140
|
+
*
|
|
2141
|
+
* @param cAddress - The C-address to query
|
|
2142
|
+
*/
|
|
2143
|
+
getBalances(cAddress: string): Promise<CAddressBalanceResult>;
|
|
2144
|
+
/**
|
|
2145
|
+
* Build a bridge transfer (G→C) using SAC.transfer.
|
|
2146
|
+
* Returns unsigned XDR for the user to sign with their wallet.
|
|
2147
|
+
* After signing, submit via submitTransfer().
|
|
2148
|
+
*
|
|
2149
|
+
* @param params.from - Sender G-address (signs the tx)
|
|
2150
|
+
* @param params.destination - Recipient C-address (or G-address)
|
|
2151
|
+
* @param params.asset - Asset to transfer: 'XLM', 'USDC', or 'EURC'
|
|
2152
|
+
* @param params.amount - Human-readable amount (e.g., '10.5')
|
|
2153
|
+
*/
|
|
2154
|
+
buildBridgeTransfer(params: {
|
|
2155
|
+
from: string;
|
|
2156
|
+
destination: string;
|
|
2157
|
+
asset: string;
|
|
2158
|
+
amount: string;
|
|
2159
|
+
}): Promise<CAddressBuildTransferResult>;
|
|
2160
|
+
/**
|
|
2161
|
+
* Build a transfer from a C-address (SmartAccount.send).
|
|
2162
|
+
* Returns unsigned XDR for the owner to sign.
|
|
2163
|
+
* After signing, submit via submitTransfer().
|
|
2164
|
+
*
|
|
2165
|
+
* @param params.from - Owner G-address (signs auth)
|
|
2166
|
+
* @param params.cAddress - Source C-address (holds the funds)
|
|
2167
|
+
* @param params.destination - Recipient (G or C address)
|
|
2168
|
+
* @param params.asset - Asset: 'XLM', 'USDC', or 'EURC'
|
|
2169
|
+
* @param params.amount - Human-readable amount
|
|
2170
|
+
*/
|
|
2171
|
+
buildTransfer(params: {
|
|
2172
|
+
from: string;
|
|
2173
|
+
cAddress: string;
|
|
2174
|
+
destination: string;
|
|
2175
|
+
asset: string;
|
|
2176
|
+
amount: string;
|
|
2177
|
+
}): Promise<CAddressBuildTransferResult>;
|
|
2178
|
+
/**
|
|
2179
|
+
* Submit a user-signed transaction.
|
|
2180
|
+
* The relayer wraps it in a fee-bump transaction and submits to the network.
|
|
2181
|
+
* The user pays zero fees — the relayer covers everything.
|
|
2182
|
+
*
|
|
2183
|
+
* @param signedXDR - The user-signed transaction XDR (base64)
|
|
2184
|
+
*/
|
|
2185
|
+
submitTransfer(signedXDR: string): Promise<CAddressSubmitResult>;
|
|
2186
|
+
/**
|
|
2187
|
+
* Get transaction history for a C-address.
|
|
2188
|
+
* Returns recent transfer events (sent/received) across all supported tokens.
|
|
2189
|
+
*
|
|
2190
|
+
* @param cAddress - The C-address to query
|
|
2191
|
+
* @param limit - Maximum number of transactions to return (default: 20)
|
|
2192
|
+
*/
|
|
2193
|
+
getHistory(cAddress: string, limit?: number): Promise<CAddressHistoryResult>;
|
|
2194
|
+
/**
|
|
2195
|
+
* Health check for the C-address bridge service.
|
|
2196
|
+
*/
|
|
2197
|
+
health(): Promise<CAddressHealthResult>;
|
|
2198
|
+
validateGAddress(address: string): void;
|
|
2199
|
+
validateCAddress(address: string): void;
|
|
2200
|
+
validateAddress(address: string): boolean;
|
|
2201
|
+
}
|
|
2202
|
+
|
|
2203
|
+
/**
|
|
2204
|
+
* Stellar Adapter - Gasless transactions via Fee Bump
|
|
2205
|
+
* Routes through proxy.smoothsend.xyz with API key authentication
|
|
2206
|
+
* Supports XLM, USDC, EURC and other Stellar assets
|
|
2207
|
+
*/
|
|
2208
|
+
declare class StellarAdapter implements IChainAdapter {
|
|
2209
|
+
readonly chain: SupportedChain;
|
|
2210
|
+
readonly config: ChainConfig;
|
|
2211
|
+
/** C-Address (Soroban Smart Account) operations */
|
|
2212
|
+
readonly cAddress: StellarCAddressAdapter;
|
|
2213
|
+
private httpClient;
|
|
2214
|
+
private network;
|
|
2215
|
+
constructor(chain: SupportedChain, config: ChainConfig, apiKey: string, network?: 'testnet' | 'mainnet', includeOrigin?: boolean);
|
|
2216
|
+
setNetwork(network: 'testnet' | 'mainnet'): void;
|
|
2217
|
+
getNetwork(): 'testnet' | 'mainnet';
|
|
2218
|
+
/**
|
|
2219
|
+
* Stellar gasless: relayer pays fee. Returns 0 for user.
|
|
2220
|
+
*/
|
|
2221
|
+
estimateFee(_request: TransferRequest): Promise<FeeEstimate>;
|
|
2222
|
+
/**
|
|
2223
|
+
* Submit signed XDR to relayer for Fee Bump wrapping
|
|
2224
|
+
*/
|
|
2225
|
+
executeGaslessTransfer(signedData: SignedTransferData): Promise<TransferResult>;
|
|
2226
|
+
getTransactionStatus(txHash: string): Promise<any>;
|
|
2227
|
+
getHealth(): Promise<HealthResponse>;
|
|
2228
|
+
validateAddress(address: string): boolean;
|
|
2229
|
+
validateAmount(amount: string): boolean;
|
|
2230
|
+
}
|
|
2231
|
+
|
|
1976
2232
|
/**
|
|
1977
2233
|
* SmoothSend SDK v2.0
|
|
1978
2234
|
*
|
|
@@ -1986,24 +2242,17 @@ declare class HttpClient {
|
|
|
1986
2242
|
* @packageDocumentation
|
|
1987
2243
|
*
|
|
1988
2244
|
* @example
|
|
1989
|
-
*
|
|
2245
|
+
* Aptos:
|
|
1990
2246
|
* ```typescript
|
|
1991
|
-
*
|
|
1992
|
-
*
|
|
1993
|
-
*
|
|
1994
|
-
* apiKey: 'no_gas_abc123...',
|
|
1995
|
-
* network: 'testnet'
|
|
1996
|
-
* });
|
|
1997
|
-
*
|
|
1998
|
-
* const result = await sdk.transfer({
|
|
1999
|
-
* from: '0x123...',
|
|
2000
|
-
* to: '0x456...',
|
|
2001
|
-
* token: 'USDC',
|
|
2002
|
-
* amount: '1000000',
|
|
2003
|
-
* chain: 'aptos-testnet'
|
|
2004
|
-
* }, wallet);
|
|
2247
|
+
* const sdk = new SmoothSendSDK({ apiKey: 'pk_nogas_xxx', network: 'testnet' });
|
|
2248
|
+
* const result = await sdk.transfer({ from, to, token: 'USDC', amount: '1000000', chain: 'aptos-testnet' }, aptosWallet);
|
|
2249
|
+
* ```
|
|
2005
2250
|
*
|
|
2006
|
-
*
|
|
2251
|
+
* @example
|
|
2252
|
+
* Stellar (same API):
|
|
2253
|
+
* ```typescript
|
|
2254
|
+
* const sdk = new SmoothSendSDK({ apiKey: 'pk_nogas_xxx', network: 'testnet' });
|
|
2255
|
+
* const result = await sdk.transfer({ from, to, token: 'XLM', amount: '100', chain: 'stellar-testnet' }, stellarWallet);
|
|
2007
2256
|
* ```
|
|
2008
2257
|
*/
|
|
2009
2258
|
|
|
@@ -2011,7 +2260,7 @@ declare class HttpClient {
|
|
|
2011
2260
|
* SDK version
|
|
2012
2261
|
* @public
|
|
2013
2262
|
*/
|
|
2014
|
-
declare const VERSION = "2.
|
|
2263
|
+
declare const VERSION = "2.0.0";
|
|
2015
2264
|
|
|
2016
|
-
export { APTOS_ERROR_CODES, AptosAdapter, AuthenticationError, CHAIN_ECOSYSTEM_MAP, HttpClient, NetworkError, RateLimitError, ScriptComposerClient, SmoothSendError, SmoothSendSDK, SmoothSendTransactionSubmitter, VERSION, ValidationError, createErrorFromResponse, createNetworkError, createScriptComposerClient, createSmoothSendSubmitter, SmoothSendSDK as default };
|
|
2017
|
-
export type { ApiResponse, AptosErrorCode, AptosTransferData, AvalancheTransferData, BatchRelayTransferRequest, BatchTransferRequest, BuildTransferParams, BuildTransferResult, ChainConfig, ChainEcosystem, ChainInfo, DomainSeparatorResponse, EVMTransferData, ErrorResponse, EstimateGasRequest, EventListener, FeeEstimate, FeeEstimateResult, GasEstimateResponse, HealthResponse, IChainAdapter, PermitData, PrepareSignatureRequest, PrepareSignatureResponse, RelayTransferRequest, RelayTransferResponse, ScriptComposerConfig, SignatureData, SignedTransferData, SmoothSendConfig, SmoothSendTransactionSubmitterConfig, SubmitSignedTransactionParams, SubmitTransactionResult, SuccessResponse, SupportedChain, TokenBalance, TokenInfo, TransactionSubmitter, TransferData, TransferEvent, TransferQuote, TransferQuoteRequest, TransferQuoteResponse, TransferRequest, TransferResult, TransferStatusResponse, UsageMetadata };
|
|
2265
|
+
export { APTOS_ERROR_CODES, AptosAdapter, AuthenticationError, CHAIN_ECOSYSTEM_MAP, HttpClient, NetworkError, RateLimitError, STELLAR_ERROR_CODES, ScriptComposerClient, SmoothSendError, SmoothSendSDK, SmoothSendTransactionSubmitter, StellarAdapter, StellarCAddressAdapter, VERSION, ValidationError, createErrorFromResponse, createNetworkError, createScriptComposerClient, createSmoothSendSubmitter, SmoothSendSDK as default };
|
|
2266
|
+
export type { ApiResponse, AptosErrorCode, AptosTransferData, AptosWallet, AvalancheTransferData, BatchRelayTransferRequest, BatchTransferRequest, BuildTransferParams, BuildTransferResult, CAddressBalance, CAddressBalanceResult, CAddressBuildTransferResult, CAddressCreateResult, CAddressHealthResult, CAddressHistoryResult, CAddressLookupResult, CAddressSubmitResult, CAddressTransaction, ChainConfig, ChainEcosystem, ChainInfo, DomainSeparatorResponse, EVMTransferData, ErrorResponse, EstimateGasRequest, EventListener, FeeEstimate, FeeEstimateResult, GasEstimateResponse, HealthResponse, IChainAdapter, PermitData, PrepareSignatureRequest, PrepareSignatureResponse, RelayTransferRequest, RelayTransferResponse, ScriptComposerConfig, SignatureData, SignedTransferData, SmoothSendConfig, SmoothSendTransactionSubmitterConfig, StellarWallet, SubmitSignedTransactionParams, SubmitTransactionResult, SuccessResponse, SupportedChain, TokenBalance, TokenInfo, TransactionSubmitter, TransferData, TransferEvent, TransferQuote, TransferQuoteRequest, TransferQuoteResponse, TransferRequest, TransferResult, TransferStatusResponse, UsageMetadata };
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAIrD,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,KAAK,oCAAoC,EACzC,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,GACvB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EACL,sBAAsB,EACtB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,8BAA8B,CAAC;AAGtC,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC"}
|