@lifi/types 3.2.0 → 3.2.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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [3.2.2](https://github.com/lifinance/types/compare/v3.2.1...v3.2.2) (2023-04-12)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * rename CZKT to LNA (Linea) ([#156](https://github.com/lifinance/types/issues/156)) ([b414277](https://github.com/lifinance/types/commit/b414277a37ebeefa37871f2e766915d9d75dd65b))
11
+
12
+ ### [3.2.1](https://github.com/lifinance/types/compare/v3.2.0...v3.2.1) (2023-04-11)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * step types cleanup ([#155](https://github.com/lifinance/types/issues/155)) ([8d3caed](https://github.com/lifinance/types/commit/8d3caedc417bdcc3e4fedba575f1438092be8f23))
18
+
5
19
  ## [3.2.0](https://github.com/lifinance/types/compare/v3.1.1...v3.2.0) (2023-04-05)
6
20
 
7
21
 
package/dist/base.d.ts CHANGED
@@ -107,7 +107,7 @@ export declare enum ChainKey {
107
107
  EVMT = "evmt",
108
108
  MORT = "mort",
109
109
  FTMT = "ftmt",
110
- CZKT = "czkt"
110
+ LNAT = "lnat"
111
111
  }
112
112
  export declare enum ChainId {
113
113
  ETH = 1,
@@ -170,7 +170,7 @@ export declare enum ChainId {
170
170
  EVMT = 9000,
171
171
  MORT = 1287,
172
172
  FTMT = 4002,
173
- CZKT = 59140
173
+ LNAT = 59140
174
174
  }
175
175
  export interface Token {
176
176
  address: string;
package/dist/base.js CHANGED
@@ -111,7 +111,7 @@ export var ChainKey;
111
111
  ChainKey["EVMT"] = "evmt";
112
112
  ChainKey["MORT"] = "mort";
113
113
  ChainKey["FTMT"] = "ftmt";
114
- ChainKey["CZKT"] = "czkt";
114
+ ChainKey["LNAT"] = "lnat";
115
115
  })(ChainKey || (ChainKey = {}));
116
116
  export var ChainId;
117
117
  (function (ChainId) {
@@ -176,5 +176,5 @@ export var ChainId;
176
176
  ChainId[ChainId["EVMT"] = 9000] = "EVMT";
177
177
  ChainId[ChainId["MORT"] = 1287] = "MORT";
178
178
  ChainId[ChainId["FTMT"] = 4002] = "FTMT";
179
- ChainId[ChainId["CZKT"] = 59140] = "CZKT";
179
+ ChainId[ChainId["LNAT"] = 59140] = "LNAT";
180
180
  })(ChainId || (ChainId = {}));
@@ -1187,27 +1187,27 @@ export const supportedEVMChains = [
1187
1187
  rpcUrls: ['https://api.avax-test.network/ext/bc/C/rpc'],
1188
1188
  },
1189
1189
  },
1190
- // 59140 - ConsenSys zkEVM Testnet
1190
+ // 59140 - Linea (formerly ConsenSys zkEVM) Testnet
1191
1191
  {
1192
- key: ChainKey.CZKT,
1192
+ key: ChainKey.LNAT,
1193
1193
  chainType: ChainType.EVM,
1194
- name: 'ConsenSys zkEVM Testnet',
1194
+ name: 'Linea Testnet',
1195
1195
  coin: CoinKey.ETH,
1196
1196
  id: 59140,
1197
1197
  mainnet: false,
1198
1198
  logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/consensys_zkevm_test.png',
1199
- // multicallAddress: multicallAddresses[ChainId.CZKT], // Not deployed yet
1200
- faucetUrls: ['https://goerli.zkevm.consensys.net/'],
1199
+ // multicallAddress: multicallAddresses[ChainId.LNAT], // Not deployed yet
1200
+ faucetUrls: ['https://faucetlink.to/goerli'],
1201
1201
  metamask: {
1202
1202
  chainId: prefixChainId(59140),
1203
- blockExplorerUrls: ['https://explorer.goerli.zkevm.consensys.net/'],
1204
- chainName: 'ConsenSys zkEVM Testnet',
1203
+ blockExplorerUrls: ['https://explorer.goerli.linea.build/'],
1204
+ chainName: 'Linea Testnet',
1205
1205
  nativeCurrency: {
1206
1206
  name: 'crETH',
1207
1207
  symbol: 'crETH',
1208
1208
  decimals: 18,
1209
1209
  },
1210
- rpcUrls: [],
1210
+ rpcUrls: ['https://rpc.goerli.linea.build'],
1211
1211
  },
1212
1212
  },
1213
1213
  // TODO: Add
@@ -107,7 +107,7 @@ export declare enum ChainKey {
107
107
  EVMT = "evmt",
108
108
  MORT = "mort",
109
109
  FTMT = "ftmt",
110
- CZKT = "czkt"
110
+ LNAT = "lnat"
111
111
  }
112
112
  export declare enum ChainId {
113
113
  ETH = 1,
@@ -170,7 +170,7 @@ export declare enum ChainId {
170
170
  EVMT = 9000,
171
171
  MORT = 1287,
172
172
  FTMT = 4002,
173
- CZKT = 59140
173
+ LNAT = 59140
174
174
  }
175
175
  export interface Token {
176
176
  address: string;
package/dist/cjs/base.js CHANGED
@@ -114,7 +114,7 @@ var ChainKey;
114
114
  ChainKey["EVMT"] = "evmt";
115
115
  ChainKey["MORT"] = "mort";
116
116
  ChainKey["FTMT"] = "ftmt";
117
- ChainKey["CZKT"] = "czkt";
117
+ ChainKey["LNAT"] = "lnat";
118
118
  })(ChainKey = exports.ChainKey || (exports.ChainKey = {}));
119
119
  var ChainId;
120
120
  (function (ChainId) {
@@ -179,5 +179,5 @@ var ChainId;
179
179
  ChainId[ChainId["EVMT"] = 9000] = "EVMT";
180
180
  ChainId[ChainId["MORT"] = 1287] = "MORT";
181
181
  ChainId[ChainId["FTMT"] = 4002] = "FTMT";
182
- ChainId[ChainId["CZKT"] = 59140] = "CZKT";
182
+ ChainId[ChainId["LNAT"] = 59140] = "LNAT";
183
183
  })(ChainId = exports.ChainId || (exports.ChainId = {}));
@@ -1190,27 +1190,27 @@ exports.supportedEVMChains = [
1190
1190
  rpcUrls: ['https://api.avax-test.network/ext/bc/C/rpc'],
1191
1191
  },
1192
1192
  },
1193
- // 59140 - ConsenSys zkEVM Testnet
1193
+ // 59140 - Linea (formerly ConsenSys zkEVM) Testnet
1194
1194
  {
1195
- key: base_1.ChainKey.CZKT,
1195
+ key: base_1.ChainKey.LNAT,
1196
1196
  chainType: Chain_1.ChainType.EVM,
1197
- name: 'ConsenSys zkEVM Testnet',
1197
+ name: 'Linea Testnet',
1198
1198
  coin: base_1.CoinKey.ETH,
1199
1199
  id: 59140,
1200
1200
  mainnet: false,
1201
1201
  logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/consensys_zkevm_test.png',
1202
- // multicallAddress: multicallAddresses[ChainId.CZKT], // Not deployed yet
1203
- faucetUrls: ['https://goerli.zkevm.consensys.net/'],
1202
+ // multicallAddress: multicallAddresses[ChainId.LNAT], // Not deployed yet
1203
+ faucetUrls: ['https://faucetlink.to/goerli'],
1204
1204
  metamask: {
1205
1205
  chainId: (0, EVMChain_1.prefixChainId)(59140),
1206
- blockExplorerUrls: ['https://explorer.goerli.zkevm.consensys.net/'],
1207
- chainName: 'ConsenSys zkEVM Testnet',
1206
+ blockExplorerUrls: ['https://explorer.goerli.linea.build/'],
1207
+ chainName: 'Linea Testnet',
1208
1208
  nativeCurrency: {
1209
1209
  name: 'crETH',
1210
1210
  symbol: 'crETH',
1211
1211
  decimals: 18,
1212
1212
  },
1213
- rpcUrls: [],
1213
+ rpcUrls: ['https://rpc.goerli.linea.build'],
1214
1214
  },
1215
1215
  },
1216
1216
  // TODO: Add
package/dist/cjs/coins.js CHANGED
@@ -130,7 +130,7 @@ const basicCoins = [
130
130
  address: '0x0000000000000000000000000000000000000000',
131
131
  decimals: 18,
132
132
  },
133
- [base_1.ChainId.CZKT]: {
133
+ [base_1.ChainId.LNAT]: {
134
134
  address: '0x0000000000000000000000000000000000000000',
135
135
  decimals: 18,
136
136
  },
@@ -694,10 +694,10 @@ const basicCoins = [
694
694
  address: '0x6d4dd09982853f08d9966ac3ca4eb5885f16f2b2',
695
695
  decimals: 6,
696
696
  },
697
- [base_1.ChainId.CZKT]: {
697
+ [base_1.ChainId.LNAT]: {
698
698
  address: '0x964FF70695da981027c81020B1c58d833D49A640',
699
699
  decimals: 6,
700
- name: 'ConsenSys USD Coin',
700
+ name: 'Linea USD Coin',
701
701
  },
702
702
  // 42, 0xb7a4f3e9097c08da09517b5ab877f7a917224ede, 6
703
703
  },
@@ -981,7 +981,7 @@ const basicCoins = [
981
981
  address: '0x4200000000000000000000000000000000000006',
982
982
  decimals: 18,
983
983
  },
984
- [base_1.ChainId.CZKT]: {
984
+ [base_1.ChainId.LNAT]: {
985
985
  address: '0x2C1b868d6596a18e32E61B901E4060C872647b6C',
986
986
  decimals: 18,
987
987
  },
@@ -1275,11 +1275,6 @@ const basicCoins = [
1275
1275
  symbol: 'WSOL',
1276
1276
  name: 'Token Wrapped SOL (Wormhole)',
1277
1277
  },
1278
- // Testnet
1279
- [base_1.ChainId.SOL]: {
1280
- address: 'So11111111111111111111111111111111111111112',
1281
- decimals: 9,
1282
- },
1283
1278
  },
1284
1279
  },
1285
1280
  ];
@@ -1621,12 +1616,12 @@ exports.wrappedTokens = {
1621
1616
  name: 'WBNB',
1622
1617
  logoURI: 'https://zapper.fi/images/networks/binance-smart-chain/0x0000000000000000000000000000000000000000.png',
1623
1618
  },
1624
- [base_1.ChainId.CZKT]: {
1619
+ [base_1.ChainId.LNAT]: {
1625
1620
  // https://explorer.prealpha.zkevm.consensys.net/address/0x2C1b868d6596a18e32E61B901E4060C872647b6C
1626
1621
  address: '0x2C1b868d6596a18e32E61B901E4060C872647b6C',
1627
1622
  symbol: 'WETH',
1628
1623
  decimals: 18,
1629
- chainId: base_1.ChainId.CZKT,
1624
+ chainId: base_1.ChainId.LNAT,
1630
1625
  coinKey: base_1.CoinKey.WETH,
1631
1626
  name: 'WETH',
1632
1627
  logoURI: 'https://zapper.fi/images/networks/ethereum/0x0000000000000000000000000000000000000000.png',
@@ -75,7 +75,8 @@ export interface Execution {
75
75
  gasAmountUSD?: string;
76
76
  }
77
77
  export declare const emptyExecution: Execution;
78
- export type StepType = 'swap' | 'cross' | 'lifi' | 'custom' | 'protocol';
78
+ export declare const _StepType: readonly ["lifi", "swap", "cross", "protocol", "custom"];
79
+ export type StepType = (typeof _StepType)[number];
79
80
  export type StepTool = string;
80
81
  export interface StepBase {
81
82
  id: string;
@@ -89,12 +90,18 @@ export interface StepBase {
89
90
  execution?: Execution;
90
91
  transactionRequest?: providers.TransactionRequest;
91
92
  }
93
+ export interface DestinationCallInfo {
94
+ toContractAddress: string;
95
+ toContractCallData: string;
96
+ toFallbackAddress: string;
97
+ callDataGasLimit: string;
98
+ }
99
+ export type CallAction = Action & DestinationCallInfo;
92
100
  export interface SwapStep extends StepBase {
93
101
  type: 'swap';
94
102
  action: Action;
95
103
  estimate: Estimate;
96
104
  }
97
- export declare function isSwapStep(step: Step): step is SwapStep;
98
105
  export interface CrossStep extends StepBase {
99
106
  type: 'cross';
100
107
  action: Action;
@@ -105,24 +112,17 @@ export interface ProtocolStep extends StepBase {
105
112
  action: Action;
106
113
  estimate: Estimate;
107
114
  }
108
- export declare function isCrossStep(step: Step): step is CrossStep;
109
- export interface DestinationCallInfo {
110
- toContractAddress: string;
111
- toContractCallData: string;
112
- toFallbackAddress: string;
113
- callDataGasLimit: string;
114
- }
115
- export type CallAction = Action & DestinationCallInfo;
116
115
  export interface CustomStep extends StepBase {
117
116
  type: 'custom';
118
117
  action: CallAction;
119
118
  estimate: Estimate;
120
119
  }
121
- export declare function isCustomStep(step: Step): step is CustomStep;
122
- export declare function isProtocolStep(step: Step): step is ProtocolStep;
123
120
  export type Step = SwapStep | CrossStep | CustomStep | ProtocolStep;
124
- export type LifiStep = Omit<Step, 'type'> & {
125
- includedSteps: Step[];
126
- } & {
121
+ export interface LifiStep extends Omit<Step, 'type'> {
127
122
  type: 'lifi';
128
- };
123
+ includedSteps: Step[];
124
+ }
125
+ export declare function isSwapStep(step: Step): step is SwapStep;
126
+ export declare function isCrossStep(step: Step): step is CrossStep;
127
+ export declare function isProtocolStep(step: Step): step is ProtocolStep;
128
+ export declare function isCustomStep(step: Step): step is CustomStep;
package/dist/cjs/step.js CHANGED
@@ -1,10 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isProtocolStep = exports.isCustomStep = exports.isCrossStep = exports.isSwapStep = exports.emptyExecution = void 0;
3
+ exports.isCustomStep = exports.isProtocolStep = exports.isCrossStep = exports.isSwapStep = exports._StepType = exports.emptyExecution = void 0;
4
4
  exports.emptyExecution = {
5
5
  status: 'NOT_STARTED',
6
6
  process: [],
7
7
  };
8
+ // STEP
9
+ exports._StepType = [
10
+ 'lifi',
11
+ 'swap',
12
+ 'cross',
13
+ 'protocol',
14
+ 'custom',
15
+ ];
8
16
  function isSwapStep(step) {
9
17
  return step.type === 'swap';
10
18
  }
@@ -13,11 +21,11 @@ function isCrossStep(step) {
13
21
  return step.type === 'cross';
14
22
  }
15
23
  exports.isCrossStep = isCrossStep;
16
- function isCustomStep(step) {
17
- return step.type === 'custom';
18
- }
19
- exports.isCustomStep = isCustomStep;
20
24
  function isProtocolStep(step) {
21
25
  return step.type === 'protocol';
22
26
  }
23
27
  exports.isProtocolStep = isProtocolStep;
28
+ function isCustomStep(step) {
29
+ return step.type === 'custom';
30
+ }
31
+ exports.isCustomStep = isCustomStep;
package/dist/coins.js CHANGED
@@ -127,7 +127,7 @@ const basicCoins = [
127
127
  address: '0x0000000000000000000000000000000000000000',
128
128
  decimals: 18,
129
129
  },
130
- [ChainId.CZKT]: {
130
+ [ChainId.LNAT]: {
131
131
  address: '0x0000000000000000000000000000000000000000',
132
132
  decimals: 18,
133
133
  },
@@ -691,10 +691,10 @@ const basicCoins = [
691
691
  address: '0x6d4dd09982853f08d9966ac3ca4eb5885f16f2b2',
692
692
  decimals: 6,
693
693
  },
694
- [ChainId.CZKT]: {
694
+ [ChainId.LNAT]: {
695
695
  address: '0x964FF70695da981027c81020B1c58d833D49A640',
696
696
  decimals: 6,
697
- name: 'ConsenSys USD Coin',
697
+ name: 'Linea USD Coin',
698
698
  },
699
699
  // 42, 0xb7a4f3e9097c08da09517b5ab877f7a917224ede, 6
700
700
  },
@@ -978,7 +978,7 @@ const basicCoins = [
978
978
  address: '0x4200000000000000000000000000000000000006',
979
979
  decimals: 18,
980
980
  },
981
- [ChainId.CZKT]: {
981
+ [ChainId.LNAT]: {
982
982
  address: '0x2C1b868d6596a18e32E61B901E4060C872647b6C',
983
983
  decimals: 18,
984
984
  },
@@ -1272,11 +1272,6 @@ const basicCoins = [
1272
1272
  symbol: 'WSOL',
1273
1273
  name: 'Token Wrapped SOL (Wormhole)',
1274
1274
  },
1275
- // Testnet
1276
- [ChainId.SOL]: {
1277
- address: 'So11111111111111111111111111111111111111112',
1278
- decimals: 9,
1279
- },
1280
1275
  },
1281
1276
  },
1282
1277
  ];
@@ -1618,12 +1613,12 @@ export const wrappedTokens = {
1618
1613
  name: 'WBNB',
1619
1614
  logoURI: 'https://zapper.fi/images/networks/binance-smart-chain/0x0000000000000000000000000000000000000000.png',
1620
1615
  },
1621
- [ChainId.CZKT]: {
1616
+ [ChainId.LNAT]: {
1622
1617
  // https://explorer.prealpha.zkevm.consensys.net/address/0x2C1b868d6596a18e32E61B901E4060C872647b6C
1623
1618
  address: '0x2C1b868d6596a18e32E61B901E4060C872647b6C',
1624
1619
  symbol: 'WETH',
1625
1620
  decimals: 18,
1626
- chainId: ChainId.CZKT,
1621
+ chainId: ChainId.LNAT,
1627
1622
  coinKey: CoinKey.WETH,
1628
1623
  name: 'WETH',
1629
1624
  logoURI: 'https://zapper.fi/images/networks/ethereum/0x0000000000000000000000000000000000000000.png',
package/dist/step.d.ts CHANGED
@@ -75,7 +75,8 @@ export interface Execution {
75
75
  gasAmountUSD?: string;
76
76
  }
77
77
  export declare const emptyExecution: Execution;
78
- export type StepType = 'swap' | 'cross' | 'lifi' | 'custom' | 'protocol';
78
+ export declare const _StepType: readonly ["lifi", "swap", "cross", "protocol", "custom"];
79
+ export type StepType = (typeof _StepType)[number];
79
80
  export type StepTool = string;
80
81
  export interface StepBase {
81
82
  id: string;
@@ -89,12 +90,18 @@ export interface StepBase {
89
90
  execution?: Execution;
90
91
  transactionRequest?: providers.TransactionRequest;
91
92
  }
93
+ export interface DestinationCallInfo {
94
+ toContractAddress: string;
95
+ toContractCallData: string;
96
+ toFallbackAddress: string;
97
+ callDataGasLimit: string;
98
+ }
99
+ export type CallAction = Action & DestinationCallInfo;
92
100
  export interface SwapStep extends StepBase {
93
101
  type: 'swap';
94
102
  action: Action;
95
103
  estimate: Estimate;
96
104
  }
97
- export declare function isSwapStep(step: Step): step is SwapStep;
98
105
  export interface CrossStep extends StepBase {
99
106
  type: 'cross';
100
107
  action: Action;
@@ -105,24 +112,17 @@ export interface ProtocolStep extends StepBase {
105
112
  action: Action;
106
113
  estimate: Estimate;
107
114
  }
108
- export declare function isCrossStep(step: Step): step is CrossStep;
109
- export interface DestinationCallInfo {
110
- toContractAddress: string;
111
- toContractCallData: string;
112
- toFallbackAddress: string;
113
- callDataGasLimit: string;
114
- }
115
- export type CallAction = Action & DestinationCallInfo;
116
115
  export interface CustomStep extends StepBase {
117
116
  type: 'custom';
118
117
  action: CallAction;
119
118
  estimate: Estimate;
120
119
  }
121
- export declare function isCustomStep(step: Step): step is CustomStep;
122
- export declare function isProtocolStep(step: Step): step is ProtocolStep;
123
120
  export type Step = SwapStep | CrossStep | CustomStep | ProtocolStep;
124
- export type LifiStep = Omit<Step, 'type'> & {
125
- includedSteps: Step[];
126
- } & {
121
+ export interface LifiStep extends Omit<Step, 'type'> {
127
122
  type: 'lifi';
128
- };
123
+ includedSteps: Step[];
124
+ }
125
+ export declare function isSwapStep(step: Step): step is SwapStep;
126
+ export declare function isCrossStep(step: Step): step is CrossStep;
127
+ export declare function isProtocolStep(step: Step): step is ProtocolStep;
128
+ export declare function isCustomStep(step: Step): step is CustomStep;
package/dist/step.js CHANGED
@@ -2,15 +2,23 @@ export const emptyExecution = {
2
2
  status: 'NOT_STARTED',
3
3
  process: [],
4
4
  };
5
+ // STEP
6
+ export const _StepType = [
7
+ 'lifi',
8
+ 'swap',
9
+ 'cross',
10
+ 'protocol',
11
+ 'custom',
12
+ ];
5
13
  export function isSwapStep(step) {
6
14
  return step.type === 'swap';
7
15
  }
8
16
  export function isCrossStep(step) {
9
17
  return step.type === 'cross';
10
18
  }
11
- export function isCustomStep(step) {
12
- return step.type === 'custom';
13
- }
14
19
  export function isProtocolStep(step) {
15
20
  return step.type === 'protocol';
16
21
  }
22
+ export function isCustomStep(step) {
23
+ return step.type === 'custom';
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/types",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "description": "Types for the LI.FI stack",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/index.js",
@@ -73,23 +73,23 @@
73
73
  "ethers": "^5.7.2"
74
74
  },
75
75
  "devDependencies": {
76
- "@commitlint/cli": "^17.4.4",
76
+ "@commitlint/cli": "^17.5.1",
77
77
  "@commitlint/config-conventional": "^17.4.4",
78
78
  "@types/jest": "^29.5.0",
79
- "@typescript-eslint/eslint-plugin": "^5.55.0",
80
- "@typescript-eslint/parser": "^5.55.0",
81
- "eslint": "^8.36.0",
82
- "eslint-config-prettier": "^8.7.0",
79
+ "@typescript-eslint/eslint-plugin": "^5.58.0",
80
+ "@typescript-eslint/parser": "^5.58.0",
81
+ "eslint": "^8.38.0",
82
+ "eslint-config-prettier": "^8.8.0",
83
83
  "eslint-plugin-prettier": "^4.2.1",
84
84
  "husky": "^8.0.3",
85
85
  "jest": "^29.5.0",
86
- "lint-staged": "^13.2.0",
86
+ "lint-staged": "^13.2.1",
87
87
  "npm-run-all": "^4.1.5",
88
88
  "pinst": "^3.0.0",
89
- "prettier": "^2.8.4",
89
+ "prettier": "^2.8.7",
90
90
  "standard-version": "^9.5.0",
91
- "ts-jest": "^29.0.5",
92
- "typescript": "^5.0.2"
91
+ "ts-jest": "^29.1.0",
92
+ "typescript": "^5.0.4"
93
93
  },
94
94
  "directories": {
95
95
  "test": "test"