@tokenflight/swap 0.1.3 → 0.2.0-rc.0
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/dist/en-US-qDDiLksN.js +1 -0
- package/dist/ja-JP-C_ZBjfPb.js +1 -0
- package/dist/ko-KR-BHIB7ZQf.js +1 -0
- package/dist/register-widget-BOOjjgip.js +3 -0
- package/dist/swap.css +1 -1
- package/dist/tokenflight-swap.d.ts +221 -40
- package/dist/tokenflight-swap.js +2 -1
- package/dist/tokenflight-swap.umd.cjs +4 -225
- package/dist/widget.d.ts +48 -6
- package/dist/widget.js +1 -1
- package/dist/zh-CN-DpZbMBLR.js +1 -0
- package/dist/zh-TW-CtmyKF1W.js +1 -0
- package/package.json +2 -19
- package/dist/deposit.d.ts +0 -304
- package/dist/deposit.js +0 -1
- package/dist/dist-AEh2EHtG.js +0 -223
- package/dist/en-US-Dg7NZU3M.js +0 -1
- package/dist/fiat.d.ts +0 -360
- package/dist/fiat.js +0 -1
- package/dist/ja-JP-Ie6oD1OM.js +0 -1
- package/dist/ko-KR-BuQ9BHw_.js +0 -1
- package/dist/receive.d.ts +0 -333
- package/dist/receive.js +0 -1
- package/dist/register-deposit-B6K7wRIc.js +0 -1
- package/dist/register-swap-zws5IotK.js +0 -2
- package/dist/register-widget-BsjeFIPX.js +0 -1
- package/dist/swap.d.ts +0 -309
- package/dist/swap.js +0 -1
- package/dist/widget-FccUKqSD.js +0 -2
- package/dist/zh-CN-BOrEaVNo.js +0 -1
- package/dist/zh-TW-BtbfBVJf.js +0 -1
package/dist/receive.d.ts
DELETED
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
import { QuoteResponse } from '@tokenflight/api';
|
|
2
|
-
import { SwapStrategy } from '@tokenflight/api';
|
|
3
|
-
|
|
4
|
-
/** Amount change data */
|
|
5
|
-
declare interface AmountChangedData {
|
|
6
|
-
amount: string;
|
|
7
|
-
direction: "from" | "to";
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Boolean HTML attribute — accepts both native booleans and the
|
|
12
|
-
* string equivalents that `parseBooleanProp()` understands.
|
|
13
|
-
*/
|
|
14
|
-
declare type BooleanAttribute = boolean | "true" | "false" | "1" | "0" | "yes" | "no" | "";
|
|
15
|
-
|
|
16
|
-
/** Callback interfaces for widget events */
|
|
17
|
-
export declare interface Callbacks {
|
|
18
|
-
onSwapSuccess?(data: SwapSuccessData): void;
|
|
19
|
-
onSwapError?(data: SwapErrorData): void;
|
|
20
|
-
onWalletConnected?(data: WalletConnectedData): void;
|
|
21
|
-
onQuoteReceived?(data: QuoteResponse): void;
|
|
22
|
-
onAmountChanged?(data: AmountChangedData): void;
|
|
23
|
-
/** Called when user clicks Connect Wallet and no walletAdapter is provided */
|
|
24
|
-
onConnectWallet?(): void;
|
|
25
|
-
/** Called when user clicks the connected wallet address (for custom account modal handling) */
|
|
26
|
-
onAccountModal?(): void;
|
|
27
|
-
/** Called when a fiat order is created and the payment widget URL is available */
|
|
28
|
-
onFiatOrderCreated?(data: {
|
|
29
|
-
orderId: string;
|
|
30
|
-
widgetUrl: string;
|
|
31
|
-
}): void;
|
|
32
|
-
/** Called when a fiat order reaches a terminal status */
|
|
33
|
-
onFiatOrderCompleted?(data: {
|
|
34
|
-
orderId: string;
|
|
35
|
-
status: string;
|
|
36
|
-
txHash?: string;
|
|
37
|
-
}): void;
|
|
38
|
-
/** Called when a deposit completes successfully */
|
|
39
|
-
onDepositSuccess?(data: SwapSuccessData): void;
|
|
40
|
-
/** Called when a deposit fails */
|
|
41
|
-
onDepositError?(data: SwapErrorData): void;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** Chain type for multi-chain support */
|
|
45
|
-
declare type ChainType = "evm" | "solana";
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Custom color overrides — keys are CSS variable names.
|
|
49
|
-
* Typed keys provide autocomplete; arbitrary `--tf-*` strings are also accepted.
|
|
50
|
-
*
|
|
51
|
-
* ```ts
|
|
52
|
-
* customColors: {
|
|
53
|
-
* "--tf-primary": "#FF6B00",
|
|
54
|
-
* "--tf-bg": "#1A1A2E",
|
|
55
|
-
* "--tf-button-radius": "4px",
|
|
56
|
-
* "--tf-widget-max-width": "480px",
|
|
57
|
-
* }
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
export declare type CustomColors = Partial<Record<TfCssVar, string>> & Record<string, string>;
|
|
61
|
-
|
|
62
|
-
/** Payment methods available in `<tokenflight-deposit>` */
|
|
63
|
-
declare type DepositMethod = "wallet" | "card";
|
|
64
|
-
|
|
65
|
-
/** EVM wallet action via EIP-1193 */
|
|
66
|
-
declare interface EvmWalletAction {
|
|
67
|
-
type: "eip1193_request";
|
|
68
|
-
chainId: number;
|
|
69
|
-
method: string;
|
|
70
|
-
params: unknown[];
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/** How the fiat payment provider UI is opened. */
|
|
74
|
-
declare type FiatPaymentMode = "overlay" | "popup";
|
|
75
|
-
|
|
76
|
-
declare interface ImperativeWidgetOptions<TConfig> {
|
|
77
|
-
container: string | HTMLElement;
|
|
78
|
-
config: TConfig;
|
|
79
|
-
walletAdapter?: IWalletAdapter;
|
|
80
|
-
callbacks?: Callbacks;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/** Wallet adapter interface that all adapters must implement */
|
|
84
|
-
export declare interface IWalletAdapter {
|
|
85
|
-
/** Human-readable name */
|
|
86
|
-
readonly name: string;
|
|
87
|
-
/** Icon URL */
|
|
88
|
-
readonly icon?: string;
|
|
89
|
-
/** Supported action types */
|
|
90
|
-
readonly supportedActionTypes: WalletActionType[];
|
|
91
|
-
/** Optional: supported chain IDs — when set, the widget only shows tokens on these chains */
|
|
92
|
-
readonly supportedChainIds?: number[];
|
|
93
|
-
/** Connect the wallet */
|
|
94
|
-
connect(chainType?: ChainType): Promise<void>;
|
|
95
|
-
/** Disconnect the wallet */
|
|
96
|
-
disconnect(): Promise<void>;
|
|
97
|
-
/** Check if connected */
|
|
98
|
-
isConnected(chainType?: ChainType): boolean;
|
|
99
|
-
/** Get the current address */
|
|
100
|
-
getAddress(chainType?: ChainType): Promise<string | null>;
|
|
101
|
-
/** Execute a wallet action */
|
|
102
|
-
executeWalletAction(action: WalletAction): Promise<WalletActionResult>;
|
|
103
|
-
/** Optional: sign a message */
|
|
104
|
-
signMessage?(message: string, chainType?: ChainType): Promise<string>;
|
|
105
|
-
/** Optional: open the wallet's native account/connected modal */
|
|
106
|
-
openAccountModal?(): Promise<void>;
|
|
107
|
-
/** Optional: clean up internal subscriptions and watchers */
|
|
108
|
-
destroy?(): void;
|
|
109
|
-
/** Subscribe to wallet events */
|
|
110
|
-
on(event: WalletEventType, handler: (event: WalletEvent) => void): void;
|
|
111
|
-
/** Unsubscribe from wallet events */
|
|
112
|
-
off(event: WalletEventType, handler: (event: WalletEvent) => void): void;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/** Receive component mode: crypto-only, fiat-only, or both */
|
|
116
|
-
export declare type ReceiveMode = "crypto" | "fiat" | "all";
|
|
117
|
-
|
|
118
|
-
export declare interface RegisterElementsOptions {
|
|
119
|
-
walletAdapter?: IWalletAdapter;
|
|
120
|
-
callbacks?: Callbacks;
|
|
121
|
-
/** Custom CSS variable overrides merged on top of the active theme.
|
|
122
|
-
* Keys are CSS variable names, e.g. `"--tf-primary"`, `"--tf-font-family"`. */
|
|
123
|
-
customColors?: CustomColors;
|
|
124
|
-
/** Default API endpoint for all widget instances. */
|
|
125
|
-
apiEndpoint?: string;
|
|
126
|
-
/** Default theme for all widget instances. */
|
|
127
|
-
theme?: Theme;
|
|
128
|
-
/** Default locale for all widget instances. */
|
|
129
|
-
locale?: SupportedLocale;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export declare function registerReceiveElement(options?: RegisterElementsOptions): void;
|
|
133
|
-
|
|
134
|
-
/** Solana sign and send transaction action */
|
|
135
|
-
declare interface SolanaSignAndSendAction {
|
|
136
|
-
type: "solana_signAndSendTransaction";
|
|
137
|
-
transaction: string;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/** Solana sign transaction action */
|
|
141
|
-
declare interface SolanaSignTransactionAction {
|
|
142
|
-
type: "solana_signTransaction";
|
|
143
|
-
transaction: string;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/** Supported locale identifiers. Accepts any string for forward-compat; known values get bundled translations. */
|
|
147
|
-
export declare type SupportedLocale = "en-US" | "zh-CN" | "zh-TW" | "ja-JP" | "ko-KR" | (string & {});
|
|
148
|
-
|
|
149
|
-
/** Data emitted on swap error */
|
|
150
|
-
declare interface SwapErrorData {
|
|
151
|
-
code: string;
|
|
152
|
-
message: string;
|
|
153
|
-
details?: unknown;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export { SwapStrategy }
|
|
157
|
-
|
|
158
|
-
/** Data emitted on swap success */
|
|
159
|
-
declare interface SwapSuccessData {
|
|
160
|
-
orderId: string;
|
|
161
|
-
fromToken: string;
|
|
162
|
-
toToken: string;
|
|
163
|
-
fromAmount: string;
|
|
164
|
-
toAmount: string;
|
|
165
|
-
txHash: string;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/** All first-party CSS custom properties exposed for theming. */
|
|
169
|
-
declare type TfCssVar = "--tf-bg" | "--tf-bg-secondary" | "--tf-bg-elevated" | "--tf-surface" | "--tf-surface-hover" | "--tf-input-bg" | "--tf-glass" | "--tf-text" | "--tf-text-secondary" | "--tf-text-tertiary" | "--tf-text-on-primary" | "--tf-border" | "--tf-border-light" | "--tf-primary" | "--tf-primary-alpha" | "--tf-primary-light" | "--tf-primary-glow" | "--tf-success" | "--tf-success-bg" | "--tf-error" | "--tf-error-bg" | "--tf-error-alpha" | "--tf-warning" | "--tf-warning-bg" | "--tf-shadow" | "--tf-shadow-lg" | "--tf-skeleton" | "--tf-radius-xs" | "--tf-radius-sm" | "--tf-radius" | "--tf-radius-lg" | "--tf-radius-xl" | "--tf-button-radius" | "--tf-widget-max-width" | "--tf-font-family" | "--tf-font-family-mono" | "--tf-font-size" | "--tf-line-height";
|
|
170
|
-
|
|
171
|
-
/** Visual theme mode. */
|
|
172
|
-
export declare type Theme = "light" | "dark" | "auto";
|
|
173
|
-
|
|
174
|
-
/** Shared configuration fields for both widgets */
|
|
175
|
-
declare interface TokenFlightConfigBase {
|
|
176
|
-
/** HyperStream API endpoint */
|
|
177
|
-
apiEndpoint?: string;
|
|
178
|
-
/** Fiat on-ramp API endpoint (default: https://fiat-preview.hyperstream.dev) */
|
|
179
|
-
fiatApiEndpoint?: string;
|
|
180
|
-
/** Visual theme */
|
|
181
|
-
theme?: Theme;
|
|
182
|
-
/** Locale for i18n */
|
|
183
|
-
locale?: SupportedLocale;
|
|
184
|
-
/** Custom CSS color overrides */
|
|
185
|
-
customColors?: CustomColors;
|
|
186
|
-
/** Optional custom widget title text */
|
|
187
|
-
titleText?: string;
|
|
188
|
-
/** Optional custom widget title image URL */
|
|
189
|
-
titleImageUrl?: string;
|
|
190
|
-
/** Hide top title/header area */
|
|
191
|
-
hideTitle?: boolean;
|
|
192
|
-
/** Hide "Powered by TokenFlight" footer */
|
|
193
|
-
hidePoweredBy?: boolean;
|
|
194
|
-
/** Remove container background (transparent) */
|
|
195
|
-
noBackground?: boolean;
|
|
196
|
-
/** Remove container border and shadow */
|
|
197
|
-
noBorder?: boolean;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/** Configuration for `<tokenflight-deposit>` */
|
|
201
|
-
declare interface TokenFlightDepositConfig extends TokenFlightConfigBase {
|
|
202
|
-
/** Target token(s) to deposit into. When omitted, user selects via TokenSelector. */
|
|
203
|
-
target?: TokenIdentifier | TokenIdentifier[];
|
|
204
|
-
/** Optional: fixed amount for the target token */
|
|
205
|
-
amount?: string;
|
|
206
|
-
/** Optional: recipient address */
|
|
207
|
-
recipient?: string;
|
|
208
|
-
/** Payment methods to offer (default: ["wallet"]) */
|
|
209
|
-
methods?: DepositMethod[];
|
|
210
|
-
/** Optional source token to pay with */
|
|
211
|
-
fromToken?: TokenIdentifier;
|
|
212
|
-
/** Optional icon URL for the target token */
|
|
213
|
-
targetIcon?: string;
|
|
214
|
-
/** Fiat currency code for card payments (default: "USD") */
|
|
215
|
-
fiatCurrency?: string;
|
|
216
|
-
/** How to open the fiat payment provider (default: "overlay") */
|
|
217
|
-
fiatPaymentMode?: FiatPaymentMode;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
export declare const TokenFlightReceive: {
|
|
221
|
-
new (options: ImperativeWidgetOptions<TokenFlightDepositConfig>): {
|
|
222
|
-
#dispose: (() => void) | null;
|
|
223
|
-
#unwatchTheme: (() => void) | null;
|
|
224
|
-
#container: HTMLElement;
|
|
225
|
-
#shadowRoot: ShadowRoot | null;
|
|
226
|
-
#config: TokenFlightDepositConfig;
|
|
227
|
-
#walletAdapter?: IWalletAdapter;
|
|
228
|
-
#callbacks?: Callbacks;
|
|
229
|
-
initialize(): void;
|
|
230
|
-
destroy(): void;
|
|
231
|
-
setTheme(theme: Theme): void;
|
|
232
|
-
setCustomColors(colors: CustomColors): void;
|
|
233
|
-
#applyThemeStyles(style: HTMLStyleElement, theme: string): void;
|
|
234
|
-
#setupAutoThemeWatch(style: HTMLStyleElement): void;
|
|
235
|
-
};
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
/** Attributes accepted by `<tokenflight-receive>`. */
|
|
239
|
-
export declare interface TokenFlightReceiveAttributes {
|
|
240
|
-
"api-endpoint"?: string;
|
|
241
|
-
target?: string;
|
|
242
|
-
amount?: string;
|
|
243
|
-
"from-token"?: string;
|
|
244
|
-
recipient?: string;
|
|
245
|
-
"title-text"?: string;
|
|
246
|
-
"title-image"?: string;
|
|
247
|
-
theme?: Theme;
|
|
248
|
-
locale?: SupportedLocale;
|
|
249
|
-
"csp-nonce"?: string;
|
|
250
|
-
icon?: string;
|
|
251
|
-
"hide-title"?: BooleanAttribute;
|
|
252
|
-
"hide-powered-by"?: BooleanAttribute;
|
|
253
|
-
"no-background"?: BooleanAttribute;
|
|
254
|
-
"no-border"?: BooleanAttribute;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/** Configuration for the Receive component (EXACT_OUTPUT UX) */
|
|
258
|
-
export declare interface TokenFlightReceiveConfig extends TokenFlightConfigBase {
|
|
259
|
-
/** Target token to receive (optional — user can select via TokenSelector if omitted) */
|
|
260
|
-
target?: TokenIdentifier;
|
|
261
|
-
/** Amount to receive (optional when amountEditable is true) */
|
|
262
|
-
amount?: string;
|
|
263
|
-
/** Optional source token to pay with */
|
|
264
|
-
fromToken?: TokenIdentifier;
|
|
265
|
-
/** Optional recipient address (for cross-chain swaps to a different address) */
|
|
266
|
-
recipient?: string;
|
|
267
|
-
/** Optional icon URL for the target token */
|
|
268
|
-
icon?: string;
|
|
269
|
-
/** Payment methods to offer (default: ["crypto"]) */
|
|
270
|
-
methods?: ("crypto" | "card")[];
|
|
271
|
-
/** Fiat currency code for card payments (default: "USD") */
|
|
272
|
-
fiatCurrency?: string;
|
|
273
|
-
/** How to open the fiat payment provider (default: "overlay") */
|
|
274
|
-
fiatPaymentMode?: FiatPaymentMode;
|
|
275
|
-
/** Allow user to edit the receive amount */
|
|
276
|
-
amountEditable?: boolean;
|
|
277
|
-
/** Whitelist of allowed source tokens (CAIP-10) */
|
|
278
|
-
fromTokens?: TokenIdentifier[];
|
|
279
|
-
/** Whitelist of allowed destination tokens (CAIP-10) */
|
|
280
|
-
toTokens?: TokenIdentifier[];
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
export declare interface TokenFlightReceiveOptions {
|
|
284
|
-
container: string | HTMLElement;
|
|
285
|
-
config: TokenFlightReceiveConfig;
|
|
286
|
-
walletAdapter?: IWalletAdapter;
|
|
287
|
-
callbacks?: Callbacks;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Flexible token identifier supporting:
|
|
292
|
-
* - Direct object: { chainId: 1, address: "0x..." }
|
|
293
|
-
* - CAIP-10 string: "eip155:1:0x..."
|
|
294
|
-
* - JSON string: '{"chainId":1,"address":"0x..."}'
|
|
295
|
-
*/
|
|
296
|
-
declare type TokenIdentifier = string | TokenTarget;
|
|
297
|
-
|
|
298
|
-
/** Token target as chain + address pair */
|
|
299
|
-
declare interface TokenTarget {
|
|
300
|
-
chainId: number;
|
|
301
|
-
address: string;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
/** Union of all wallet action types */
|
|
305
|
-
declare type WalletAction = EvmWalletAction | SolanaSignTransactionAction | SolanaSignAndSendAction;
|
|
306
|
-
|
|
307
|
-
/** Result of executing a wallet action */
|
|
308
|
-
declare interface WalletActionResult {
|
|
309
|
-
success: boolean;
|
|
310
|
-
data?: unknown;
|
|
311
|
-
error?: string;
|
|
312
|
-
txHash?: string;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
/** Wallet action types */
|
|
316
|
-
declare type WalletActionType = "eip1193_request" | "solana_signTransaction" | "solana_signAndSendTransaction";
|
|
317
|
-
|
|
318
|
-
/** Data emitted when wallet is connected */
|
|
319
|
-
declare interface WalletConnectedData {
|
|
320
|
-
address: string;
|
|
321
|
-
chainType: string;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
/** Wallet event payload */
|
|
325
|
-
declare interface WalletEvent {
|
|
326
|
-
type: WalletEventType;
|
|
327
|
-
data?: unknown;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
/** Wallet event types */
|
|
331
|
-
declare type WalletEventType = "connect" | "disconnect" | "chainChanged" | "accountsChanged";
|
|
332
|
-
|
|
333
|
-
export { }
|
package/dist/receive.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./dist-AEh2EHtG.js";import"./widget-FccUKqSD.js";import{n as e,t}from"./register-deposit-B6K7wRIc.js";export{e as TokenFlightReceive,t as registerReceiveElement};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,Cn as t,Qt as n,a as r,bn as i,c as a,dn as o,en as s,gn as c,i as l,in as u,l as d,ln as f,n as p,nn as m,o as h,r as g,rn as _,s as v,sn as y,t as b,tn as x,vn as S}from"./dist-AEh2EHtG.js";import{n as C,t as w}from"./widget-FccUKqSD.js";function T(e){if(e)return e.map(e=>e===`wallet`?`crypto`:`card`)}var E=n((e,t,n)=>c(C,{config:{apiEndpoint:e.apiEndpoint,fiatApiEndpoint:e.fiatApiEndpoint,theme:e.theme,locale:e.locale,customColors:e.customColors,titleText:e.titleText,titleImageUrl:e.titleImageUrl,hideTitle:e.hideTitle,hidePoweredBy:e.hidePoweredBy,noBackground:e.noBackground,noBorder:e.noBorder,toToken:e.target,fromToken:e.fromToken,tradeType:e.amount?`EXACT_OUTPUT`:`EXACT_INPUT`,amount:e.amount,recipient:e.recipient,methods:T(e.methods),icon:e.targetIcon,fiatCurrency:e.fiatCurrency,fiatPaymentMode:e.fiatPaymentMode},walletAdapter:t,callbacks:n}),()=>w),D=o(`<style>`);function O(e){if(!e)return``;let t=e.trim();if(t.startsWith(`[`))try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return t}function k(e){if(e)try{let t=JSON.parse(e.trim());if(Array.isArray(t))return t}catch{}}function A(e){if(e)return e.map(e=>e===`wallet`?`crypto`:`card`)}function j(n){n&&p(n),!(typeof customElements>`u`)&&(customElements.get(`tokenflight-deposit`)||b(`tokenflight-deposit`,{"api-endpoint":``,target:``,amount:``,"from-token":``,recipient:``,methods:``,"target-icon":``,"fiat-currency":``,"fiat-payment-mode":``,"title-text":``,"title-image":``,theme:``,locale:``,"csp-nonce":``,"hide-title":!1,"hide-powered-by":!1,"no-background":!1,"no-border":!1},(n,{element:o})=>{let p=k(n.methods),b={apiEndpoint:n[`api-endpoint`]||g()||void 0,toToken:O(n.target),fromToken:n[`from-token`]||void 0,tradeType:n.amount?`EXACT_OUTPUT`:`EXACT_INPUT`,amount:n.amount||void 0,recipient:n.recipient||void 0,methods:A(p),icon:n[`target-icon`]||void 0,fiatCurrency:n[`fiat-currency`]||void 0,fiatPaymentMode:n[`fiat-payment-mode`]||void 0,titleText:n[`title-text`]||void 0,titleImageUrl:n[`title-image`]||void 0,theme:n.theme||v()||`light`,locale:n.locale||h()||`en-US`,hideTitle:d(n[`hide-title`]),hidePoweredBy:d(n[`hide-powered-by`]),noBackground:d(n[`no-background`]),noBorder:d(n[`no-border`])},T=n[`csp-nonce`]||void 0,[E,j]=i(typeof window<`u`&&window.matchMedia?.(`(prefers-color-scheme: dark)`).matches===!0);t(_(e=>{j(e===x)}));let M=o.__customColors,N=S(()=>{let e=n.theme||v()||`light`,t=(e===`auto`?E():e===`dark`)?x:m,i=r();return`${w}\n:host { ${s(i||M?{...t,...i,...M}:t)} }`}),P=o.__walletAdapter,F=o.__callbacks;return[(()=>{var e=D();return f(e,`nonce`,T),y(e,N),e})(),c(u,{client:e,get children(){return c(C,{config:b,get walletAdapter(){return P??a()},get callbacks(){return F?{...l(),...F}:l()}})}})]}))}export{E as n,j as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{$t as e,C as t,Cn as n,D as r,E as i,Qt as a,S as o,T as s,_ as c,a as l,b as u,bn as d,c as f,d as p,dn as m,en as h,f as g,g as _,gn as v,h as y,i as b,in as x,l as S,ln as C,m as w,n as T,nn as E,o as D,p as O,r as k,rn as A,s as j,sn as M,t as N,tn as P,u as F,v as I,vn as L,w as R,x as z,y as B}from"./dist-AEh2EHtG.js";var V=[i,s,R,t,o,z,u,B,I,c,_,y,w,O,g,p,F].join(`
|
|
2
|
-
`),H=a((e,t,n)=>v(r,{config:e,walletAdapter:t,callbacks:n}),()=>V),U=m(`<style>`);function W(t){t&&T(t),!(typeof customElements>`u`)&&(customElements.get(`tokenflight-swap`)||N(`tokenflight-swap`,{"api-endpoint":``,"from-token":``,"to-token":``,recipient:``,"title-text":``,"title-image":``,theme:``,locale:``,"csp-nonce":``,"hide-title":!1,"hide-powered-by":!1,"no-background":!1,"no-border":!1},(t,{element:i})=>{let a={apiEndpoint:t[`api-endpoint`]||k()||void 0,fromToken:t[`from-token`]||void 0,toToken:t[`to-token`]||void 0,recipient:t.recipient||void 0,titleText:t[`title-text`]||void 0,titleImageUrl:t[`title-image`]||void 0,theme:t.theme||j()||`light`,locale:t.locale||D()||`en-US`,hideTitle:S(t[`hide-title`]),hidePoweredBy:S(t[`hide-powered-by`]),noBackground:S(t[`no-background`]),noBorder:S(t[`no-border`])},o=t[`csp-nonce`]||void 0,[s,c]=d(typeof window<`u`&&window.matchMedia?.(`(prefers-color-scheme: dark)`).matches===!0);n(A(e=>{c(e===P)}));let u=i.__customColors,p=L(()=>{let e=t.theme||j()||`light`,n=(e===`auto`?s():e===`dark`)?P:E,r=l();return`${V}\n:host { ${h(r||u?{...n,...r,...u}:n)} }`}),m=i.__walletAdapter,g=i.__callbacks;return[(()=>{var e=U();return C(e,`nonce`,o),M(e,p),e})(),v(x,{client:e,get children(){return v(r,{config:a,get walletAdapter(){return m??f()},get callbacks(){return g?{...b(),...g}:b()}})}})]}))}export{H as n,W as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,Cn as t,Qt as n,a as r,bn as i,c as a,dn as o,en as s,gn as c,i as l,in as u,l as d,ln as f,n as p,nn as m,o as h,r as g,rn as _,s as v,sn as y,t as b,tn as x,vn as S}from"./dist-AEh2EHtG.js";import{n as C,t as w}from"./widget-FccUKqSD.js";var T=n((e,t,n)=>c(C,{config:e,walletAdapter:t,callbacks:n}),()=>w),E=o(`<style>`);function D(e){if(!e)return``;let t=e.trim();if(t.startsWith(`[`))try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return t}function O(e){if(e)try{let t=JSON.parse(e.trim());if(Array.isArray(t))return t}catch{}}function k(e){if(e)try{let t=JSON.parse(e.trim());if(Array.isArray(t))return t}catch{}}function A(n){n&&p(n),!(typeof customElements>`u`)&&(customElements.get(`tokenflight-widget`)||b(`tokenflight-widget`,{"api-endpoint":``,"fiat-api-endpoint":``,"to-token":``,"from-token":``,"trade-type":``,amount:``,recipient:``,icon:``,"lock-from-token":!1,"lock-to-token":!1,"fiat-currency":``,"fiat-payment-mode":``,methods:``,"default-pay-method":``,"from-tokens":``,"to-tokens":``,"title-text":``,"title-image":``,theme:``,locale:``,"csp-nonce":``,"hide-title":!1,"hide-powered-by":!1,"no-background":!1,"no-border":!1},(n,{element:o})=>{let p={apiEndpoint:n[`api-endpoint`]||g()||void 0,fiatApiEndpoint:n[`fiat-api-endpoint`]||void 0,toToken:D(n[`to-token`]),fromToken:n[`from-token`]||void 0,tradeType:n[`trade-type`]||void 0,amount:n.amount||void 0,recipient:n.recipient||void 0,icon:n.icon||void 0,lockFromToken:d(n[`lock-from-token`]),lockToToken:d(n[`lock-to-token`]),fiatCurrency:n[`fiat-currency`]||void 0,fiatPaymentMode:n[`fiat-payment-mode`]||void 0,methods:k(n.methods),defaultPayMethod:n[`default-pay-method`]||void 0,fromTokens:O(n[`from-tokens`]),toTokens:O(n[`to-tokens`]),titleText:n[`title-text`]||void 0,titleImageUrl:n[`title-image`]||void 0,theme:n.theme||v()||`light`,locale:n.locale||h()||`en-US`,hideTitle:d(n[`hide-title`]),hidePoweredBy:d(n[`hide-powered-by`]),noBackground:d(n[`no-background`]),noBorder:d(n[`no-border`])},b=n[`csp-nonce`]||void 0,[T,A]=i(typeof window<`u`&&window.matchMedia?.(`(prefers-color-scheme: dark)`).matches===!0);t(_(e=>{A(e===x)}));let j=o.__customColors,M=S(()=>{let e=n.theme||v()||`light`,t=(e===`auto`?T():e===`dark`)?x:m,i=r();return`${w}\n:host { ${s(i||j?{...t,...i,...j}:t)} }`}),N=o.__walletAdapter,P=o.__callbacks;return[(()=>{var e=E();return f(e,`nonce`,b),y(e,M),e})(),c(u,{client:e,get children(){return c(C,{config:p,get walletAdapter(){return N??a()},get callbacks(){return P?{...l(),...P}:l()}})}})]}))}export{T as n,A as t};
|
package/dist/swap.d.ts
DELETED
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
import { QuoteResponse } from '@tokenflight/api';
|
|
2
|
-
|
|
3
|
-
/** Amount change data */
|
|
4
|
-
declare interface AmountChangedData {
|
|
5
|
-
amount: string;
|
|
6
|
-
direction: "from" | "to";
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Boolean HTML attribute — accepts both native booleans and the
|
|
11
|
-
* string equivalents that `parseBooleanProp()` understands.
|
|
12
|
-
*/
|
|
13
|
-
declare type BooleanAttribute = boolean | "true" | "false" | "1" | "0" | "yes" | "no" | "";
|
|
14
|
-
|
|
15
|
-
/** Callback interfaces for widget events */
|
|
16
|
-
export declare interface Callbacks {
|
|
17
|
-
onSwapSuccess?(data: SwapSuccessData): void;
|
|
18
|
-
onSwapError?(data: SwapErrorData): void;
|
|
19
|
-
onWalletConnected?(data: WalletConnectedData): void;
|
|
20
|
-
onQuoteReceived?(data: QuoteResponse): void;
|
|
21
|
-
onAmountChanged?(data: AmountChangedData): void;
|
|
22
|
-
/** Called when user clicks Connect Wallet and no walletAdapter is provided */
|
|
23
|
-
onConnectWallet?(): void;
|
|
24
|
-
/** Called when user clicks the connected wallet address (for custom account modal handling) */
|
|
25
|
-
onAccountModal?(): void;
|
|
26
|
-
/** Called when a fiat order is created and the payment widget URL is available */
|
|
27
|
-
onFiatOrderCreated?(data: {
|
|
28
|
-
orderId: string;
|
|
29
|
-
widgetUrl: string;
|
|
30
|
-
}): void;
|
|
31
|
-
/** Called when a fiat order reaches a terminal status */
|
|
32
|
-
onFiatOrderCompleted?(data: {
|
|
33
|
-
orderId: string;
|
|
34
|
-
status: string;
|
|
35
|
-
txHash?: string;
|
|
36
|
-
}): void;
|
|
37
|
-
/** Called when a deposit completes successfully */
|
|
38
|
-
onDepositSuccess?(data: SwapSuccessData): void;
|
|
39
|
-
/** Called when a deposit fails */
|
|
40
|
-
onDepositError?(data: SwapErrorData): void;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/** Chain type for multi-chain support */
|
|
44
|
-
declare type ChainType = "evm" | "solana";
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Custom color overrides — keys are CSS variable names.
|
|
48
|
-
* Typed keys provide autocomplete; arbitrary `--tf-*` strings are also accepted.
|
|
49
|
-
*
|
|
50
|
-
* ```ts
|
|
51
|
-
* customColors: {
|
|
52
|
-
* "--tf-primary": "#FF6B00",
|
|
53
|
-
* "--tf-bg": "#1A1A2E",
|
|
54
|
-
* "--tf-button-radius": "4px",
|
|
55
|
-
* "--tf-widget-max-width": "480px",
|
|
56
|
-
* }
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
export declare type CustomColors = Partial<Record<TfCssVar, string>> & Record<string, string>;
|
|
60
|
-
|
|
61
|
-
/** EVM wallet action via EIP-1193 */
|
|
62
|
-
declare interface EvmWalletAction {
|
|
63
|
-
type: "eip1193_request";
|
|
64
|
-
chainId: number;
|
|
65
|
-
method: string;
|
|
66
|
-
params: unknown[];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/** How the fiat payment provider UI is opened. */
|
|
70
|
-
declare type FiatPaymentMode = "overlay" | "popup";
|
|
71
|
-
|
|
72
|
-
declare interface ImperativeWidgetOptions<TConfig> {
|
|
73
|
-
container: string | HTMLElement;
|
|
74
|
-
config: TConfig;
|
|
75
|
-
walletAdapter?: IWalletAdapter;
|
|
76
|
-
callbacks?: Callbacks;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/** Wallet adapter interface that all adapters must implement */
|
|
80
|
-
export declare interface IWalletAdapter {
|
|
81
|
-
/** Human-readable name */
|
|
82
|
-
readonly name: string;
|
|
83
|
-
/** Icon URL */
|
|
84
|
-
readonly icon?: string;
|
|
85
|
-
/** Supported action types */
|
|
86
|
-
readonly supportedActionTypes: WalletActionType[];
|
|
87
|
-
/** Optional: supported chain IDs — when set, the widget only shows tokens on these chains */
|
|
88
|
-
readonly supportedChainIds?: number[];
|
|
89
|
-
/** Connect the wallet */
|
|
90
|
-
connect(chainType?: ChainType): Promise<void>;
|
|
91
|
-
/** Disconnect the wallet */
|
|
92
|
-
disconnect(): Promise<void>;
|
|
93
|
-
/** Check if connected */
|
|
94
|
-
isConnected(chainType?: ChainType): boolean;
|
|
95
|
-
/** Get the current address */
|
|
96
|
-
getAddress(chainType?: ChainType): Promise<string | null>;
|
|
97
|
-
/** Execute a wallet action */
|
|
98
|
-
executeWalletAction(action: WalletAction): Promise<WalletActionResult>;
|
|
99
|
-
/** Optional: sign a message */
|
|
100
|
-
signMessage?(message: string, chainType?: ChainType): Promise<string>;
|
|
101
|
-
/** Optional: open the wallet's native account/connected modal */
|
|
102
|
-
openAccountModal?(): Promise<void>;
|
|
103
|
-
/** Optional: clean up internal subscriptions and watchers */
|
|
104
|
-
destroy?(): void;
|
|
105
|
-
/** Subscribe to wallet events */
|
|
106
|
-
on(event: WalletEventType, handler: (event: WalletEvent) => void): void;
|
|
107
|
-
/** Unsubscribe from wallet events */
|
|
108
|
-
off(event: WalletEventType, handler: (event: WalletEvent) => void): void;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export declare interface RegisterElementsOptions {
|
|
112
|
-
walletAdapter?: IWalletAdapter;
|
|
113
|
-
callbacks?: Callbacks;
|
|
114
|
-
/** Custom CSS variable overrides merged on top of the active theme.
|
|
115
|
-
* Keys are CSS variable names, e.g. `"--tf-primary"`, `"--tf-font-family"`. */
|
|
116
|
-
customColors?: CustomColors;
|
|
117
|
-
/** Default API endpoint for all widget instances. */
|
|
118
|
-
apiEndpoint?: string;
|
|
119
|
-
/** Default theme for all widget instances. */
|
|
120
|
-
theme?: Theme;
|
|
121
|
-
/** Default locale for all widget instances. */
|
|
122
|
-
locale?: SupportedLocale;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export declare function registerSwapElement(options?: RegisterElementsOptions): void;
|
|
126
|
-
|
|
127
|
-
/** Solana sign and send transaction action */
|
|
128
|
-
declare interface SolanaSignAndSendAction {
|
|
129
|
-
type: "solana_signAndSendTransaction";
|
|
130
|
-
transaction: string;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/** Solana sign transaction action */
|
|
134
|
-
declare interface SolanaSignTransactionAction {
|
|
135
|
-
type: "solana_signTransaction";
|
|
136
|
-
transaction: string;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/** Supported locale identifiers. Accepts any string for forward-compat; known values get bundled translations. */
|
|
140
|
-
export declare type SupportedLocale = "en-US" | "zh-CN" | "zh-TW" | "ja-JP" | "ko-KR" | (string & {});
|
|
141
|
-
|
|
142
|
-
/** Data emitted on swap error */
|
|
143
|
-
declare interface SwapErrorData {
|
|
144
|
-
code: string;
|
|
145
|
-
message: string;
|
|
146
|
-
details?: unknown;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/** Payment methods available in swap widget */
|
|
150
|
-
declare type SwapPayMethod = "crypto" | "card";
|
|
151
|
-
|
|
152
|
-
/** Data emitted on swap success */
|
|
153
|
-
declare interface SwapSuccessData {
|
|
154
|
-
orderId: string;
|
|
155
|
-
fromToken: string;
|
|
156
|
-
toToken: string;
|
|
157
|
-
fromAmount: string;
|
|
158
|
-
toAmount: string;
|
|
159
|
-
txHash: string;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/** All first-party CSS custom properties exposed for theming. */
|
|
163
|
-
declare type TfCssVar = "--tf-bg" | "--tf-bg-secondary" | "--tf-bg-elevated" | "--tf-surface" | "--tf-surface-hover" | "--tf-input-bg" | "--tf-glass" | "--tf-text" | "--tf-text-secondary" | "--tf-text-tertiary" | "--tf-text-on-primary" | "--tf-border" | "--tf-border-light" | "--tf-primary" | "--tf-primary-alpha" | "--tf-primary-light" | "--tf-primary-glow" | "--tf-success" | "--tf-success-bg" | "--tf-error" | "--tf-error-bg" | "--tf-error-alpha" | "--tf-warning" | "--tf-warning-bg" | "--tf-shadow" | "--tf-shadow-lg" | "--tf-skeleton" | "--tf-radius-xs" | "--tf-radius-sm" | "--tf-radius" | "--tf-radius-lg" | "--tf-radius-xl" | "--tf-button-radius" | "--tf-widget-max-width" | "--tf-font-family" | "--tf-font-family-mono" | "--tf-font-size" | "--tf-line-height";
|
|
164
|
-
|
|
165
|
-
/** Visual theme mode. */
|
|
166
|
-
export declare type Theme = "light" | "dark" | "auto";
|
|
167
|
-
|
|
168
|
-
/** Shared configuration fields for both widgets */
|
|
169
|
-
declare interface TokenFlightConfigBase {
|
|
170
|
-
/** HyperStream API endpoint */
|
|
171
|
-
apiEndpoint?: string;
|
|
172
|
-
/** Fiat on-ramp API endpoint (default: https://fiat-preview.hyperstream.dev) */
|
|
173
|
-
fiatApiEndpoint?: string;
|
|
174
|
-
/** Visual theme */
|
|
175
|
-
theme?: Theme;
|
|
176
|
-
/** Locale for i18n */
|
|
177
|
-
locale?: SupportedLocale;
|
|
178
|
-
/** Custom CSS color overrides */
|
|
179
|
-
customColors?: CustomColors;
|
|
180
|
-
/** Optional custom widget title text */
|
|
181
|
-
titleText?: string;
|
|
182
|
-
/** Optional custom widget title image URL */
|
|
183
|
-
titleImageUrl?: string;
|
|
184
|
-
/** Hide top title/header area */
|
|
185
|
-
hideTitle?: boolean;
|
|
186
|
-
/** Hide "Powered by TokenFlight" footer */
|
|
187
|
-
hidePoweredBy?: boolean;
|
|
188
|
-
/** Remove container background (transparent) */
|
|
189
|
-
noBackground?: boolean;
|
|
190
|
-
/** Remove container border and shadow */
|
|
191
|
-
noBorder?: boolean;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export declare const TokenFlightSwap: {
|
|
195
|
-
new (options: ImperativeWidgetOptions<TokenFlightSwapConfig>): {
|
|
196
|
-
#dispose: (() => void) | null;
|
|
197
|
-
#unwatchTheme: (() => void) | null;
|
|
198
|
-
#container: HTMLElement;
|
|
199
|
-
#shadowRoot: ShadowRoot | null;
|
|
200
|
-
#config: TokenFlightSwapConfig;
|
|
201
|
-
#walletAdapter?: IWalletAdapter;
|
|
202
|
-
#callbacks?: Callbacks;
|
|
203
|
-
initialize(): void;
|
|
204
|
-
destroy(): void;
|
|
205
|
-
setTheme(theme: Theme): void;
|
|
206
|
-
setCustomColors(colors: CustomColors): void;
|
|
207
|
-
#applyThemeStyles(style: HTMLStyleElement, theme: string): void;
|
|
208
|
-
#setupAutoThemeWatch(style: HTMLStyleElement): void;
|
|
209
|
-
};
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
/** Attributes accepted by `<tokenflight-swap>`. */
|
|
213
|
-
export declare interface TokenFlightSwapAttributes {
|
|
214
|
-
"api-endpoint"?: string;
|
|
215
|
-
"from-token"?: string;
|
|
216
|
-
"to-token"?: string;
|
|
217
|
-
recipient?: string;
|
|
218
|
-
"title-text"?: string;
|
|
219
|
-
"title-image"?: string;
|
|
220
|
-
theme?: Theme;
|
|
221
|
-
locale?: SupportedLocale;
|
|
222
|
-
"csp-nonce"?: string;
|
|
223
|
-
"hide-title"?: BooleanAttribute;
|
|
224
|
-
"hide-powered-by"?: BooleanAttribute;
|
|
225
|
-
"no-background"?: BooleanAttribute;
|
|
226
|
-
"no-border"?: BooleanAttribute;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
/** Configuration for `<tokenflight-swap>` and `<tokenflight-widget>` swap mode */
|
|
230
|
-
export declare interface TokenFlightSwapConfig extends TokenFlightConfigBase {
|
|
231
|
-
/** Optional source token (crypto tab) */
|
|
232
|
-
fromToken?: TokenIdentifier;
|
|
233
|
-
/** Optional destination token */
|
|
234
|
-
toToken?: TokenIdentifier;
|
|
235
|
-
/** Optional recipient address */
|
|
236
|
-
recipient?: string;
|
|
237
|
-
/** Trade direction: "EXACT_INPUT" (default) = amount is input, "EXACT_OUTPUT" = amount is output */
|
|
238
|
-
tradeType?: "EXACT_INPUT" | "EXACT_OUTPUT";
|
|
239
|
-
/** Amount value — interpreted as input or output based on tradeType */
|
|
240
|
-
amount?: string;
|
|
241
|
-
/** Payment methods to offer (default: ["crypto"]) */
|
|
242
|
-
methods?: SwapPayMethod[];
|
|
243
|
-
/** Default active pay method tab (default: "crypto") */
|
|
244
|
-
defaultPayMethod?: SwapPayMethod;
|
|
245
|
-
/** Fiat currency code for card payments (default: "USD") */
|
|
246
|
-
fiatCurrency?: string;
|
|
247
|
-
/** How to open the fiat payment provider (default: "overlay") */
|
|
248
|
-
fiatPaymentMode?: FiatPaymentMode;
|
|
249
|
-
/** Whitelist of allowed source tokens (CAIP-10) */
|
|
250
|
-
fromTokens?: TokenIdentifier[];
|
|
251
|
-
/** Whitelist of allowed destination tokens (CAIP-10) */
|
|
252
|
-
toTokens?: TokenIdentifier[];
|
|
253
|
-
/** Lock the from-token selector (disable changing) */
|
|
254
|
-
lockFromToken?: boolean;
|
|
255
|
-
/** Lock the to-token selector (disable changing) */
|
|
256
|
-
lockToToken?: boolean;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
export declare interface TokenFlightSwapOptions {
|
|
260
|
-
container: string | HTMLElement;
|
|
261
|
-
config: TokenFlightSwapConfig;
|
|
262
|
-
walletAdapter?: IWalletAdapter;
|
|
263
|
-
callbacks?: Callbacks;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Flexible token identifier supporting:
|
|
268
|
-
* - Direct object: { chainId: 1, address: "0x..." }
|
|
269
|
-
* - CAIP-10 string: "eip155:1:0x..."
|
|
270
|
-
* - JSON string: '{"chainId":1,"address":"0x..."}'
|
|
271
|
-
*/
|
|
272
|
-
declare type TokenIdentifier = string | TokenTarget;
|
|
273
|
-
|
|
274
|
-
/** Token target as chain + address pair */
|
|
275
|
-
declare interface TokenTarget {
|
|
276
|
-
chainId: number;
|
|
277
|
-
address: string;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/** Union of all wallet action types */
|
|
281
|
-
declare type WalletAction = EvmWalletAction | SolanaSignTransactionAction | SolanaSignAndSendAction;
|
|
282
|
-
|
|
283
|
-
/** Result of executing a wallet action */
|
|
284
|
-
declare interface WalletActionResult {
|
|
285
|
-
success: boolean;
|
|
286
|
-
data?: unknown;
|
|
287
|
-
error?: string;
|
|
288
|
-
txHash?: string;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
/** Wallet action types */
|
|
292
|
-
declare type WalletActionType = "eip1193_request" | "solana_signTransaction" | "solana_signAndSendTransaction";
|
|
293
|
-
|
|
294
|
-
/** Data emitted when wallet is connected */
|
|
295
|
-
declare interface WalletConnectedData {
|
|
296
|
-
address: string;
|
|
297
|
-
chainType: string;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/** Wallet event payload */
|
|
301
|
-
declare interface WalletEvent {
|
|
302
|
-
type: WalletEventType;
|
|
303
|
-
data?: unknown;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
/** Wallet event types */
|
|
307
|
-
declare type WalletEventType = "connect" | "disconnect" | "chainChanged" | "accountsChanged";
|
|
308
|
-
|
|
309
|
-
export { }
|
package/dist/swap.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./dist-AEh2EHtG.js";import{n as e,t}from"./register-swap-zws5IotK.js";export{e as TokenFlightSwap,t as registerSwapElement};
|