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

Update README.md - Add destroy #881

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ Start by importing the TatumSDK library and initializing Ethereum client as foll
import { TatumSDK, Network, Ethereum } from '@tatumio/tatum'

const tatum = await TatumSDK.init<Ethereum>({ network: Network.ETHEREUM })

// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
```

### RPC Calls
Expand All @@ -120,6 +123,9 @@ const tatum = await TatumSDK.init<Ethereum>({ network: Network.ETHEREUM })

const { result } = await tatum.rpc.getBalance('0x742d35Cc6634C0532925a3b844Bc454e4438f44e')
console.log(`Balance: ${data}`)

// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
```

### Subscribing to Notifications
Expand All @@ -139,6 +145,9 @@ const response = await tatum.notification.subscribe.addressEvent({

console.log(response)
// 🎉 Now your address is subscribed for any events!

// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
```

### Get NFT balance of a wallet
Expand All @@ -155,6 +164,9 @@ const balances: NftAddressBalance[] = await tatum.nft.getBalance({
})

console.log(balances)

// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
```

### Connect to MetaMask and send transaction
Expand All @@ -173,6 +185,9 @@ const txId: string = await tatum.walletProvider.metaMask.transferNative(
)

console.log(txId)

// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
```

### Get exchange rates
Expand All @@ -187,6 +202,9 @@ const tatum = await TatumSDK.init<Ethereum>({ network: Network.ETHEREUM })
const res = await tatum.rates.getCurrentRate('BTC', 'EUR')

console.log(res.data)

// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
```

### Get current fees
Expand All @@ -212,6 +230,9 @@ const tatum = await TatumSDK.init<Ethereum>({
const result = await tatum.fee.getCurrentFee()

console.log(result.data)

// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
```

### Get token balance
Expand All @@ -228,6 +249,9 @@ const { data: balances } = await tatum.token.getBalance({
})

console.log(balances)

// Destroy Tatum SDK - needed for stopping background jobs
tatum.destroy()
```

## Documentation
Expand Down
Loading