@shapeshiftoss/types 9.0.0-alpha.0 → 9.0.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.
@@ -0,0 +1,52 @@
1
+ export type ZrxPermit2SignatureRequired = {
2
+ type: 'zrx_permit2';
3
+ eip712: Record<string, unknown>;
4
+ };
5
+ export type EvmTransactionData = {
6
+ type: 'evm';
7
+ chainId: number;
8
+ to: string;
9
+ data: string;
10
+ value: string;
11
+ gasLimit?: string;
12
+ signatureRequired?: ZrxPermit2SignatureRequired;
13
+ };
14
+ export type SolanaTransactionData = {
15
+ type: 'solana_instructions';
16
+ instructions: {
17
+ programId: string;
18
+ keys: {
19
+ pubkey: string;
20
+ isSigner: boolean;
21
+ isWritable: boolean;
22
+ }[];
23
+ data: string;
24
+ }[];
25
+ addressLookupTableAddresses: string[];
26
+ };
27
+ export type SolanaSerializedTxTransactionData = {
28
+ type: 'solana_serialized_tx';
29
+ serializedTx: string;
30
+ };
31
+ export type UtxoTransactionData = {
32
+ type: 'utxo';
33
+ to: string;
34
+ opReturnData?: string;
35
+ value: string;
36
+ };
37
+ export type CosmosSdkMsgSendTransactionData = {
38
+ type: 'cosmossdk_msg_send';
39
+ chainId: string;
40
+ to: string;
41
+ denom: string;
42
+ value: string;
43
+ memo?: string;
44
+ };
45
+ export type CosmosSdkMsgDepositTransactionData = {
46
+ type: 'cosmossdk_msg_deposit';
47
+ chainId: string;
48
+ value: string;
49
+ memo: string;
50
+ coin: string;
51
+ };
52
+ export type TransactionData = EvmTransactionData | SolanaTransactionData | SolanaSerializedTxTransactionData | UtxoTransactionData | CosmosSdkMsgSendTransactionData | CosmosSdkMsgDepositTransactionData;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { AccountId, AssetId, ChainId } from '@shapeshiftoss/caip';
2
- import type { PartialRecord } from './utility';
2
+ import type { PartialRecord } from './utility.js';
3
3
  export type RootBip44Params = {
4
4
  purpose: number;
5
5
  coinType: number;
@@ -17,20 +17,60 @@ export declare enum KnownChainIds {
17
17
  PolygonMainnet = "eip155:137",
18
18
  GnosisMainnet = "eip155:100",
19
19
  ArbitrumMainnet = "eip155:42161",
20
- ArbitrumNovaMainnet = "eip155:42170",
21
20
  BaseMainnet = "eip155:8453",
21
+ MonadMainnet = "eip155:143",
22
+ HyperEvmMainnet = "eip155:999",
23
+ PlasmaMainnet = "eip155:9745",
24
+ MantleMainnet = "eip155:5000",
25
+ InkMainnet = "eip155:57073",
26
+ MegaEthMainnet = "eip155:4326",
27
+ BerachainMainnet = "eip155:80094",
28
+ CronosMainnet = "eip155:25",
29
+ KatanaMainnet = "eip155:747474",
30
+ EtherealMainnet = "eip155:5064014",
31
+ FlowEvmMainnet = "eip155:747",
32
+ CeloMainnet = "eip155:42220",
33
+ PlumeMainnet = "eip155:98866",
34
+ StoryMainnet = "eip155:1514",
35
+ ZkSyncEraMainnet = "eip155:324",
36
+ BlastMainnet = "eip155:81457",
37
+ WorldChainMainnet = "eip155:480",
38
+ HemiMainnet = "eip155:43111",
39
+ SeiMainnet = "eip155:1329",
40
+ LineaMainnet = "eip155:59144",
41
+ ScrollMainnet = "eip155:534352",
42
+ SonicMainnet = "eip155:146",
43
+ UnichainMainnet = "eip155:130",
44
+ BobMainnet = "eip155:60808",
45
+ ModeMainnet = "eip155:34443",
46
+ SoneiumMainnet = "eip155:1868",
22
47
  BitcoinMainnet = "bip122:000000000019d6689c085ae165831e93",
23
48
  BitcoinCashMainnet = "bip122:000000000000000000651ef99cb9fcbe",
24
49
  DogecoinMainnet = "bip122:00000000001a91e3dace36e2be3bf030",
25
50
  LitecoinMainnet = "bip122:12a765e31ffd4059bada1e25190f6e98",
51
+ ZcashMainnet = "bip122:00040fe8ec8471911baa1db1266ea15d",
26
52
  CosmosMainnet = "cosmos:cosmoshub-4",
27
53
  ThorchainMainnet = "cosmos:thorchain-1",
28
54
  MayachainMainnet = "cosmos:mayachain-mainnet-v1",
29
- SolanaMainnet = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"
55
+ SolanaMainnet = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
56
+ TronMainnet = "tron:0x2b6653dc",
57
+ SuiMainnet = "sui:35834a8a",
58
+ NearMainnet = "near:mainnet",
59
+ StarknetMainnet = "starknet:SN_MAIN",
60
+ TonMainnet = "ton:mainnet",
61
+ AbstractMainnet = "eip155:2741",
62
+ RobinhoodMainnet = "eip155:4663"
30
63
  }
31
- export type EvmChainId = KnownChainIds.EthereumMainnet | KnownChainIds.AvalancheMainnet | KnownChainIds.OptimismMainnet | KnownChainIds.BnbSmartChainMainnet | KnownChainIds.PolygonMainnet | KnownChainIds.GnosisMainnet | KnownChainIds.ArbitrumMainnet | KnownChainIds.ArbitrumNovaMainnet | KnownChainIds.BaseMainnet;
64
+ export type EvmChainId = KnownChainIds.EthereumMainnet | KnownChainIds.AvalancheMainnet | KnownChainIds.OptimismMainnet | KnownChainIds.BnbSmartChainMainnet | KnownChainIds.PolygonMainnet | KnownChainIds.GnosisMainnet | KnownChainIds.ArbitrumMainnet | KnownChainIds.BaseMainnet | KnownChainIds.MonadMainnet | KnownChainIds.HyperEvmMainnet | KnownChainIds.PlasmaMainnet | KnownChainIds.MantleMainnet | KnownChainIds.InkMainnet | KnownChainIds.MegaEthMainnet | KnownChainIds.BerachainMainnet | KnownChainIds.CronosMainnet | KnownChainIds.KatanaMainnet | KnownChainIds.EtherealMainnet | KnownChainIds.FlowEvmMainnet | KnownChainIds.CeloMainnet | KnownChainIds.PlumeMainnet | KnownChainIds.StoryMainnet | KnownChainIds.ZkSyncEraMainnet | KnownChainIds.BlastMainnet | KnownChainIds.WorldChainMainnet | KnownChainIds.HemiMainnet | KnownChainIds.SeiMainnet | KnownChainIds.LineaMainnet | KnownChainIds.ScrollMainnet | KnownChainIds.SonicMainnet | KnownChainIds.UnichainMainnet | KnownChainIds.BobMainnet | KnownChainIds.ModeMainnet | KnownChainIds.SoneiumMainnet | KnownChainIds.AbstractMainnet | KnownChainIds.RobinhoodMainnet;
32
65
  export type CosmosSdkChainId = KnownChainIds.CosmosMainnet | KnownChainIds.ThorchainMainnet | KnownChainIds.MayachainMainnet;
33
- export type UtxoChainId = KnownChainIds.BitcoinMainnet | KnownChainIds.BitcoinCashMainnet | KnownChainIds.DogecoinMainnet | KnownChainIds.LitecoinMainnet;
66
+ export type ThorMayaChainId = KnownChainIds.ThorchainMainnet | KnownChainIds.MayachainMainnet;
67
+ export type UtxoChainId = KnownChainIds.BitcoinMainnet | KnownChainIds.BitcoinCashMainnet | KnownChainIds.DogecoinMainnet | KnownChainIds.LitecoinMainnet | KnownChainIds.ZcashMainnet;
68
+ export type TronChainId = KnownChainIds.TronMainnet;
69
+ export type SuiChainId = KnownChainIds.SuiMainnet;
70
+ export type NearChainId = KnownChainIds.NearMainnet;
71
+ export type SolanaChainId = KnownChainIds.SolanaMainnet;
72
+ export type StarknetChainId = KnownChainIds.StarknetMainnet;
73
+ export type TonChainId = KnownChainIds.TonMainnet;
34
74
  export declare enum WithdrawType {
35
75
  DELAYED = 0,
36
76
  INSTANT = 1
@@ -59,6 +99,8 @@ export type Asset = {
59
99
  explorerTxLink: string;
60
100
  explorerAddressLink: string;
61
101
  relatedAssetKey: AssetId | null | undefined;
102
+ isPrimary?: boolean;
103
+ isChainSpecific?: boolean;
62
104
  isPool?: boolean;
63
105
  };
64
106
  export type AssetsById = Record<AssetId, Asset>;
package/dist/esm/base.js CHANGED
@@ -7,16 +7,49 @@ export var KnownChainIds;
7
7
  KnownChainIds["PolygonMainnet"] = "eip155:137";
8
8
  KnownChainIds["GnosisMainnet"] = "eip155:100";
9
9
  KnownChainIds["ArbitrumMainnet"] = "eip155:42161";
10
- KnownChainIds["ArbitrumNovaMainnet"] = "eip155:42170";
11
10
  KnownChainIds["BaseMainnet"] = "eip155:8453";
11
+ KnownChainIds["MonadMainnet"] = "eip155:143";
12
+ KnownChainIds["HyperEvmMainnet"] = "eip155:999";
13
+ KnownChainIds["PlasmaMainnet"] = "eip155:9745";
14
+ KnownChainIds["MantleMainnet"] = "eip155:5000";
15
+ KnownChainIds["InkMainnet"] = "eip155:57073";
16
+ KnownChainIds["MegaEthMainnet"] = "eip155:4326";
17
+ KnownChainIds["BerachainMainnet"] = "eip155:80094";
18
+ KnownChainIds["CronosMainnet"] = "eip155:25";
19
+ KnownChainIds["KatanaMainnet"] = "eip155:747474";
20
+ KnownChainIds["EtherealMainnet"] = "eip155:5064014";
21
+ KnownChainIds["FlowEvmMainnet"] = "eip155:747";
22
+ KnownChainIds["CeloMainnet"] = "eip155:42220";
23
+ KnownChainIds["PlumeMainnet"] = "eip155:98866";
24
+ KnownChainIds["StoryMainnet"] = "eip155:1514";
25
+ KnownChainIds["ZkSyncEraMainnet"] = "eip155:324";
26
+ KnownChainIds["BlastMainnet"] = "eip155:81457";
27
+ KnownChainIds["WorldChainMainnet"] = "eip155:480";
28
+ KnownChainIds["HemiMainnet"] = "eip155:43111";
29
+ KnownChainIds["SeiMainnet"] = "eip155:1329";
30
+ KnownChainIds["LineaMainnet"] = "eip155:59144";
31
+ KnownChainIds["ScrollMainnet"] = "eip155:534352";
32
+ KnownChainIds["SonicMainnet"] = "eip155:146";
33
+ KnownChainIds["UnichainMainnet"] = "eip155:130";
34
+ KnownChainIds["BobMainnet"] = "eip155:60808";
35
+ KnownChainIds["ModeMainnet"] = "eip155:34443";
36
+ KnownChainIds["SoneiumMainnet"] = "eip155:1868";
12
37
  KnownChainIds["BitcoinMainnet"] = "bip122:000000000019d6689c085ae165831e93";
13
38
  KnownChainIds["BitcoinCashMainnet"] = "bip122:000000000000000000651ef99cb9fcbe";
14
39
  KnownChainIds["DogecoinMainnet"] = "bip122:00000000001a91e3dace36e2be3bf030";
15
40
  KnownChainIds["LitecoinMainnet"] = "bip122:12a765e31ffd4059bada1e25190f6e98";
41
+ KnownChainIds["ZcashMainnet"] = "bip122:00040fe8ec8471911baa1db1266ea15d";
16
42
  KnownChainIds["CosmosMainnet"] = "cosmos:cosmoshub-4";
17
43
  KnownChainIds["ThorchainMainnet"] = "cosmos:thorchain-1";
18
44
  KnownChainIds["MayachainMainnet"] = "cosmos:mayachain-mainnet-v1";
19
45
  KnownChainIds["SolanaMainnet"] = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
46
+ KnownChainIds["TronMainnet"] = "tron:0x2b6653dc";
47
+ KnownChainIds["SuiMainnet"] = "sui:35834a8a";
48
+ KnownChainIds["NearMainnet"] = "near:mainnet";
49
+ KnownChainIds["StarknetMainnet"] = "starknet:SN_MAIN";
50
+ KnownChainIds["TonMainnet"] = "ton:mainnet";
51
+ KnownChainIds["AbstractMainnet"] = "eip155:2741";
52
+ KnownChainIds["RobinhoodMainnet"] = "eip155:4663";
20
53
  })(KnownChainIds || (KnownChainIds = {}));
21
54
  export var WithdrawType;
22
55
  (function (WithdrawType) {
@@ -1,9 +1,6 @@
1
- import type { AppDataRootSchema as AppDataRootSchemaLegacy } from '@cowprotocol/app-data/dist/generatedTypes/v0.4.0';
2
- import type { AppDataRootSchema as AppDataRootSchemaLatest } from '@cowprotocol/app-data/dist/generatedTypes/v1.3.0';
3
1
  import type { Nominal } from '@shapeshiftoss/caip';
4
- import type { TypedDataField } from 'ethers5';
5
2
  import type { Address } from 'viem';
6
- import type { KnownChainIds } from './base';
3
+ import type { KnownChainIds } from './base.js';
7
4
  export type AppDataHash = Nominal<string, 'AppDataHash'>;
8
5
  export type AppData = Nominal<string, 'AppData'>;
9
6
  export type OrderId = Nominal<string, 'OrderId'>;
@@ -264,9 +261,15 @@ export declare enum CowNetwork {
264
261
  ArbitrumOne = "arbitrum_one",
265
262
  Base = "base",
266
263
  Avalanche = "avalanche",
267
- Polygon = "polygon"
264
+ Polygon = "polygon",
265
+ Bnb = "bnb",
266
+ Plasma = "plasma",
267
+ Linea = "linea",
268
+ Ink = "ink"
268
269
  }
269
- export type CowChainId = KnownChainIds.EthereumMainnet | KnownChainIds.GnosisMainnet | KnownChainIds.ArbitrumMainnet;
270
+ export type CowChainId = KnownChainIds.EthereumMainnet | KnownChainIds.GnosisMainnet | KnownChainIds.ArbitrumMainnet | KnownChainIds.BaseMainnet | KnownChainIds.AvalancheMainnet | KnownChainIds.PolygonMainnet | KnownChainIds.BnbSmartChainMainnet | KnownChainIds.PlasmaMainnet | KnownChainIds.LineaMainnet | KnownChainIds.InkMainnet;
271
+ export type TypedDataField = {
272
+ name: string;
273
+ type: string;
274
+ };
270
275
  export type TypedDataTypes = Record<string, TypedDataField[]>;
271
- export type ParsedAppData = AppDataRootSchemaLatest | AppDataRootSchemaLegacy;
272
- export declare const isLegacyAppData: (appData: ParsedAppData) => appData is AppDataRootSchemaLegacy;
@@ -119,7 +119,8 @@ export var CowNetwork;
119
119
  CowNetwork["Base"] = "base";
120
120
  CowNetwork["Avalanche"] = "avalanche";
121
121
  CowNetwork["Polygon"] = "polygon";
122
+ CowNetwork["Bnb"] = "bnb";
123
+ CowNetwork["Plasma"] = "plasma";
124
+ CowNetwork["Linea"] = "linea";
125
+ CowNetwork["Ink"] = "ink";
122
126
  })(CowNetwork || (CowNetwork = {}));
123
- export const isLegacyAppData = (appData) => {
124
- return appData.version === 'v0.4.0';
125
- };
@@ -1,5 +1,6 @@
1
- export * from './cowSwap';
2
- export * from './base';
3
- export * from './market';
4
- export * from './utility';
5
- export * from './zerion';
1
+ export * from './api.js';
2
+ export * from './cowSwap.js';
3
+ export * from './base.js';
4
+ export * from './market.js';
5
+ export * from './utility.js';
6
+ export * from './zerion.js';
package/dist/esm/index.js CHANGED
@@ -1,5 +1,6 @@
1
- export * from './cowSwap';
2
- export * from './base';
3
- export * from './market';
4
- export * from './utility';
5
- export * from './zerion';
1
+ export * from './api.js';
2
+ export * from './cowSwap.js';
3
+ export * from './base.js';
4
+ export * from './market.js';
5
+ export * from './utility.js';
6
+ export * from './zerion.js';
@@ -1,5 +1,5 @@
1
1
  import type { ChainId } from '@shapeshiftoss/caip';
2
- export declare const ZERION_CHAINS: readonly ["avalanche", "binance-smart-chain", "ethereum", "optimism", "polygon", "arbitrum", "xdai", "base"];
2
+ export declare const ZERION_CHAINS: readonly ["avalanche", "binance-smart-chain", "ethereum", "optimism", "polygon", "arbitrum", "xdai", "base", "solana", "tron", "monad", "sui", "plasma", "plume", "world-chain", "katana", "celo", "flow-evm", "story", "zksync-era", "blast", "hemi", "mantle", "linea", "berachain", "sei", "ink", "cronos", "sonic", "unichain", "bob", "mode", "soneium"];
3
3
  export type ZerionChainId = (typeof ZERION_CHAINS)[number];
4
4
  export declare const ZERION_CHAINS_MAP: Record<ZerionChainId, ChainId>;
5
5
  export declare const zerionChainIdToChainId: (chainId: ZerionChainId) => ChainId | undefined;
@@ -1,4 +1,4 @@
1
- import { arbitrumChainId, avalancheChainId, baseChainId, bscChainId, ethChainId, gnosisChainId, optimismChainId, polygonChainId, } from '@shapeshiftoss/caip';
1
+ import { arbitrumChainId, avalancheChainId, baseChainId, berachainChainId, blastChainId, bobChainId, bscChainId, celoChainId, cronosChainId, ethChainId, flowEvmChainId, gnosisChainId, hemiChainId, inkChainId, katanaChainId, lineaChainId, mantleChainId, modeChainId, monadChainId, optimismChainId, plasmaChainId, plumeChainId, polygonChainId, seiChainId, solanaChainId, soneiumChainId, sonicChainId, storyChainId, suiChainId, tronChainId, unichainChainId, worldChainChainId, zkSyncEraChainId, } from '@shapeshiftoss/caip';
2
2
  export const ZERION_CHAINS = [
3
3
  // shapeshift supported
4
4
  'avalanche',
@@ -9,10 +9,34 @@ export const ZERION_CHAINS = [
9
9
  'arbitrum',
10
10
  'xdai',
11
11
  'base',
12
+ 'solana',
13
+ 'tron',
14
+ 'monad',
15
+ 'sui',
16
+ 'plasma',
17
+ 'plume',
18
+ 'world-chain',
19
+ 'katana',
20
+ 'celo',
21
+ 'flow-evm',
22
+ 'story',
23
+ 'zksync-era',
24
+ 'blast',
25
+ 'hemi',
26
+ 'mantle',
27
+ 'linea',
28
+ 'berachain',
29
+ 'sei',
30
+ 'ink',
31
+ 'cronos',
32
+ 'sonic',
33
+ 'unichain',
34
+ 'bob',
35
+ 'mode',
36
+ 'soneium',
12
37
  // not yet
13
38
  // 'aurora',
14
39
  // 'fantom',
15
- // 'solana',
16
40
  ];
17
41
  export const ZERION_CHAINS_MAP = {
18
42
  avalanche: avalancheChainId,
@@ -23,5 +47,30 @@ export const ZERION_CHAINS_MAP = {
23
47
  arbitrum: arbitrumChainId,
24
48
  xdai: gnosisChainId,
25
49
  base: baseChainId,
50
+ solana: solanaChainId,
51
+ tron: tronChainId,
52
+ monad: monadChainId,
53
+ sui: suiChainId,
54
+ plasma: plasmaChainId,
55
+ plume: plumeChainId,
56
+ 'world-chain': worldChainChainId,
57
+ katana: katanaChainId,
58
+ celo: celoChainId,
59
+ 'flow-evm': flowEvmChainId,
60
+ story: storyChainId,
61
+ 'zksync-era': zkSyncEraChainId,
62
+ blast: blastChainId,
63
+ hemi: hemiChainId,
64
+ mantle: mantleChainId,
65
+ linea: lineaChainId,
66
+ berachain: berachainChainId,
67
+ sei: seiChainId,
68
+ ink: inkChainId,
69
+ cronos: cronosChainId,
70
+ sonic: sonicChainId,
71
+ unichain: unichainChainId,
72
+ bob: bobChainId,
73
+ mode: modeChainId,
74
+ soneium: soneiumChainId,
26
75
  };
27
76
  export const zerionChainIdToChainId = (chainId) => ZERION_CHAINS_MAP[chainId];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/types",
3
- "version": "9.0.0-alpha.0",
3
+ "version": "9.0.1",
4
4
  "description": "Common types shared across packages",
5
5
  "repository": "https://github.com/shapeshift/web",
6
6
  "license": "MIT",
@@ -10,9 +10,9 @@
10
10
  "types": "dist/esm/index.d.ts",
11
11
  "exports": {
12
12
  ".": {
13
+ "types": "./dist/esm/index.d.ts",
13
14
  "import": "./dist/esm/index.js",
14
- "require": "./dist/cjs/index.js",
15
- "types": "./dist/esm/index.d.ts"
15
+ "require": "./dist/cjs/index.js"
16
16
  }
17
17
  },
18
18
  "files": [
@@ -21,13 +21,16 @@
21
21
  "publishConfig": {
22
22
  "access": "public"
23
23
  },
24
- "scripts": {
25
- "build": "yarn clean && yarn run -T tsc --build && yarn postbuild",
26
- "clean": "rm -rf dist",
27
- "dev": "yarn run -T tsc --build --watch",
28
- "postbuild": "echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json"
24
+ "dependencies": {
25
+ "viem": "2.55.11",
26
+ "@shapeshiftoss/caip": "^8.16.10"
29
27
  },
30
- "devDependencies": {
31
- "@shapeshiftoss/caip": "workspace:^"
28
+ "scripts": {
29
+ "build": "rm -rf dist && pnpm exec tsc --build && pnpm run postbuild",
30
+ "clean": "rm -rf dist node_modules",
31
+ "dev": "pnpm exec tsc --build --watch",
32
+ "postbuild": "pnpm run postbuild:esm && pnpm run postbuild:cjs",
33
+ "postbuild:esm": "pnpm exec tsc-esm-fix --target=dist/esm --ext=.js",
34
+ "postbuild:cjs": "echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json"
32
35
  }
33
- }
36
+ }