@swapkit/helpers 1.0.0-rc.60 → 1.0.0-rc.62
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.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +49 -47
- package/dist/index.es.js.map +1 -1
- package/package.json +3 -3
- package/src/helpers/asset.ts +12 -4
package/src/helpers/asset.ts
CHANGED
|
@@ -5,7 +5,12 @@ import { RequestClient } from '../index.ts';
|
|
|
5
5
|
|
|
6
6
|
const getDecimalMethodHex = '0x313ce567';
|
|
7
7
|
|
|
8
|
-
export type CommonAssetString =
|
|
8
|
+
export type CommonAssetString =
|
|
9
|
+
| `${Chain.Maya}.MAYA`
|
|
10
|
+
| `${Chain.Ethereum}.THOR`
|
|
11
|
+
| `${Chain.Ethereum}.vTHOR`
|
|
12
|
+
| `${Chain.Kujira}.USK`
|
|
13
|
+
| Chain;
|
|
9
14
|
|
|
10
15
|
const getContractDecimals = async ({ chain, to }: { chain: EVMChain; to: string }) => {
|
|
11
16
|
try {
|
|
@@ -108,9 +113,9 @@ export const getCommonAssetInfo = (
|
|
|
108
113
|
assetString: CommonAssetString,
|
|
109
114
|
): { identifier: string; decimal: number } => {
|
|
110
115
|
switch (assetString) {
|
|
111
|
-
case
|
|
116
|
+
case `${Chain.Ethereum}.THOR`:
|
|
112
117
|
return { identifier: 'ETH.THOR-0xa5f2211b9b8170f694421f2046281775e8468044', decimal: 18 };
|
|
113
|
-
case
|
|
118
|
+
case `${Chain.Ethereum}.vTHOR`:
|
|
114
119
|
return { identifier: 'ETH.vTHOR-0x815c23eca83261b6ec689b60cc4a58b54bc24d8d', decimal: 18 };
|
|
115
120
|
|
|
116
121
|
case Chain.Cosmos:
|
|
@@ -121,9 +126,12 @@ export const getCommonAssetInfo = (
|
|
|
121
126
|
return { identifier: 'BSC.BNB', decimal: BaseDecimal[assetString] };
|
|
122
127
|
case Chain.Maya:
|
|
123
128
|
return { identifier: 'MAYA.CACAO', decimal: BaseDecimal.MAYA };
|
|
124
|
-
case
|
|
129
|
+
case `${Chain.Maya}.MAYA`:
|
|
125
130
|
return { identifier: 'MAYA.MAYA', decimal: 4 };
|
|
126
131
|
|
|
132
|
+
case `${Chain.Kujira}.USK`:
|
|
133
|
+
return { identifier: `${Chain.Kujira}.USK`, decimal: 6 };
|
|
134
|
+
|
|
127
135
|
case Chain.Kujira:
|
|
128
136
|
case Chain.Arbitrum:
|
|
129
137
|
case Chain.Optimism:
|