Skip to content

Commit 9e5c4d9

Browse files
committed
fix: Various small fixes & tweaks
- Add tokenscript name to GA event parameters - processUrlLoader before loading my tokenscripts - Add contractURI to ERC20 ABI - Update Klaytn -> Kaia & remove defunct RPC URLs.
1 parent ae679fb commit 9e5c4d9

File tree

3 files changed

+28
-15
lines changed

3 files changed

+28
-15
lines changed

javascript/tokenscript-viewer/src/components/viewers/new/new-viewer.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ export class NewViewer {
6767
}
6868
}
6969
})
70-
this.init();
71-
this.processUrlLoad();
70+
this.processUrlLoad().then(() => this.init());
7271
}
7372

7473

javascript/tokenscript-viewer/src/components/viewers/new/viewer-popover/viewer-popover.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ export class ViewerPopover {
138138

139139
if (window.gtag) {
140140
let data: any = {
141-
tsIdOrUrl: sourceInfo.tsId ?? sourceInfo.sourceUrl
141+
tsIdOrUrl: sourceInfo.tsId ?? sourceInfo.sourceUrl,
142+
tsName: tokenScript.getName()
142143
};
143144
if (params.has("chain")){
144145
data.chain = params.get("chain");

javascript/tokenscript-viewer/src/integration/constants.ts

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export enum ChainID {
1818
AMOY = 80002,
1919
AVALANCH = 43114,
2020
FANTOM = 250,
21-
KLAYTN = 8217,
22-
BAOBAB = 1001,
21+
KAIA = 8217,
22+
KAIA_KAIROS = 1001,
2323
HARDHAT_LOCALHOST = 31337,
2424
MANTLE = 5000,
2525
MANTLE_SEPOLIA = 5003,
@@ -45,8 +45,8 @@ export const CHAIN_MAP: ChainMapInterface = {
4545
[ChainID.AMOY]: "amoy",
4646
[ChainID.AVALANCH]: "avalanche",
4747
[ChainID.FANTOM]: "fantom",
48-
[ChainID.KLAYTN]: "cypress",
49-
[ChainID.BAOBAB]: "baobab",
48+
[ChainID.KAIA]: "cypress",
49+
[ChainID.KAIA_KAIROS]: "baobab",
5050
[ChainID.HARDHAT_LOCALHOST]: "hardhat-localhost",
5151
[ChainID.MANTLE]: "mantle",
5252
[ChainID.MANTLE_SEPOLIA]: "mantle-sepolia",
@@ -71,8 +71,8 @@ export const CHAIN_NAME_MAP: ChainMapInterface = {
7171
[ChainID.BSC]: "Binance Smart Chain",
7272
[ChainID.AVALANCH]: "Avalanche",
7373
[ChainID.FANTOM]: "Fantom",
74-
[ChainID.KLAYTN]: "Cypress (Klaytn Mainnet)",
75-
[ChainID.BAOBAB]: "Baobab (Klaytn Testnet)",
74+
[ChainID.KAIA]: "Kaia",
75+
[ChainID.KAIA_KAIROS]: "Kairos (Kaia Testnet)",
7676
[ChainID.HARDHAT_LOCALHOST]: "Hardhat Localhost (EVM Test Network)",
7777
[ChainID.MANTLE]: "Mantle",
7878
[ChainID.MANTLE_SEPOLIA]: "Mantle (Sepolia Testnet)",
@@ -146,20 +146,20 @@ export const CHAIN_CONFIG: {[chain: number]: IChainConfig} = {
146146
rpc: 'https://mainnet.optimism.io',
147147
explorer: 'https://optimistic.etherscan.io/tx/'
148148
},
149-
[ChainID.KLAYTN]: {
149+
[ChainID.KAIA]: {
150150
rpc: [
151-
'https://public-en-cypress.klaytn.net',
151+
'https://public-en.node.kaia.io',
152152
'https://rpc.ankr.com/klaytn',
153153
'https://klaytn-pokt.nodies.app',
154154
'https://1rpc.io/klay',
155155
],
156156
explorer: 'https://scope.klaytn.com/tx/',
157157
},
158-
[ChainID.BAOBAB]: {
158+
[ChainID.KAIA_KAIROS]: {
159159
rpc: [
160-
'https://public-en-baobab.klaytn.net',
160+
'https://public-en.kairos.node.kaia.io',
161161
'https://rpc.ankr.com/klaytn_testnet',
162-
'https://klaytn-baobab.blockpi.network/v1/rpc/public',
162+
'https://kaia-kairos.blockpi.network/v1/rpc/public',
163163
],
164164
explorer: 'https://baobab.scope.klaytn.com/tx/',
165165
},
@@ -1505,5 +1505,18 @@ export const ERC20_ABI_JSON = [
15051505
"outputs": [],
15061506
"stateMutability": "nonpayable",
15071507
"type": "function"
1508-
}
1508+
},
1509+
{
1510+
"inputs": [],
1511+
"name": "contractURI",
1512+
"outputs": [
1513+
{
1514+
"internalType": "string",
1515+
"name": "",
1516+
"type": "string"
1517+
}
1518+
],
1519+
"stateMutability": "pure",
1520+
"type": "function"
1521+
},
15091522
];

0 commit comments

Comments
 (0)