Skip to content

Latest commit

 

History

History
75 lines (57 loc) · 2.12 KB

README.md

File metadata and controls

75 lines (57 loc) · 2.12 KB

🛠️ Example Application

This is an example application demonstrating the use of various extensions. Dive in to learn more!

📦 Extensions Used

🚀 Quick Start

yarn install
yarn example

📖 Description

The application comprises the following packages:

  • @tatumio/tatum
  • @tatumio/hello-world
  • @tatumio/configurable-extension

Initialization

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'}},
    ]
})

Method Calls

  1. It invokes the sayHello() method from HelloWorldExtension:
await tatumSdk.extension(HelloWorldExtension).sayHello()
  1. It then calls the sayHelloWithConfiguration() method from ConfigurableExtension:
await tatumSdk.extension(ConfigurableExtension).sayHelloWithConfiguration()

Cleanup

Finally, it disposes the SDK, which also disposes all extensions:

tatumSdk.dispose()

🖨️ Output

[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