@knine-sdk/helpers
Version:
Helpers for Knine projects. Part of Knine JS SDK
69 lines (50 loc) • 1.62 kB
Markdown
Helpers for Knine projects.
Part of Knine JS SDK
- [Install](
- [Etherscan](
- [getEtherscanTxLink](
- [getEtherscanTokenLink](
- [getEtherscanAddressLink](
- [Open window](
```bash
yarn add @knine-sdk/helpers
```
A set of functions for generating links to [etherscan](https://etherscan.io/)
```ts
import { getEtherscanTxLink } from '@knine-sdk/helpers';
import { CHAINS } from '@knine-sdk/constants';
const link = getEtherscanTxLink(
CHAINS.Mainnet,
'0x0000000000000000000000000000000000000000000000000000000000000000',
);
console.log(link); // https://etherscan.io/tx/0x0000000000000000000000000000000000000000000000000000000000000000
```
```ts
import { getEtherscanTokenLink } from '@knine-sdk/helpers';
import { CHAINS } from '@knine-sdk/constants';
const link = getEtherscanTokenLink(
CHAINS.Mainnet,
'0x0000000000000000000000000000000000000000',
);
console.log(link); // https://etherscan.io/address/0x0000000000000000000000000000000000000000
```
```ts
import { getEtherscanAddressLink } from '@knine-sdk/helpers';
import { CHAINS } from '@knine-sdk/constants';
const link = getEtherscanAddressLink(
CHAINS.Mainnet,
'0x0000000000000000000000000000000000000000',
);
console.log(link); // https://etherscan.io/address/0x0000000000000000000000000000000000000000
```
```ts
import { openWindow } from '@knine-sdk/helpers';
openWindow('https://knine.io');
```