@sodax/types 1.5.7-beta → 2.0.0-rc.2
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 +84 -20
- package/dist/backend/backendApi.d.ts +75 -0
- package/dist/backend/backendApi.d.ts.map +1 -0
- package/dist/backend/backendApi.js +2 -0
- package/dist/backend/backendApi.js.map +1 -0
- package/dist/backend/index.d.ts +1 -80
- package/dist/backend/index.d.ts.map +1 -1
- package/dist/backend/index.js +1 -1
- package/dist/backend/index.js.map +1 -1
- package/dist/{btc/index.d.ts → bitcoin/bitcoin.d.ts} +31 -31
- package/dist/bitcoin/bitcoin.d.ts.map +1 -0
- package/dist/{btc/index.js → bitcoin/bitcoin.js} +5 -4
- package/dist/bitcoin/bitcoin.js.map +1 -0
- package/dist/bitcoin/index.d.ts +2 -0
- package/dist/bitcoin/index.d.ts.map +1 -0
- package/dist/bitcoin/index.js +2 -0
- package/dist/bitcoin/index.js.map +1 -0
- package/dist/chains/chain-keys.d.ts +31 -0
- package/dist/chains/chain-keys.d.ts.map +1 -0
- package/dist/chains/chain-keys.js +39 -0
- package/dist/chains/chain-keys.js.map +1 -0
- package/dist/chains/chains.d.ts +3491 -0
- package/dist/chains/chains.d.ts.map +1 -0
- package/dist/chains/chains.js +712 -0
- package/dist/chains/chains.js.map +1 -0
- package/dist/chains/index.d.ts +3 -0
- package/dist/chains/index.d.ts.map +1 -0
- package/dist/chains/index.js +3 -0
- package/dist/chains/index.js.map +1 -0
- package/dist/chains/tokens.d.ts +4390 -0
- package/dist/chains/tokens.d.ts.map +1 -0
- package/dist/chains/tokens.js +2139 -0
- package/dist/chains/tokens.js.map +1 -0
- package/dist/common/common.d.ts +282 -0
- package/dist/common/common.d.ts.map +1 -0
- package/dist/common/common.js +30 -0
- package/dist/common/common.js.map +1 -0
- package/dist/common/constants.d.ts +70 -0
- package/dist/common/constants.d.ts.map +1 -0
- package/dist/common/constants.js +31 -0
- package/dist/common/constants.js.map +1 -0
- package/dist/common/index.d.ts +2 -274
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +2 -1
- package/dist/common/index.js.map +1 -1
- package/dist/dex/dex.d.ts +268 -0
- package/dist/dex/dex.d.ts.map +1 -0
- package/dist/dex/dex.js +128 -0
- package/dist/dex/dex.js.map +1 -0
- package/dist/dex/index.d.ts +2 -0
- package/dist/dex/index.d.ts.map +1 -0
- package/dist/dex/index.js +2 -0
- package/dist/dex/index.js.map +1 -0
- package/dist/dex/pancakeswap-infinity.d.ts +539 -0
- package/dist/dex/pancakeswap-infinity.d.ts.map +1 -0
- package/dist/dex/pancakeswap-infinity.js +3 -0
- package/dist/dex/pancakeswap-infinity.js.map +1 -0
- package/dist/evm/evm.d.ts +48 -0
- package/dist/evm/evm.d.ts.map +1 -0
- package/dist/evm/evm.js +2 -0
- package/dist/evm/evm.js.map +1 -0
- package/dist/evm/index.d.ts +1 -39
- package/dist/evm/index.d.ts.map +1 -1
- package/dist/evm/index.js +1 -1
- package/dist/evm/index.js.map +1 -1
- package/dist/icon/icon.d.ts +55 -0
- package/dist/icon/icon.d.ts.map +1 -0
- package/dist/icon/icon.js +2 -0
- package/dist/icon/icon.js.map +1 -0
- package/dist/icon/index.d.ts +1 -35
- package/dist/icon/index.d.ts.map +1 -1
- package/dist/icon/index.js +1 -1
- package/dist/icon/index.js.map +1 -1
- package/dist/index.d.ts +15 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -7
- package/dist/index.js.map +1 -1
- package/dist/injective/index.d.ts +1 -67
- package/dist/injective/index.d.ts.map +1 -1
- package/dist/injective/index.js +1 -16
- package/dist/injective/index.js.map +1 -1
- package/dist/injective/injective.d.ts +103 -0
- package/dist/injective/injective.d.ts.map +1 -0
- package/dist/injective/injective.js +2 -0
- package/dist/injective/injective.js.map +1 -0
- package/dist/moneyMarket/index.d.ts +2 -0
- package/dist/moneyMarket/index.d.ts.map +1 -0
- package/dist/moneyMarket/index.js +2 -0
- package/dist/moneyMarket/index.js.map +1 -0
- package/dist/moneyMarket/moneyMarket.d.ts +2440 -0
- package/dist/moneyMarket/moneyMarket.d.ts.map +1 -0
- package/dist/moneyMarket/moneyMarket.js +194 -0
- package/dist/moneyMarket/moneyMarket.js.map +1 -0
- package/dist/near/index.d.ts +1 -69
- package/dist/near/index.d.ts.map +1 -1
- package/dist/near/index.js +1 -1
- package/dist/near/index.js.map +1 -1
- package/dist/near/near-api-js.d.ts +6119 -0
- package/dist/near/near-api-js.d.ts.map +1 -0
- package/dist/near/near-api-js.js +2 -0
- package/dist/near/near-api-js.js.map +1 -0
- package/dist/near/near.d.ts +75 -0
- package/dist/near/near.d.ts.map +1 -0
- package/dist/near/near.js +2 -0
- package/dist/near/near.js.map +1 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +2 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/shared.d.ts +17 -0
- package/dist/shared/shared.d.ts.map +1 -0
- package/dist/shared/shared.js +6 -0
- package/dist/shared/shared.js.map +1 -0
- package/dist/sodax-config/index.d.ts +2 -0
- package/dist/sodax-config/index.d.ts.map +1 -0
- package/dist/sodax-config/index.js +2 -0
- package/dist/sodax-config/index.js.map +1 -0
- package/dist/sodax-config/sodax-config.d.ts +6070 -0
- package/dist/{constants/index.d.ts.map → sodax-config/sodax-config.d.ts.map} +1 -1
- package/dist/sodax-config/sodax-config.js +22 -0
- package/dist/sodax-config/sodax-config.js.map +1 -0
- package/dist/solana/index.d.ts +1 -99
- package/dist/solana/index.d.ts.map +1 -1
- package/dist/solana/index.js +1 -1
- package/dist/solana/index.js.map +1 -1
- package/dist/solana/solana-web3.d.ts +390 -0
- package/dist/solana/solana-web3.d.ts.map +1 -0
- package/dist/solana/solana-web3.js +2 -0
- package/dist/solana/solana-web3.js.map +1 -0
- package/dist/solana/solana.d.ts +111 -0
- package/dist/solana/solana.d.ts.map +1 -0
- package/dist/solana/solana.js +2 -0
- package/dist/solana/solana.js.map +1 -0
- package/dist/stacks/index.d.ts +1 -16
- package/dist/stacks/index.d.ts.map +1 -1
- package/dist/stacks/index.js +1 -1
- package/dist/stacks/index.js.map +1 -1
- package/dist/stacks/stacks.d.ts +211 -0
- package/dist/stacks/stacks.d.ts.map +1 -0
- package/dist/stacks/stacks.js +2 -0
- package/dist/stacks/stacks.js.map +1 -0
- package/dist/stellar/index.d.ts +1 -69
- package/dist/stellar/index.d.ts.map +1 -1
- package/dist/stellar/index.js +1 -1
- package/dist/stellar/index.js.map +1 -1
- package/dist/stellar/stellar.d.ts +97 -0
- package/dist/stellar/stellar.d.ts.map +1 -0
- package/dist/stellar/stellar.js +2 -0
- package/dist/stellar/stellar.js.map +1 -0
- package/dist/sui/index.d.ts +1 -32
- package/dist/sui/index.d.ts.map +1 -1
- package/dist/sui/index.js +1 -1
- package/dist/sui/index.js.map +1 -1
- package/dist/sui/sui.d.ts +312 -0
- package/dist/sui/sui.d.ts.map +1 -0
- package/dist/sui/sui.js +2 -0
- package/dist/sui/sui.js.map +1 -0
- package/dist/swap/index.d.ts +2 -0
- package/dist/swap/index.d.ts.map +1 -0
- package/dist/swap/index.js +2 -0
- package/dist/swap/index.js.map +1 -0
- package/dist/swap/swap.d.ts +3369 -0
- package/dist/swap/swap.d.ts.map +1 -0
- package/dist/swap/swap.js +242 -0
- package/dist/swap/swap.js.map +1 -0
- package/dist/utils/deep-partial.d.ts +9 -0
- package/dist/utils/deep-partial.d.ts.map +1 -0
- package/dist/utils/deep-partial.js +2 -0
- package/dist/utils/deep-partial.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/utils.d.ts +61 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +144 -0
- package/dist/utils/utils.js.map +1 -0
- package/dist/wallet/index.d.ts +3 -0
- package/dist/wallet/index.d.ts.map +1 -0
- package/dist/wallet/index.js +3 -0
- package/dist/wallet/index.js.map +1 -0
- package/dist/wallet/providers.d.ts +24 -0
- package/dist/wallet/providers.d.ts.map +1 -0
- package/dist/wallet/providers.js +2 -0
- package/dist/wallet/providers.js.map +1 -0
- package/dist/wallet/wallet.d.ts +19 -0
- package/dist/wallet/wallet.d.ts.map +1 -0
- package/dist/wallet/wallet.js +2 -0
- package/dist/wallet/wallet.js.map +1 -0
- package/package.json +20 -9
- package/dist/btc/index.d.ts.map +0 -1
- package/dist/btc/index.js.map +0 -1
- package/dist/constants/index.d.ts +0 -7299
- package/dist/constants/index.js +0 -3227
- package/dist/constants/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,32 +1,96 @@
|
|
|
1
1
|
# @sodax/types
|
|
2
2
|
|
|
3
|
-
Shared
|
|
3
|
+
Shared SODAX type definitions, constants, and configuration for SDK packages and applications.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This package includes chain and token metadata, wallet provider interfaces, transaction and receipt types, backend API contracts, swap and money market configuration, DEX configuration, and common utilities.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Install
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- **Backend API types**: Type definitions for configuration API responses
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @sodax/types
|
|
11
|
+
```
|
|
13
12
|
|
|
14
|
-
##
|
|
13
|
+
## Usage
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
- **`constants/`**: Chain IDs, token definitions, hub vaults, and spoke chain configurations
|
|
18
|
-
- **`backend/`**: API response types for configuration endpoints
|
|
19
|
-
- **`evm/`**: EVM-specific transaction and wallet provider types
|
|
20
|
-
- **`stellar/`**: Stellar-specific transaction and wallet provider types
|
|
21
|
-
- **`solana/`**: Solana-specific transaction and wallet provider types
|
|
22
|
-
- **`sui/`**: Sui-specific transaction and wallet provider types
|
|
23
|
-
- **`icon/`**: ICON-specific transaction and wallet provider types
|
|
24
|
-
- **`injective/`**: Injective-specific transaction and wallet provider types
|
|
15
|
+
Import shared types, constants, configuration, and helpers from the root package:
|
|
25
16
|
|
|
26
|
-
|
|
17
|
+
```typescript
|
|
18
|
+
import {
|
|
19
|
+
ChainKeys,
|
|
20
|
+
CONFIG_VERSION,
|
|
21
|
+
getEvmChainKeyByChainId,
|
|
22
|
+
sodaxConfig,
|
|
23
|
+
supportedTokensByChain,
|
|
24
|
+
} from '@sodax/types';
|
|
25
|
+
|
|
26
|
+
import type {
|
|
27
|
+
Address,
|
|
28
|
+
DeepPartial,
|
|
29
|
+
EvmRawTransaction,
|
|
30
|
+
IBitcoinWalletProvider,
|
|
31
|
+
IEvmWalletProvider,
|
|
32
|
+
IWalletProvider,
|
|
33
|
+
SpokeChainKey,
|
|
34
|
+
WalletAddressProvider,
|
|
35
|
+
} from '@sodax/types';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
DEX types and constants are also available from the dedicated DEX subpath export:
|
|
27
39
|
|
|
28
40
|
```typescript
|
|
29
|
-
import
|
|
30
|
-
|
|
41
|
+
import { concentratedLiquidityConfig, dexConfig } from '@sodax/types/dex';
|
|
42
|
+
|
|
43
|
+
import type { ConcentratedLiquidityConfig, DexConfig, PoolKey } from '@sodax/types/dex';
|
|
31
44
|
```
|
|
32
45
|
|
|
46
|
+
The package currently exposes only the root export (`@sodax/types`) and the DEX export (`@sodax/types/dex`). Chain-specific types such as `IEvmWalletProvider`, `BitcoinRawTransaction`, and `SolanaRawTransactionReceipt` are available from the root package.
|
|
47
|
+
|
|
48
|
+
## Export Overview
|
|
49
|
+
|
|
50
|
+
| Area | Examples |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
| Shared primitives | `Address`, `Hex`, `Hash`, `Base64String`, `HttpUrl`, `TxPollingConfig` |
|
|
53
|
+
| Common types and constants | `Result`, `PartnerFee`, `TxReturnType`, `apiConfig`, `solverConfig`, retry and timeout constants |
|
|
54
|
+
| Chains and tokens | `ChainKeys`, `SpokeChainKey`, `ChainType`, `baseChainInfo`, `spokeChainConfig`, `supportedTokensByChain` |
|
|
55
|
+
| Wallet providers | `WalletAddressProvider`, `ICoreWallet`, `IWalletProvider`, `GetWalletProviderType` |
|
|
56
|
+
| Chain transaction types | `EvmRawTransaction`, `BitcoinRawTransaction`, `SolanaRawTransaction`, `StellarRawTransaction`, `SuiRawTransaction`, `IconRawTransaction`, `InjectiveRawTransaction`, `NearRawTransaction`, `StacksRawTransaction` |
|
|
57
|
+
| Backend API contracts | `IConfigApi`, `GetAllConfigApiResponse`, `SubmitSwapTxRequest`, `SubmitSwapTxResponse`, `SubmitSwapTxStatusResponse` |
|
|
58
|
+
| Product configuration | `sodaxConfig`, `bridgeConfig`, `swapsConfig`, `moneyMarketConfig`, `dexConfig`, `concentratedLiquidityConfig` |
|
|
59
|
+
| Utilities | `DeepPartial`, `getChainType`, `getEvmChainKeyByChainId`, chain guard helpers, bnUSD token helpers |
|
|
60
|
+
|
|
61
|
+
## Wallet Providers
|
|
62
|
+
|
|
63
|
+
All wallet providers extend the base wallet address contract:
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
interface WalletAddressProvider {
|
|
67
|
+
getWalletAddress(): Promise<string>;
|
|
68
|
+
getPublicKey?: () => Promise<string>;
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`ICoreWallet` extends `WalletAddressProvider`, and each chain-specific provider adds its own signing, transaction, and query methods. The root export includes provider interfaces for all supported chain families:
|
|
73
|
+
|
|
74
|
+
| Chain family | Provider interface |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| EVM | `IEvmWalletProvider` |
|
|
77
|
+
| Bitcoin | `IBitcoinWalletProvider` |
|
|
78
|
+
| Solana | `ISolanaWalletProvider` |
|
|
79
|
+
| Stellar | `IStellarWalletProvider` |
|
|
80
|
+
| Sui | `ISuiWalletProvider` |
|
|
81
|
+
| ICON | `IIconWalletProvider` |
|
|
82
|
+
| Injective | `IInjectiveWalletProvider` |
|
|
83
|
+
| NEAR | `INearWalletProvider` |
|
|
84
|
+
| Stacks | `IStacksWalletProvider` |
|
|
85
|
+
|
|
86
|
+
Use `IWalletProvider` for the union of all chain-specific wallet providers, or `GetWalletProviderType<C>` to map a `SpokeChainKey` or `ChainType` to the matching provider interface.
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
import type { GetWalletProviderType, IEvmWalletProvider, IWalletProvider, SpokeChainKey } from '@sodax/types';
|
|
90
|
+
|
|
91
|
+
type ProviderForChain<C extends SpokeChainKey> = GetWalletProviderType<C>;
|
|
92
|
+
|
|
93
|
+
function isEvmProvider(provider: IWalletProvider): provider is IEvmWalletProvider {
|
|
94
|
+
return provider.chainType === 'EVM';
|
|
95
|
+
}
|
|
96
|
+
```
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { SpokeChainKey, IntentRelayChainIdMap } from '../chains/chains.js';
|
|
2
|
+
import type { XToken } from '../chains/tokens.js';
|
|
3
|
+
import type { Result, SpokeChainConfigMap } from '../common/common.js';
|
|
4
|
+
import type { Address } from '../shared/shared.js';
|
|
5
|
+
import type { SodaxConfig } from '../sodax-config/sodax-config.js';
|
|
6
|
+
export type GetChainsApiResponse = readonly SpokeChainKey[];
|
|
7
|
+
export type GetSwapTokensApiResponse = Record<SpokeChainKey, readonly XToken[]>;
|
|
8
|
+
export type GetSwapTokensByChainIdApiResponse = readonly XToken[];
|
|
9
|
+
export type GetMoneyMarketTokensApiResponse = Record<SpokeChainKey, readonly XToken[]>;
|
|
10
|
+
export type GetMoneyMarketTokensByChainIdApiResponse = readonly XToken[];
|
|
11
|
+
export type GetRelayChainIdMapApiResponse = IntentRelayChainIdMap;
|
|
12
|
+
export type GetSpokeChainConfigApiResponse = SpokeChainConfigMap;
|
|
13
|
+
export type GetMoneyMarketReserveAssetsApiResponse = readonly Address[];
|
|
14
|
+
export type GetAllConfigApiResponse = {
|
|
15
|
+
version?: number;
|
|
16
|
+
config: SodaxConfig;
|
|
17
|
+
};
|
|
18
|
+
export interface IConfigApi {
|
|
19
|
+
getChains(): Promise<Result<GetChainsApiResponse>>;
|
|
20
|
+
getSwapTokens(): Promise<Result<GetSwapTokensApiResponse>>;
|
|
21
|
+
getSwapTokensByChainId(chainId: SpokeChainKey): Promise<Result<GetSwapTokensByChainIdApiResponse>>;
|
|
22
|
+
getMoneyMarketTokens(): Promise<Result<GetMoneyMarketTokensApiResponse>>;
|
|
23
|
+
getMoneyMarketTokensByChainId(chainId: SpokeChainKey): Promise<Result<GetMoneyMarketTokensByChainIdApiResponse>>;
|
|
24
|
+
}
|
|
25
|
+
export interface SwapIntentData {
|
|
26
|
+
intentId: string;
|
|
27
|
+
creator: string;
|
|
28
|
+
inputToken: string;
|
|
29
|
+
outputToken: string;
|
|
30
|
+
inputAmount: string;
|
|
31
|
+
minOutputAmount: string;
|
|
32
|
+
deadline: string;
|
|
33
|
+
allowPartialFill: boolean;
|
|
34
|
+
srcChain: number;
|
|
35
|
+
dstChain: number;
|
|
36
|
+
srcAddress: string;
|
|
37
|
+
dstAddress: string;
|
|
38
|
+
solver: string;
|
|
39
|
+
data: string;
|
|
40
|
+
}
|
|
41
|
+
export interface SubmitSwapTxRequest {
|
|
42
|
+
txHash: string;
|
|
43
|
+
srcChainKey: string;
|
|
44
|
+
walletAddress: string;
|
|
45
|
+
intent: SwapIntentData;
|
|
46
|
+
relayData: string;
|
|
47
|
+
}
|
|
48
|
+
export interface SubmitSwapTxResponse {
|
|
49
|
+
success: boolean;
|
|
50
|
+
message: string;
|
|
51
|
+
}
|
|
52
|
+
export interface GetSubmitSwapTxStatusParams {
|
|
53
|
+
txHash: string;
|
|
54
|
+
srcChainKey?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface SubmitSwapTxStatusResult {
|
|
57
|
+
dstIntentTxHash: string;
|
|
58
|
+
packetData?: Record<string, unknown>;
|
|
59
|
+
intent_hash?: string;
|
|
60
|
+
}
|
|
61
|
+
export type SubmitSwapTxStatus = 'pending' | 'verifying' | 'verified' | 'relaying' | 'relayed' | 'posting_execution' | 'executed' | 'failed';
|
|
62
|
+
export interface SubmitSwapTxStatusData {
|
|
63
|
+
txHash: string;
|
|
64
|
+
srcChainKey: string;
|
|
65
|
+
status: SubmitSwapTxStatus;
|
|
66
|
+
failedAtStep?: string;
|
|
67
|
+
failureReason?: string;
|
|
68
|
+
failedAttempts: number;
|
|
69
|
+
result?: SubmitSwapTxStatusResult;
|
|
70
|
+
}
|
|
71
|
+
export interface SubmitSwapTxStatusResponse {
|
|
72
|
+
success: boolean;
|
|
73
|
+
data: SubmitSwapTxStatusData;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=backendApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backendApi.d.ts","sourceRoot":"","sources":["../../src/backend/backendApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,MAAM,MAAM,oBAAoB,GAAG,SAAS,aAAa,EAAE,CAAC;AAC5D,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;AAChF,MAAM,MAAM,iCAAiC,GAAG,SAAS,MAAM,EAAE,CAAC;AAClE,MAAM,MAAM,+BAA+B,GAAG,MAAM,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;AACvF,MAAM,MAAM,wCAAwC,GAAG,SAAS,MAAM,EAAE,CAAC;AACzE,MAAM,MAAM,6BAA6B,GAAG,qBAAqB,CAAC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AE,cAAc,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,wBAAwB;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,WAAW,GACX,UAAU,GACV,UAAU,GACV,SAAS,GACT,mBAAmB,GACnB,UAAU,GACV,QAAQ,CAAC;AAEb,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,wBAAwB,CAAC;CACnC;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,sBAAsB,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backendApi.js","sourceRoot":"","sources":["../../src/backend/backendApi.ts"],"names":[],"mappings":""}
|
package/dist/backend/index.d.ts
CHANGED
|
@@ -1,81 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export type GetChainsApiResponse = readonly SpokeChainId[];
|
|
3
|
-
export type GetSwapTokensApiResponse = Record<SpokeChainId, readonly Token[]>;
|
|
4
|
-
export type GetSwapTokensByChainIdApiResponse = readonly Token[];
|
|
5
|
-
export type GetMoneyMarketTokensApiResponse = Record<SpokeChainId, readonly Token[]>;
|
|
6
|
-
export type GetMoneyMarketTokensByChainIdApiResponse = readonly Token[];
|
|
7
|
-
export type GetHubAssetsApiResponse = Record<SpokeChainId, Record<string, HubAsset>>;
|
|
8
|
-
export type GetHubAssetsByChainIdApiResponse = Record<string, HubAsset>;
|
|
9
|
-
export type GetRelayChainIdMapApiResponse = IntentRelayChainIdMap;
|
|
10
|
-
export type GetSpokeChainConfigApiResponse = SpokeChainConfigMap;
|
|
11
|
-
export type GetMoneyMarketReserveAssetsApiResponse = readonly Address[];
|
|
12
|
-
export type GetAllConfigApiResponse = {
|
|
13
|
-
version?: number;
|
|
14
|
-
supportedChains: GetChainsApiResponse;
|
|
15
|
-
supportedSwapTokens: GetSwapTokensApiResponse;
|
|
16
|
-
supportedMoneyMarketTokens: GetMoneyMarketTokensApiResponse;
|
|
17
|
-
supportedMoneyMarketReserveAssets: GetMoneyMarketReserveAssetsApiResponse;
|
|
18
|
-
supportedHubAssets: GetHubAssetsApiResponse;
|
|
19
|
-
relayChainIdMap: GetRelayChainIdMapApiResponse;
|
|
20
|
-
spokeChainConfig: GetSpokeChainConfigApiResponse;
|
|
21
|
-
};
|
|
22
|
-
export interface IConfigApi {
|
|
23
|
-
getChains(): Promise<GetChainsApiResponse>;
|
|
24
|
-
getSwapTokens(): Promise<GetSwapTokensApiResponse>;
|
|
25
|
-
getSwapTokensByChainId(chainId: SpokeChainId): Promise<GetSwapTokensByChainIdApiResponse>;
|
|
26
|
-
getMoneyMarketTokens(): Promise<GetMoneyMarketTokensApiResponse>;
|
|
27
|
-
getMoneyMarketTokensByChainId(chainId: SpokeChainId): Promise<GetMoneyMarketTokensByChainIdApiResponse>;
|
|
28
|
-
getHubAssets(): Promise<GetHubAssetsApiResponse>;
|
|
29
|
-
getHubAssetsByChainId(chainId: SpokeChainId): Promise<GetHubAssetsByChainIdApiResponse>;
|
|
30
|
-
}
|
|
31
|
-
export interface SwapIntentData {
|
|
32
|
-
intentId: string;
|
|
33
|
-
creator: string;
|
|
34
|
-
inputToken: string;
|
|
35
|
-
outputToken: string;
|
|
36
|
-
inputAmount: string;
|
|
37
|
-
minOutputAmount: string;
|
|
38
|
-
deadline: string;
|
|
39
|
-
allowPartialFill: boolean;
|
|
40
|
-
srcChain: number;
|
|
41
|
-
dstChain: number;
|
|
42
|
-
srcAddress: string;
|
|
43
|
-
dstAddress: string;
|
|
44
|
-
solver: string;
|
|
45
|
-
data: string;
|
|
46
|
-
}
|
|
47
|
-
export interface SubmitSwapTxRequest {
|
|
48
|
-
txHash: string;
|
|
49
|
-
srcChainId: string;
|
|
50
|
-
walletAddress: string;
|
|
51
|
-
intent: SwapIntentData;
|
|
52
|
-
relayData: string;
|
|
53
|
-
}
|
|
54
|
-
export interface SubmitSwapTxResponse {
|
|
55
|
-
success: boolean;
|
|
56
|
-
message: string;
|
|
57
|
-
}
|
|
58
|
-
export interface GetSubmitSwapTxStatusParams {
|
|
59
|
-
txHash: string;
|
|
60
|
-
srcChainId?: string;
|
|
61
|
-
}
|
|
62
|
-
export interface SubmitSwapTxStatusResult {
|
|
63
|
-
dstIntentTxHash: string;
|
|
64
|
-
packetData?: Record<string, unknown>;
|
|
65
|
-
intent_hash?: string;
|
|
66
|
-
}
|
|
67
|
-
export type SubmitSwapTxStatus = 'pending' | 'verifying' | 'verified' | 'relaying' | 'relayed' | 'posting_execution' | 'executed' | 'failed';
|
|
68
|
-
export interface SubmitSwapTxStatusData {
|
|
69
|
-
txHash: string;
|
|
70
|
-
srcChainId: string;
|
|
71
|
-
status: SubmitSwapTxStatus;
|
|
72
|
-
failedAtStep?: string;
|
|
73
|
-
failureReason?: string;
|
|
74
|
-
failedAttempts: number;
|
|
75
|
-
result?: SubmitSwapTxStatusResult;
|
|
76
|
-
}
|
|
77
|
-
export interface SubmitSwapTxStatusResponse {
|
|
78
|
-
success: boolean;
|
|
79
|
-
data: SubmitSwapTxStatusData;
|
|
80
|
-
}
|
|
1
|
+
export * from './backendApi.js';
|
|
81
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/backend/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/backend/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
package/dist/backend/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './backendApi.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/backend/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/backend/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type AddressType = "P2PKH" | "P2SH" | "P2WPKH" | "P2TR";
|
|
3
|
-
/** Subset of AddressType that Sodax can actually sign/spend from. */
|
|
4
|
-
export type SupportedAddressType = "P2PKH" | "P2SH" | "P2WPKH" | "P2TR";
|
|
5
|
-
/** User-friendly Bitcoin address type for wallet connection. */
|
|
6
|
-
export type BtcWalletAddressType = 'taproot' | 'segwit';
|
|
1
|
+
import type { ICoreWallet } from '../wallet/wallet.js';
|
|
7
2
|
/** Check whether an AddressType is supported for signing/spending. */
|
|
8
|
-
export declare function isSupportedBitcoinAddressType(addressType:
|
|
3
|
+
export declare function isSupportedBitcoinAddressType(addressType: string): addressType is BtcAddressType;
|
|
9
4
|
/**
|
|
10
5
|
* Detect Bitcoin address type from its prefix.
|
|
11
6
|
* Shared utility — use this instead of duplicating prefix checks.
|
|
12
7
|
*/
|
|
13
|
-
export declare function detectBitcoinAddressType(address: string):
|
|
8
|
+
export declare function detectBitcoinAddressType(address: string): BtcAddressType;
|
|
9
|
+
export declare const BTC_WALLET_ADDRESS_TYPES: readonly ["taproot", "segwit"];
|
|
10
|
+
/** User-friendly Bitcoin address type for wallet connection. */
|
|
11
|
+
export type BtcWalletAddressType = (typeof BTC_WALLET_ADDRESS_TYPES)[number];
|
|
12
|
+
/** Address types that Sodax supports for transactions. */
|
|
13
|
+
declare const BTC_ADDRESS_TYPES: readonly ["P2PKH", "P2SH", "P2WPKH", "P2TR"];
|
|
14
|
+
/** Subset of AddressType that Sodax can actually sign/spend from. */
|
|
15
|
+
export type BtcAddressType = (typeof BTC_ADDRESS_TYPES)[number];
|
|
14
16
|
export interface BitcoinTransactionStatus {
|
|
15
17
|
confirmed: boolean;
|
|
16
18
|
block_height?: number;
|
|
@@ -52,17 +54,30 @@ export interface BitcoinRawTransactionReceipt {
|
|
|
52
54
|
fee?: number;
|
|
53
55
|
status: BitcoinTransactionStatus;
|
|
54
56
|
}
|
|
55
|
-
export interface
|
|
57
|
+
export interface RadfiDepositTxResponse {
|
|
58
|
+
base64Psbt: string;
|
|
59
|
+
fee: BitcoinFee;
|
|
60
|
+
userInputIndexes: number[];
|
|
61
|
+
txId: string;
|
|
62
|
+
}
|
|
63
|
+
export interface BitcoinFee {
|
|
64
|
+
feeRate: number;
|
|
65
|
+
totalFee: number;
|
|
66
|
+
}
|
|
67
|
+
export type BitcoinRawTransaction = {
|
|
68
|
+
from: string;
|
|
69
|
+
to: string;
|
|
70
|
+
value: bigint;
|
|
71
|
+
data: string;
|
|
72
|
+
};
|
|
73
|
+
export type BitcoinReturnType<Raw extends boolean> = Raw extends true ? BitcoinRawTransaction | string : Raw extends false ? string : BitcoinRawTransaction | string;
|
|
74
|
+
export interface IBitcoinWalletProvider extends ICoreWallet {
|
|
75
|
+
readonly chainType: 'BITCOIN';
|
|
56
76
|
/**
|
|
57
77
|
* Get the wallet's Bitcoin address
|
|
58
78
|
* @returns Promise resolving to the Bitcoin address
|
|
59
79
|
*/
|
|
60
80
|
getWalletAddress(): Promise<string>;
|
|
61
|
-
/**
|
|
62
|
-
* Get the wallet's address type
|
|
63
|
-
* @returns Promise resolving to the address type
|
|
64
|
-
*/
|
|
65
|
-
getAddressType(address: string): Promise<AddressType>;
|
|
66
81
|
/**
|
|
67
82
|
* Sign a Bitcoin transaction (PSBT format)
|
|
68
83
|
* @param psbtHex - Hex-encoded PSBT transaction
|
|
@@ -71,11 +86,6 @@ export interface IBitcoinWalletProvider extends WalletAddressProvider {
|
|
|
71
86
|
signTransaction(psbt: string, finalize?: boolean): Promise<string>;
|
|
72
87
|
signEcdsaMessage(message: string): Promise<string>;
|
|
73
88
|
signBip322Message(message: string): Promise<string>;
|
|
74
|
-
/**
|
|
75
|
-
* Broadcast a signed transaction to the Bitcoin network
|
|
76
|
-
* @param txHex - Hex-encoded signed transaction
|
|
77
|
-
* @returns Promise resolving to transaction hash
|
|
78
|
-
*/
|
|
79
89
|
/**
|
|
80
90
|
* Send Bitcoin to an address
|
|
81
91
|
* @param toAddress - Destination Bitcoin address
|
|
@@ -95,15 +105,5 @@ export interface UTXO {
|
|
|
95
105
|
block_time?: number;
|
|
96
106
|
};
|
|
97
107
|
}
|
|
98
|
-
export
|
|
99
|
-
|
|
100
|
-
fee: Fee;
|
|
101
|
-
userInputIndexes: number[];
|
|
102
|
-
txId: string;
|
|
103
|
-
}
|
|
104
|
-
export interface Fee {
|
|
105
|
-
feeRate: number;
|
|
106
|
-
totalFee: number;
|
|
107
|
-
}
|
|
108
|
-
export type { BitcoinRawTransactionReceipt as BitcoinTransactionReceipt };
|
|
109
|
-
//# sourceMappingURL=index.d.ts.map
|
|
108
|
+
export {};
|
|
109
|
+
//# sourceMappingURL=bitcoin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitcoin.d.ts","sourceRoot":"","sources":["../../src/bitcoin/bitcoin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,sEAAsE;A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AAC,CAAC;IAEnE,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnD,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEpD;;;;;OAKG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACnE;AAED,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QACN,SAAS,EAAE,OAAO,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
/** Address types that Sodax supports for transactions. */
|
|
2
|
-
const SUPPORTED_ADDRESS_TYPES = ['P2PKH', 'P2SH', 'P2WPKH', 'P2TR'];
|
|
3
1
|
/** Check whether an AddressType is supported for signing/spending. */
|
|
4
2
|
export function isSupportedBitcoinAddressType(addressType) {
|
|
5
|
-
return
|
|
3
|
+
return BTC_ADDRESS_TYPES.includes(addressType);
|
|
6
4
|
}
|
|
7
5
|
/**
|
|
8
6
|
* Detect Bitcoin address type from its prefix.
|
|
@@ -19,4 +17,7 @@ export function detectBitcoinAddressType(address) {
|
|
|
19
17
|
return 'P2PKH';
|
|
20
18
|
throw new Error(`Unknown Bitcoin address type: ${address}`);
|
|
21
19
|
}
|
|
22
|
-
|
|
20
|
+
export const BTC_WALLET_ADDRESS_TYPES = ['taproot', 'segwit'];
|
|
21
|
+
/** Address types that Sodax supports for transactions. */
|
|
22
|
+
const BTC_ADDRESS_TYPES = ['P2PKH', 'P2SH', 'P2WPKH', 'P2TR'];
|
|
23
|
+
//# sourceMappingURL=bitcoin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitcoin.js","sourceRoot":"","sources":["../../src/bitcoin/bitcoin.ts"],"names":[],"mappings":"AAEA,sEAAsE;AACtE,MAAM,UAAU,6BAA6B,CAAC,WAAmB;IAC/D,OAAQ,iBAAuC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACxE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAe;IACtD,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAC5E,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC5E,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,MAAM,CAAC;IACtE,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,OAAO,CAAC;IAClG,MAAM,IAAI,KAAK,CAAC,iCAAiC,OAAO,EAAE,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAU,CAAC;AAIvE,0DAA0D;AAC1D,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bitcoin/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bitcoin/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spoke chain key constants only — no imports from tokens/chains to avoid ESM circular init.
|
|
3
|
+
*/
|
|
4
|
+
export declare const ChainTypeArr: readonly ["ICON", "EVM", "INJECTIVE", "SUI", "STELLAR", "SOLANA", "STACKS", "NEAR", "BITCOIN"];
|
|
5
|
+
export declare const ChainKeys: {
|
|
6
|
+
readonly AVALANCHE_MAINNET: "0xa86a.avax";
|
|
7
|
+
readonly ARBITRUM_MAINNET: "0xa4b1.arbitrum";
|
|
8
|
+
readonly BASE_MAINNET: "0x2105.base";
|
|
9
|
+
readonly BSC_MAINNET: "0x38.bsc";
|
|
10
|
+
readonly INJECTIVE_MAINNET: "injective-1";
|
|
11
|
+
readonly SONIC_MAINNET: "sonic";
|
|
12
|
+
readonly ICON_MAINNET: "0x1.icon";
|
|
13
|
+
readonly SUI_MAINNET: "sui";
|
|
14
|
+
readonly OPTIMISM_MAINNET: "0xa.optimism";
|
|
15
|
+
readonly POLYGON_MAINNET: "0x89.polygon";
|
|
16
|
+
readonly SOLANA_MAINNET: "solana";
|
|
17
|
+
readonly STELLAR_MAINNET: "stellar";
|
|
18
|
+
readonly HYPEREVM_MAINNET: "hyper";
|
|
19
|
+
readonly LIGHTLINK_MAINNET: "lightlink";
|
|
20
|
+
readonly NEAR_MAINNET: "near";
|
|
21
|
+
readonly ETHEREUM_MAINNET: "ethereum";
|
|
22
|
+
readonly BITCOIN_MAINNET: "bitcoin";
|
|
23
|
+
readonly REDBELLY_MAINNET: "redbelly";
|
|
24
|
+
readonly KAIA_MAINNET: "0x2019.kaia";
|
|
25
|
+
readonly STACKS_MAINNET: "stacks";
|
|
26
|
+
};
|
|
27
|
+
export type ChainKey = (typeof ChainKeys)[keyof typeof ChainKeys];
|
|
28
|
+
export declare const CHAIN_KEYS: ("0xa86a.avax" | "0xa4b1.arbitrum" | "0x2105.base" | "0x38.bsc" | "injective-1" | "sonic" | "0x1.icon" | "sui" | "0xa.optimism" | "0x89.polygon" | "solana" | "stellar" | "hyper" | "lightlink" | "near" | "ethereum" | "bitcoin" | "redbelly" | "0x2019.kaia" | "stacks")[];
|
|
29
|
+
export declare const spokeChainKeysSet: Set<"0xa86a.avax" | "0xa4b1.arbitrum" | "0x2105.base" | "0x38.bsc" | "injective-1" | "sonic" | "0x1.icon" | "sui" | "0xa.optimism" | "0x89.polygon" | "solana" | "stellar" | "hyper" | "lightlink" | "near" | "ethereum" | "bitcoin" | "redbelly" | "0x2019.kaia" | "stacks">;
|
|
30
|
+
export type ChainType = (typeof ChainTypeArr)[number];
|
|
31
|
+
//# sourceMappingURL=chain-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain-keys.d.ts","sourceRoot":"","sources":["../../src/chains/chain-keys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,YAAY,gGAUf,CAAC;AAEX,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;CAqBZ,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAElE,eAAO,MAAM,UAAU,8QAA2B,CAAC;AACnD,eAAO,MAAM,iBAAiB,+QAAsB,CAAC;AAErD,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spoke chain key constants only — no imports from tokens/chains to avoid ESM circular init.
|
|
3
|
+
*/
|
|
4
|
+
export const ChainTypeArr = [
|
|
5
|
+
'ICON',
|
|
6
|
+
'EVM',
|
|
7
|
+
'INJECTIVE',
|
|
8
|
+
'SUI',
|
|
9
|
+
'STELLAR',
|
|
10
|
+
'SOLANA',
|
|
11
|
+
'STACKS',
|
|
12
|
+
'NEAR',
|
|
13
|
+
'BITCOIN',
|
|
14
|
+
];
|
|
15
|
+
export const ChainKeys = {
|
|
16
|
+
AVALANCHE_MAINNET: '0xa86a.avax',
|
|
17
|
+
ARBITRUM_MAINNET: '0xa4b1.arbitrum',
|
|
18
|
+
BASE_MAINNET: '0x2105.base',
|
|
19
|
+
BSC_MAINNET: '0x38.bsc',
|
|
20
|
+
INJECTIVE_MAINNET: 'injective-1',
|
|
21
|
+
SONIC_MAINNET: 'sonic',
|
|
22
|
+
ICON_MAINNET: '0x1.icon',
|
|
23
|
+
SUI_MAINNET: 'sui',
|
|
24
|
+
OPTIMISM_MAINNET: '0xa.optimism',
|
|
25
|
+
POLYGON_MAINNET: '0x89.polygon',
|
|
26
|
+
SOLANA_MAINNET: 'solana',
|
|
27
|
+
STELLAR_MAINNET: 'stellar',
|
|
28
|
+
HYPEREVM_MAINNET: 'hyper',
|
|
29
|
+
LIGHTLINK_MAINNET: 'lightlink',
|
|
30
|
+
NEAR_MAINNET: 'near',
|
|
31
|
+
ETHEREUM_MAINNET: 'ethereum',
|
|
32
|
+
BITCOIN_MAINNET: 'bitcoin',
|
|
33
|
+
REDBELLY_MAINNET: 'redbelly',
|
|
34
|
+
KAIA_MAINNET: '0x2019.kaia',
|
|
35
|
+
STACKS_MAINNET: 'stacks',
|
|
36
|
+
};
|
|
37
|
+
export const CHAIN_KEYS = Object.values(ChainKeys);
|
|
38
|
+
export const spokeChainKeysSet = new Set(CHAIN_KEYS);
|
|
39
|
+
//# sourceMappingURL=chain-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain-keys.js","sourceRoot":"","sources":["../../src/chains/chain-keys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,MAAM;IACN,KAAK;IACL,WAAW;IACX,KAAK;IACL,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,SAAS;CACD,CAAC;AAEX,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,aAAa;IAChC,gBAAgB,EAAE,iBAAiB;IACnC,YAAY,EAAE,aAAa;IAC3B,WAAW,EAAE,UAAU;IACvB,iBAAiB,EAAE,aAAa;IAChC,aAAa,EAAE,OAAO;IACtB,YAAY,EAAE,UAAU;IACxB,WAAW,EAAE,KAAK;IAClB,gBAAgB,EAAE,cAAc;IAChC,eAAe,EAAE,cAAc;IAC/B,cAAc,EAAE,QAAQ;IACxB,eAAe,EAAE,SAAS;IAC1B,gBAAgB,EAAE,OAAO;IACzB,iBAAiB,EAAE,WAAW;IAC9B,YAAY,EAAE,MAAM;IACpB,gBAAgB,EAAE,UAAU;IAC5B,eAAe,EAAE,SAAS;IAC1B,gBAAgB,EAAE,UAAU;IAC5B,YAAY,EAAE,aAAa;IAC3B,cAAc,EAAE,QAAQ;CAChB,CAAC;AAIX,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC"}
|