@xswap-link/sdk 0.2.4 → 0.2.6
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/CHANGELOG.md +14 -0
- package/dist/index.css +244 -267
- package/dist/index.d.mts +19 -12
- package/dist/index.d.ts +19 -12
- package/dist/index.js +588 -432
- package/dist/index.mjs +539 -383
- package/package.json +1 -1
- package/src/components/Alert/index.tsx +1 -1
- package/src/components/Skeleton/index.tsx +3 -1
- package/src/components/TxConfigForm/BalanceComponent.tsx +1 -1
- package/src/components/TxConfigForm/Button.tsx +1 -1
- package/src/components/TxConfigForm/ChainListElement.tsx +2 -2
- package/src/components/TxConfigForm/Description.tsx +2 -2
- package/src/components/TxConfigForm/ErrorField.tsx +4 -2
- package/src/components/TxConfigForm/FeesDetails.tsx +35 -31
- package/src/components/TxConfigForm/Form.tsx +23 -7
- package/src/components/TxConfigForm/History.tsx +36 -9
- package/src/components/TxConfigForm/HistoryCard.tsx +33 -40
- package/src/components/TxConfigForm/PoweredBy.tsx +2 -2
- package/src/components/TxConfigForm/Settings.tsx +33 -27
- package/src/components/TxConfigForm/Summary.tsx +33 -20
- package/src/components/TxConfigForm/SwapPanel.tsx +12 -12
- package/src/components/TxConfigForm/TokenPicker.tsx +36 -34
- package/src/components/TxConfigForm/TopBar.tsx +8 -8
- package/src/components/TxConfigForm/UsdPrice.tsx +2 -2
- package/src/components/TxConfigForm/index.tsx +11 -6
- package/src/components/TxStatusButton/index.tsx +47 -35
- package/src/components/UnknownTokenLogo/UnknownTokenLogo.tsx +14 -0
- package/src/components/global.css +7 -5
- package/src/components/icons/CircularProgressIcon.tsx +1 -1
- package/src/config/init.tsx +19 -18
- package/src/index.ts +9 -1
- package/src/models/TokenData.ts +1 -1
- package/src/models/TransactionHistory.ts +12 -8
- package/src/models/payloads/GetRoutePayload.ts +1 -0
- package/src/models/payloads/GetSwapTxPayload.ts +1 -0
- package/src/services/api.ts +9 -0
- package/src/services/blockchain.ts +49 -0
- package/src/services/index.ts +1 -0
- package/src/services/integrations/monitoring.ts +34 -14
- package/src/services/integrations/transactions.ts +8 -3
- package/src/utils/strings.ts +4 -0
- package/tailwind.config.js +1 -0
package/dist/index.d.mts
CHANGED
|
@@ -48,7 +48,7 @@ type Token = {
|
|
|
48
48
|
name: string;
|
|
49
49
|
symbol: string;
|
|
50
50
|
decimals: number;
|
|
51
|
-
image
|
|
51
|
+
image?: string;
|
|
52
52
|
priority: number;
|
|
53
53
|
quickPick?: boolean;
|
|
54
54
|
supported?: boolean;
|
|
@@ -119,6 +119,7 @@ type GenerateStakingCallsParams = {
|
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
type GetRoutePayload = {
|
|
122
|
+
integratorId: string;
|
|
122
123
|
fromChain: string;
|
|
123
124
|
toChain: string;
|
|
124
125
|
fromToken: string;
|
|
@@ -145,6 +146,7 @@ type AddReferralPayload = {
|
|
|
145
146
|
};
|
|
146
147
|
|
|
147
148
|
type GetSwapTxPayload = {
|
|
149
|
+
integratorId: string;
|
|
148
150
|
dstChain: string;
|
|
149
151
|
dstToken: string;
|
|
150
152
|
customContractCalls?: ContractCall[];
|
|
@@ -229,7 +231,7 @@ type HistoryTransaction = {
|
|
|
229
231
|
tokenAddress: string;
|
|
230
232
|
} | null;
|
|
231
233
|
};
|
|
232
|
-
type TransactionStatus = "IN_PROGRESS" | "DONE" | "REVERTED";
|
|
234
|
+
type TransactionStatus = "IN_PROGRESS" | "DONE" | "REVERTED" | "NOT_FOUND";
|
|
233
235
|
type Transaction = {
|
|
234
236
|
hash: string;
|
|
235
237
|
timestamp: number;
|
|
@@ -243,20 +245,25 @@ type Transaction = {
|
|
|
243
245
|
status: TransactionStatus;
|
|
244
246
|
};
|
|
245
247
|
type MonitoredTransaction = {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
248
|
+
srcChain: string | undefined;
|
|
249
|
+
srcChainImage: string | undefined;
|
|
250
|
+
srcToken: string | undefined;
|
|
251
|
+
srcTokenImage: string | undefined;
|
|
252
|
+
srcAmount: string | undefined;
|
|
253
|
+
dstChain: string | undefined;
|
|
254
|
+
dstChainImage: string | undefined;
|
|
253
255
|
isDone: boolean;
|
|
254
256
|
txHash: string;
|
|
255
257
|
explorer: string | undefined;
|
|
256
258
|
};
|
|
257
259
|
|
|
258
|
-
declare const
|
|
260
|
+
declare const renderTxStatus: (txChainId: string, txHash: string) => Promise<void>;
|
|
261
|
+
|
|
262
|
+
declare const openTransactionModal: ({ integratorId, dstChain, dstToken, customContractCalls, desc, }: GetSwapTxPayload) => Promise<Transactions>;
|
|
259
263
|
|
|
260
|
-
declare const
|
|
264
|
+
declare const XPay: {
|
|
265
|
+
openTransactionModal: ({ integratorId, dstChain, dstToken, customContractCalls, desc, }: GetSwapTxPayload) => Promise<Transactions>;
|
|
266
|
+
renderTxStatus: (txChainId: string, txHash: string) => Promise<void>;
|
|
267
|
+
};
|
|
261
268
|
|
|
262
|
-
export { type AddReferralPayload, type Addresses, type BridgeToken, type Chain, type CoinTypeAddress, type CollectFees, type ContractCall, ContractName, type Contracts, Ecosystem, Environment, type GenerateStakingCallsParams, type GetPricesPayload, type GetRoutePayload, type GetSwapTxPayload, type HistoryTransaction, type MonitoredTransaction, type Prices, type Protocol, type Referral, type ReferralInfo, type Route, type Token, type TokenBalances, type TokenPrices, type Transaction, type TransactionHistory, type TransactionRequest, type TransactionStatus, type Transactions, type TxConfigFormData, Web3Environment, XSwapCallType, type XSwapConfig, type XSwapFee, type XSwapFees,
|
|
269
|
+
export { type AddReferralPayload, type Addresses, type BridgeToken, type Chain, type CoinTypeAddress, type CollectFees, type ContractCall, ContractName, type Contracts, Ecosystem, Environment, type GenerateStakingCallsParams, type GetPricesPayload, type GetRoutePayload, type GetSwapTxPayload, type HistoryTransaction, type MonitoredTransaction, type Prices, type Protocol, type Referral, type ReferralInfo, type Route, type Token, type TokenBalances, type TokenPrices, type Transaction, type TransactionHistory, type TransactionRequest, type TransactionStatus, type Transactions, type TxConfigFormData, Web3Environment, XSwapCallType, type XSwapConfig, type XSwapFee, type XSwapFees, XPay as default, openTransactionModal, renderTxStatus };
|
package/dist/index.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ type Token = {
|
|
|
48
48
|
name: string;
|
|
49
49
|
symbol: string;
|
|
50
50
|
decimals: number;
|
|
51
|
-
image
|
|
51
|
+
image?: string;
|
|
52
52
|
priority: number;
|
|
53
53
|
quickPick?: boolean;
|
|
54
54
|
supported?: boolean;
|
|
@@ -119,6 +119,7 @@ type GenerateStakingCallsParams = {
|
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
type GetRoutePayload = {
|
|
122
|
+
integratorId: string;
|
|
122
123
|
fromChain: string;
|
|
123
124
|
toChain: string;
|
|
124
125
|
fromToken: string;
|
|
@@ -145,6 +146,7 @@ type AddReferralPayload = {
|
|
|
145
146
|
};
|
|
146
147
|
|
|
147
148
|
type GetSwapTxPayload = {
|
|
149
|
+
integratorId: string;
|
|
148
150
|
dstChain: string;
|
|
149
151
|
dstToken: string;
|
|
150
152
|
customContractCalls?: ContractCall[];
|
|
@@ -229,7 +231,7 @@ type HistoryTransaction = {
|
|
|
229
231
|
tokenAddress: string;
|
|
230
232
|
} | null;
|
|
231
233
|
};
|
|
232
|
-
type TransactionStatus = "IN_PROGRESS" | "DONE" | "REVERTED";
|
|
234
|
+
type TransactionStatus = "IN_PROGRESS" | "DONE" | "REVERTED" | "NOT_FOUND";
|
|
233
235
|
type Transaction = {
|
|
234
236
|
hash: string;
|
|
235
237
|
timestamp: number;
|
|
@@ -243,20 +245,25 @@ type Transaction = {
|
|
|
243
245
|
status: TransactionStatus;
|
|
244
246
|
};
|
|
245
247
|
type MonitoredTransaction = {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
248
|
+
srcChain: string | undefined;
|
|
249
|
+
srcChainImage: string | undefined;
|
|
250
|
+
srcToken: string | undefined;
|
|
251
|
+
srcTokenImage: string | undefined;
|
|
252
|
+
srcAmount: string | undefined;
|
|
253
|
+
dstChain: string | undefined;
|
|
254
|
+
dstChainImage: string | undefined;
|
|
253
255
|
isDone: boolean;
|
|
254
256
|
txHash: string;
|
|
255
257
|
explorer: string | undefined;
|
|
256
258
|
};
|
|
257
259
|
|
|
258
|
-
declare const
|
|
260
|
+
declare const renderTxStatus: (txChainId: string, txHash: string) => Promise<void>;
|
|
261
|
+
|
|
262
|
+
declare const openTransactionModal: ({ integratorId, dstChain, dstToken, customContractCalls, desc, }: GetSwapTxPayload) => Promise<Transactions>;
|
|
259
263
|
|
|
260
|
-
declare const
|
|
264
|
+
declare const XPay: {
|
|
265
|
+
openTransactionModal: ({ integratorId, dstChain, dstToken, customContractCalls, desc, }: GetSwapTxPayload) => Promise<Transactions>;
|
|
266
|
+
renderTxStatus: (txChainId: string, txHash: string) => Promise<void>;
|
|
267
|
+
};
|
|
261
268
|
|
|
262
|
-
export { type AddReferralPayload, type Addresses, type BridgeToken, type Chain, type CoinTypeAddress, type CollectFees, type ContractCall, ContractName, type Contracts, Ecosystem, Environment, type GenerateStakingCallsParams, type GetPricesPayload, type GetRoutePayload, type GetSwapTxPayload, type HistoryTransaction, type MonitoredTransaction, type Prices, type Protocol, type Referral, type ReferralInfo, type Route, type Token, type TokenBalances, type TokenPrices, type Transaction, type TransactionHistory, type TransactionRequest, type TransactionStatus, type Transactions, type TxConfigFormData, Web3Environment, XSwapCallType, type XSwapConfig, type XSwapFee, type XSwapFees,
|
|
269
|
+
export { type AddReferralPayload, type Addresses, type BridgeToken, type Chain, type CoinTypeAddress, type CollectFees, type ContractCall, ContractName, type Contracts, Ecosystem, Environment, type GenerateStakingCallsParams, type GetPricesPayload, type GetRoutePayload, type GetSwapTxPayload, type HistoryTransaction, type MonitoredTransaction, type Prices, type Protocol, type Referral, type ReferralInfo, type Route, type Token, type TokenBalances, type TokenPrices, type Transaction, type TransactionHistory, type TransactionRequest, type TransactionStatus, type Transactions, type TxConfigFormData, Web3Environment, XSwapCallType, type XSwapConfig, type XSwapFee, type XSwapFees, XPay as default, openTransactionModal, renderTxStatus };
|