From ec2a25bd3d02cdeb6b56fad1b1a85c9c249dc697 Mon Sep 17 00:00:00 2001 From: Cameron Gilbert Date: Thu, 15 Aug 2024 09:52:44 -0400 Subject: [PATCH] chore: develop -> main (#370) * revert: cosmos submodule only (#362) * revert: cosmos submodule only * fix: rem * fix: rem * fix: update * feat: add msg client * fix: paths * fix: try chaosnet ibc * fix: path again * fix: try hm * fix: fixes to pass * feat: eth protos (#366) * fix: eth protos * fix: client * fix: fixes * fix: try older nibiru * fix: index * fix: mainnet * fix: import * revert: build change * chore: tests (#367) * fix: all query tests * chore: final tests * fix: buf * fix: fix * fix: pull latest * fix: build * fix: build * refactor(faucet)!: set default tokens (#369) * chore: develop -> main (#368) * revert: cosmos submodule only (#362) * revert: cosmos submodule only * fix: rem * fix: rem * fix: update * feat: add msg client * fix: paths * fix: try chaosnet ibc * fix: path again * fix: try hm * fix: fixes to pass * feat: eth protos (#366) * fix: eth protos * fix: client * fix: fixes * fix: try older nibiru * fix: index * fix: mainnet * fix: import * revert: build change * chore: tests (#367) * fix: all query tests * chore: final tests * fix: buf * fix: fix * fix: pull latest * fix: build * fix: build * chore(release): 4.5.1 ### [4.5.1](https://github.com/NibiruChain/ts-sdk/compare/v4.5.0...v4.5.1) (2024-08-09) ### Miscellaneous Chores * develop -> main ([#368](https://github.com/NibiruChain/ts-sdk/issues/368)) ([c6d6570](https://github.com/NibiruChain/ts-sdk/commit/c6d657009eed49442243c4b0e9021afd34392a98)), closes [#362](https://github.com/NibiruChain/ts-sdk/issues/362) [#366](https://github.com/NibiruChain/ts-sdk/issues/366) [#367](https://github.com/NibiruChain/ts-sdk/issues/367) [skip ci] * fix(faucet): remove unused tokens from default faucet request * fix: bump test --------- Co-authored-by: Cameron Gilbert Co-authored-by: semantic-release-bot --------- Co-authored-by: Kevin Yang <5478483+k-yang@users.noreply.github.com> Co-authored-by: semantic-release-bot --- src/sdk/utils/faucet.test.ts | 7 +++---- src/sdk/utils/faucet.ts | 19 ++----------------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/sdk/utils/faucet.test.ts b/src/sdk/utils/faucet.test.ts index ef3d4825..3e8d5c26 100644 --- a/src/sdk/utils/faucet.test.ts +++ b/src/sdk/utils/faucet.test.ts @@ -78,7 +78,7 @@ describe("useFaucet", () => { test("should request funds from faucet with default amounts", async () => { await useFaucet({ address, chain, grecaptcha }) - const expectedCoins = ["11000000unibi", "100000000unusd", "100000000uusdt"] + const expectedCoins = ["10000000unibi"] expect(fetch).toHaveBeenCalledWith(expectedUrl, { method: "POST", @@ -91,10 +91,9 @@ describe("useFaucet", () => { }) test("should request funds from faucet with custom amounts", async () => { - const amts = { nibi: 5, nusd: 50, usdt: 50 } - await useFaucet({ address, chain, amts, grecaptcha }) + await useFaucet({ address, chain, grecaptcha }) - const expectedCoins = ["5000000unibi", "50000000unusd", "50000000uusdt"] + const expectedCoins = ["10000000unibi"] expect(fetch).toHaveBeenCalledWith(expectedUrl, { method: "POST", diff --git a/src/sdk/utils/faucet.ts b/src/sdk/utils/faucet.ts index afa589ea..2c561efc 100644 --- a/src/sdk/utils/faucet.ts +++ b/src/sdk/utils/faucet.ts @@ -2,33 +2,18 @@ import { fetch } from "cross-fetch" import { Chain, chainToParts } from "." /** - * Sends 11 NIBI, 100 NUSD, and 100 USDT to the given address from the testnet faucet. + * Sends 10 NIBI to the given address from the testnet faucet. */ export async function useFaucet({ address, chain, - amts, grecaptcha, }: { address: string chain: Chain - amts?: { nibi: number; nusd: number; usdt: number } grecaptcha: string }): Promise { - if (!amts) { - // default values - amts = { - nibi: 11, - nusd: 100, - usdt: 100, - } - } - - const coins: string[] = [ - `${amts.nibi * 1e6}unibi`, - `${amts.nusd * 1e6}unusd`, - `${amts.usdt * 1e6}uusdt`, - ] + const coins: string[] = [`${10e6}unibi`] const faucetUrl = faucetUrlFromChain(chain) // Execute faucet request