@tcswap/helpers 4.5.15
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/api/index.cjs +4 -0
- package/dist/api/index.cjs.map +16 -0
- package/dist/api/index.js +4 -0
- package/dist/api/index.js.map +16 -0
- package/dist/chunk-pfmeq01a.js +5 -0
- package/dist/chunk-pfmeq01a.js.map +9 -0
- package/dist/chunk-vb4wtm2w.js +4 -0
- package/dist/chunk-vb4wtm2w.js.map +9 -0
- package/dist/contracts.cjs +4 -0
- package/dist/contracts.cjs.map +10 -0
- package/dist/contracts.js +4 -0
- package/dist/contracts.js.map +10 -0
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +30 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +30 -0
- package/dist/tokens.cjs +4 -0
- package/dist/tokens.cjs.map +10 -0
- package/dist/tokens.js +4 -0
- package/dist/tokens.js.map +10 -0
- package/dist/types/api/index.d.ts +502 -0
- package/dist/types/api/index.d.ts.map +1 -0
- package/dist/types/api/memoless/endpoints.d.ts +56 -0
- package/dist/types/api/memoless/endpoints.d.ts.map +1 -0
- package/dist/types/api/memoless/types.d.ts +85 -0
- package/dist/types/api/memoless/types.d.ts.map +1 -0
- package/dist/types/api/midgard/endpoints.d.ts +80 -0
- package/dist/types/api/midgard/endpoints.d.ts.map +1 -0
- package/dist/types/api/midgard/types.d.ts +543 -0
- package/dist/types/api/midgard/types.d.ts.map +1 -0
- package/dist/types/api/thornode/endpoints.d.ts +34 -0
- package/dist/types/api/thornode/endpoints.d.ts.map +1 -0
- package/dist/types/api/thornode/types.d.ts +264 -0
- package/dist/types/api/thornode/types.d.ts.map +1 -0
- package/dist/types/api/uswap/endpoints.d.ts +372 -0
- package/dist/types/api/uswap/endpoints.d.ts.map +1 -0
- package/dist/types/api/uswap/types.d.ts +1487 -0
- package/dist/types/api/uswap/types.d.ts.map +1 -0
- package/dist/types/contracts.d.ts +2 -0
- package/dist/types/contracts.d.ts.map +1 -0
- package/dist/types/index.d.ts +32 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/modules/assetValue.d.ts +82 -0
- package/dist/types/modules/assetValue.d.ts.map +1 -0
- package/dist/types/modules/bigIntArithmetics.d.ts +60 -0
- package/dist/types/modules/bigIntArithmetics.d.ts.map +1 -0
- package/dist/types/modules/feeMultiplier.d.ts +48 -0
- package/dist/types/modules/feeMultiplier.d.ts.map +1 -0
- package/dist/types/modules/requestClient.d.ts +33 -0
- package/dist/types/modules/requestClient.d.ts.map +1 -0
- package/dist/types/modules/uSwapConfig.d.ts +249 -0
- package/dist/types/modules/uSwapConfig.d.ts.map +1 -0
- package/dist/types/modules/uSwapError.d.ts +879 -0
- package/dist/types/modules/uSwapError.d.ts.map +1 -0
- package/dist/types/modules/uSwapNumber.d.ts +10 -0
- package/dist/types/modules/uSwapNumber.d.ts.map +1 -0
- package/dist/types/tokens.d.ts +2 -0
- package/dist/types/tokens.d.ts.map +1 -0
- package/dist/types/types/commonTypes.d.ts +16 -0
- package/dist/types/types/commonTypes.d.ts.map +1 -0
- package/dist/types/types/derivationPath.d.ts +4 -0
- package/dist/types/types/derivationPath.d.ts.map +1 -0
- package/dist/types/types/errors/apiV1.d.ts +2 -0
- package/dist/types/types/errors/apiV1.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +6 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/quotes.d.ts +180 -0
- package/dist/types/types/quotes.d.ts.map +1 -0
- package/dist/types/types/sdk.d.ts +35 -0
- package/dist/types/types/sdk.d.ts.map +1 -0
- package/dist/types/types/wallet.d.ts +130 -0
- package/dist/types/types/wallet.d.ts.map +1 -0
- package/dist/types/utils/asset.d.ts +37 -0
- package/dist/types/utils/asset.d.ts.map +1 -0
- package/dist/types/utils/chains.d.ts +13 -0
- package/dist/types/utils/chains.d.ts.map +1 -0
- package/dist/types/utils/derivationPath.d.ts +21 -0
- package/dist/types/utils/derivationPath.d.ts.map +1 -0
- package/dist/types/utils/explorerUrls.d.ts +10 -0
- package/dist/types/utils/explorerUrls.d.ts.map +1 -0
- package/dist/types/utils/liquidity.d.ts +62 -0
- package/dist/types/utils/liquidity.d.ts.map +1 -0
- package/dist/types/utils/memo.d.ts +65 -0
- package/dist/types/utils/memo.d.ts.map +1 -0
- package/dist/types/utils/others.d.ts +15 -0
- package/dist/types/utils/others.d.ts.map +1 -0
- package/dist/types/utils/validators.d.ts +6 -0
- package/dist/types/utils/validators.d.ts.map +1 -0
- package/dist/types/utils/wallets.d.ts +36 -0
- package/dist/types/utils/wallets.d.ts.map +1 -0
- package/package.json +67 -0
- package/src/api/index.ts +15 -0
- package/src/api/memoless/endpoints.ts +62 -0
- package/src/api/memoless/types.ts +83 -0
- package/src/api/midgard/endpoints.ts +352 -0
- package/src/api/midgard/types.ts +515 -0
- package/src/api/thornode/endpoints.ts +109 -0
- package/src/api/thornode/types.ts +247 -0
- package/src/api/uswap/endpoints.ts +252 -0
- package/src/api/uswap/types.ts +626 -0
- package/src/contracts.ts +1 -0
- package/src/index.ts +32 -0
- package/src/modules/__tests__/assetValue.test.ts +2452 -0
- package/src/modules/__tests__/bigIntArithmetics.test.ts +410 -0
- package/src/modules/__tests__/feeMultiplier.test.ts +131 -0
- package/src/modules/__tests__/uSwapConfig.test.ts +429 -0
- package/src/modules/__tests__/uSwapNumber.test.ts +439 -0
- package/src/modules/assetValue.ts +536 -0
- package/src/modules/bigIntArithmetics.ts +366 -0
- package/src/modules/feeMultiplier.ts +84 -0
- package/src/modules/requestClient.ts +116 -0
- package/src/modules/uSwapConfig.ts +189 -0
- package/src/modules/uSwapError.ts +474 -0
- package/src/modules/uSwapNumber.ts +17 -0
- package/src/tokens.ts +1 -0
- package/src/types/commonTypes.ts +10 -0
- package/src/types/derivationPath.ts +11 -0
- package/src/types/errors/apiV1.ts +0 -0
- package/src/types/index.ts +5 -0
- package/src/types/quotes.ts +182 -0
- package/src/types/sdk.ts +38 -0
- package/src/types/wallet.ts +124 -0
- package/src/utils/__tests__/asset.test.ts +186 -0
- package/src/utils/__tests__/derivationPath.test.ts +142 -0
- package/src/utils/__tests__/explorerUrls.test.ts +59 -0
- package/src/utils/__tests__/liquidity.test.ts +302 -0
- package/src/utils/__tests__/memo.test.ts +99 -0
- package/src/utils/__tests__/others.test.ts +169 -0
- package/src/utils/__tests__/validators.test.ts +84 -0
- package/src/utils/__tests__/wallets.test.ts +625 -0
- package/src/utils/asset.ts +399 -0
- package/src/utils/chains.ts +104 -0
- package/src/utils/derivationPath.ts +101 -0
- package/src/utils/explorerUrls.ts +32 -0
- package/src/utils/liquidity.ts +154 -0
- package/src/utils/memo.ts +102 -0
- package/src/utils/others.ts +64 -0
- package/src/utils/validators.ts +36 -0
- package/src/utils/wallets.ts +238 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uSwapError.d.ts","sourceRoot":"","sources":["../../../src/modules/uSwapError.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,uEAAuE;AACvE,QAAA,MAAM,UAAU;IACd;;OAEG;;;;;;;;;;;IAWH;;OAEG;;;;;;;;;;;;;;;;IAgBH;;OAEG;;;;;;;;;IASH;;OAEG;;;;;;;;;;;;;;;;;;IAkBH;;OAEG;;;;;;;IAOH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;IAyBH;;OAEG;;IAEH;;OAEG;;;;;IAKH;;OAEG;;;;;;;IAOH;;OAEG;;;;;;IAMH;;OAEG;;;IAGH;;OAEG;;IAEH;;OAEG;;;;;;IAMH;;OAEG;;;;;;;;;;;;;;;;;;IAkBH;;OAEG;;;;IAIH;;OAEG;;;;;;;;;IASH;;OAEG;;;IAGH;;OAEG;;;;;IAKH;;OAEG;;;;;IAKH;;OAEG;;;;;;;;;IASH;;OAEG;IAEH;;OAEG;;;;;IAKH;;OAEG;;;;IAIH;;OAEG;;;IAGH;;OAEG;;;;;IAKH;;OAEG;;;;;IAMH;;OAEG;;;;;;;IAOH;;OAEG;;;IAIH;;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;;WAEG;;;;;;;;;QASH;;WAEG;;;QAGH;;WAEG;;;QAGH;;WAEG;;QAEH;;WAEG;;;;;;QAMH;;WAEG;;;;;;;;;;QAUH;;WAEG;;;;;;;;;;;;;;QAcH;;WAEG;;;;;;;;;QASH;;WAEG;;QAEH;;WAEG;;;;;;QAMH;;WAEG;;QAEH;;WAEG;;;;QAIH;;WAEG;;;;;;;;;;;;;QAaH;;WAEG;;MAO2B;gBAG5B,eAAe,EAAE,SAAS,GAAG;QAAE,QAAQ,EAAE,SAAS,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,EAChF,iBAAiB,CAAC,EAAE,GAAG;CAwB1B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modifications © 2025 Horizontal Systems.
|
|
3
|
+
*/
|
|
4
|
+
import { BigIntArithmetics } from "./bigIntArithmetics";
|
|
5
|
+
export type SwapKitValueType = BigIntArithmetics | string | number;
|
|
6
|
+
export declare class USwapNumber extends BigIntArithmetics {
|
|
7
|
+
eq(value: SwapKitValueType): boolean;
|
|
8
|
+
static fromBigInt(value: bigint, decimal?: number): USwapNumber;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=uSwapNumber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uSwapNumber.d.ts","sourceRoot":"","sources":["../../../src/modules/uSwapNumber.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAA2B,MAAM,qBAAqB,CAAC;AAEjF,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnE,qBAAa,WAAY,SAAQ,iBAAiB;IAChD,EAAE,CAAC,KAAK,EAAE,gBAAgB;IAI1B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAGlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/tokens.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Chain } from "@tcswap/types";
|
|
2
|
+
import type { ChainWallet } from "./wallet";
|
|
3
|
+
export type AddChainType<M = {
|
|
4
|
+
[key in string]: any;
|
|
5
|
+
}> = <T extends Chain>(params: Omit<ChainWallet<T>, "balance"> & M) => void;
|
|
6
|
+
export type Witness = {
|
|
7
|
+
value: number;
|
|
8
|
+
script: Buffer;
|
|
9
|
+
};
|
|
10
|
+
export type Asset = {
|
|
11
|
+
chain: Chain;
|
|
12
|
+
symbol: string;
|
|
13
|
+
ticker: string;
|
|
14
|
+
synth?: boolean;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=commonTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonTypes.d.ts","sourceRoot":"","sources":["../../../src/types/commonTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG;KAAG,GAAG,IAAI,MAAM,GAAG,GAAG;CAAE,IAAI,CAAC,CAAC,SAAS,KAAK,EACvE,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,KACxC,IAAI,CAAC;AAEV,MAAM,MAAM,OAAO,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,MAAM,MAAM,KAAK,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Chain, getChainConfig } from "@tcswap/types";
|
|
2
|
+
export type DerivationPathArray = ReturnType<typeof getChainConfig>["networkDerivationPath"];
|
|
3
|
+
export declare const NetworkDerivationPath: Record<Chain, [44, 118, 0, 0, 0] | [44, 931, 0, 0, 0] | [number, number, number, number, number] | [44, 397, 0, 0, 0] | [0, 0, 0, 0, 0] | [44, 144, 0, 0, 0] | [44, 501, 0, 0, 0] | [44, 607, 0, 0, 0] | [44, 195, 0, 0, 0] | [44, 784, 0, 0, 0] | [1852, 1815, 0, 0, 0] | [number, number, number, number, (number | undefined)?] | [44, 145, 0, 0, 0] | [84, 2, 0, 0, 0] | [44, 3, 0, 0, 0] | [44, 5, 0, 0, 0] | [44, 133, 0, 0, 0]>;
|
|
4
|
+
//# sourceMappingURL=derivationPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derivationPath.d.ts","sourceRoot":"","sources":["../../../src/types/derivationPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEtE,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,uBAAuB,CAAC,CAAC;AAE7F,eAAO,MAAM,qBAAqB,waAMjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiV1.d.ts","sourceRoot":"","sources":["../../../../src/types/errors/apiV1.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
export declare enum ErrorCode {
|
|
2
|
+
unknownError = "unknownError",
|
|
3
|
+
test_error = "test_error",
|
|
4
|
+
providerDetailsError = "providerDetailsError",
|
|
5
|
+
blockHeaderNotFound = "blockHeaderNotFound",
|
|
6
|
+
blockHashNotFoundAtHeight = "blockHashNotFoundAtHeight",
|
|
7
|
+
blockHashNotFoundAtHash = "blockHashNotFoundAtHash",
|
|
8
|
+
txHashMissing = "txHashMissing",
|
|
9
|
+
assetValueMissingInfo = "assetValueMissingInfo",
|
|
10
|
+
invalidAsset = "invalidAsset",
|
|
11
|
+
blockIsRequired = "blockIsRequired",
|
|
12
|
+
currentBlockHeaderNotFound = "currentBlockHeaderNotFound",
|
|
13
|
+
failedToRetrieveBalance = "failedToRetrieveBalance",
|
|
14
|
+
failedToRetrieveBlock = "failedToRetrieveBlock",
|
|
15
|
+
failedToRetrieveFees = "failedToRetrieveFees",
|
|
16
|
+
notImplementedBCH = "notImplementedBCH",
|
|
17
|
+
notImplementedDoge = "notImplementedDoge",
|
|
18
|
+
noPoolsFound = "noPoolsFound",
|
|
19
|
+
noVaultsFound = "noVaultsFound",
|
|
20
|
+
noTxFound = "noTxFound",
|
|
21
|
+
noInputCoinFound = "noInputCoinFound",
|
|
22
|
+
noBlockDataFound = "noBlockDataFound",
|
|
23
|
+
multipleCosmosMessages = "multipleCosmosMessages",
|
|
24
|
+
heightOrHashNotProvided = "heightOrHashNotProvided",
|
|
25
|
+
unknownDenom = "unknownDenom",
|
|
26
|
+
invalidBlockHeight = "invalidBlockHeight",
|
|
27
|
+
timestampExtrinsicNoArgumentsForBlock = "timestampExtrinsicNoArgumentsForBlock",
|
|
28
|
+
timestampExtrinsicNoTimestampForBlock = "timestampExtrinsicNoTimestampForBlock",
|
|
29
|
+
noTimestampExtrinsicForHash = "noTimestampExtrinsicForHash",
|
|
30
|
+
timestampExtrinsicNoArgumentsForHash = "timestampExtrinsicNoArgumentsForHash",
|
|
31
|
+
txMemoUndefined = "txMemoUndefined",
|
|
32
|
+
txMemoIncorrect = "txMemoIncorrect",
|
|
33
|
+
txTypeNotFound = "txTypeNotFound",
|
|
34
|
+
txNoMessage = "txNoMessage",
|
|
35
|
+
txNotFound = "txNotFound",
|
|
36
|
+
txReceiptNotFound = "txReceiptNotFound",
|
|
37
|
+
txParsingError = "txParsingError",
|
|
38
|
+
txLogsParsingError = "txLogsParsingError",
|
|
39
|
+
blockNotFound = "blockNotFound",
|
|
40
|
+
balanceNotFound = "balanceNotFound",
|
|
41
|
+
configError = "configError",
|
|
42
|
+
synthSwapDisallowed = "synthSwapDisallowed",
|
|
43
|
+
providerQuoteTimeout = "providerQuoteTimeout",
|
|
44
|
+
noQuoteResponse = "noQuoteResponse",
|
|
45
|
+
noPoolAssetsFound = "noPoolAssetsFound",
|
|
46
|
+
noThorchainPools = "noThorchainPools",
|
|
47
|
+
noMayachainPools = "noMayachainPools",
|
|
48
|
+
noThorchainNetworkInfo = "noThorchainNetworkInfo",
|
|
49
|
+
invalidAffiliateFee = "invalidAffiliateFee",
|
|
50
|
+
invalidBuyAssetAddress = "invalidBuyAssetAddress",
|
|
51
|
+
invalidSellAssetAddress = "invalidSellAssetAddress",
|
|
52
|
+
invalidSourceAddress = "invalidSourceAddress",
|
|
53
|
+
invalidDestinationAddress = "invalidDestinationAddress",
|
|
54
|
+
sourceAddressIsSmartContract = "sourceAddressIsSmartContract",
|
|
55
|
+
destinationAddressIsSmartContract = "destinationAddressIsSmartContract",
|
|
56
|
+
invalidChainId = "invalidChainId",
|
|
57
|
+
unsupportedChainId = "unsupportedChainId",
|
|
58
|
+
unsupportedEVMChainId = "unsupportedEVMChainId",
|
|
59
|
+
unsupportedMethod = "unsupportedMethod",
|
|
60
|
+
unsupportedProvider = "unsupportedProvider",
|
|
61
|
+
invalidParamsForMethod = "invalidParamsForMethod",
|
|
62
|
+
unsupportedAdapter = "unsupportedAdapter",
|
|
63
|
+
noWhitelistTokens = "noWhitelistTokens",
|
|
64
|
+
failedFetchGasPrice = "failedFetchGasPrice",
|
|
65
|
+
failedToCreateDepositChannel = "failedToCreateDepositChannel",
|
|
66
|
+
noProviderDetailsFound = "noProviderDetailsFound",
|
|
67
|
+
noTokenListsFound = "noTokenListsFound",
|
|
68
|
+
tokenNotFound = "tokenNotFound",
|
|
69
|
+
tokenPriceNotFound = "tokenPriceNotFound",
|
|
70
|
+
tokenPriceFailedToUpdate = "tokenPriceFailedToUpdate",
|
|
71
|
+
swapAmountTooSmall = "swapAmountTooSmall",
|
|
72
|
+
legsArrayIsEmpty = "legsArrayIsEmpty",
|
|
73
|
+
failedToFetchQuoteForLeg = "failedToFetchQuoteForLeg",
|
|
74
|
+
noBlockHeaderFound = "noBlockHeaderFound",
|
|
75
|
+
failedToSimulateSwap = "failedToSimulateSwap",
|
|
76
|
+
addressScreeningFailed = "addressScreeningFailed",
|
|
77
|
+
noLiquidtyProvidersFound = "noLiquidtyProvidersFound",
|
|
78
|
+
insufficientLiquidity = "insufficientLiquidity",
|
|
79
|
+
noInboundDataFound = "noInbounDataFound",
|
|
80
|
+
noInboundAddressesFound = "noInboundAddressesFound",
|
|
81
|
+
noInboundAddressFoundForChain = "noInboundAddressFoundForChain",
|
|
82
|
+
noLastBlocksFound = "noLastBlocksFound",
|
|
83
|
+
noVersionFound = "noVersionFound",
|
|
84
|
+
noConstantsFound = "noConstantsFound",
|
|
85
|
+
noMimirsFound = "noMimirsFound",
|
|
86
|
+
noRoutesFound = "noRoutesFound",
|
|
87
|
+
quoteNotFound = "quoteNotFound",
|
|
88
|
+
ledgerSignFailed = "ledgerSignFailed",
|
|
89
|
+
ledgerWrongPayload = "ledgerWrongPayload",
|
|
90
|
+
ledgerFetchSwapFailed = "ledgerFetchSwapFailed",
|
|
91
|
+
failedToFetchTx = "failedToFetchTx",
|
|
92
|
+
failedBuildTransactionDetails = "failedBuildTransactionDetails",
|
|
93
|
+
noLegsForRoute = "noLegsForRoute",
|
|
94
|
+
noRouterAddressFound = "noRouterAddressFound",
|
|
95
|
+
noAggregatorAddressFound = "noAggregatorAddressFound",
|
|
96
|
+
noContractInstanceFound = "noContractInstanceFound",
|
|
97
|
+
noContractAddressFound = "noContractAddressFound",
|
|
98
|
+
invalidAffiliate = "invalidAffiliate",
|
|
99
|
+
thornameAffiliate = "thornameAffiliate",
|
|
100
|
+
providerNotfound = "No provider found",
|
|
101
|
+
noRecordFound = "No Record found",
|
|
102
|
+
slippageTooLow = "Slippage too low",
|
|
103
|
+
tradingHalted = "tradingHalted",
|
|
104
|
+
noWrappedGasAsset = "noWrappedGasAsset",
|
|
105
|
+
aggregatorAddressNotFound = "aggregatorAddressNotFound",
|
|
106
|
+
routerAddressNotFound = "routerAddressNotFound",
|
|
107
|
+
dummyAddressNotFound = "dummyAddressNotFound",
|
|
108
|
+
trackerError = "trackerError",
|
|
109
|
+
thorchainPoolUnavailable = "thorchainPoolUnavailable",
|
|
110
|
+
noOhlcvDataFound = "noOhlcvDataFound",
|
|
111
|
+
noTradingPairs = "noTradingPairs",
|
|
112
|
+
noLendingAvailability = "noLendingAvailability",
|
|
113
|
+
lendingRepayTooSmall = "lendingRepayTooSmall",
|
|
114
|
+
missingState = "missingState",
|
|
115
|
+
ledgerSwapNotFound = "ledgerSwapNotFound",
|
|
116
|
+
ledgerSwapNotReadyForTracking = "ledgerSwapNotReadyForTracking",
|
|
117
|
+
errorEstimatingGas = "errorEstimatingGas",
|
|
118
|
+
apiKeyInvalid = "apiKeyInvalid",
|
|
119
|
+
apiKeyFailedToUpdate = "apiKeyFailedToUpdate",
|
|
120
|
+
apiKeyExpired = "apiKeyExpired",
|
|
121
|
+
unauthorized = "unauthorized",
|
|
122
|
+
failedToCreateMemo = "failedToCreateMemo",
|
|
123
|
+
radixIncorrectInstructions = "radixIncorrectInstructions",
|
|
124
|
+
radixTxMissedParam = "radixTxMissedParam",
|
|
125
|
+
radixTxMissedAccount = "radixTxMissedAccount",
|
|
126
|
+
radixManifestParseError = "radixManifestParseError",
|
|
127
|
+
radixManifestBuildError = "radixManifestBuildError",
|
|
128
|
+
invalidAddressForChain = "invalidAddressForChain",
|
|
129
|
+
riskyAddress = "riskyAddress",
|
|
130
|
+
noRoutesToProcess = "noRoutesToProcess",
|
|
131
|
+
sellAssetAmountTooSmall = "sellAssetAmountTooSmall",
|
|
132
|
+
missingPrivateKey = "missingPrivateKey",
|
|
133
|
+
noMemoPriceProtection = "noMemoPriceProtection",
|
|
134
|
+
rateExpired = "rateExpired",
|
|
135
|
+
amountTooSmall = "amountTooSmall",
|
|
136
|
+
amountTooBig = "amountTooBig",
|
|
137
|
+
amountOutOfRange = "amountOutOfRange",
|
|
138
|
+
requestTimeOut = "requestTimeOut",
|
|
139
|
+
networkError = "networkError",
|
|
140
|
+
unknownApiError = "unknownApiError",
|
|
141
|
+
invalidResponseFormat = "invalidResponseFormat"
|
|
142
|
+
}
|
|
143
|
+
export declare enum WarningCodeEnum {
|
|
144
|
+
highSlippage = "highSlippage",
|
|
145
|
+
highPriceImpact = "highPriceImpact"
|
|
146
|
+
}
|
|
147
|
+
export declare enum ProviderName {
|
|
148
|
+
CAVIAR_V1 = "CAVIAR_V1",
|
|
149
|
+
CAMELOT_V3 = "CAMELOT_V3",
|
|
150
|
+
CHAINFLIP = "CHAINFLIP",
|
|
151
|
+
CHAINFLIP_STREAMING = "CHAINFLIP_STREAMING",
|
|
152
|
+
JUPITER = "JUPITER",
|
|
153
|
+
MAYACHAIN = "MAYACHAIN",
|
|
154
|
+
MAYACHAIN_STREAMING = "MAYACHAIN_STREAMING",
|
|
155
|
+
OCISWAP_V1 = "OCISWAP_V1",
|
|
156
|
+
ONEINCH = "ONEINCH",
|
|
157
|
+
OPENOCEAN_V2 = "OPENOCEAN_V2",
|
|
158
|
+
PANCAKESWAP = "PANCAKESWAP",
|
|
159
|
+
PANGOLIN_V1 = "PANGOLIN_V1",
|
|
160
|
+
SUSHISWAP_V2 = "SUSHISWAP_V2",
|
|
161
|
+
THORCHAIN = "THORCHAIN",
|
|
162
|
+
THORCHAIN_STREAMING = "THORCHAIN_STREAMING",
|
|
163
|
+
TRADERJOE_V2 = "TRADERJOE_V2",
|
|
164
|
+
UNISWAP_V2 = "UNISWAP_V2",
|
|
165
|
+
UNISWAP_V3 = "UNISWAP_V3",
|
|
166
|
+
NEAR = "NEAR",
|
|
167
|
+
GARDEN = "GARDEN",
|
|
168
|
+
OKX = "OKX"
|
|
169
|
+
}
|
|
170
|
+
export declare enum FeeTypeEnum {
|
|
171
|
+
LIQUIDITY = "liquidity",
|
|
172
|
+
NETWORK = "network",
|
|
173
|
+
INBOUND = "inbound",
|
|
174
|
+
OUTBOUND = "outbound",
|
|
175
|
+
AFFILIATE = "affiliate",
|
|
176
|
+
TAX = "tax",
|
|
177
|
+
PRIORITY = "priority",
|
|
178
|
+
SERVICE = "service"
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=quotes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quotes.d.ts","sourceRoot":"","sources":["../../../src/types/quotes.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,oBAAoB,yBAAyB;IAC7C,mBAAmB,wBAAwB;IAC3C,yBAAyB,8BAA8B;IACvD,uBAAuB,4BAA4B;IACnD,aAAa,kBAAkB;IAC/B,qBAAqB,0BAA0B;IAC/C,YAAY,iBAAiB;IAC7B,eAAe,oBAAoB;IACnC,0BAA0B,+BAA+B;IACzD,uBAAuB,4BAA4B;IACnD,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;IAC7C,iBAAiB,sBAAsB;IACvC,kBAAkB,uBAAuB;IACzC,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,SAAS,cAAc;IACvB,gBAAgB,qBAAqB;IACrC,gBAAgB,qBAAqB;IACrC,sBAAsB,2BAA2B;IACjD,uBAAuB,4BAA4B;IACnD,YAAY,iBAAiB;IAC7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;IAC3B,cAAc,mBAAmB;IACjC,YAAY,iBAAiB;IAC7B,gBAAgB,qBAAqB;IACrC,cAAc,mBAAmB;IACjC,YAAY,iBAAiB;IAC7B,eAAe,oBAAoB;IACnC,qBAAqB,0BAA0B;CAChD;AAED,oBAAY,eAAe;IACzB,YAAY,iBAAiB;IAC7B,eAAe,oBAAoB;CACpC;AAED,oBAAY,YAAY;IACtB,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,mBAAmB,wBAAwB;IAC3C,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,mBAAmB,wBAAwB;IAC3C,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,SAAS,cAAc;IACvB,mBAAmB,wBAAwB;IAC3C,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,GAAG,QAAQ;CACZ;AAED,oBAAY,WAAW;IACrB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,OAAO,YAAY;CACpB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AssetValue } from "../modules/assetValue";
|
|
2
|
+
export type GenericSwapParams<T = unknown> = {
|
|
3
|
+
buyAsset?: AssetValue;
|
|
4
|
+
sellAsset?: AssetValue;
|
|
5
|
+
recipient?: string;
|
|
6
|
+
feeOptionKey?: FeeOption;
|
|
7
|
+
route: T;
|
|
8
|
+
};
|
|
9
|
+
export type SwapParams<PluginNames = string, R = unknown> = GenericSwapParams<R> & {
|
|
10
|
+
pluginName?: PluginNames;
|
|
11
|
+
};
|
|
12
|
+
export declare enum FeeOption {
|
|
13
|
+
Average = "average",
|
|
14
|
+
Fast = "fast",
|
|
15
|
+
Fastest = "fastest"
|
|
16
|
+
}
|
|
17
|
+
export declare enum ApproveMode {
|
|
18
|
+
Approve = "approve",
|
|
19
|
+
CheckOnly = "checkOnly"
|
|
20
|
+
}
|
|
21
|
+
export type ApproveReturnType<T extends ApproveMode> = T extends "checkOnly" ? Promise<boolean> : Promise<string>;
|
|
22
|
+
export declare enum MemoType {
|
|
23
|
+
NAME_REGISTER = "~",
|
|
24
|
+
BOND = "BOND",
|
|
25
|
+
DEPOSIT = "+",
|
|
26
|
+
LEAVE = "LEAVE",
|
|
27
|
+
UNBOND = "UNBOND",
|
|
28
|
+
WITHDRAW = "-",
|
|
29
|
+
RUNEPOOL_DEPOSIT = "POOL+",
|
|
30
|
+
RUNEPOOL_WITHDRAW = "POOL-",
|
|
31
|
+
CLAIM_TCY = "tcy",
|
|
32
|
+
STAKE_TCY = "tcy+",
|
|
33
|
+
UNSTAKE_TCY = "tcy-"
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=sdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/types/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,OAAO,IAAI;IAC3C,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,WAAW,GAAG,MAAM,EAAE,CAAC,GAAG,OAAO,IAAI,iBAAiB,CAAC,CAAC,CAAC,GAAG;IAAE,UAAU,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AAEhH,oBAAY,SAAS;IACnB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,SAAS,cAAc;CACxB;AAED,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,WAAW,IAAI,CAAC,SAAS,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAElH,oBAAY,QAAQ;IAClB,aAAa,MAAM;IACnB,IAAI,SAAS;IACb,OAAO,MAAM;IACb,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,QAAQ,MAAM;IACd,gBAAgB,UAAU;IAC1B,iBAAiB,UAAU;IAC3B,SAAS,QAAQ;IACjB,SAAS,SAAS;IAClB,WAAW,SAAS;CACrB"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { Chain, getChainConfig } from "@tcswap/types";
|
|
2
|
+
import type { BrowserProvider, Eip1193Provider } from "ethers";
|
|
3
|
+
import type { AssetValue } from "../modules/assetValue";
|
|
4
|
+
import type { FeeOption } from "./sdk";
|
|
5
|
+
declare global {
|
|
6
|
+
interface WindowEventMap {
|
|
7
|
+
"eip6963:announceProvider": CustomEvent;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export type EthereumWindowProvider = BrowserProvider & {
|
|
11
|
+
__XDEFI?: boolean;
|
|
12
|
+
isBraveWallet?: boolean;
|
|
13
|
+
isCoinbaseWallet?: boolean;
|
|
14
|
+
isMetaMask?: boolean;
|
|
15
|
+
isOkxWallet?: boolean;
|
|
16
|
+
isKeepKeyWallet?: boolean;
|
|
17
|
+
isTrust?: boolean;
|
|
18
|
+
isTalisman?: boolean;
|
|
19
|
+
on: (event: string, callback?: () => void) => void;
|
|
20
|
+
overrideIsMetaMask?: boolean;
|
|
21
|
+
request: <T = unknown>(args: {
|
|
22
|
+
method: string;
|
|
23
|
+
params?: unknown[];
|
|
24
|
+
}) => Promise<T>;
|
|
25
|
+
selectedProvider?: EthereumWindowProvider;
|
|
26
|
+
};
|
|
27
|
+
export type NetworkParams = {
|
|
28
|
+
chainId: ReturnType<typeof getChainConfig>["chainIdHex"];
|
|
29
|
+
chainName: string;
|
|
30
|
+
nativeCurrency: {
|
|
31
|
+
name: string;
|
|
32
|
+
symbol: string;
|
|
33
|
+
decimals: number;
|
|
34
|
+
};
|
|
35
|
+
rpcUrls: string[];
|
|
36
|
+
blockExplorerUrls: string[];
|
|
37
|
+
};
|
|
38
|
+
export declare enum WalletOption {
|
|
39
|
+
BITGET = "BITGET",
|
|
40
|
+
BRAVE = "BRAVE",
|
|
41
|
+
COINBASE_MOBILE = "COINBASE_MOBILE",
|
|
42
|
+
COINBASE_WEB = "COINBASE_WEB",
|
|
43
|
+
COSMOSTATION = "COSMOSTATION",
|
|
44
|
+
CTRL = "CTRL",
|
|
45
|
+
EIP6963 = "EIP6963",
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated Use PASSKEYS instead
|
|
48
|
+
*/
|
|
49
|
+
EXODUS = "EXODUS",
|
|
50
|
+
KEEPKEY = "KEEPKEY",
|
|
51
|
+
KEEPKEY_BEX = "KEEPKEY_BEX",
|
|
52
|
+
KEPLR = "KEPLR",
|
|
53
|
+
KEYSTORE = "KEYSTORE",
|
|
54
|
+
LEAP = "LEAP",
|
|
55
|
+
LEDGER = "LEDGER",
|
|
56
|
+
LEDGER_LIVE = "LEDGER_LIVE",
|
|
57
|
+
METAMASK = "METAMASK",
|
|
58
|
+
OKX = "OKX",
|
|
59
|
+
OKX_MOBILE = "OKX_MOBILE",
|
|
60
|
+
ONEKEY = "ONEKEY",
|
|
61
|
+
PASSKEYS = "PASSKEYS",
|
|
62
|
+
PHANTOM = "PHANTOM",
|
|
63
|
+
POLKADOT_JS = "POLKADOT_JS",
|
|
64
|
+
RADIX_WALLET = "RADIX_WALLET",
|
|
65
|
+
TALISMAN = "TALISMAN",
|
|
66
|
+
TREZOR = "TREZOR",
|
|
67
|
+
TRONLINK = "TRONLINK",
|
|
68
|
+
TRUSTWALLET_WEB = "TRUSTWALLET_WEB",
|
|
69
|
+
VULTISIG = "VULTISIG",
|
|
70
|
+
WALLETCONNECT = "WALLETCONNECT",
|
|
71
|
+
WALLET_SELECTOR = "WALLET_SELECTOR",
|
|
72
|
+
XAMAN = "XAMAN"
|
|
73
|
+
}
|
|
74
|
+
export declare enum LedgerErrorCode {
|
|
75
|
+
NoError = 36864,
|
|
76
|
+
LockedDevice = 21781,
|
|
77
|
+
TC_NotFound = 65535
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @deprecated CryptoChain has been deprecated - use Chain instead
|
|
81
|
+
*/
|
|
82
|
+
export type CryptoChain = Chain;
|
|
83
|
+
export type ChainWallet<T extends Chain> = {
|
|
84
|
+
chain: T;
|
|
85
|
+
address: string;
|
|
86
|
+
balance: AssetValue[];
|
|
87
|
+
walletType: WalletOption | string;
|
|
88
|
+
disconnect?: () => void;
|
|
89
|
+
signMessage?: (message: string) => Promise<string>;
|
|
90
|
+
};
|
|
91
|
+
export type EmptyWallet = {
|
|
92
|
+
[key in Chain]?: unknown;
|
|
93
|
+
};
|
|
94
|
+
export type BaseWallet<T extends EmptyWallet | Record<string, unknown>> = {
|
|
95
|
+
[key in Chain]: ChainWallet<key> & (T extends EmptyWallet ? T[key] : never);
|
|
96
|
+
};
|
|
97
|
+
export type EIP6963ProviderInfo = {
|
|
98
|
+
walletId: string;
|
|
99
|
+
uuid: string;
|
|
100
|
+
name: string;
|
|
101
|
+
icon: string;
|
|
102
|
+
};
|
|
103
|
+
export type EIP6963ProviderDetail = {
|
|
104
|
+
info: EIP6963ProviderInfo;
|
|
105
|
+
provider: Eip1193Provider;
|
|
106
|
+
};
|
|
107
|
+
export type EIP6963Provider = {
|
|
108
|
+
info: EIP6963ProviderInfo;
|
|
109
|
+
provider: Eip1193Provider;
|
|
110
|
+
};
|
|
111
|
+
export type EIP6963AnnounceProviderEvent = Event & {
|
|
112
|
+
detail: EIP6963Provider;
|
|
113
|
+
};
|
|
114
|
+
export type ChainSigner<T, S> = {
|
|
115
|
+
signTransaction: (params: T) => Promise<S> | S;
|
|
116
|
+
getAddress: () => Promise<string> | string;
|
|
117
|
+
sign?: (message: string) => Promise<string> | string;
|
|
118
|
+
};
|
|
119
|
+
export type GenericTransferParams = {
|
|
120
|
+
recipient: string;
|
|
121
|
+
assetValue: AssetValue;
|
|
122
|
+
memo?: string;
|
|
123
|
+
feeRate?: number;
|
|
124
|
+
feeOptionKey?: FeeOption;
|
|
125
|
+
};
|
|
126
|
+
export type GenericCreateTransactionParams = Omit<GenericTransferParams, "feeOptionKey" & "feeRate"> & {
|
|
127
|
+
sender: string;
|
|
128
|
+
feeRate: number;
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=wallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../src/types/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAE/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,cAAc;QACtB,0BAA0B,EAAE,WAAW,CAAC;KACzC;CACF;AAED,MAAM,MAAM,sBAAsB,GAAG,eAAe,GAAG;IACrD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CA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