Skip to content
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

API key for "@tatumio/api-client" #1117

Closed
fl0ydj opened this issue Jun 28, 2024 · 5 comments
Closed

API key for "@tatumio/api-client" #1117

fl0ydj opened this issue Jun 28, 2024 · 5 comments

Comments

@fl0ydj
Copy link

fl0ydj commented Jun 28, 2024

Describe the bug
I have been using classes exposed by @tatumio/api-client (e.g. BitcoinService). Recently I started getting 401s that I have to add an API key. However, there is no option to add an api key (differently to the standard tatum SDK.

To Reproduce

import {
  BitcoinService,
} from "@tatumio/api-client";
await BitcoinService.btcGetBlockChainInfo();

Additional context
SDK version:

    "@tatumio/api-client": "^2.2.81",
    "@tatumio/tatum": "^4.2.35",
@fl0ydj
Copy link
Author

fl0ydj commented Jul 4, 2024

Any help would be appreciated!

@Hathoriel
Copy link
Member

Hathoriel commented Jul 4, 2024

Hello @fl0ydj
You can declare api client like this

import { TatumBtcSDK } from '@tatumio/btc'

const btcSDK = TatumBtcSDK({ apiKey: 'your-api-key' })
const { mnemonic, xpub } = await btcSDK.wallet.generateWallet()

console.log(`Created a wallet with ${mnemonic} and public key ${xpub}.`)

For more examples check out https://github.com/tatumio/tatum-js/tree/v2/examples.
Have a nice day.

@fl0ydj
Copy link
Author

fl0ydj commented Jul 4, 2024

Hey @Hathoriel,
my question is about the "@tatumio/api-client". There you can't pass an argument for the api key.
E.g.

import {
  BitcoinService,
} from "@tatumio/api-client";
await BitcoinService.btcGetBlockChainInfo();

@fl0ydj
Copy link
Author

fl0ydj commented Jul 4, 2024

Ok seeing now that the SDK reexports the api client fully.
Thanks for the pointer then.

@fl0ydj
Copy link
Author

fl0ydj commented Jul 4, 2024

Ok nope doesnt fix this. Opened a new issue for this specifically then: #1119

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

No branches or pull requests

2 participants