@armory-sh/tokens 0.2.12 → 0.2.14
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 +41 -11
- package/dist/index.d.ts +1 -41
- package/dist/index.js +12 -194
- package/package.json +5 -7
package/README.md
CHANGED
|
@@ -1,21 +1,51 @@
|
|
|
1
1
|
# @armory-sh/tokens
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **⚠️ DEPRECATED** - This package is deprecated and will be removed in v3.0.0
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Migration
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
bun add @armory-sh/tokens
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Use
|
|
7
|
+
Import token constants from `@armory-sh/base` instead:
|
|
12
8
|
|
|
13
9
|
```typescript
|
|
14
|
-
|
|
10
|
+
// Old (deprecated)
|
|
11
|
+
import { TOKENS, USDC_BASE } from "@armory-sh/tokens";
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
// New
|
|
14
|
+
import { TOKENS, USDC_BASE } from "@armory-sh/base";
|
|
17
15
|
```
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
### Available Tokens
|
|
18
|
+
|
|
19
|
+
All token constants are now exported from `@armory-sh/base`:
|
|
20
|
+
|
|
21
|
+
- `TOKENS` - Collection of all tokens
|
|
22
|
+
- `USDC_BASE` - USDC on Base
|
|
23
|
+
- `EURC_BASE` - EURC on Base
|
|
24
|
+
- `USDC_BASE_SEPOLIA` - USDC on Base Sepolia
|
|
25
|
+
- `USDC_SKALE_BASE` - USDC on SKALE Base
|
|
26
|
+
- `USDT_SKALE_BASE` - USDT on SKALE Base
|
|
27
|
+
- `WBTC_SKALE_BASE` - WBTC on SKALE Base
|
|
28
|
+
- `WETH_SKALE_BASE` - WETH on SKALE Base
|
|
29
|
+
- `SKL_SKALE_BASE` - SKL on SKALE Base
|
|
30
|
+
- `USDC_SKALE_BASE_SEPOLIA` - USDC on SKALE Base Sepolia
|
|
31
|
+
- `USDT_SKALE_BASE_SEPOLIA` - USDT on SKALE Base Sepolia
|
|
32
|
+
- `WBTC_SKALE_BASE_SEPOLIA` - WBTC on SKALE Base Sepolia
|
|
33
|
+
- `WETH_SKALE_BASE_SEPOLIA` - WETH on SKALE Base Sepolia
|
|
34
|
+
- `SKL_SKALE_BASE_SEPOLIA` - SKL on SKALE Base Sepolia
|
|
20
35
|
|
|
21
|
-
|
|
36
|
+
### Helper Functions
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import {
|
|
40
|
+
getToken,
|
|
41
|
+
getAllTokens,
|
|
42
|
+
getTokensBySymbol,
|
|
43
|
+
getTokensByChain,
|
|
44
|
+
getUSDCTokens,
|
|
45
|
+
getEURCTokens,
|
|
46
|
+
getSKLTokens,
|
|
47
|
+
getUSDTokens,
|
|
48
|
+
getWBTCTokens,
|
|
49
|
+
getWETHTokens,
|
|
50
|
+
} from "@armory-sh/base";
|
|
51
|
+
```
|
package/dist/index.d.ts
CHANGED
|
@@ -1,42 +1,2 @@
|
|
|
1
|
-
import { CustomToken } from '@armory-sh/base';
|
|
2
1
|
|
|
3
|
-
|
|
4
|
-
declare const EURC_BASE: CustomToken;
|
|
5
|
-
declare const USDC_BASE_SEPOLIA: CustomToken;
|
|
6
|
-
declare const USDC_SKALE_BASE: CustomToken;
|
|
7
|
-
declare const SKL_SKALE_BASE: CustomToken;
|
|
8
|
-
declare const USDT_SKALE_BASE: CustomToken;
|
|
9
|
-
declare const WBTC_SKALE_BASE: CustomToken;
|
|
10
|
-
declare const WETH_SKALE_BASE: CustomToken;
|
|
11
|
-
declare const SKL_SKALE_BASE_SEPOLIA: CustomToken;
|
|
12
|
-
declare const USDC_SKALE_BASE_SEPOLIA: CustomToken;
|
|
13
|
-
declare const USDT_SKALE_BASE_SEPOLIA: CustomToken;
|
|
14
|
-
declare const WBTC_SKALE_BASE_SEPOLIA: CustomToken;
|
|
15
|
-
declare const WETH_SKALE_BASE_SEPOLIA: CustomToken;
|
|
16
|
-
declare const TOKENS: {
|
|
17
|
-
readonly USDC_BASE: CustomToken;
|
|
18
|
-
readonly USDC_BASE_SEPOLIA: CustomToken;
|
|
19
|
-
readonly EURC_BASE: CustomToken;
|
|
20
|
-
readonly USDC_SKALE_BASE: CustomToken;
|
|
21
|
-
readonly USDT_SKALE_BASE: CustomToken;
|
|
22
|
-
readonly WBTC_SKALE_BASE: CustomToken;
|
|
23
|
-
readonly WETH_SKALE_BASE: CustomToken;
|
|
24
|
-
readonly SKL_SKALE_BASE: CustomToken;
|
|
25
|
-
readonly SKL_SKALE_BASE_SEPOLIA: CustomToken;
|
|
26
|
-
readonly USDC_SKALE_BASE_SEPOLIA: CustomToken;
|
|
27
|
-
readonly USDT_SKALE_BASE_SEPOLIA: CustomToken;
|
|
28
|
-
readonly WBTC_SKALE_BASE_SEPOLIA: CustomToken;
|
|
29
|
-
readonly WETH_SKALE_BASE_SEPOLIA: CustomToken;
|
|
30
|
-
};
|
|
31
|
-
declare function getToken(chainId: number, contractAddress: string): CustomToken | undefined;
|
|
32
|
-
declare function getAllTokens(): CustomToken[];
|
|
33
|
-
declare function getTokensBySymbol(symbol: string): CustomToken[];
|
|
34
|
-
declare function getTokensByChain(chainId: number): CustomToken[];
|
|
35
|
-
declare function getUSDCTokens(): CustomToken[];
|
|
36
|
-
declare function getEURCTokens(): CustomToken[];
|
|
37
|
-
declare function getSKLTokens(): CustomToken[];
|
|
38
|
-
declare function getUSDTokens(): CustomToken[];
|
|
39
|
-
declare function getWBTCTokens(): CustomToken[];
|
|
40
|
-
declare function getWETHTokens(): CustomToken[];
|
|
41
|
-
|
|
42
|
-
export { EURC_BASE, SKL_SKALE_BASE, SKL_SKALE_BASE_SEPOLIA, TOKENS, USDC_BASE, USDC_BASE_SEPOLIA, USDC_SKALE_BASE, USDC_SKALE_BASE_SEPOLIA, USDT_SKALE_BASE, USDT_SKALE_BASE_SEPOLIA, WBTC_SKALE_BASE, WBTC_SKALE_BASE_SEPOLIA, WETH_SKALE_BASE, WETH_SKALE_BASE_SEPOLIA, getAllTokens, getEURCTokens, getSKLTokens, getToken, getTokensByChain, getTokensBySymbol, getUSDCTokens, getUSDTokens, getWBTCTokens, getWETHTokens };
|
|
2
|
+
export { }
|
package/dist/index.js
CHANGED
|
@@ -1,195 +1,13 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
registerToken(USDC_BASE);
|
|
16
|
-
var EURC_BASE = {
|
|
17
|
-
symbol: "EURC",
|
|
18
|
-
name: "EURC",
|
|
19
|
-
version: "2",
|
|
20
|
-
contractAddress: "0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42",
|
|
21
|
-
chainId: 8453,
|
|
22
|
-
decimals: 6
|
|
23
|
-
};
|
|
24
|
-
registerToken(EURC_BASE);
|
|
25
|
-
var USDC_BASE_SEPOLIA = {
|
|
26
|
-
symbol: "USDC",
|
|
27
|
-
name: "USD Coin",
|
|
28
|
-
version: "2",
|
|
29
|
-
contractAddress: "0x036CbD5d9A3b9231f83BefBE4F9E3FAA03eee2e0",
|
|
30
|
-
chainId: 84532,
|
|
31
|
-
decimals: 6
|
|
32
|
-
};
|
|
33
|
-
registerToken(USDC_BASE_SEPOLIA);
|
|
34
|
-
var USDC_SKALE_BASE = {
|
|
35
|
-
symbol: "USDC",
|
|
36
|
-
name: "USD Coin",
|
|
37
|
-
version: "2",
|
|
38
|
-
contractAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
39
|
-
chainId: 1187947933,
|
|
40
|
-
decimals: 6
|
|
41
|
-
};
|
|
42
|
-
registerToken(USDC_SKALE_BASE);
|
|
43
|
-
var SKL_SKALE_BASE = {
|
|
44
|
-
symbol: "SKL",
|
|
45
|
-
name: "SKALE",
|
|
46
|
-
version: "1",
|
|
47
|
-
contractAddress: "0xaf2e1eb5c9f4a94dbf7400f76e4ec0d8de18fb8584",
|
|
48
|
-
chainId: 1187947933,
|
|
49
|
-
decimals: 18
|
|
50
|
-
};
|
|
51
|
-
registerToken(SKL_SKALE_BASE);
|
|
52
|
-
var USDT_SKALE_BASE = {
|
|
53
|
-
symbol: "USDT",
|
|
54
|
-
name: "Tether USD",
|
|
55
|
-
version: "1",
|
|
56
|
-
contractAddress: "0x2bF5bF154b4881Ef4E3Ff28Ac1a60Fa1aDcb5fE5F6",
|
|
57
|
-
chainId: 1187947933,
|
|
58
|
-
decimals: 6
|
|
59
|
-
};
|
|
60
|
-
registerToken(USDT_SKALE_BASE);
|
|
61
|
-
var WBTC_SKALE_BASE = {
|
|
62
|
-
symbol: "WBTC",
|
|
63
|
-
name: "Wrapped BTC",
|
|
64
|
-
version: "1",
|
|
65
|
-
contractAddress: "0x1aee79F6316aD699F96468A32F7BaF2fD8d55c0000",
|
|
66
|
-
chainId: 1187947933,
|
|
67
|
-
decimals: 8
|
|
68
|
-
};
|
|
69
|
-
registerToken(WBTC_SKALE_BASE);
|
|
70
|
-
var WETH_SKALE_BASE = {
|
|
71
|
-
symbol: "WETH",
|
|
72
|
-
name: "Wrapped Ether",
|
|
73
|
-
version: "1",
|
|
74
|
-
contractAddress: "0x8fF2237e4d845bc7Db6E1f1a93C8bCb288Bc5a400",
|
|
75
|
-
chainId: 1187947933,
|
|
76
|
-
decimals: 18
|
|
77
|
-
};
|
|
78
|
-
registerToken(WETH_SKALE_BASE);
|
|
79
|
-
var SKL_SKALE_BASE_SEPOLIA = {
|
|
80
|
-
symbol: "SKL",
|
|
81
|
-
name: "SKALE",
|
|
82
|
-
version: "1",
|
|
83
|
-
contractAddress: "0xaf2e1eb5c9f4a94dbf7400f76e4ec0d8de18fb8584",
|
|
84
|
-
chainId: 324705682,
|
|
85
|
-
decimals: 18
|
|
86
|
-
};
|
|
87
|
-
registerToken(SKL_SKALE_BASE_SEPOLIA);
|
|
88
|
-
var USDC_SKALE_BASE_SEPOLIA = {
|
|
89
|
-
symbol: "USDC",
|
|
90
|
-
name: "USD Coin",
|
|
91
|
-
version: "2",
|
|
92
|
-
contractAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
93
|
-
chainId: 324705682,
|
|
94
|
-
decimals: 6
|
|
95
|
-
};
|
|
96
|
-
registerToken(USDC_SKALE_BASE_SEPOLIA);
|
|
97
|
-
var USDT_SKALE_BASE_SEPOLIA = {
|
|
98
|
-
symbol: "USDT",
|
|
99
|
-
name: "Tether USD",
|
|
100
|
-
version: "1",
|
|
101
|
-
contractAddress: "0xe8af39ca6558a983f6b5f8c0b828cc609f7a1c200",
|
|
102
|
-
chainId: 324705682,
|
|
103
|
-
decimals: 6
|
|
104
|
-
};
|
|
105
|
-
registerToken(USDT_SKALE_BASE_SEPOLIA);
|
|
106
|
-
var WBTC_SKALE_BASE_SEPOLIA = {
|
|
107
|
-
symbol: "WBTC",
|
|
108
|
-
name: "Wrapped BTC",
|
|
109
|
-
version: "1",
|
|
110
|
-
contractAddress: "0x1aee79F6316aD699F96468A32F7BaF2fD8d55c0000",
|
|
111
|
-
chainId: 324705682,
|
|
112
|
-
decimals: 8
|
|
113
|
-
};
|
|
114
|
-
registerToken(WBTC_SKALE_BASE_SEPOLIA);
|
|
115
|
-
var WETH_SKALE_BASE_SEPOLIA = {
|
|
116
|
-
symbol: "WETH",
|
|
117
|
-
name: "Wrapped Ether",
|
|
118
|
-
version: "1",
|
|
119
|
-
contractAddress: "0x8fF2237e4d845bc7Db6E1f1a93C8bCb288Bc5a400",
|
|
120
|
-
chainId: 324705682,
|
|
121
|
-
decimals: 18
|
|
122
|
-
};
|
|
123
|
-
registerToken(WETH_SKALE_BASE_SEPOLIA);
|
|
124
|
-
var TOKENS = {
|
|
125
|
-
USDC_BASE,
|
|
126
|
-
USDC_BASE_SEPOLIA,
|
|
127
|
-
EURC_BASE,
|
|
128
|
-
USDC_SKALE_BASE,
|
|
129
|
-
USDT_SKALE_BASE,
|
|
130
|
-
WBTC_SKALE_BASE,
|
|
131
|
-
WETH_SKALE_BASE,
|
|
132
|
-
SKL_SKALE_BASE,
|
|
133
|
-
SKL_SKALE_BASE_SEPOLIA,
|
|
134
|
-
USDC_SKALE_BASE_SEPOLIA,
|
|
135
|
-
USDT_SKALE_BASE_SEPOLIA,
|
|
136
|
-
WBTC_SKALE_BASE_SEPOLIA,
|
|
137
|
-
WETH_SKALE_BASE_SEPOLIA
|
|
138
|
-
};
|
|
139
|
-
function getToken(chainId, contractAddress) {
|
|
140
|
-
const key = `${chainId}:${contractAddress.toLowerCase()}`;
|
|
141
|
-
return tokenRegistry.get(key);
|
|
142
|
-
}
|
|
143
|
-
function getAllTokens() {
|
|
144
|
-
return Array.from(tokenRegistry.values());
|
|
145
|
-
}
|
|
146
|
-
function getTokensBySymbol(symbol) {
|
|
147
|
-
return getAllTokens().filter((t) => t.symbol.toUpperCase() === symbol.toUpperCase());
|
|
148
|
-
}
|
|
149
|
-
function getTokensByChain(chainId) {
|
|
150
|
-
return getAllTokens().filter((t) => t.chainId === chainId);
|
|
151
|
-
}
|
|
152
|
-
function getUSDCTokens() {
|
|
153
|
-
return getTokensBySymbol("USDC");
|
|
154
|
-
}
|
|
155
|
-
function getEURCTokens() {
|
|
156
|
-
return getTokensBySymbol("EURC");
|
|
157
|
-
}
|
|
158
|
-
function getSKLTokens() {
|
|
159
|
-
return getTokensBySymbol("SKL");
|
|
160
|
-
}
|
|
161
|
-
function getUSDTokens() {
|
|
162
|
-
return getTokensBySymbol("USDT");
|
|
163
|
-
}
|
|
164
|
-
function getWBTCTokens() {
|
|
165
|
-
return getTokensBySymbol("WBTC");
|
|
166
|
-
}
|
|
167
|
-
function getWETHTokens() {
|
|
168
|
-
return getTokensBySymbol("WETH");
|
|
169
|
-
}
|
|
170
|
-
export {
|
|
171
|
-
EURC_BASE,
|
|
172
|
-
SKL_SKALE_BASE,
|
|
173
|
-
SKL_SKALE_BASE_SEPOLIA,
|
|
174
|
-
TOKENS,
|
|
175
|
-
USDC_BASE,
|
|
176
|
-
USDC_BASE_SEPOLIA,
|
|
177
|
-
USDC_SKALE_BASE,
|
|
178
|
-
USDC_SKALE_BASE_SEPOLIA,
|
|
179
|
-
USDT_SKALE_BASE,
|
|
180
|
-
USDT_SKALE_BASE_SEPOLIA,
|
|
181
|
-
WBTC_SKALE_BASE,
|
|
182
|
-
WBTC_SKALE_BASE_SEPOLIA,
|
|
183
|
-
WETH_SKALE_BASE,
|
|
184
|
-
WETH_SKALE_BASE_SEPOLIA,
|
|
185
|
-
getAllTokens,
|
|
186
|
-
getEURCTokens,
|
|
187
|
-
getSKLTokens,
|
|
188
|
-
getToken,
|
|
189
|
-
getTokensByChain,
|
|
190
|
-
getTokensBySymbol,
|
|
191
|
-
getUSDCTokens,
|
|
192
|
-
getUSDTokens,
|
|
193
|
-
getWBTCTokens,
|
|
194
|
-
getWETHTokens
|
|
195
|
-
};
|
|
2
|
+
var DEPRECATION_MESSAGE = `
|
|
3
|
+
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
4
|
+
\u2551 DEPRECATED: @armory-sh/tokens \u2551
|
|
5
|
+
\u2551 \u2551
|
|
6
|
+
\u2551 This package is deprecated and will be removed in v3.0.0. \u2551
|
|
7
|
+
\u2551 \u2551
|
|
8
|
+
\u2551 Migration: \u2551
|
|
9
|
+
\u2551 import { TOKENS, USDC_BASE } from "@armory-sh/base"; \u2551
|
|
10
|
+
\u2551 \u2551
|
|
11
|
+
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
12
|
+
`;
|
|
13
|
+
console.warn(DEPRECATION_MESSAGE);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@armory-sh/tokens",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Sawyer Cutler <sawyer@dirtroad.dev>",
|
|
6
6
|
"type": "module",
|
|
@@ -26,15 +26,13 @@
|
|
|
26
26
|
"url": "git+https://github.com/thegreataxios/armory.git",
|
|
27
27
|
"directory": "packages/tokens"
|
|
28
28
|
},
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"@armory-sh/base": "^0.2.14"
|
|
31
|
-
},
|
|
29
|
+
"dependencies": {},
|
|
32
30
|
"devDependencies": {
|
|
33
31
|
"typescript": "5.9.3",
|
|
34
|
-
"bun-types": "latest"
|
|
32
|
+
"bun-types": "latest",
|
|
33
|
+
"tsup": "8.3.5"
|
|
35
34
|
},
|
|
36
35
|
"scripts": {
|
|
37
|
-
"build": "rm -rf dist && tsup"
|
|
38
|
-
"test": "bun test"
|
|
36
|
+
"build": "rm -rf dist && tsup"
|
|
39
37
|
}
|
|
40
38
|
}
|