Add support for token denom $Z #2

Merged
nabarun merged 4 commits from pm-update-denom into main 2025-06-24 07:24:41 +00:00
5 changed files with 17 additions and 2 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
node_modules
dist
db

1
.npmrc Normal file
View File

@ -0,0 +1 @@
@laconic-network:registry=https://git.vdb.to/api/packages/LaconicNetwork/npm/

View File

@ -23,6 +23,7 @@
"@cosmjs/encoding": "^0.33.1",
"@cosmjs/proto-signing": "^0.33.1",
"@cosmjs/stargate": "^0.33.1",
"@laconic-network/cosmjs-util": "^0.1.0",
"@keyv/sqlite": "^3.6.7",
"cors": "^2.8.5",
"express": "^4.19.2",

View File

@ -6,11 +6,13 @@ import toml from 'toml';
import cors from 'cors';
import { DirectSecp256k1Wallet } from '@cosmjs/proto-signing';
import { GasPrice, SigningStargateClient } from '@cosmjs/stargate';
import { SigningStargateClient } from '@cosmjs/stargate';
import { Comet38Client } from '@cosmjs/tendermint-rpc';
import { fromBech32 } from '@cosmjs/encoding';
import KeyvSqlite from '@keyv/sqlite';
import { parseCustomGasPrice } from '@laconic-network/cosmjs-util';
const CONFIG_PATH = 'environments/local.toml';
const FAUCET_DATA_FILE = 'faucet_data.sqlite';
const FAUCET_DATA_TTL = 86400000; // 24 hrs
@ -123,7 +125,7 @@ async function sendTokens (config: Config, recipientAddress: string, amount: str
const client = await SigningStargateClient.createWithSigner(
cometClient,
wallet,
{ gasPrice: GasPrice.fromString(`${config.upstream.gasPrice}${config.upstream.denom}`) }
{ gasPrice: parseCustomGasPrice(`${config.upstream.gasPrice}${config.upstream.denom}`) }
);
const result = await client.sendTokens(

View File

@ -201,6 +201,14 @@
dependencies:
sqlite3 "^5.1.7"
"@laconic-network/cosmjs-util@^0.1.0":
version "0.1.0"
resolved "https://git.vdb.to/api/packages/LaconicNetwork/npm/%40laconic-network%2Fcosmjs-util/-/0.1.0/cosmjs-util-0.1.0.tgz#899af1de6101834e42c68aa684a00f51f7b913ed"
integrity sha512-18Gez/2FwDkLf/de1x6httgtwrj+9jldc7V6Or0KGGtboQgKPUC6G5RebowpeWR/d9GVORV3ha8H2PpCtH4XMQ==
dependencies:
"@cosmjs/math" "^0.33.1"
"@cosmjs/stargate" "^0.33.1"
"@noble/hashes@^1":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426"