这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@krzysu
Copy link
Contributor

@krzysu krzysu commented Dec 9, 2024

Closes #56
Closes #25

  • Adds components to display wallet details and balance.
  • Adds wallet page to the demo app
Screenshot 2024-12-10 at 14 30 18 Screenshot 2024-12-10 at 14 30 00

@krzysu krzysu force-pushed the 56-wallet-balance branch 3 times, most recently from 31d34cd to 1d6a9b3 Compare December 9, 2024 16:33
@krzysu krzysu marked this pull request as ready for review December 10, 2024 13:17
* @returns boolean
* @returns void
*
* TODO: this endpoint doesn't work, returns TypeError: Only absolute URLs are supported
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi @avkos

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it works in tests.

describe('Faucet Api', () => {
  const faucetApi = new FaucetApi(apikey, BASE_URL);

  it('Request native token', async () => {
    const res = await faucetApi.request({
      blockchain: BLOCKCHAIN.ETH_SEPOLIA,
      address: ETH_SEPOLIA_WALLET_ADDRESS,
      native: true,
    });
    expect(res).toBe(true);
  });

  it('Request eurc token', async () => {
    const res = await faucetApi.request({
      blockchain: BLOCKCHAIN.ETH_SEPOLIA,
      address: ETH_SEPOLIA_WALLET_ADDRESS,
      eurc: true,
    });
    expect(res).toBe(true);
  });

  it('Request usdc token', async () => {
    const res = await faucetApi.request({
      blockchain: BLOCKCHAIN.ETH_SEPOLIA,
      address: ETH_SEPOLIA_WALLET_ADDRESS,
      usdc: true,
    });
    expect(res).toBe(true);
  });
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our sdk return boolean

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change to void in next PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it from just a simple node script and faucet works fine, so it must be something with remix then, I will investigate, sorry.
you can keep boolean return, there was a bug with 'wallet' part though in here, no?

------------------------------------------------------ ⬇️ (unnecessary)
await this.postRequest<void>('/faucet/drips', params, 'wallets')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after pulling latest version from main it also works in the webapp, seems you fixed something in your last PR 😄

async balance(params: WalletBalanceParameters): Promise<WalletTokenBalance[]> {
const { id, ...rest } = params;
return this.getRequest<WalletTokenBalances>(
return this.getRequest<WalletTokenBalance[]>(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi @avkos (the return type was wrong)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@krzysu krzysu merged commit c8fe891 into main Dec 11, 2024
2 checks passed
@krzysu krzysu deleted the 56-wallet-balance branch December 11, 2024 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Component that displays wallet native balance Component that displays wallet ERC20 token balances

3 participants