Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
tokamak-multichain
Advanced tools
The tokamak-multichain
package provides a collection of tools for efficiently interacting with the Titan network.
It achieves this by providing a unified token and contract list for Titan and other chains.
npm install tokamak-multichain
import { MultiChainSDK } from 'tokamak-multichain'
const sdk = new MultiChainSDK({
chainId: 55004,
})
const tokenList = sdk.tokens
// Output the structure of the tokenList
console.log('Token List:', tokenList)
/*
The structure of the tokenList
tokenList = [
{
chainId: 55004,
address: '0x7c6b91D9Be155A6Db01f749217d76fF02A7227F2',
name: 'Tokamak Network Token',
symbol: 'TON',
decimals: 18,
logoURI: 'https://github.com/tokamak-network/tokamak-multichain/data/TON/logo.svg',
extensions: {
bridgeAddress: '0x4200000000000000000000000000000000000010',
titanListId: 'default',
titanTokenId: 'TON'
}
},
{
chainId: 55004,
address: '0x0000000000000000000000000000000000000000',
name: 'Ether',
symbol: 'ETH',
decimals: 18,
logoURI: 'https://github.com/tokamak-network/tokamak-multichain/data/ETH/logo.svg',
extensions: {
bridgeAddress: '0x4200000000000000000000000000000000000010',
titanListId: 'default',
titanTokenId: 'ETH'
}
},
... more token comes
]
*/
import { MultiChainSDK } from 'tokamak-multichain'
const sdk = new MultiChainSDK({
chainId: 55004,
})
const TON_CONTRACT = sdk.getTokenContract('TON')
const totalSupply = await TON_CONTRACT.totalSupply()
console.log('totalSupply :', totalSupply)
// totalSupply : BigNumber { _hex: '0x24d826680754da71d432', _isBigNumber: true }
import { MultiChainSDK } from 'tokamak-multichain'
const sdk = new MultiChainSDK({
chainId: 55004,
})
const L2StandardBridge = sdk.getContract('L2StandardBridge')
const L2Messenger = await L2StandardBridge.messenger()
console.log('L2Messenger : ', L2Messenger)
// L2Messenger : 0x4200000000000000000000000000000000000007
You can try out the tokamak-multichain package in an online environment using CodeSandbox. Click the button below to open the project in CodeSandbox:
This CodeSandbox project includes a basic setup with the @titan/sdk package. You can explore and experiment with the functionalities in a live environment.
├── contracts:
├── tokens:
├── bin:
├── test:
├── src
│ ├──
The production branch is "main". This branch holds the codebase for the most recent "stable" releases. Any changes made to the main branch are initially integrated from the develop branch.
The primary development branch is "develop". The develop branch includes the latest software version that remains compatible with the most recent experimental network deployments. If you're implementing a change that maintains backward compatibility, please submit your pull request to the develop branch.
FAQs
Unified token and contract list for Titan Mainnet and other Chains.
The npm package tokamak-multichain receives a total of 0 weekly downloads. As such, tokamak-multichain popularity was classified as not popular.
We found that tokamak-multichain demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.