Skip to content

Commit e0d5a17

Browse files
committed
Merge branch 'main' into v3.1.X
2 parents 6a6304e + 2444640 commit e0d5a17

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kilnfi/sdk",
3-
"version": "3.1.16",
3+
"version": "3.1.17",
44
"autor": "Kiln <[email protected]> (https://kiln.fi)",
55
"license": "BUSL-1.1",
66
"description": "JavaScript sdk for Kiln API",

src/utils.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,38 @@ export const compressPublicKey = (pubkey: string): string => {
204204
const compressed_key = Buffer.concat([new Uint8Array(Buffer.from(prefix, 'hex')), x]);
205205
return compressed_key.toString('hex');
206206
};
207+
208+
// Convert ATOM to uATOM
209+
export const atomToUatom = (atom: string): bigint => {
210+
return parseUnits(atom, 6);
211+
};
212+
213+
// Convert DYDX to adydx
214+
export const dydxToAdydx = (dydx: string): bigint => {
215+
return parseUnits(dydx, 18); // adydx uses 18 decimals
216+
};
217+
218+
// Convert ZETA to azeta
219+
export const zetaToAzeta = (zeta: string): bigint => {
220+
return parseUnits(zeta, 18); // azeta uses 18 decimals
221+
};
222+
223+
// Convert OSMO to uosmo
224+
export const osmoToUosmo = (osmo: string): bigint => {
225+
return parseUnits(osmo, 6);
226+
};
227+
228+
// Convert INJ to inj
229+
export const injToInj = (inj: string): bigint => {
230+
return parseUnits(inj, 18); // inj uses 18 decimals
231+
};
232+
233+
// Convert TIA to utia
234+
export const tiaToUtia = (tia: string): bigint => {
235+
return parseUnits(tia, 6);
236+
};
237+
238+
// Convert FET to afet
239+
export const fetToAfet = (fet: string): bigint => {
240+
return parseUnits(fet, 18); // afet uses 18 decimals
241+
};

0 commit comments

Comments
 (0)