Skip to content

Commit

Permalink
Merge branch 'main' into v3.1.X
Browse files Browse the repository at this point in the history
  • Loading branch information
menefrego15 committed Nov 18, 2024
2 parents 6a6304e + 2444640 commit e0d5a17
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kilnfi/sdk",
"version": "3.1.16",
"version": "3.1.17",
"autor": "Kiln <[email protected]> (https://kiln.fi)",
"license": "BUSL-1.1",
"description": "JavaScript sdk for Kiln API",
Expand Down
35 changes: 35 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,38 @@ export const compressPublicKey = (pubkey: string): string => {
const compressed_key = Buffer.concat([new Uint8Array(Buffer.from(prefix, 'hex')), x]);
return compressed_key.toString('hex');
};

// Convert ATOM to uATOM
export const atomToUatom = (atom: string): bigint => {
return parseUnits(atom, 6);
};

// Convert DYDX to adydx
export const dydxToAdydx = (dydx: string): bigint => {
return parseUnits(dydx, 18); // adydx uses 18 decimals
};

// Convert ZETA to azeta
export const zetaToAzeta = (zeta: string): bigint => {
return parseUnits(zeta, 18); // azeta uses 18 decimals
};

// Convert OSMO to uosmo
export const osmoToUosmo = (osmo: string): bigint => {
return parseUnits(osmo, 6);
};

// Convert INJ to inj
export const injToInj = (inj: string): bigint => {
return parseUnits(inj, 18); // inj uses 18 decimals
};

// Convert TIA to utia
export const tiaToUtia = (tia: string): bigint => {
return parseUnits(tia, 6);
};

// Convert FET to afet
export const fetToAfet = (fet: string): bigint => {
return parseUnits(fet, 18); // afet uses 18 decimals
};

0 comments on commit e0d5a17

Please sign in to comment.