@1delta/wnative 0.0.4 → 0.0.7
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/dist/index.js +21 -0
- package/dist/index.mjs +19 -1
- package/dist/wnative.d.ts +8 -0
- package/package.json +3 -4
package/dist/index.js
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// src/wnative.ts
|
|
4
|
+
function getWrappedNativeAddress(chainId) {
|
|
5
|
+
const info = WRAPPED_NATIVE_INFO[String(chainId)];
|
|
6
|
+
if (!info) throw new Error(`No wrapped native for chain ${chainId}`);
|
|
7
|
+
return info.address;
|
|
8
|
+
}
|
|
9
|
+
function getWrappedNativeAddressSafe(chainId) {
|
|
10
|
+
return WRAPPED_NATIVE_INFO[String(chainId)]?.address;
|
|
11
|
+
}
|
|
12
|
+
function getWrappedNativeAddressLower(chainId) {
|
|
13
|
+
return getWrappedNativeAddress(chainId).toLowerCase();
|
|
14
|
+
}
|
|
4
15
|
var WRAPPED_NATIVE_INFO = {
|
|
5
16
|
"1": {
|
|
6
17
|
chainId: "1",
|
|
@@ -107,6 +118,13 @@ var WRAPPED_NATIVE_INFO = {
|
|
|
107
118
|
address: "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270",
|
|
108
119
|
decimals: 18
|
|
109
120
|
},
|
|
121
|
+
"143": {
|
|
122
|
+
chainId: "143",
|
|
123
|
+
name: "Wrapped MON",
|
|
124
|
+
symbol: "WMON",
|
|
125
|
+
address: "0x3bd359c1119da7da1d913d1c4d2b7c461115433a",
|
|
126
|
+
decimals: 18
|
|
127
|
+
},
|
|
110
128
|
"146": {
|
|
111
129
|
chainId: "146",
|
|
112
130
|
name: "Wrapped Sonic",
|
|
@@ -677,3 +695,6 @@ var WRAPPED_NATIVE_INFO = {
|
|
|
677
695
|
};
|
|
678
696
|
|
|
679
697
|
exports.WRAPPED_NATIVE_INFO = WRAPPED_NATIVE_INFO;
|
|
698
|
+
exports.getWrappedNativeAddress = getWrappedNativeAddress;
|
|
699
|
+
exports.getWrappedNativeAddressLower = getWrappedNativeAddressLower;
|
|
700
|
+
exports.getWrappedNativeAddressSafe = getWrappedNativeAddressSafe;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
// src/wnative.ts
|
|
2
|
+
function getWrappedNativeAddress(chainId) {
|
|
3
|
+
const info = WRAPPED_NATIVE_INFO[String(chainId)];
|
|
4
|
+
if (!info) throw new Error(`No wrapped native for chain ${chainId}`);
|
|
5
|
+
return info.address;
|
|
6
|
+
}
|
|
7
|
+
function getWrappedNativeAddressSafe(chainId) {
|
|
8
|
+
return WRAPPED_NATIVE_INFO[String(chainId)]?.address;
|
|
9
|
+
}
|
|
10
|
+
function getWrappedNativeAddressLower(chainId) {
|
|
11
|
+
return getWrappedNativeAddress(chainId).toLowerCase();
|
|
12
|
+
}
|
|
2
13
|
var WRAPPED_NATIVE_INFO = {
|
|
3
14
|
"1": {
|
|
4
15
|
chainId: "1",
|
|
@@ -105,6 +116,13 @@ var WRAPPED_NATIVE_INFO = {
|
|
|
105
116
|
address: "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270",
|
|
106
117
|
decimals: 18
|
|
107
118
|
},
|
|
119
|
+
"143": {
|
|
120
|
+
chainId: "143",
|
|
121
|
+
name: "Wrapped MON",
|
|
122
|
+
symbol: "WMON",
|
|
123
|
+
address: "0x3bd359c1119da7da1d913d1c4d2b7c461115433a",
|
|
124
|
+
decimals: 18
|
|
125
|
+
},
|
|
108
126
|
"146": {
|
|
109
127
|
chainId: "146",
|
|
110
128
|
name: "Wrapped Sonic",
|
|
@@ -674,4 +692,4 @@ var WRAPPED_NATIVE_INFO = {
|
|
|
674
692
|
}
|
|
675
693
|
};
|
|
676
694
|
|
|
677
|
-
export { WRAPPED_NATIVE_INFO };
|
|
695
|
+
export { WRAPPED_NATIVE_INFO, getWrappedNativeAddress, getWrappedNativeAddressLower, getWrappedNativeAddressSafe };
|
package/dist/wnative.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { WrappedNativeInfo } from './types';
|
|
2
|
+
type ChainIdLike = string | number;
|
|
3
|
+
/** Get the wrapped native token address for a chain. Throws if not found. */
|
|
4
|
+
export declare function getWrappedNativeAddress(chainId: ChainIdLike): string;
|
|
5
|
+
/** Get the wrapped native token address for a chain, or undefined if not found. */
|
|
6
|
+
export declare function getWrappedNativeAddressSafe(chainId: ChainIdLike): string | undefined;
|
|
7
|
+
/** Get the wrapped native token address (lowercase) for a chain. Throws if not found. */
|
|
8
|
+
export declare function getWrappedNativeAddressLower(chainId: ChainIdLike): string;
|
|
2
9
|
export declare const WRAPPED_NATIVE_INFO: WrappedNativeInfo;
|
|
10
|
+
export {};
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.0.
|
|
7
|
+
"version": "0.0.7",
|
|
8
8
|
"description": "Hold wnative currency data",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist"
|
|
@@ -16,10 +16,9 @@
|
|
|
16
16
|
"main": "dist/index.js",
|
|
17
17
|
"types": "dist/index.d.ts",
|
|
18
18
|
"module": "dist/index.mjs",
|
|
19
|
-
"dependencies": {},
|
|
20
19
|
"devDependencies": {
|
|
21
|
-
"tsup": "^8.5.
|
|
22
|
-
"typescript": "^5.
|
|
20
|
+
"tsup": "^8.5.1",
|
|
21
|
+
"typescript": "^5.9.3"
|
|
23
22
|
},
|
|
24
23
|
"engines": {
|
|
25
24
|
"node": ">=20"
|