@tokenflight/swap 0.0.4 → 0.1.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 +3 -1
- package/dist/custom-elements.d.ts +24 -0
- package/dist/deposit.d.ts +304 -0
- package/dist/deposit.js +1 -0
- package/dist/dist-QzDwShnx.js +2 -0
- package/dist/en-US-Dg7NZU3M.js +1 -0
- package/dist/fiat.d.ts +360 -0
- package/dist/fiat.js +1 -0
- package/dist/ja-JP-FXTra_NF.js +1 -0
- package/dist/ko-KR-D4gcrXFl.js +1 -0
- package/dist/receive.d.ts +333 -0
- package/dist/receive.js +1 -0
- package/dist/register-deposit-TIxgJ8p6.js +1 -0
- package/dist/register-swap-t4Uli1Zx.js +2 -0
- package/dist/register-widget-B49bMwiA.js +1 -0
- package/dist/swap.css +2 -0
- package/dist/swap.d.ts +283 -0
- package/dist/swap.js +1 -0
- package/dist/tokenflight-swap.d.ts +829 -0
- package/dist/tokenflight-swap.js +1 -11182
- package/dist/tokenflight-swap.umd.cjs +225 -8
- package/dist/widget-Bf9MCT78.js +223 -0
- package/dist/widget.d.ts +319 -0
- package/dist/widget.js +1 -0
- package/dist/zh-CN-CuSlgEdI.js +1 -0
- package/dist/zh-TW-DkEqrPgE.js +1 -0
- package/package.json +35 -6
- package/dist/index.d.ts +0 -688
- package/dist/ja-JP-CCPQw3wd.js +0 -113
- package/dist/ko-KR-C28W7gug.js +0 -113
- package/dist/tokenflight-swap.css +0 -1
- package/dist/zh-CN-DVc1QrCz.js +0 -113
- package/dist/zh-TW-t3fL4aXT.js +0 -113
package/dist/widget.d.ts
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
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
|
+
export 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 registerWidgetElement(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
|
+
/** Data emitted on swap success */
|
|
150
|
+
declare interface SwapSuccessData {
|
|
151
|
+
orderId: string;
|
|
152
|
+
fromToken: string;
|
|
153
|
+
toToken: string;
|
|
154
|
+
fromAmount: string;
|
|
155
|
+
toAmount: string;
|
|
156
|
+
txHash: string;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** Payment methods available in SwapV2 */
|
|
160
|
+
export declare type SwapV2PayMethod = "crypto" | "card";
|
|
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";
|
|
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 TokenFlightWidget: {
|
|
195
|
+
new (options: ImperativeWidgetOptions<TokenFlightWidgetConfig>): {
|
|
196
|
+
#dispose: (() => void) | null;
|
|
197
|
+
#unwatchTheme: (() => void) | null;
|
|
198
|
+
#container: HTMLElement;
|
|
199
|
+
#shadowRoot: ShadowRoot | null;
|
|
200
|
+
#config: TokenFlightWidgetConfig;
|
|
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-widget>`. */
|
|
213
|
+
export declare interface TokenFlightWidgetAttributes {
|
|
214
|
+
"api-endpoint"?: string;
|
|
215
|
+
"fiat-api-endpoint"?: string;
|
|
216
|
+
"to-token"?: string;
|
|
217
|
+
"from-token"?: string;
|
|
218
|
+
"trade-type"?: string;
|
|
219
|
+
amount?: string;
|
|
220
|
+
recipient?: string;
|
|
221
|
+
icon?: string;
|
|
222
|
+
"lock-from-token"?: BooleanAttribute;
|
|
223
|
+
"lock-to-token"?: BooleanAttribute;
|
|
224
|
+
"fiat-currency"?: string;
|
|
225
|
+
"fiat-payment-mode"?: string;
|
|
226
|
+
methods?: string;
|
|
227
|
+
"default-pay-method"?: "crypto" | "card";
|
|
228
|
+
"from-tokens"?: string;
|
|
229
|
+
"to-tokens"?: string;
|
|
230
|
+
"title-text"?: string;
|
|
231
|
+
"title-image"?: string;
|
|
232
|
+
theme?: Theme;
|
|
233
|
+
locale?: SupportedLocale;
|
|
234
|
+
"csp-nonce"?: string;
|
|
235
|
+
"hide-title"?: BooleanAttribute;
|
|
236
|
+
"hide-powered-by"?: BooleanAttribute;
|
|
237
|
+
"no-background"?: BooleanAttribute;
|
|
238
|
+
"no-border"?: BooleanAttribute;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/** Configuration for Widget component (auto-selects SwapV2 or Deposit UX based on config) */
|
|
242
|
+
export declare interface TokenFlightWidgetConfig extends TokenFlightConfigBase {
|
|
243
|
+
/** Optional source token (crypto tab) */
|
|
244
|
+
fromToken?: TokenIdentifier;
|
|
245
|
+
/** Destination token(s) — array for launchpad multi-select */
|
|
246
|
+
toToken?: TokenIdentifier | TokenIdentifier[];
|
|
247
|
+
/** Trade direction: "EXACT_INPUT" (default) or "EXACT_OUTPUT" */
|
|
248
|
+
tradeType?: "EXACT_INPUT" | "EXACT_OUTPUT";
|
|
249
|
+
/** Amount value — interpreted as input or output based on tradeType */
|
|
250
|
+
amount?: string;
|
|
251
|
+
/** Optional recipient address */
|
|
252
|
+
recipient?: string;
|
|
253
|
+
/** Fiat currency code for card payments (default: "USD") */
|
|
254
|
+
fiatCurrency?: string;
|
|
255
|
+
/** How to open the fiat payment provider (default: "overlay") */
|
|
256
|
+
fiatPaymentMode?: FiatPaymentMode;
|
|
257
|
+
/** Whitelist of allowed source tokens (CAIP-10) */
|
|
258
|
+
fromTokens?: TokenIdentifier[];
|
|
259
|
+
/** Whitelist of allowed destination tokens (CAIP-10) */
|
|
260
|
+
toTokens?: TokenIdentifier[];
|
|
261
|
+
/** Optional icon URL for target token */
|
|
262
|
+
icon?: string;
|
|
263
|
+
/** Lock the from-token selector (disable changing) */
|
|
264
|
+
lockFromToken?: boolean;
|
|
265
|
+
/** Lock the to-token selector (disable changing) */
|
|
266
|
+
lockToToken?: boolean;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export declare interface TokenFlightWidgetOptions {
|
|
270
|
+
container: string | HTMLElement;
|
|
271
|
+
config: TokenFlightWidgetConfig;
|
|
272
|
+
walletAdapter?: IWalletAdapter;
|
|
273
|
+
callbacks?: Callbacks;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Flexible token identifier supporting:
|
|
278
|
+
* - Direct object: { chainId: 1, address: "0x..." }
|
|
279
|
+
* - CAIP-10 string: "eip155:1:0x..."
|
|
280
|
+
* - JSON string: '{"chainId":1,"address":"0x..."}'
|
|
281
|
+
*/
|
|
282
|
+
declare type TokenIdentifier = string | TokenTarget;
|
|
283
|
+
|
|
284
|
+
/** Token target as chain + address pair */
|
|
285
|
+
declare interface TokenTarget {
|
|
286
|
+
chainId: number;
|
|
287
|
+
address: string;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/** Union of all wallet action types */
|
|
291
|
+
declare type WalletAction = EvmWalletAction | SolanaSignTransactionAction | SolanaSignAndSendAction;
|
|
292
|
+
|
|
293
|
+
/** Result of executing a wallet action */
|
|
294
|
+
declare interface WalletActionResult {
|
|
295
|
+
success: boolean;
|
|
296
|
+
data?: unknown;
|
|
297
|
+
error?: string;
|
|
298
|
+
txHash?: string;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/** Wallet action types */
|
|
302
|
+
declare type WalletActionType = "eip1193_request" | "solana_signTransaction" | "solana_signAndSendTransaction";
|
|
303
|
+
|
|
304
|
+
/** Data emitted when wallet is connected */
|
|
305
|
+
declare interface WalletConnectedData {
|
|
306
|
+
address: string;
|
|
307
|
+
chainType: string;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/** Wallet event payload */
|
|
311
|
+
declare interface WalletEvent {
|
|
312
|
+
type: WalletEventType;
|
|
313
|
+
data?: unknown;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/** Wallet event types */
|
|
317
|
+
declare type WalletEventType = "connect" | "disconnect" | "chainChanged" | "accountsChanged";
|
|
318
|
+
|
|
319
|
+
export { }
|
package/dist/widget.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./dist-QzDwShnx.js";import"./widget-Bf9MCT78.js";import{n as e,t}from"./register-widget-B49bMwiA.js";export{e as TokenFlightWidget,t as registerWidgetElement};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`等待确认中...`,ee=`在浏览器中查看`,te=`交付未成功`,t=`选择法币支付通道`,n=`输入金额`,r=`正在寻找最优价格...`,i=`订单已过期`,a=e=>`通过 ${e.provider} 支付 ${e.amount}`,ne=void 0,o=e=>`通过 ${e.provider} 继续`,re=void 0,s=e=>`通过 ${e.provider}`,c=`确认充值`,l=`充值`,u=`代币已送达您的钱包`,d=`支付`,f=`您的代币已送达`,p=e=>`≈ $${e.formatUsd}`,m=`收款地址`,h=`确认`,g=`连接钱包以查看支付选项`,_=`未找到代币`,ie=void 0,v=`请在钱包中确认...`,y=`退款交易`,ae=void 0,b=`通过 DEX 兑换中...`,x=`重新打开支付窗口`,S=`选择货币`,C=`交易失败 — 重试`,w=`无做市商接受此订单`,oe=void 0,T=`支付`,E=`执行中...`,D=`选择目标代币`,O=e=>`已在 ${e.chain} 上完成`,k=`支付已确认`,A=`购买`,j=`关闭`,se=void 0,M=e=>`对比其他 ${e.count} 家`,ce=void 0,N=`退款进行中`,P=e=>`在 ${e.chain} 上存入`,F=`加密货币`,I=`已签名`,L=`订单失败`,le=void 0,R=`接收地址`,ue=void 0,z=`存款目标`,B=`使用信用卡或借记卡购买`,de=void 0,V=`这可能是由于浏览器隐私设置阻止了第三方内容。请尝试在新窗口中打开支付页面。`,H=`兑换`,U=`发送方`,W=`选择支付代币`,G=e=>`通过 ${e.provider}`,K=`总费用`,q=`已支付`,J=`重试`,Y=`查看兑换`,X=`报价刷新`,Z=`提供商正在执行订单`,Q=`代币兑换中`,fe=e=>`正在 ${e.chain} 上退还代币`,pe=`银行卡`,me=`交换代币`,he=`法币支付`,ge=`处理中...`,_e=`购买失败`,ve=`新购买`,ye=e=>`购买 ${e.store_targetToken}`,be=`使用信用卡或借记卡支付`,xe=`已上链确认`,Se=`钱包签名`,$=`发送`,Ce=`支付窗口无法加载`,we=`正在加载支付...`,Te=`接收代币所必需`,Ee=`最大`,De=`支付`,Oe=`重试`,ke=`费用`,Ae=`无法完成`,je=void 0,Me=`完成交易`,Ne=e=>`${e.seconds}秒内送达`,Pe=`使用支付`,Fe=void 0,Ie=`兑换成功`,Le=`代币已送达`,Re=`收取`,ze=`最低`,Be=`按名称或地址搜索`,Ve=e=>`~${e.value}秒`,He=`0`,Ue=`提供商`,We=`预计时间`,Ge=`余额不足`,Ke=`此链地址格式无效`,qe=`输入目标地址`,Je=`没有可用的代币`,Ye=`最高`,Xe=`转账交易`,Ze=`确认兑换`,Qe=`该代币不支持直接刷卡购买,我们会先购买 USDC,再自动兑换为您需要的代币。`,$e=`报价失败`,et=void 0,tt=e=>`在 ${e.chain} 上`,nt=e=>`~${e.value}分钟`,rt=`无可用路径`,it=`代币已到账!`,at=`等待付款`,ot=e=>`通过 ${e.token} 路由以获取最优价格`,st=`用户已取消`,ct=`新交易`,lt=`输入收款地址`,ut=`钱包与源链不匹配`,dt=`查看`,ft=`最优价格`,pt=`您的订单无法完成。`,mt=e=>`正在将 ${e.symbol} 发送到您的钱包...`,ht=`您的资金已退回钱包。`,gt=`已在新窗口中打开支付`,_t=`签名已提交`,vt=`存入交易`,yt=`连接钱包`,bt=`使用钱包中的代币支付`,xt=`完成支付`,St=`收到`,Ct=`购买完成`,wt=`在新窗口中打开`,Tt=`所选代币当前无法用于此次购买`,Et=`输入收款地址`,Dt=`推荐`,Ot=`钱包账户`,kt=e=>`余额: ${e.fromBalance}`,At=`购买完成`,jt=`重试`,Mt=void 0,Nt=`选择代币`,Pt={"10ioi7e":e,"10v0i5g":ee,"115lknq":te,"118a77s":t,"119fv83":n,"12rnjtt":r,"12rrl0i":i,"132vna6":a,"13i9oqu":void 0,"13l4n4r":o,"13x5i2v":void 0,"14j1lze":s,"15lxzx":c,"15lz1at":l,"1685rko":u,"17kq51m":d,"17wtaao":f,"188897k":p,"18cmny0":m,"18tbqwf":h,"18y1lrp":g,"19is1h8":_,"19ne1ha":void 0,"1bze7sg":v,"1c5n7ll":y,"1cei180":void 0,"1g8tdk7":b,"1gi9nny":x,"1gx00do":S,"1hb73om":C,"1hdpo6q":w,"1hzmxtu":void 0,"1i7coq1":T,"1ih47b3":E,"1ix1b7w":D,"1ixbbo7":O,"1jhuo24":k,"1ka8utn":A,"1l0xxoj":j,"1l41ftg":void 0,"1m2n0pw":M,"1ne9nkz":void 0,"1nhkl7x":N,"1nn0owb":P,"1o1b4a8":F,"1o4ofyx":I,"1ok4m5g":L,"1olegnl":void 0,"1oncz6g":R,"1ovj1tk":void 0,"1py89j9":z,"1q45kup":B,"1qbiehv":void 0,"1qisb2z":V,"1rkfalq":H,"1rnxx1g":U,"1t0r88u":W,"1t86tnu":G,"1viukn9":K,"1w0n607":q,"1w68n16":J,"1x5xdes":Y,"1xnfoqn":X,"1y28pgi":Z,"1y6hn5o":Q,"27fhcv":fe,"2b8ghr":pe,"2eikro":me,"2zh3gr":he,"344av8":ge,"3pklqf":_e,"3u5vqs":ve,"515x49":ye,"6c0jc7":be,"6c5l2f":xe,"6gkge0":Se,"6s9hn9":$,"75id35":Ce,"7iskw5":we,"7m2ht3":Te,"7v6g6x":Ee,"958wsx":De,"982hh6":Oe,"9l4mg3":ke,"9p7amh":Ae,axj370:void 0,bdo3n8:Me,biwlqk:Ne,cgzgvn:Pe,chajkh:void 0,cjn1xs:Ie,cnwfg3:Le,cwk7r6:Re,cx9lh3:ze,dizog6:Be,ek03j3:Ve,epw9f3:`0`,evz7q4:Ue,f45rwo:We,fcy4ey:Ge,fo0vw0:Ke,fpand1:qe,g7pjpv:Je,gtvgs9:Ye,hzq69q:Xe,ibrnk6:Ze,ifug2i:Qe,jf8ts4:$e,jnzipx:void 0,k47stp:tt,knrcsh:nt,ln9xiv:rt,mnlddk:it,n9zkql:at,ofi1rq:ot,otqba5:st,pmqvh0:ct,pom1h2:lt,q4mqcd:ut,q5w460:dt,r7v9s7:ft,rvctng:pt,sykid7:mt,t1rvqg:ht,t40bok:gt,tgp8yw:_t,tjg3i3:vt,u61kge:yt,udneg1:bt,ulp7ys:xt,va18uh:St,vum0cd:Ct,w6pv1a:wt,wuxjl9:Tt,wx5bee:Et,xel5qk:Dt,xphk5n:Ot,y6jqu9:kt,yhtv6l:At,zkouah:jt,zsopm1:void 0,zz4mrw:Nt};export{Ze as _100907z,St as _108j3sk,q as _10lgc56,U as _10n9ta8,d as _113vzpe,lt as _11ncipg,F as _11p3b1r,rt as _12qyh2x,N as _13ym6k2,pe as _14oyo32,ie as _15vbpgm,we as _1640n3f,gt as _165eyp5,Qe as _16ln1wz,Ie as _16pzx0g,Ae as _16rump9,D as _17g2rjk,x as _181ewwm,p as _18346vt,wt as _18ogtk,A as _1982g2x,Ot as _1biskvr,b as _1bjtgx1,Le as _1cmz8k7,bt as _1cpadi9,ue as _1d7sodl,ut as _1e023il,re as _1e5aqjt,P as _1ea99j0,ee as _1f4czmp,xe as _1f8nqa3,Y as _1f8umlr,R as _1fe46d3,Te as _1fikhaa,ct as _1fu9qvd,Pe as _1gfjrn0,Ne as _1gma9hv,fe as _1hs819x,_t as _1ht75o0,te as _1i8i0au,j as _1ib6ekl,B as _1ievltk,ft as _1in1gel,le as _1in9ocp,qe as _1ju6xlj,ae as _1jvje3y,ke as _1kd3yrp,oe as _1kez60s,Q as _1krtsvx,ot as _1kvlpuf,be as _1l1rqi2,H as _1l2nmmx,T as _1lra4kg,Tt as _1n1igys,C as _1na1vy4,a as _1nwhws6,Ve as _1o0vi1j,Xe as _1o2h7a2,o as _1o8feo7,Je as _1om32zr,y as _1oqs23j,jt as _1popw3r,e as _1qamgmj,se as _1s3hwm,nt as _1s54fdc,ne as _1s9ryeq,Se as _1t3gki9,S as _1uje2mm,u as _1urf8wf,t as _1w2bswr,O as _1wwy4yj,mt as _1y7hba4,ye as _1yh8ttx,_ as _1yv1ajq,Et as _3mtvnb,Ue as _3w8t28,W as _41y3qp,de as _454sub,dt as _49235i,L as _4itr6p,I as _4opuqb,he as _5af8qp,h as _5r87wo,g as _78b61s,Ce as _78ts6w,l as _89hoyp,$ as _8edkty,Mt as _8wjab,Me as _a5vz6z,Be as _al7a0k,Ee as _bii6w9,Oe as _cakypo,He as _cnghfj,E as _czpegb,vt as _d7bf51,$e as _doc1yy,c as _fdcaz1,ce as _g3pfjv,Fe as _g88yty,at as _gkmqsa,s as _hyiyqa,V as _i1jamr,m as _ide9vv,yt as _ig1w2,xt as _jj7boh,kt as _jpt8np,K as _kmeu9o,Z as _kqdlbv,Dt as _l5s0fl,et as _l78r94,f as _ly147p,je as _m8t1qc,Re as _mdvri5,st as _mq62g3,i as _nrzzox,tt as _o3um2w,k as _oj2fr8,Ct as _p5ybee,M as _peuj54,z as _pkny2p,w as _pqml54,_e as _pr6lte,ge as _q0rsrj,ht as _qm85b2,De as _r56hbl,v as _sf0mgy,Nt as _si8n6l,Ye as _swoaip,At as _t0vnn4,G as _t91lwj,Ke as _ty2nen,pt as _u7tj7p,We as _uc0jju,X as _ur1tmm,n as _uu4paz,it as _vogk37,J as _xavgbs,me as _xkdtbf,r as _xpl7mo,ve as _ystooe,ze as _z6jr7i,Ge as _zzusn5,Pt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`等待確認中...`,ee=`在瀏覽器中查看`,te=`交付未成功`,t=`選擇法幣支付通道`,n=`輸入金額`,r=`正在尋找最優價格...`,i=`訂單已過期`,a=e=>`透過 ${e.provider} 支付 ${e.amount}`,ne=void 0,o=e=>`透過 ${e.provider} 繼續`,re=void 0,s=e=>`透過 ${e.provider}`,c=`確認充值`,l=`充值`,u=`代幣已送達您的錢包`,d=`支付`,f=`您的代幣已送達`,p=e=>`≈ $${e.formatUsd}`,m=`收款地址`,h=`確認`,g=`連接錢包以查看支付選項`,_=`未找到代幣`,ie=void 0,v=`請在錢包中確認...`,y=`退款交易`,ae=void 0,b=`透過 DEX 兌換中...`,x=`重新開啟支付視窗`,S=`選擇貨幣`,C=`交易失敗 — 重試`,w=`無做市商接受此訂單`,oe=void 0,T=`支付`,E=`執行中...`,D=`選擇目標代幣`,O=e=>`已在 ${e.chain} 上完成`,k=`支付已確認`,A=`購買`,j=`關閉`,se=void 0,M=e=>`比較其他 ${e.count} 家`,ce=void 0,N=`退款進行中`,P=e=>`在 ${e.chain} 上存入`,F=`加密貨幣`,I=`已簽名`,L=`訂單失敗`,le=void 0,R=`接收地址`,ue=void 0,z=`存款目標`,B=`使用信用卡或簽帳卡購買`,de=void 0,V=`這可能是由於瀏覽器隱私設定阻止了第三方內容。請嘗試在新視窗中開啟支付頁面。`,H=`兌換`,U=`發送方`,W=`選擇支付代幣`,G=e=>`透過 ${e.provider}`,K=`總費用`,q=`已支付`,J=`重試`,Y=`查看兌換`,X=`報價刷新`,Z=`提供商正在執行訂單`,Q=`代幣兌換中`,fe=e=>`正在 ${e.chain} 上退還代幣`,pe=`銀行卡`,me=`交換代幣`,he=`法幣支付`,ge=`處理中...`,_e=`購買失敗`,ve=`新購買`,ye=e=>`購買 ${e.store_targetToken}`,be=`使用信用卡或簽帳卡付款`,xe=`已上鏈確認`,Se=`錢包簽名`,$=`發送`,Ce=`支付視窗無法載入`,we=`正在載入支付...`,Te=`接收代幣所必需`,Ee=`最大`,De=`支付`,Oe=`重試`,ke=`費用`,Ae=`無法完成`,je=void 0,Me=`完成交易`,Ne=e=>`${e.seconds}秒內送達`,Pe=`使用支付`,Fe=void 0,Ie=`兌換成功`,Le=`代幣已送達`,Re=`收取`,ze=`最低`,Be=`按名稱或地址搜索`,Ve=e=>`~${e.value}秒`,He=`0`,Ue=`提供商`,We=`預計時間`,Ge=`餘額不足`,Ke=`此鏈地址格式無效`,qe=`輸入目標地址`,Je=`沒有可用的代幣`,Ye=`最高`,Xe=`轉帳交易`,Ze=`確認兌換`,Qe=`該代幣不支援直接刷卡購買,我們會先購買 USDC,再自動兌換為您需要的代幣。`,$e=`報價失敗`,et=void 0,tt=e=>`在 ${e.chain} 上`,nt=e=>`~${e.value}分鐘`,rt=`無可用路徑`,it=`代幣已到帳!`,at=`等待付款`,ot=e=>`透過 ${e.token} 路由以獲取最優價格`,st=`用戶已取消`,ct=`新交易`,lt=`輸入收款地址`,ut=`錢包與來源鏈不匹配`,dt=`查看`,ft=`最優價格`,pt=`您的訂單無法完成。`,mt=e=>`正在將 ${e.symbol} 發送到您的錢包...`,ht=`您的資金已退回錢包。`,gt=`已在新視窗中開啟支付`,_t=`簽名已提交`,vt=`存入交易`,yt=`連接錢包`,bt=`使用錢包中的代幣支付`,xt=`完成支付`,St=`收到`,Ct=`購買完成`,wt=`在新視窗中開啟`,Tt=`所選代幣目前無法用於此次購買`,Et=`輸入收款地址`,Dt=`推薦`,Ot=`錢包帳戶`,kt=e=>`餘額: ${e.fromBalance}`,At=`購買完成`,jt=`重試`,Mt=void 0,Nt=`選擇代幣`,Pt={"10ioi7e":e,"10v0i5g":ee,"115lknq":te,"118a77s":t,"119fv83":n,"12rnjtt":r,"12rrl0i":i,"132vna6":a,"13i9oqu":void 0,"13l4n4r":o,"13x5i2v":void 0,"14j1lze":s,"15lxzx":c,"15lz1at":l,"1685rko":u,"17kq51m":d,"17wtaao":f,"188897k":p,"18cmny0":m,"18tbqwf":h,"18y1lrp":g,"19is1h8":_,"19ne1ha":void 0,"1bze7sg":v,"1c5n7ll":y,"1cei180":void 0,"1g8tdk7":b,"1gi9nny":x,"1gx00do":S,"1hb73om":C,"1hdpo6q":w,"1hzmxtu":void 0,"1i7coq1":T,"1ih47b3":E,"1ix1b7w":D,"1ixbbo7":O,"1jhuo24":k,"1ka8utn":A,"1l0xxoj":j,"1l41ftg":void 0,"1m2n0pw":M,"1ne9nkz":void 0,"1nhkl7x":N,"1nn0owb":P,"1o1b4a8":F,"1o4ofyx":I,"1ok4m5g":L,"1olegnl":void 0,"1oncz6g":R,"1ovj1tk":void 0,"1py89j9":z,"1q45kup":B,"1qbiehv":void 0,"1qisb2z":V,"1rkfalq":H,"1rnxx1g":U,"1t0r88u":W,"1t86tnu":G,"1viukn9":K,"1w0n607":q,"1w68n16":J,"1x5xdes":Y,"1xnfoqn":X,"1y28pgi":Z,"1y6hn5o":Q,"27fhcv":fe,"2b8ghr":pe,"2eikro":me,"2zh3gr":he,"344av8":ge,"3pklqf":_e,"3u5vqs":ve,"515x49":ye,"6c0jc7":be,"6c5l2f":xe,"6gkge0":Se,"6s9hn9":$,"75id35":Ce,"7iskw5":we,"7m2ht3":Te,"7v6g6x":Ee,"958wsx":De,"982hh6":Oe,"9l4mg3":ke,"9p7amh":Ae,axj370:void 0,bdo3n8:Me,biwlqk:Ne,cgzgvn:Pe,chajkh:void 0,cjn1xs:Ie,cnwfg3:Le,cwk7r6:Re,cx9lh3:ze,dizog6:Be,ek03j3:Ve,epw9f3:`0`,evz7q4:Ue,f45rwo:We,fcy4ey:Ge,fo0vw0:Ke,fpand1:qe,g7pjpv:Je,gtvgs9:Ye,hzq69q:Xe,ibrnk6:Ze,ifug2i:Qe,jf8ts4:$e,jnzipx:void 0,k47stp:tt,knrcsh:nt,ln9xiv:rt,mnlddk:it,n9zkql:at,ofi1rq:ot,otqba5:st,pmqvh0:ct,pom1h2:lt,q4mqcd:ut,q5w460:dt,r7v9s7:ft,rvctng:pt,sykid7:mt,t1rvqg:ht,t40bok:gt,tgp8yw:_t,tjg3i3:vt,u61kge:yt,udneg1:bt,ulp7ys:xt,va18uh:St,vum0cd:Ct,w6pv1a:wt,wuxjl9:Tt,wx5bee:Et,xel5qk:Dt,xphk5n:Ot,y6jqu9:kt,yhtv6l:At,zkouah:jt,zsopm1:void 0,zz4mrw:Nt};export{Ze as _100907z,St as _108j3sk,q as _10lgc56,U as _10n9ta8,d as _113vzpe,lt as _11ncipg,F as _11p3b1r,rt as _12qyh2x,N as _13ym6k2,pe as _14oyo32,ie as _15vbpgm,we as _1640n3f,gt as _165eyp5,Qe as _16ln1wz,Ie as _16pzx0g,Ae as _16rump9,D as _17g2rjk,x as _181ewwm,p as _18346vt,wt as _18ogtk,A as _1982g2x,Ot as _1biskvr,b as _1bjtgx1,Le as _1cmz8k7,bt as _1cpadi9,ue as _1d7sodl,ut as _1e023il,re as _1e5aqjt,P as _1ea99j0,ee as _1f4czmp,xe as _1f8nqa3,Y as _1f8umlr,R as _1fe46d3,Te as _1fikhaa,ct as _1fu9qvd,Pe as _1gfjrn0,Ne as _1gma9hv,fe as _1hs819x,_t as _1ht75o0,te as _1i8i0au,j as _1ib6ekl,B as _1ievltk,ft as _1in1gel,le as _1in9ocp,qe as _1ju6xlj,ae as _1jvje3y,ke as _1kd3yrp,oe as _1kez60s,Q as _1krtsvx,ot as _1kvlpuf,be as _1l1rqi2,H as _1l2nmmx,T as _1lra4kg,Tt as _1n1igys,C as _1na1vy4,a as _1nwhws6,Ve as _1o0vi1j,Xe as _1o2h7a2,o as _1o8feo7,Je as _1om32zr,y as _1oqs23j,jt as _1popw3r,e as _1qamgmj,se as _1s3hwm,nt as _1s54fdc,ne as _1s9ryeq,Se as _1t3gki9,S as _1uje2mm,u as _1urf8wf,t as _1w2bswr,O as _1wwy4yj,mt as _1y7hba4,ye as _1yh8ttx,_ as _1yv1ajq,Et as _3mtvnb,Ue as _3w8t28,W as _41y3qp,de as _454sub,dt as _49235i,L as _4itr6p,I as _4opuqb,he as _5af8qp,h as _5r87wo,g as _78b61s,Ce as _78ts6w,l as _89hoyp,$ as _8edkty,Mt as _8wjab,Me as _a5vz6z,Be as _al7a0k,Ee as _bii6w9,Oe as _cakypo,He as _cnghfj,E as _czpegb,vt as _d7bf51,$e as _doc1yy,c as _fdcaz1,ce as _g3pfjv,Fe as _g88yty,at as _gkmqsa,s as _hyiyqa,V as _i1jamr,m as _ide9vv,yt as _ig1w2,xt as _jj7boh,kt as _jpt8np,K as _kmeu9o,Z as _kqdlbv,Dt as _l5s0fl,et as _l78r94,f as _ly147p,je as _m8t1qc,Re as _mdvri5,st as _mq62g3,i as _nrzzox,tt as _o3um2w,k as _oj2fr8,Ct as _p5ybee,M as _peuj54,z as _pkny2p,w as _pqml54,_e as _pr6lte,ge as _q0rsrj,ht as _qm85b2,De as _r56hbl,v as _sf0mgy,Nt as _si8n6l,Ye as _swoaip,At as _t0vnn4,G as _t91lwj,Ke as _ty2nen,pt as _u7tj7p,We as _uc0jju,X as _ur1tmm,n as _uu4paz,it as _vogk37,J as _xavgbs,me as _xkdtbf,r as _xpl7mo,ve as _ystooe,ze as _z6jr7i,Ge as _zzusn5,Pt as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenflight/swap",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Embeddable Web Components for cross-chain token swaps",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Khalani",
|
|
@@ -22,6 +22,26 @@
|
|
|
22
22
|
"import": "./dist/tokenflight-swap.js",
|
|
23
23
|
"require": "./dist/tokenflight-swap.umd.cjs"
|
|
24
24
|
},
|
|
25
|
+
"./swap": {
|
|
26
|
+
"types": "./dist/swap.d.ts",
|
|
27
|
+
"import": "./dist/swap.js"
|
|
28
|
+
},
|
|
29
|
+
"./receive": {
|
|
30
|
+
"types": "./dist/receive.d.ts",
|
|
31
|
+
"import": "./dist/receive.js"
|
|
32
|
+
},
|
|
33
|
+
"./fiat": {
|
|
34
|
+
"types": "./dist/fiat.d.ts",
|
|
35
|
+
"import": "./dist/fiat.js"
|
|
36
|
+
},
|
|
37
|
+
"./deposit": {
|
|
38
|
+
"types": "./dist/deposit.d.ts",
|
|
39
|
+
"import": "./dist/deposit.js"
|
|
40
|
+
},
|
|
41
|
+
"./widget": {
|
|
42
|
+
"types": "./dist/widget.d.ts",
|
|
43
|
+
"import": "./dist/widget.js"
|
|
44
|
+
},
|
|
25
45
|
"./custom-elements": {
|
|
26
46
|
"types": "./dist/custom-elements.d.ts"
|
|
27
47
|
}
|
|
@@ -31,12 +51,19 @@
|
|
|
31
51
|
],
|
|
32
52
|
"sideEffects": [
|
|
33
53
|
"./dist/tokenflight-swap.js",
|
|
34
|
-
"./dist/tokenflight-swap.umd.cjs"
|
|
54
|
+
"./dist/tokenflight-swap.umd.cjs",
|
|
55
|
+
"./dist/dist-*.js"
|
|
35
56
|
],
|
|
36
57
|
"publishConfig": {
|
|
37
58
|
"access": "public"
|
|
38
59
|
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@tokenflight/api": "0.1.1"
|
|
62
|
+
},
|
|
39
63
|
"devDependencies": {
|
|
64
|
+
"@fluenti/cli": "^0.3.4",
|
|
65
|
+
"@fluenti/core": "^0.3.4",
|
|
66
|
+
"@fluenti/solid": "^0.3.4",
|
|
40
67
|
"@tanstack/solid-query": "^5.75.7",
|
|
41
68
|
"fast-glob": "^3.3.3",
|
|
42
69
|
"jsdom": "^28.1.0",
|
|
@@ -44,15 +71,17 @@
|
|
|
44
71
|
"lucide-solid": "^0.574.0",
|
|
45
72
|
"solid-element": "^1.8.2",
|
|
46
73
|
"solid-js": "^1.9.5",
|
|
47
|
-
"terser": "^5.46.0",
|
|
48
74
|
"typescript": "5.9.2",
|
|
49
75
|
"valibot": "^1.1.0",
|
|
50
|
-
"vite": "^
|
|
76
|
+
"vite": "^8.0.0",
|
|
51
77
|
"vite-plugin-dts": "^4.5.4",
|
|
52
|
-
"vite-plugin-solid": "^2.11.
|
|
53
|
-
"vitest": "^
|
|
78
|
+
"vite-plugin-solid": "^2.11.11",
|
|
79
|
+
"vitest": "^4.1.0"
|
|
54
80
|
},
|
|
55
81
|
"scripts": {
|
|
82
|
+
"i18n:extract": "fluenti extract --clean",
|
|
83
|
+
"i18n:compile": "fluenti compile",
|
|
84
|
+
"prebuild": "pnpm run i18n:compile",
|
|
56
85
|
"build": "vite build",
|
|
57
86
|
"dev": "vite build --watch",
|
|
58
87
|
"check-types": "tsc --noEmit",
|