@0xsquid/react-hooks 8.0.1-para-beta.2 → 8.0.1-para-beta.3
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/{index-CvsT0xf8.js → index-CjNxoWnC.js} +84 -47
- package/dist/{index-BxbblIad.js.map → index-CjNxoWnC.js.map} +1 -1
- package/dist/{index-BxbblIad.js → index-gPUCtJnZ.js} +84 -47
- package/dist/{index-CvsT0xf8.js.map → index-gPUCtJnZ.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{secretService-nvn8-zjs.js → secretService-7WbMaDcW.js} +2 -2
- package/dist/{secretService-nvn8-zjs.js.map → secretService-7WbMaDcW.js.map} +1 -1
- package/dist/{secretService-BjLmYyy4.js → secretService-Dp2zmZW_.js} +2 -2
- package/dist/{secretService-BjLmYyy4.js.map → secretService-Dp2zmZW_.js.map} +1 -1
- package/dist/{stellarService.client-BuIqVMl2.js → stellarService.client-CfGdqxtp.js} +2 -2
- package/dist/{stellarService.client-BuIqVMl2.js.map → stellarService.client-CfGdqxtp.js.map} +1 -1
- package/dist/{stellarService.client-ep6_7QVE.js → stellarService.client-CqP7EehD.js} +2 -2
- package/dist/{stellarService.client-ep6_7QVE.js.map → stellarService.client-CqP7EehD.js.map} +1 -1
- package/package.json +4 -2
|
@@ -27473,7 +27473,7 @@ const filterViewableTokens = (tokens, config, direction) => {
|
|
|
27473
27473
|
};
|
|
27474
27474
|
const getSecretNetworkBalances = async (chainData, cosmosAddress, squidTokens, keplrTypeWallet) => {
|
|
27475
27475
|
const squidSecretTokens = squidTokens.filter((t) => t.chainId === CHAIN_IDS.SECRET);
|
|
27476
|
-
const { fetchAllSecretBalances } = await Promise.resolve().then(function () { return require('./secretService-
|
|
27476
|
+
const { fetchAllSecretBalances } = await Promise.resolve().then(function () { return require('./secretService-Dp2zmZW_.js'); });
|
|
27477
27477
|
return fetchAllSecretBalances(chainData, cosmosAddress, squidSecretTokens, keplrTypeWallet);
|
|
27478
27478
|
};
|
|
27479
27479
|
function getTokenAssetsKey(token) {
|
|
@@ -30552,7 +30552,7 @@ function useStellarWallets() {
|
|
|
30552
30552
|
return;
|
|
30553
30553
|
try {
|
|
30554
30554
|
const { allowAllModules: initializeAllModules } = await import('@creit.tech/stellar-wallets-kit');
|
|
30555
|
-
const { formatStellarWallet } = await Promise.resolve().then(function () { return require('./stellarService.client-
|
|
30555
|
+
const { formatStellarWallet } = await Promise.resolve().then(function () { return require('./stellarService.client-CqP7EehD.js'); });
|
|
30556
30556
|
const modules = initializeAllModules();
|
|
30557
30557
|
const promises = modules.map(async (module) => {
|
|
30558
30558
|
const isAvailable = await module.isAvailable();
|
|
@@ -31777,7 +31777,7 @@ const useCosmos = () => {
|
|
|
31777
31777
|
}
|
|
31778
31778
|
}
|
|
31779
31779
|
return undefined;
|
|
31780
|
-
}
|
|
31780
|
+
},
|
|
31781
31781
|
});
|
|
31782
31782
|
const clearData = () => {
|
|
31783
31783
|
disconnectWallet(squidTypes.ChainType.COSMOS);
|
|
@@ -31826,7 +31826,7 @@ function useCosmosSigner({ chain }) {
|
|
|
31826
31826
|
// use Amino signer for Ledger compatibility
|
|
31827
31827
|
const newCosmosSigner = getCosmosSignerForChain(chain.chainId, connector);
|
|
31828
31828
|
return newCosmosSigner;
|
|
31829
|
-
}, [chain?.chainId, chain?.chainType, connector]);
|
|
31829
|
+
}, [chain?.chainId, chain?.chainType, connector, getCosmosSignerForChain]);
|
|
31830
31830
|
return { signer, keplrTypeWallet: connector };
|
|
31831
31831
|
}
|
|
31832
31832
|
|
|
@@ -35798,20 +35798,6 @@ const useAllTransactionsStatus = ({ enabled }) => {
|
|
|
35798
35798
|
retry: 4,
|
|
35799
35799
|
retryDelay: getSwapTxStatusRefetchInterval(data),
|
|
35800
35800
|
refetchInterval: 5000,
|
|
35801
|
-
onSuccess: (statusResponse) => {
|
|
35802
|
-
if (!statusResponse)
|
|
35803
|
-
return;
|
|
35804
|
-
const endStatus = getTransactionEndStatus({
|
|
35805
|
-
statusResponse,
|
|
35806
|
-
});
|
|
35807
|
-
if (!endStatus)
|
|
35808
|
-
return;
|
|
35809
|
-
replaceSwapTransactionStatus({
|
|
35810
|
-
transactionId: data.transactionId,
|
|
35811
|
-
statusResponse,
|
|
35812
|
-
status: endStatus,
|
|
35813
|
-
});
|
|
35814
|
-
},
|
|
35815
35801
|
};
|
|
35816
35802
|
}
|
|
35817
35803
|
case exports.HistoryTxType.BUY:
|
|
@@ -35828,22 +35814,6 @@ const useAllTransactionsStatus = ({ enabled }) => {
|
|
|
35828
35814
|
}
|
|
35829
35815
|
return TX_STATUS_CONSTANTS.REFETCH_INTERVAL;
|
|
35830
35816
|
},
|
|
35831
|
-
onSuccess: (statusData) => {
|
|
35832
|
-
replaceTransactionStatus({
|
|
35833
|
-
orderId: data.orderId,
|
|
35834
|
-
status: statusData.status,
|
|
35835
|
-
transactionHash: statusData.transactionHash,
|
|
35836
|
-
txType: exports.HistoryTxType.BUY,
|
|
35837
|
-
});
|
|
35838
|
-
},
|
|
35839
|
-
onError: () => {
|
|
35840
|
-
replaceTransactionStatus({
|
|
35841
|
-
txType: exports.HistoryTxType.BUY,
|
|
35842
|
-
orderId: data.orderId,
|
|
35843
|
-
status: "failed",
|
|
35844
|
-
transactionHash: undefined,
|
|
35845
|
-
});
|
|
35846
|
-
},
|
|
35847
35817
|
enabled: true,
|
|
35848
35818
|
};
|
|
35849
35819
|
case exports.HistoryTxType.SEND:
|
|
@@ -35860,28 +35830,95 @@ const useAllTransactionsStatus = ({ enabled }) => {
|
|
|
35860
35830
|
});
|
|
35861
35831
|
},
|
|
35862
35832
|
refetchInterval: getSendTxStatusRefetchInterval(data.token.type),
|
|
35863
|
-
|
|
35833
|
+
};
|
|
35834
|
+
}
|
|
35835
|
+
});
|
|
35836
|
+
const queries = reactQuery.useQueries({
|
|
35837
|
+
queries: enabled && config.apiUrl ? statusQueries : [],
|
|
35838
|
+
});
|
|
35839
|
+
React.useEffect(() => {
|
|
35840
|
+
queries.forEach((query, index) => {
|
|
35841
|
+
const transaction = pendingTransactions[index];
|
|
35842
|
+
switch (transaction.txType) {
|
|
35843
|
+
case exports.HistoryTxType.SWAP:
|
|
35844
|
+
if (query.isSuccess && query.data) {
|
|
35845
|
+
const statusResponse = query.data;
|
|
35846
|
+
const endStatus = getTransactionEndStatus({
|
|
35847
|
+
statusResponse,
|
|
35848
|
+
});
|
|
35849
|
+
if (!endStatus)
|
|
35850
|
+
return;
|
|
35851
|
+
replaceSwapTransactionStatus({
|
|
35852
|
+
transactionId: transaction.data.transactionId,
|
|
35853
|
+
statusResponse,
|
|
35854
|
+
status: endStatus,
|
|
35855
|
+
});
|
|
35856
|
+
}
|
|
35857
|
+
if (query.isError) {
|
|
35858
|
+
const error = query.error;
|
|
35859
|
+
const is404 = is404Error(error.cause);
|
|
35860
|
+
if (is404) {
|
|
35861
|
+
replaceSwapTransactionStatus({
|
|
35862
|
+
transactionId: transaction.data.transactionId,
|
|
35863
|
+
statusResponse: undefined,
|
|
35864
|
+
status: exports.TransactionStatus.NOT_FOUND,
|
|
35865
|
+
});
|
|
35866
|
+
}
|
|
35867
|
+
else {
|
|
35868
|
+
replaceSwapTransactionStatus({
|
|
35869
|
+
transactionId: transaction.data.transactionId,
|
|
35870
|
+
statusResponse: undefined,
|
|
35871
|
+
status: exports.TransactionStatus.ERROR,
|
|
35872
|
+
});
|
|
35873
|
+
}
|
|
35874
|
+
}
|
|
35875
|
+
break;
|
|
35876
|
+
case exports.HistoryTxType.BUY:
|
|
35877
|
+
if (query.isSuccess && query.data) {
|
|
35878
|
+
const statusData = query.data;
|
|
35879
|
+
replaceTransactionStatus({
|
|
35880
|
+
orderId: transaction.data.orderId,
|
|
35881
|
+
status: statusData.status,
|
|
35882
|
+
transactionHash: statusData.transactionHash,
|
|
35883
|
+
txType: exports.HistoryTxType.BUY,
|
|
35884
|
+
});
|
|
35885
|
+
}
|
|
35886
|
+
if (query.isError) {
|
|
35887
|
+
replaceTransactionStatus({
|
|
35888
|
+
txType: exports.HistoryTxType.BUY,
|
|
35889
|
+
orderId: transaction.data.orderId,
|
|
35890
|
+
status: "failed",
|
|
35891
|
+
transactionHash: undefined,
|
|
35892
|
+
});
|
|
35893
|
+
}
|
|
35894
|
+
break;
|
|
35895
|
+
case exports.HistoryTxType.SEND:
|
|
35896
|
+
if (query.isSuccess && query.data) {
|
|
35897
|
+
const status = query.data;
|
|
35864
35898
|
if (status !== exports.SendTransactionStatus.ONGOING) {
|
|
35865
35899
|
replaceTransactionStatus({
|
|
35866
35900
|
txType: exports.HistoryTxType.SEND,
|
|
35867
35901
|
status,
|
|
35868
|
-
hash: data.hash,
|
|
35902
|
+
hash: transaction.data.hash,
|
|
35869
35903
|
});
|
|
35870
35904
|
}
|
|
35871
|
-
}
|
|
35872
|
-
|
|
35905
|
+
}
|
|
35906
|
+
if (query.isError) {
|
|
35873
35907
|
replaceTransactionStatus({
|
|
35874
35908
|
txType: exports.HistoryTxType.SEND,
|
|
35875
35909
|
status: exports.SendTransactionStatus.ERROR,
|
|
35876
|
-
hash: data.hash,
|
|
35910
|
+
hash: transaction.data.hash,
|
|
35877
35911
|
});
|
|
35878
|
-
}
|
|
35879
|
-
|
|
35880
|
-
|
|
35881
|
-
|
|
35882
|
-
|
|
35883
|
-
|
|
35884
|
-
|
|
35912
|
+
}
|
|
35913
|
+
break;
|
|
35914
|
+
}
|
|
35915
|
+
});
|
|
35916
|
+
}, [
|
|
35917
|
+
pendingTransactions,
|
|
35918
|
+
queries,
|
|
35919
|
+
replaceSwapTransactionStatus,
|
|
35920
|
+
replaceTransactionStatus,
|
|
35921
|
+
]);
|
|
35885
35922
|
return {
|
|
35886
35923
|
isPending: queries.some((q) => q.isPending),
|
|
35887
35924
|
isError: queries.some((q) => q.isError),
|
|
@@ -41078,4 +41115,4 @@ exports.useWallets = useWallets;
|
|
|
41078
41115
|
exports.useXrplTrustLine = useXrplTrustLine;
|
|
41079
41116
|
exports.walletIconBaseUrl = walletIconBaseUrl;
|
|
41080
41117
|
exports.walletSupportsChainType = walletSupportsChainType;
|
|
41081
|
-
//# sourceMappingURL=index-
|
|
41118
|
+
//# sourceMappingURL=index-CjNxoWnC.js.map
|