-
Notifications
You must be signed in to change notification settings - Fork 4
feat: wallet balance component #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
31d34cd to
1d6a9b3
Compare
8ca25a5 to
d79362d
Compare
9b13406 to
d7e4c34
Compare
| * @returns boolean | ||
| * @returns void | ||
| * | ||
| * TODO: this endpoint doesn't work, returns TypeError: Only absolute URLs are supported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi @avkos
There was a problem hiding this comment.
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);
});
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
our sdk return boolean
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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')
There was a problem hiding this comment.
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[]>( |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
d00025c to
715535c
Compare
715535c to
bc628f4
Compare
Closes #56
Closes #25