This is an example application demonstrating the use of various extensions. Dive in to learn more!
yarn install
yarn example
The application comprises the following packages:
- @tatumio/tatum
- @tatumio/hello-world
- @tatumio/configurable-extension
The application initializes Tatum SDK with two extensions:
const tatumSdk = await TatumSDK.init<Ethereum>({
network: Network.ETHEREUM_SEPOLIA,
version: ApiVersion.V3,
configureExtensions: [
HelloWorldExtension,
{type: ConfigurableExtension, config: {configurationValue: 'CONFIGURED VALUE'}},
]
})
- It invokes the
sayHello()
method fromHelloWorldExtension
:
await tatumSdk.extension(HelloWorldExtension).sayHello()
- It then calls the
sayHelloWithConfiguration()
method fromConfigurableExtension
:
await tatumSdk.extension(ConfigurableExtension).sayHelloWithConfiguration()
Finally, it disposes the SDK, which also disposes all extensions:
tatumSdk.dispose()
[HelloWorldExtension] initialised
[ConfigurableExtension] initialised
[HelloWorldExtension] Hello World
[HelloWorldExtension] Getting network from TatumSDK configuration: ethereum-sepolia
[HelloWorldExtension] Getting base fee for the network from TatumSDK FeeEvm module: 10.735841739
[HelloWorldExtension] Base Fee for ethereum-sepolia is 10.735841739
[ConfigurableExtension] Hello World
[ConfigurableExtension] Getting network from TatumSDK configuration: ethereum-sepolia
[ConfigurableExtension] Getting string from ConfigurableExtension configuration: CONFIGURED VALUE
[ConfigurableExtension] Getting base fee for the network from TatumSDK FeeEvm module: 10.735841739
[ConfigurableExtension] Base Fee for ethereum-sepolia is 10.735841739
[HelloWorldExtension] disposed
[ConfigurableExtension] disposed