@shapeshiftoss/types 8.6.6 → 8.6.8
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/LICENSE.md +21 -0
- package/README.md +1 -1
- package/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/api.d.ts +46 -0
- package/dist/cjs/api.js +2 -0
- package/dist/cjs/base.d.ts +28 -3
- package/dist/cjs/base.js +24 -1
- package/dist/cjs/cowSwap.d.ts +5 -2
- package/dist/cjs/cowSwap.js +3 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/zerion.d.ts +1 -1
- package/dist/cjs/zerion.js +38 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/api.d.ts +46 -0
- package/dist/esm/api.js +1 -0
- package/dist/esm/base.d.ts +28 -3
- package/dist/esm/base.js +24 -1
- package/dist/esm/cowSwap.d.ts +5 -2
- package/dist/esm/cowSwap.js +3 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/zerion.d.ts +1 -1
- package/dist/esm/zerion.js +39 -1
- package/package.json +13 -13
- package/CHANGELOG.md +0 -665
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export type Permit2SignatureRequired = {
|
|
2
|
+
type: '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?: Permit2SignatureRequired;
|
|
13
|
+
};
|
|
14
|
+
export type SolanaTransactionData = {
|
|
15
|
+
type: 'solana';
|
|
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 UtxoPsbtTransactionData = {
|
|
28
|
+
type: 'utxo_psbt';
|
|
29
|
+
psbt: string;
|
|
30
|
+
opReturnData?: string;
|
|
31
|
+
};
|
|
32
|
+
export type UtxoDepositTransactionData = {
|
|
33
|
+
type: 'utxo_deposit';
|
|
34
|
+
depositAddress: string;
|
|
35
|
+
memo: string;
|
|
36
|
+
value: string;
|
|
37
|
+
};
|
|
38
|
+
export type UtxoTransactionData = UtxoPsbtTransactionData | UtxoDepositTransactionData;
|
|
39
|
+
export type CosmosTransactionData = {
|
|
40
|
+
type: 'cosmos';
|
|
41
|
+
chainId: string;
|
|
42
|
+
to: string;
|
|
43
|
+
value: string;
|
|
44
|
+
memo?: string;
|
|
45
|
+
};
|
|
46
|
+
export type TransactionData = EvmTransactionData | SolanaTransactionData | UtxoTransactionData | CosmosTransactionData;
|
package/dist/esm/api.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/base.d.ts
CHANGED
|
@@ -17,12 +17,33 @@ 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",
|
|
22
21
|
MonadMainnet = "eip155:143",
|
|
23
22
|
HyperEvmMainnet = "eip155:999",
|
|
24
23
|
PlasmaMainnet = "eip155:9745",
|
|
24
|
+
MantleMainnet = "eip155:5000",
|
|
25
|
+
InkMainnet = "eip155:57073",
|
|
26
|
+
MegaEthMainnet = "eip155:4326",
|
|
27
|
+
BerachainMainnet = "eip155:80094",
|
|
28
|
+
CronosMainnet = "eip155:25",
|
|
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",
|
|
26
47
|
BitcoinMainnet = "bip122:000000000019d6689c085ae165831e93",
|
|
27
48
|
BitcoinCashMainnet = "bip122:000000000000000000651ef99cb9fcbe",
|
|
28
49
|
DogecoinMainnet = "bip122:00000000001a91e3dace36e2be3bf030",
|
|
@@ -35,16 +56,20 @@ export declare enum KnownChainIds {
|
|
|
35
56
|
TronMainnet = "tron:0x2b6653dc",
|
|
36
57
|
SuiMainnet = "sui:35834a8a",
|
|
37
58
|
NearMainnet = "near:mainnet",
|
|
38
|
-
StarknetMainnet = "starknet:SN_MAIN"
|
|
59
|
+
StarknetMainnet = "starknet:SN_MAIN",
|
|
60
|
+
TonMainnet = "ton:mainnet",
|
|
61
|
+
AbstractMainnet = "eip155:2741"
|
|
39
62
|
}
|
|
40
|
-
export type EvmChainId = KnownChainIds.EthereumMainnet | KnownChainIds.AvalancheMainnet | KnownChainIds.OptimismMainnet | KnownChainIds.BnbSmartChainMainnet | KnownChainIds.PolygonMainnet | KnownChainIds.GnosisMainnet | KnownChainIds.ArbitrumMainnet | KnownChainIds.
|
|
63
|
+
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;
|
|
41
64
|
export type CosmosSdkChainId = KnownChainIds.CosmosMainnet | KnownChainIds.ThorchainMainnet | KnownChainIds.MayachainMainnet;
|
|
42
65
|
export type ThorMayaChainId = KnownChainIds.ThorchainMainnet | KnownChainIds.MayachainMainnet;
|
|
43
66
|
export type UtxoChainId = KnownChainIds.BitcoinMainnet | KnownChainIds.BitcoinCashMainnet | KnownChainIds.DogecoinMainnet | KnownChainIds.LitecoinMainnet | KnownChainIds.ZcashMainnet;
|
|
44
67
|
export type TronChainId = KnownChainIds.TronMainnet;
|
|
45
68
|
export type SuiChainId = KnownChainIds.SuiMainnet;
|
|
46
69
|
export type NearChainId = KnownChainIds.NearMainnet;
|
|
70
|
+
export type SolanaChainId = KnownChainIds.SolanaMainnet;
|
|
47
71
|
export type StarknetChainId = KnownChainIds.StarknetMainnet;
|
|
72
|
+
export type TonChainId = KnownChainIds.TonMainnet;
|
|
48
73
|
export declare enum WithdrawType {
|
|
49
74
|
DELAYED = 0,
|
|
50
75
|
INSTANT = 1
|
package/dist/esm/base.js
CHANGED
|
@@ -7,12 +7,33 @@ 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";
|
|
12
11
|
KnownChainIds["MonadMainnet"] = "eip155:143";
|
|
13
12
|
KnownChainIds["HyperEvmMainnet"] = "eip155:999";
|
|
14
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";
|
|
15
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";
|
|
16
37
|
KnownChainIds["BitcoinMainnet"] = "bip122:000000000019d6689c085ae165831e93";
|
|
17
38
|
KnownChainIds["BitcoinCashMainnet"] = "bip122:000000000000000000651ef99cb9fcbe";
|
|
18
39
|
KnownChainIds["DogecoinMainnet"] = "bip122:00000000001a91e3dace36e2be3bf030";
|
|
@@ -26,6 +47,8 @@ export var KnownChainIds;
|
|
|
26
47
|
KnownChainIds["SuiMainnet"] = "sui:35834a8a";
|
|
27
48
|
KnownChainIds["NearMainnet"] = "near:mainnet";
|
|
28
49
|
KnownChainIds["StarknetMainnet"] = "starknet:SN_MAIN";
|
|
50
|
+
KnownChainIds["TonMainnet"] = "ton:mainnet";
|
|
51
|
+
KnownChainIds["AbstractMainnet"] = "eip155:2741";
|
|
29
52
|
})(KnownChainIds || (KnownChainIds = {}));
|
|
30
53
|
export var WithdrawType;
|
|
31
54
|
(function (WithdrawType) {
|
package/dist/esm/cowSwap.d.ts
CHANGED
|
@@ -265,9 +265,12 @@ export declare enum CowNetwork {
|
|
|
265
265
|
Base = "base",
|
|
266
266
|
Avalanche = "avalanche",
|
|
267
267
|
Polygon = "polygon",
|
|
268
|
-
Bnb = "bnb"
|
|
268
|
+
Bnb = "bnb",
|
|
269
|
+
Plasma = "plasma",
|
|
270
|
+
Linea = "linea",
|
|
271
|
+
Ink = "ink"
|
|
269
272
|
}
|
|
270
|
-
export type CowChainId = KnownChainIds.EthereumMainnet | KnownChainIds.GnosisMainnet | KnownChainIds.ArbitrumMainnet;
|
|
273
|
+
export type CowChainId = KnownChainIds.EthereumMainnet | KnownChainIds.GnosisMainnet | KnownChainIds.ArbitrumMainnet | KnownChainIds.BaseMainnet | KnownChainIds.AvalancheMainnet | KnownChainIds.PolygonMainnet | KnownChainIds.BnbSmartChainMainnet | KnownChainIds.PlasmaMainnet | KnownChainIds.LineaMainnet | KnownChainIds.InkMainnet;
|
|
271
274
|
export type TypedDataTypes = Record<string, TypedDataField[]>;
|
|
272
275
|
export type ParsedAppData = AppDataRootSchemaLatest | AppDataRootSchemaLegacy;
|
|
273
276
|
export declare const isLegacyAppData: (appData: ParsedAppData) => appData is AppDataRootSchemaLegacy;
|
package/dist/esm/cowSwap.js
CHANGED
|
@@ -120,6 +120,9 @@ export var CowNetwork;
|
|
|
120
120
|
CowNetwork["Avalanche"] = "avalanche";
|
|
121
121
|
CowNetwork["Polygon"] = "polygon";
|
|
122
122
|
CowNetwork["Bnb"] = "bnb";
|
|
123
|
+
CowNetwork["Plasma"] = "plasma";
|
|
124
|
+
CowNetwork["Linea"] = "linea";
|
|
125
|
+
CowNetwork["Ink"] = "ink";
|
|
123
126
|
})(CowNetwork || (CowNetwork = {}));
|
|
124
127
|
export const isLegacyAppData = (appData) => {
|
|
125
128
|
return appData.version === 'v0.4.0';
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js
CHANGED
package/dist/esm/zerion.d.ts
CHANGED
|
@@ -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", "solana", "tron", "monad", "sui", "plasma", "katana"];
|
|
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;
|
package/dist/esm/zerion.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { arbitrumChainId, avalancheChainId, baseChainId, bscChainId, ethChainId, gnosisChainId, katanaChainId, monadChainId, optimismChainId, plasmaChainId, polygonChainId, solanaChainId, suiChainId, tronChainId, } 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',
|
|
@@ -14,7 +14,26 @@ export const ZERION_CHAINS = [
|
|
|
14
14
|
'monad',
|
|
15
15
|
'sui',
|
|
16
16
|
'plasma',
|
|
17
|
+
'plume',
|
|
18
|
+
'world-chain',
|
|
17
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',
|
|
18
37
|
// not yet
|
|
19
38
|
// 'aurora',
|
|
20
39
|
// 'fantom',
|
|
@@ -33,6 +52,25 @@ export const ZERION_CHAINS_MAP = {
|
|
|
33
52
|
monad: monadChainId,
|
|
34
53
|
sui: suiChainId,
|
|
35
54
|
plasma: plasmaChainId,
|
|
55
|
+
plume: plumeChainId,
|
|
56
|
+
'world-chain': worldChainChainId,
|
|
36
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,
|
|
37
75
|
};
|
|
38
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": "8.6.
|
|
3
|
+
"version": "8.6.8",
|
|
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,18 +21,18 @@
|
|
|
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": "yarn postbuild:esm && yarn postbuild:cjs",
|
|
29
|
-
"postbuild:esm": "yarn run -T tsc-esm-fix --target=dist/esm --ext=.js",
|
|
30
|
-
"postbuild:cjs": "echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json"
|
|
31
|
-
},
|
|
32
24
|
"dependencies": {
|
|
33
25
|
"@cowprotocol/app-data": "^2.3.0",
|
|
34
|
-
"@shapeshiftoss/caip": "^8.16.6",
|
|
35
26
|
"ethers5": "npm:ethers@5.7.2",
|
|
36
|
-
"viem": "
|
|
27
|
+
"viem": "2.43.5",
|
|
28
|
+
"@shapeshiftoss/caip": "^8.16.9"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "rm -rf dist && pnpm exec tsc --build && pnpm run postbuild",
|
|
32
|
+
"clean": "rm -rf dist node_modules",
|
|
33
|
+
"dev": "pnpm exec tsc --build --watch",
|
|
34
|
+
"postbuild": "pnpm run postbuild:esm && pnpm run postbuild:cjs",
|
|
35
|
+
"postbuild:esm": "pnpm exec tsc-esm-fix --target=dist/esm --ext=.js",
|
|
36
|
+
"postbuild:cjs": "echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json"
|
|
37
37
|
}
|
|
38
38
|
}
|