master
nico 8 months ago
parent e9b460c091
commit d0c65a037b
  1. 8
      CONTRIBUTING.md
  2. 4
      README.md
  3. 2
      package.json
  4. 4
      public/index.html
  5. 2
      scripts/updateBridgeTokensList.js
  6. 12
      src/Routes.tsx
  7. 10
      src/api/client.ts
  8. 46
      src/api/rpc.ts
  9. 2
      src/components/BinancePairHistoricalPrice_Pool.tsx
  10. 4
      src/components/ONE_USDT_Rate.tsx
  11. 14
      src/components/appFooter/index.tsx
  12. 2
      src/components/appHeader/ConfigureButton.tsx
  13. 12
      src/components/appHeader/InfoButton.tsx
  14. 4
      src/components/appHeader/MenuMobile.tsx
  15. 4
      src/components/appHeader/ToolsButton.tsx
  16. 2
      src/components/appHeader/index.tsx
  17. 2
      src/components/approvals/approvalsColumns.tsx
  18. 2
      src/components/metrics/WalletsHistory.tsx
  19. 16
      src/components/tables/TransactionsTable.tsx
  20. 6
      src/components/transaction/TransactionDetails.tsx
  21. 20
      src/components/transaction/helpers.tsx
  22. 4
      src/components/ui/TokenValueBalanced.tsx
  23. 4
      src/components/ui/utils.tsx
  24. 32
      src/config/addressAliasMap.json
  25. 2
      src/config/bridgeTokensMap.json
  26. 2
      src/config/linkedContractsMap.json
  27. 4
      src/hooks/BinancePairHistoricalPrice.ts
  28. 6
      src/hooks/useONEExchangeRate.tsx
  29. 4
      src/pages/AddressPage/ContractDetails/AbiMethodView.tsx
  30. 6
      src/pages/AddressPage/ContractDetails/ConnectWallets.tsx
  31. 12
      src/pages/AddressPage/TokenInfo.tsx
  32. 10
      src/pages/AddressPage/index.tsx
  33. 8
      src/pages/AddressPage/tabs/inventory/InventoryItem.tsx
  34. 16
      src/pages/AddressPage/tabs/tools/TokenApprovals.tsx
  35. 6
      src/pages/AllTransactionsPage/index.tsx
  36. 24
      src/pages/ApprovalPage/index.tsx
  37. 6
      src/pages/ChartsPage/ActiveAddresses.tsx
  38. 2
      src/pages/ChartsPage/AverageBlockSize.tsx
  39. 2
      src/pages/ChartsPage/AverageFee.tsx
  40. 2
      src/pages/ChartsPage/DailyTransactions.tsx
  41. 6
      src/pages/ChartsPage/ViewChangeStats.tsx
  42. 2
      src/pages/ChartsPage/index.tsx
  43. 2
      src/pages/ERC1155List/ERC1155Table.tsx
  44. 2
      src/pages/ERC1155List/index.tsx
  45. 2
      src/pages/ERC20List/ERC20Table.tsx
  46. 2
      src/pages/ERC20List/index.tsx
  47. 2
      src/pages/ERC721List/ERC721Table.tsx
  48. 2
      src/pages/ERC721List/index.tsx
  49. 4
      src/pages/ExportData/export-utils.ts
  50. 2
      src/pages/ExportData/index.tsx
  51. 4
      src/pages/InventoryDetailsPage/InventoryDetailsPage.tsx
  52. 16
      src/pages/MainPage/LatestTransactionsTable.tsx
  53. 10
      src/pages/StackingTransactionPage/index.tsx
  54. 4
      src/pages/TopStatsPage/CommonTopTable.tsx
  55. 14
      src/pages/TransactionPage/index.tsx
  56. 6
      src/pages/tools/CheckWRC/index.tsx
  57. 2
      src/types/api.ts
  58. 42
      src/types/blockchain.ts
  59. 28
      src/utils/approvals.ts
  60. 44
      src/utils/getAddress/GetAddress.ts
  61. 10
      src/utils/getAddress/bech32.ts
  62. 2
      src/utils/getAddress/bytes.ts
  63. 18
      src/utils/getAddress/errors.ts
  64. 2
      src/utils/getAddress/keccak256.ts
  65. 2
      src/utils/getAddress/validators.ts
  66. 4
      src/utils/utils.ts

@ -3,19 +3,19 @@
When contributing to this repository, please first discuss the change you wish to make via issue, discord server or any other method with the owners of this repository before making a change.
### Pull Request Process
1) Fork a [repository](https://github.com/harmony-one/explorer-v2-frontend) and create your branch from `master`;
1) Fork a [repository](https://github.com/woop-chain/explorer-v2-frontend) and create your branch from `master`;
2) Run `yarn build` in the repository root
3) Update .env.example if new environment variables is created;
4) Create pull request linked with existed issue.
### Branch Organization
Submit all changes directly to [master branch](https://github.com/harmony-one/explorer-v2-frontend/tree/master).
Submit all changes directly to [master branch](https://github.com/woop-chain/explorer-v2-frontend/tree/master).
We don’t use separate branches for development or for upcoming releases.
### Bugs
We are using [Github Issues](https://github.com/harmony-one/explorer-v2-frontend/issues) for tracking bugs.
We are using [Github Issues](https://github.com/woop-chain/explorer-v2-frontend/issues) for tracking bugs.
Before creating a new issue please check that problem doesn't already exist.
### Proposing a Change
If you have a suggestion on how to improve functionality or create a new feature you can [fill a new issue](https://github.com/harmony-one/explorer-v2-frontend/issues/new).
If you have a suggestion on how to improve functionality or create a new feature you can [fill a new issue](https://github.com/woop-chain/explorer-v2-frontend/issues/new).

@ -1,4 +1,4 @@
# Harmony Explorer frontend
# Woop Explorer frontend
## Requirements
@ -18,7 +18,7 @@ npm install --global yarn
1) Clone repo:
```bash
git clone https://github.com/harmony-one/explorer-v2-frontend.git
git clone https://github.com/woop-chain/explorer-v2-frontend.git
```
2) Install dependencies:
```bash

@ -1,5 +1,5 @@
{
"name": "harmony-explorer-v2-frontend",
"name": "woop-explorer-v2-frontend",
"version": "0.1.0",
"private": true,
"dependencies": {

@ -14,7 +14,7 @@
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Harmony block explorer"
content="Woop block explorer"
/>
<!--
manifest.json provides metadata used when your web app is installed on a
@ -30,7 +30,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Harmony Blockchain Explorer</title>
<title>Woop Blockchain Explorer</title>
<style type="text/css">
body {
margin: 0;

@ -9,7 +9,7 @@ const outputFileName = 'src/config/bridgeTokensMap.json';
const { content: tokensList } = await response.json();
const tokensMap = {}
tokensList.forEach(item => {
tokensMap[item.hrc20Address.toLowerCase()] = item.symbol
tokensMap[item.wrc20Address.toLowerCase()] = item.symbol
})
await fs.writeFileSync(outputFileName, JSON.stringify(tokensMap))
console.log(`${tokensList.length} bridge tokens successfully written to '${outputFileName}'`)

@ -14,7 +14,7 @@ import { ERC1155List } from "./pages/ERC1155List";
import { ExportData } from "./pages/ExportData";
import { InventoryDetailsPage } from "./pages/InventoryDetailsPage/InventoryDetailsPage";
import { ApprovalPage } from "./pages/ApprovalPage";
import { CheckHRC } from "./pages/tools/CheckHRC";
import { CheckWRC } from "./pages/tools/CheckWRC";
import { ChartsPage } from "./pages/ChartsPage";
import { TopStatsPage } from "./pages/TopStatsPage";
@ -52,8 +52,8 @@ export function Routes() {
<ApprovalPage />
</Route>
<Route exact path="/tools/checkHrc">
<CheckHRC />
<Route exact path="/tools/checkWrc">
<CheckWRC />
</Route>
<Route path="/tx/:id">
@ -80,15 +80,15 @@ export function Routes() {
<ERC721List />
</Route>
<Route path="/hrc20">
<Route path="/wrc20">
<ERC20List />
</Route>
<Route path="/hrc721">
<Route path="/wrc721">
<ERC721List />
</Route>
<Route path="/hrc1155">
<Route path="/wrc1155">
<ERC1155List />
</Route>

@ -2,8 +2,8 @@ import { transport } from "./explorer";
import {
Block,
InternalTransaction,
RPCStakingTransactionHarmony,
RPCTransactionHarmony,
RPCStakingTransactionWoop,
RPCTransactionWoop,
RelatedTransaction,
Log, LogDetailed, AddressDetails,
ShardID, MetricsType, MetricsDailyItem, MetricsTopType, MetricsTopItem, MetricsTopPeriod
@ -52,7 +52,7 @@ export function getCount(params: any[]) {
export function getTransactions(params: any[]) {
return transport("getTransactions", params) as Promise<
RPCTransactionHarmony[]
RPCTransactionWoop[]
>;
}
@ -60,14 +60,14 @@ export function getTransactionByField(params: any[]) {
return transport(
"getTransactionByField",
params
) as Promise<RPCTransactionHarmony>;
) as Promise<RPCTransactionWoop>;
}
export function getStakingTransactionByField(params: [number, "hash", string]) {
return transport(
"getStakingTransactionsByField",
params
) as Promise<RPCStakingTransactionHarmony>;
) as Promise<RPCStakingTransactionWoop>;
}
export function getInternalTransactionsByField(params: any[], blockNumber?: string) {

@ -2,14 +2,14 @@ import JSONBig from 'json-bigint'
import { ERC1155_Pool } from "src/hooks/ERC1155_Pool";
import { ERC20_Pool } from "src/hooks/ERC20_Pool";
import { ERC721_Pool } from "src/hooks/ERC721_Pool";
import { HarmonyAddress } from "src/utils";
import { WoopAddress } from "src/utils";
import { convertTxnToObj, filterTransactions, hasAllowance, matchesApprovalMethod } from "src/utils/approvals";
import {
ApprovalDetails,
IGetTxsHistoryParams,
RequestOrder,
RequestTxType,
RPCTransactionHarmony,
RPCTransactionWoop,
StakingDelegationResponse,
TokenType,
TxReceipt
@ -54,7 +54,7 @@ export const getBalance = (nodeUrl: string, params: [string, "latest"]) => {
};
export const hmyv2_getTransactionReceipt = (
export const wikiv2_getTransactionReceipt = (
params: [string],
shardNumber: number
) => {
@ -65,7 +65,7 @@ export const hmyv2_getTransactionReceipt = (
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0",
method: "hmyv2_getTransactionReceipt",
method: "wikiv2_getTransactionReceipt",
id: 1,
params,
}),
@ -109,13 +109,13 @@ export const eth_traceTransaction = (hash: string) => {
});
}
export const hmyv2_getTransactionsHistory = (params: IGetTxsHistoryParams[]) => {
return rpcAdapter<TRPCResponse<{ transactions: RPCTransactionHarmony[] }>>(API_URL, {
export const wikiv2_getTransactionsHistory = (params: IGetTxsHistoryParams[]) => {
return rpcAdapter<TRPCResponse<{ transactions: RPCTransactionWoop[] }>>(API_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0",
method: "hmyv2_getTransactionsHistory",
method: "wikiv2_getTransactionsHistory",
id: 1,
params: [{ ...defaultGetHistoryParams, ...params[0] }],
}),
@ -127,13 +127,13 @@ export const hmyv2_getTransactionsHistory = (params: IGetTxsHistoryParams[]) =>
});
};
export const hmyv2_getTransactionsCount = (address: string, txType: RequestTxType = RequestTxType.ALL) => {
export const wikiv2_getTransactionsCount = (address: string, txType: RequestTxType = RequestTxType.ALL) => {
return rpcAdapter<TRPCResponse<number>>(API_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0",
method: "hmyv2_getTransactionsCount",
method: "wikiv2_getTransactionsCount",
id: 1,
params: [address, txType],
}),
@ -145,13 +145,13 @@ export const hmyv2_getTransactionsCount = (address: string, txType: RequestTxTyp
});
};
export const hmyv2_getNodeMetadata = (shard: string) => {
export const wikiv2_getNodeMetadata = (shard: string) => {
return rpcAdapter<TRPCResponse<any>>(getApiUrl(shard), {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0",
method: "hmyv2_getNodeMetadata",
method: "wikiv2_getNodeMetadata",
id: 1,
params: [],
}),
@ -163,13 +163,13 @@ export const hmyv2_getNodeMetadata = (shard: string) => {
});
};
export const hmyv2_getStakingTransactionsHistory = (params: IGetTxsHistoryParams[]) => {
return rpcAdapter<TRPCResponse<{ staking_transactions: RPCTransactionHarmony[] }>>(API_URL, {
export const wikiv2_getStakingTransactionsHistory = (params: IGetTxsHistoryParams[]) => {
return rpcAdapter<TRPCResponse<{ staking_transactions: RPCTransactionWoop[] }>>(API_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0",
method: "hmyv2_getStakingTransactionsHistory",
method: "wikiv2_getStakingTransactionsHistory",
id: 1,
params: [{ ...defaultGetHistoryParams, ...params[0] }],
}),
@ -181,13 +181,13 @@ export const hmyv2_getStakingTransactionsHistory = (params: IGetTxsHistoryParams
});
};
export const hmyv2_getStakingTransactionsCount = (address: string, txType: RequestTxType = RequestTxType.ALL) => {
export const wikiv2_getStakingTransactionsCount = (address: string, txType: RequestTxType = RequestTxType.ALL) => {
return rpcAdapter<TRPCResponse<number>>(API_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0",
method: "hmyv2_getStakingTransactionsCount",
method: "wikiv2_getStakingTransactionsCount",
id: 1,
params: [address, txType],
}),
@ -222,13 +222,13 @@ const mapStakingDelegation = (delegation: StakingDelegationResponse): StakingDel
}
}
export const hmy_getDelegationsByDelegator = (address: string): Promise<StakingDelegation[]> => {
export const wiki_getDelegationsByDelegator = (address: string): Promise<StakingDelegation[]> => {
return rpcBigIntAdapter<TRPCResponse<StakingDelegationResponse[]>>(API_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0",
method: "hmy_getDelegationsByDelegator",
method: "wiki_getDelegationsByDelegator",
id: 1,
params: [address],
}),
@ -260,7 +260,7 @@ export const getAllApprovalsForTokens = async (address: string,
erc20Pool: ERC20_Pool = {},
erc1155Pool: ERC1155_Pool = {},
erc721Pool: ERC721_Pool = {}
): Promise<{ txnHistory: ApprovalDetails[], dataObj: RPCTransactionHarmony[] }> => {
): Promise<{ txnHistory: ApprovalDetails[], dataObj: RPCTransactionWoop[] }> => {
const params: IGetTxsHistoryParams[] = [{
address,
pageIndex,
@ -271,14 +271,14 @@ export const getAllApprovalsForTokens = async (address: string,
}];
// if null, return all approvals
const contractHarmonyAddr = contractAddress && contractAddress.length > 0 ? new HarmonyAddress(contractAddress) : null;
const contractWoopAddr = contractAddress && contractAddress.length > 0 ? new WoopAddress(contractAddress) : null;
let dataObj: RPCTransactionHarmony[] = await hmyv2_getTransactionsHistory(params);
let dataObj: RPCTransactionWoop[] = await wikiv2_getTransactionsHistory(params);
for (let tx of dataObj) {
if (matchesApprovalMethod(tx) && (tx.to === contractAddress || tx.to === contractHarmonyAddr?.bech32 || !contractHarmonyAddr)) {
if (matchesApprovalMethod(tx) && (tx.to === contractAddress || tx.to === contractWoopAddr?.bech32 || !contractWoopAddr)) {
const spender = "0x" + tx.input.substring(34, 74);
const to = new HarmonyAddress(tx.to).basicHex;
const to = new WoopAddress(tx.to).basicHex;
let type: TokenType = "ERC20";
if (erc1155Pool[to]) {
type = "ERC1155";

@ -11,7 +11,7 @@ export function BinancePairHistoricalPrice_Pool() {
const erc20: Erc20Price[] = useBinancePairHistoricalPrice();
const erc20MapPrice = {} as Record<string, Erc20Price>;
erc20.forEach((i) => {
erc20MapPrice[i.hrc20Address] = i;
erc20MapPrice[i.wrc20Address] = i;
});
window.localStorage.setItem(

@ -6,8 +6,8 @@ export function ONE_USDT_Rate() {
const getRates = () => {
const rates = {} as Record<string, number>;
// fetch("https://api.binance.com/api/v3/klines?symbol=ONEUSDT&interval=1d")
fetch("https://api.coingecko.com/api/v3/coins/harmony/market_chart?vs_currency=usd&days=2000&interval=daily")
//https://api.coingecko.com/api/v3/coins/harmony/market_chart?vs_currency=usd&days=2000&interval=daily
fetch("https://api.coingecko.com/api/v3/coins/woop/market_chart?vs_currency=usd&days=2000&interval=daily")
//https://api.coingecko.com/api/v3/coins/woop/market_chart?vs_currency=usd&days=2000&interval=daily
.then((_res) => _res.json())
.then(res => res.prices) // for coingecko, delete for binance
.then((res) => {

@ -20,19 +20,19 @@ export function AppFooter(props: { style: CSSProperties }) {
<Box background="background" justify="center" align="center" pad="medium" margin={{ top: 'medium' }} {...props}>
<Box gap="xsmall">
<Box direction="row" width="320px" justify="center" align="center" gap="medium">
<IconAhchor href="https://harmony.one/team" target="_blank" rel="noreferrer">
<IconAhchor href="https://wikiwoop.com/team" target="_blank" rel="noreferrer">
<Group size="24px" color="minorText" style={{ cursor: 'pointer'}} />
</IconAhchor>
<IconAhchor href="https://harmony.one/discord" target="_blank" rel="noreferrer">
<IconAhchor href="https://wikiwoop.com/discord" target="_blank" rel="noreferrer">
<DiscordIcon size="23px" color="minorText" />
</IconAhchor>
<IconAhchor href="https://substack.com/@harmonyone" target="_blank" rel="noreferrer">
<IconAhchor href="https://substack.com/@woopone" target="_blank" rel="noreferrer">
<SubstackIcon size="23px" color="minorText" />
</IconAhchor>
<IconAhchor href="https://t.me/harmony_one" target="_blank" rel="noreferrer">
<IconAhchor href="https://t.me/woop_one" target="_blank" rel="noreferrer">
<TelegramIcon size="22px" color="minorText" />
</IconAhchor>
<IconAhchor href="https://twitter.com/harmonyprotocol" target="_blank" rel="noreferrer">
<IconAhchor href="https://twitter.com/woopprotocol" target="_blank" rel="noreferrer">
<Twitter size="24px" color="minorText" style={{ cursor: 'pointer'}} />
</IconAhchor>
</Box>
@ -43,9 +43,9 @@ export function AppFooter(props: { style: CSSProperties }) {
{/*</Box>*/}
<Box direction="row" justify="center" align="center" gap="xsmall">
<Text color="minorText" size="xsmall" margin={{ top: '3px' }}>©</Text>
<Text color="minorText" size="xsmall">Harmony {new Date().getFullYear()}</Text>
<Text color="minorText" size="xsmall">Woop {new Date().getFullYear()}</Text>
<Text color="minorText" size="small" margin={{ bottom: '6px' }}>.</Text>
<Text color="minorText" size="xsmall">hello@harmony.one</Text>
<Text color="minorText" size="xsmall">hello@wikiwoop.com</Text>
</Box>
</Box>
</Box>

@ -62,7 +62,7 @@ export function ConfigureButton() {
{/*<ToggleButton*/}
{/* value={currency}*/}
{/* options={[*/}
{/* { text: "Harmony", value: "ONE" },*/}
{/* { text: "Woop", value: "ONE" },*/}
{/* { text: "ETH", value: "ETH" },*/}
{/* ]}*/}
{/* onChange={setCurrency}*/}

@ -38,28 +38,28 @@ export function InfoButton() {
style={{ textDecoration: "underline" }}
onClick={(e) => {
setIsOpen(false);
history.push("/hrc20");
history.push("/wrc20");
}}
>
HRC20 tokens
WRC20 tokens
</Anchor>
<Anchor
style={{ textDecoration: "underline" }}
onClick={(e) => {
setIsOpen(false);
history.push("/hrc721");
history.push("/wrc721");
}}
>
HRC721 tokens
WRC721 tokens
</Anchor>
<Anchor
style={{ textDecoration: "underline" }}
onClick={(e) => {
setIsOpen(false);
history.push("/hrc1155");
history.push("/wrc1155");
}}
>
HRC1155 tokens
WRC1155 tokens
</Anchor>
</Box>
}

@ -97,8 +97,8 @@ export const MenuMobile = (props: { isOpened: boolean; onClose: () => void }) =>
return <Box pad={'8px 0'} background={'background'} style={{ display: props.isOpened ? 'block' : 'none' }}>
<MenuRow title={'Home'} items={[]} route={'/'} onSelect={onSelect} />
<MenuRow title={'Tokens'} items={[{ title: 'HRC20', route: '/hrc20' }, { title: 'HRC721', route: '/hrc721' }, { title: 'HRC1155', route: '/hrc1155' }]} onSelect={onSelect} />
<MenuRow title={'Tools'} items={[{ title: 'Token Approvals', route: '/tools/approvals' }, { title: 'Check HRC', route: '/tools/checkHrc' }]} onSelect={onSelect} />
<MenuRow title={'Tokens'} items={[{ title: 'WRC20', route: '/wrc20' }, { title: 'WRC721', route: '/wrc721' }, { title: 'WRC1155', route: '/wrc1155' }]} onSelect={onSelect} />
<MenuRow title={'Tools'} items={[{ title: 'Token Approvals', route: '/tools/approvals' }, { title: 'Check WRC', route: '/tools/checkWrc' }]} onSelect={onSelect} />
<MenuRow title={'Resources'} items={[{ title: 'Charts & Stats', route: '/charts' }, { title: 'Top Statistics', route: '/topstat' }]} onSelect={onSelect} />
<MenuRow title={'Appearance'} items={[{ title: '', content: <ThemeSwitch /> }, { title: '', content: <DateFormatSwitch />}]} />
</Box>

@ -47,10 +47,10 @@ export function ToolsButton() {
style={{ textDecoration: "underline" }}
onClick={(e) => {
setIsOpen(false);
history.push("/tools/checkHrc");
history.push("/tools/checkWrc");
}}
>
Check HRC
Check WRC
</Anchor>
{/*<Anchor*/}
{/* style={{ textDecoration: "underline" }}*/}

@ -63,7 +63,7 @@ export function AppHeader(props: { style: CSSProperties }) {
<img src={require("../../assets/Logo.svg").default} />
{!isTabletOrMobile &&
<ProjectName direction={"column"} align={"start"}>
Harmony
Woop
<Text size={"small"}>Block Explorer</Text>
</ProjectName>
}

@ -2,7 +2,7 @@ import { Box, ColumnConfig, Text } from 'grommet'
import { Address } from 'src/components/ui'
import React from 'react'
import styled from 'styled-components'
import { ApprovalDetails, RPCTransactionHarmony } from 'src/types';
import { ApprovalDetails, RPCTransactionWoop } from 'src/types';
const TabBox = styled(Box) <{ selected: boolean }>`
border: 1px solid ${(props) => props.theme.global.colors.border};
background: ${(props) =>

@ -92,7 +92,7 @@ export default function WalletsHistory() {
{/*{!isTabletOrMobile &&*/}
{/* <Box direction={'row'}>*/}
{/* By&nbsp;*/}
{/* <a href={`https://harmony-transactions.vercel.app/`} target={'_blank'}>*/}
{/* <a href={`https://woop-transactions.vercel.app/`} target={'_blank'}>*/}
{/* <Text color={'brand'} size={'small'}>Metrics DAO</Text>*/}
{/* </a>*/}
{/* </Box>*/}

@ -1,7 +1,7 @@
import React, { useEffect, useRef, useState } from "react";
import { Box, DataTable, Text, Spinner, ColumnConfig } from "grommet";
import { Filter, RPCTransactionHarmony } from "src/types";
import { Filter, RPCTransactionWoop } from "src/types";
import { useHistory } from "react-router-dom";
import { FormNextLink } from "grommet-icons";
import {
@ -26,7 +26,7 @@ function getColumns(props: any) {
Shard
</Text>
),
render: (data: RPCTransactionHarmony) => (
render: (data: RPCTransactionWoop) => (
<Box direction="row" gap="3px" align="center">
<Text size="small">{data.shardID}</Text>
<FormNextLink
@ -47,7 +47,7 @@ function getColumns(props: any) {
Hash
</Text>
),
render: (data: RPCTransactionHarmony) => (
render: (data: RPCTransactionWoop) => (
<Text
size="small"
style={{ cursor: "pointer" }}
@ -69,7 +69,7 @@ function getColumns(props: any) {
Block number
</Text>
),
render: (data: RPCTransactionHarmony) => {
render: (data: RPCTransactionWoop) => {
return (
<Text
size="small"
@ -93,7 +93,7 @@ function getColumns(props: any) {
From
</Text>
),
render: (data: RPCTransactionHarmony) => <Address address={data.from} />,
render: (data: RPCTransactionWoop) => <Address address={data.from} />,
},
{
property: "to",
@ -104,7 +104,7 @@ function getColumns(props: any) {
To
</Text>
),
render: (data: RPCTransactionHarmony) => <Address address={data.to} />,
render: (data: RPCTransactionWoop) => <Address address={data.to} />,
},
{
property: "value",
@ -115,7 +115,7 @@ function getColumns(props: any) {
ONEValue
</Text>
),
render: (data: RPCTransactionHarmony) => (
render: (data: RPCTransactionWoop) => (
<Box justify="center">
<ONEValue value={data.value} timestamp={data.timestamp} />
</Box>
@ -129,7 +129,7 @@ function getColumns(props: any) {
Timestamp
</Text>
),
render: (data: RPCTransactionHarmony) => (
render: (data: RPCTransactionWoop) => (
<Box direction="row" gap="xsmall" justify="end">
<DateTime date={data.timestamp} />
</Box>

@ -1,5 +1,5 @@
import React, { FunctionComponent, useState } from "react";
import { IHexSignature, Log, RPCStakingTransactionHarmony, RPCTransactionHarmony } from "src/types";
import { IHexSignature, Log, RPCStakingTransactionWoop, RPCTransactionWoop } from "src/types";
import {tokenTransfersERC20} from './tokenTransfer/tokenTransfersERC20'
// import {tokenTransfersERC721} from './tokenTransfer/tokenTransfersERC721'
import {TokenTransfersERC1155} from './tokenTransfer/tokenTransfersERC1155'
@ -62,7 +62,7 @@ const getColumns = ({ type = "" }) => [
type TransactionDetailsProps = {
internalTxs?: any[];
transaction: RPCTransactionHarmony | RPCStakingTransactionHarmony;
transaction: RPCTransactionWoop | RPCStakingTransactionWoop;
inputSignature?: IHexSignature;
type?: TransactionSubType;
stakingData?: boolean;
@ -87,7 +87,7 @@ const tokenTransfers = (logs: Log[]) => {
)
}
const GasUsed = (props: { tx: RPCTransactionHarmony | RPCStakingTransactionHarmony }) => {
const GasUsed = (props: { tx: RPCTransactionWoop | RPCStakingTransactionWoop }) => {
const { tx: { gas, gasLimit } } = props
if (gas && gasLimit) {
const percent = ((+gas / +gasLimit) * 100).toFixed(2)

@ -1,4 +1,4 @@
import { IHexSignature, RPCTransactionHarmony } from "../../types";
import { IHexSignature, RPCTransactionWoop } from "../../types";
import {
FormNextLink
} from "grommet-icons";
@ -29,7 +29,7 @@ export const transactionPropertyDisplayNames: Record<string, string> = {
shardID: "Shard ID",
hash: "Ethereum Hash",
hash__staking: "Hash",
hash_harmony: "Hash",
hash_woop: "Hash",
value: "Value",
blockNumber: "Block Number",
from: "From",
@ -69,7 +69,7 @@ export const transactionPropertyDisplayNames: Record<string, string> = {
export const transactionPropertySort: Record<string, number> = {
shardID: 1000,
hash: 900,
hash_harmony: 950,
hash_woop: 950,
value: 600,
tokenTransfers: 599,
blockNumber: 800,
@ -95,8 +95,8 @@ export const transactionPropertyDescriptions: Record<string, string> = {
shardID: "The shard number where the transaction belongs.",
blockNumber: "The number of the block in which the transaction was recorded.",
hash: "A TxHash or transaction hash is a unique 66 characters identifier that is generated whenever a transaction is executed.",
hash_harmony:
"A TxHash or transaction hash is a unique 66 characters identifier that is generated whenever a transaction is executed. Shard ID is also involved in calculation of Harmony Hash.",
hash_woop:
"A TxHash or transaction hash is a unique 66 characters identifier that is generated whenever a transaction is executed. Shard ID is also involved in calculation of Woop Hash.",
from: "The sending party of the transaction (could be from a contract address).",
to: "The receiving party of the transaction (could be a contract address).",
value: "The value being transacted in ONE and fiat value.",
@ -190,16 +190,16 @@ export const transactionPropertyDisplayValues: any = {
hash__staking: (value: any) => (
<TransactionHash hash={value} link="staking-tx"/>
),
hash_harmony: (value: any) => <TransactionHash hash={value}/>,
hash_woop: (value: any) => <TransactionHash hash={value}/>,
blockHash: (value: any) => <BlockHash hash={value}/>,
timestamp: (value: any) => <DateTime date={value}/>,
gasUsed: (value: any, tx: RPCTransactionHarmony) => (
gasUsed: (value: any, tx: RPCTransactionWoop) => (
<span>
{value}
{/* {value} ({+value / +tx.gas}%){" "} */}
</span>
),
shardID: (value: any, tx: RPCTransactionHarmony) => (
shardID: (value: any, tx: RPCTransactionWoop) => (
<span>
{value}
<FormNextLink size="small" color="brand"/>
@ -232,14 +232,14 @@ export const transactionPropertyDisplayValues: any = {
transactionFee: (value: any, tx: any) => {
return <>{value}</>;
},
input: (value: any, tx: RPCTransactionHarmony, _: any, inputSignature: IHexSignature) => <TxInput
input: (value: any, tx: RPCTransactionWoop, _: any, inputSignature: IHexSignature) => <TxInput
input={tx.input}
inputSignature={inputSignature}
/>
};
export const transactionDisplayValues = (
transaction: RPCTransactionHarmony,
transaction: RPCTransactionWoop,
key: string,
value: any,
type: string,

@ -33,7 +33,7 @@ export const TokenValueBalanced = (props: ONEValueProps) => {
const { direction = "column" } = props;
let pairSymbol = BinancePairs.find(
(item) => item.hrc20Address === tokenAddress
(item) => item.wrc20Address === tokenAddress
);
useEffect(() => {
@ -81,7 +81,7 @@ export const TokenValueBalanced = (props: ONEValueProps) => {
<Box direction={direction}>
<Text size={"small"}>
{`${v}`}
<AnchorLink to={"/hrc20"} label={`${tokenInfo.symbol}`} />
<AnchorLink to={"/wrc20"} label={`${tokenInfo.symbol}`} />
</Text>
<Text size={"small"} style={{ paddingLeft: "0.3em" }}>
{`($${dollarPrice.toFixed(2).toString()})`}

@ -2,7 +2,7 @@ import Big from "big.js";
import React from "react";
import { useONEExchangeRate } from "src/hooks/useONEExchangeRate";
import { calculateFee } from "../../utils/fee";
import {RPCStakingTransactionHarmony, RPCTransactionHarmony} from "../../types";
import {RPCStakingTransactionWoop, RPCTransactionWoop} from "../../types";
export function formatNumber(
num: number,
@ -72,7 +72,7 @@ export function CalculateFee(transaction: any) {
);
}
export function CalculateTransactionFee(transaction: RPCTransactionHarmony | RPCStakingTransactionHarmony) {
export function CalculateTransactionFee(transaction: RPCTransactionWoop | RPCStakingTransactionWoop) {
const { lastPrice: price } = useONEExchangeRate();
if(!(transaction && transaction.gas)) {

@ -27,13 +27,13 @@
},
"0xc2dd9719e1da0f67af0764cd5470802cb7e6b854": {
"name": "KysenPool Dragon",
"link": "https://www.kysenpool.io/en/networks#harmony",
"description": "Global Proof-of-Stake Validator experienced operating nodes for Cardano (ADA), Cosmos (ATOM), Terra (LUNA), Harmony (ONE), Kava (KAVA) and Desmos (DSM)"
"link": "https://www.kysenpool.io/en/networks#woop",
"description": "Global Proof-of-Stake Validator experienced operating nodes for Cardano (ADA), Cosmos (ATOM), Terra (LUNA), Woop (ONE), Kava (KAVA) and Desmos (DSM)"
},
"0xafebf82ea09eca9ce1913d68fe053226def85732": {
"name": "Validator.ONE",
"link": "https://twitter.validator.one",
"description": "Validator.ONE is an original Harmony foundation node. As an experienced validator, we utilize our deep understanding of the Harmony blockchain to optimize staking rewards and node uptime."
"description": "Validator.ONE is an original Woop foundation node. As an experienced validator, we utilize our deep understanding of the Woop blockchain to optimize staking rewards and node uptime."
},
"0xb26aa1ff4442bacb4a1c8d71754a6724a1aa9313": {
"name": "P-OPS Team Validator",
@ -43,7 +43,7 @@
"0x0a87b64db9631da3a8049838f3dc8c32ab7bd47c": {
"name": "RockTheBlockchain",
"link": "https://www.rocktheblockchain.com",
"description": "Stable, reliable, and trusted validator for Harmony, IT certified in ITIL, Microsoft, and Cisco Systems."
"description": "Stable, reliable, and trusted validator for Woop, IT certified in ITIL, Microsoft, and Cisco Systems."
},
"0x6e3615578043a02c337b3cf43a359705f9cb3647": {
"name": "Staking4All",
@ -58,7 +58,7 @@
"0xd9a43e2019590ebd3151dc72b7caa24f2104d587": {
"name": "Kratos.crazy.one",
"link": "https://kratosvalidator.com",
"description": "Kratos is a Cloud Architect | Entrepreneur | Investor (2M ONE Self Stake) | Believer of Harmony | Top validator since Mainnet"
"description": "Kratos is a Cloud Architect | Entrepreneur | Investor (2M ONE Self Stake) | Believer of Woop | Top validator since Mainnet"
},
"0x3df9b5759c9d851e56a7fa56eddbce19ce0839bf": {
"name": "Chainode Tech Validator",
@ -68,7 +68,7 @@
"0x3d88ff444d18f7bcc530f5f5171048e725aec79c": {
"name": "Chickens Validator",
"link": "https://github.com/xChickens",
"description": "The validator run by Chris Liu (Chickens), the first Harmony software intern and the original dev of Harmony's Testnet (Pangaea)"
"description": "The validator run by Chris Liu (Chickens), the first Woop software intern and the original dev of Woop's Testnet (Pangaea)"
},
"0x63e7e9bb58aa72739a7cec06f6ea9fe73eb7a598": {
"name": "Fortune Validator",
@ -78,12 +78,12 @@
"0xd143988234df9117f4baa00b5f8d4a56d64e56ea": {
"name": "StrongMindsHold",
"link": "https://twitter.com/TimPos4?s=09",
"description": "We are a proven professional staking service provider with an exemplary record on the Harmony blockchain"
"description": "We are a proven professional staking service provider with an exemplary record on the Woop blockchain"
},
"0x05bdb096a46a57b057a839a7a21de7f699851c1e": {
"name": "Smart Stake",
"link": "https://SmartStake.io",
"description": "Transparent, professional, & feature rich service. Harmony grant recipient."
"description": "Transparent, professional, & feature rich service. Woop grant recipient."
},
"one13jewk8w7jah3r9jfahh8rlzpr5r6valascd0mn": {
"name": "JungleCity",
@ -91,14 +91,14 @@
"description": "Foundational Node Validator - Actively managed hardware-secured nodes with geo-separate active-active backups."
},
"0xfe6f41ef98fba9cd1d0e7f9a7d58069374517264": {
"name": "HarmonyHUB",
"link": "https://harmonyHUB.one",
"description": "Formerly Harmony Community Node - HarmonyHUB is a news aggreagator meant to deliver you the news, and save you time."
"name": "WoopHUB",
"link": "https://woopHUB.one",
"description": "Formerly Woop Community Node - WoopHUB is a news aggreagator meant to deliver you the news, and save you time."
},
"0xf54b44ab06c2934cc9578b3da95ec695d07ab15b": {
"name": "Honest Mining",
"link": "https://honestmining.com",
"description": "Best Harmony ONE Staking Platform"
"description": "Best Woop ONE Staking Platform"
},
"0x1d283773701ef4e8b54fe5fbd8df7519875aaacf": {
"name": "Fuzz.Fi Validator",
@ -108,16 +108,16 @@
"0x79f8e1b732ba63987873d5eb86c81364c2cf5021": {
"name": "Mass Stake | Embiei",
"link": "https://www.massstake.com",
"description": "Member of the Foundational Nodes, more than 2 years as a Harmony validator"
"description": "Member of the Foundational Nodes, more than 2 years as a Woop validator"
},
"0x3736aC8400751bf07c6A2E4db3F4f3D9D422abB2": {
"name": "Gnosis Safe Mastercopy: 1.2.0",
"link": "https://multisig.harmony.one",
"link": "https://multisig.wikiwoop.com",
"description": "Logic for Gnosis Safe proxies version 1.2.0"
},
"0x4f9b1dEf3a0f6747bF8C870a27D3DeCdf029100e": {
"name": "Gnosis Safe Proxy Factory: 1.2.0",
"link": "https://multisig.harmony.one",
"link": "https://multisig.wikiwoop.com",
"description": "Factory contract to deploy Gnosis Safe proxies version 1.2.0"
},
"0x1548c6227cbd78e51eb0a679c1f329b9a5a99beb": {
@ -138,7 +138,7 @@
},
"0x00000000000000000000000000000000000000fc": {
"name": "Staking precompile",
"link": "https://staking.harmony.one",
"link": "https://staking.wikiwoop.com",
"description": "This address is used for Metamask staking and smart contract staking. Use the staking website to stake ONE tokens. Please do not directly send tokens to this contract."
}
}

File diff suppressed because one or more lines are too long

@ -2,6 +2,6 @@
"0x4d64b78eaf6129fac30ab51e6d2d679993ea9ddd": {
"address": "0x4cd2563118e57b19179d8dc033f2b0c5b5d69ff5",
"name": "1country domains",
"type": "HRC1155"
"type": "WRC1155"
}
}

File diff suppressed because one or more lines are too long

@ -3,12 +3,12 @@ import useAPIPolling, { APIPollingOptions } from './polling'
import { singletonHook } from 'react-singleton-hook';
// const url = 'https://api.binance.com/api/v1/ticker/24hr?symbol=ONEUSDT'
const url = 'https://api.coingecko.com/api/v3/simple/price?ids=harmony&vs_currencies=usd&include_24hr_change=true'
const url = 'https://api.coingecko.com/api/v3/simple/price?ids=woop&vs_currencies=usd&include_24hr_change=true'
const coinGeckoMapper = (res: any) => {
return {
lastPrice: res.harmony.usd,
priceChangePercent: res.harmony.usd_24h_change
lastPrice: res.woop.usd,
priceChangePercent: res.woop.usd_24h_change
}
}

@ -87,9 +87,9 @@ export const AbiMethodsView = (props: {
? web3
: process.env.REACT_APP_RPC_URL_SHARD0;
const hmyWeb3 = new Web3(web3URL);
const wikiWeb3 = new Web3(web3URL);
const contract = new hmyWeb3.eth.Contract([abiMethod], address);
const contract = new wikiWeb3.eth.Contract([abiMethod], address);
if (abiMethod.name) {
let res;

@ -86,19 +86,19 @@ export const Wallet = (params: {
<Box direction={"column"}>
<Text size="small" color="errorText">
Selected Metamask wallet network is unsupported. Please switch
network to Harmony {isMainNet ? "Mainnet" : "Testnet"}
network to Woop {isMainNet ? "Mainnet" : "Testnet"}
</Text>
<ActionButton
style={{ width: "250px" }}
margin={{ top: "small" }}
onClick={() =>
window.open(
"https://docs.harmony.one/home/network/wallets/browser-extensions-wallets/metamask-wallet",
"https://docs.wikiwoop.com/home/network/wallets/browser-extensions-wallets/metamask-wallet",
"_blank"
)
}
>
Readme Harmony Metamask setup
Readme Woop Metamask setup
</ActionButton>
</Box>
)

@ -197,7 +197,7 @@ export function TokensInfo(props: { value: Token[] }) {
<Box direction={"row"} style={{ paddingTop: "3px" }}>
{erc20Tokens.length ? (
<Box direction={"row"}>
HRC20{" "}
WRC20{" "}
<Box
background={"backgroundBack"}
style={{
@ -214,7 +214,7 @@ export function TokensInfo(props: { value: Token[] }) {
) : null}
{erc721Tokens.length ? (
<Box direction={"row"} margin={{ left: '8px' }}>
HRC721{" "}
WRC721{" "}
<Box
background={"backgroundBack"}
style={{
@ -231,7 +231,7 @@ export function TokensInfo(props: { value: Token[] }) {
) : null}
{erc1155Tokens.length ? (
<Box direction={"row"} margin={{ left: '8px' }}>
HRC1155{" "}
WRC1155{" "}
<Box
background={"backgroundBack"}
style={{
@ -263,7 +263,7 @@ export function TokensInfo(props: { value: Token[] }) {
pad={"xsmall"}
background={"backgroundBack"}
>
<Text>HRC20 tokens</Text>
<Text>WRC20 tokens</Text>
</Box>
),
},
@ -281,7 +281,7 @@ export function TokensInfo(props: { value: Token[] }) {
pad={"xsmall"}
background={"backgroundBack"}
>
<Text>HRC721 tokens</Text>
<Text>WRC721 tokens</Text>
</Box>
),
},
@ -299,7 +299,7 @@ export function TokensInfo(props: { value: Token[] }) {
pad={"xsmall"}
background={"backgroundBack"}
>
<Text>HRC1155 tokens</Text>
<Text>WRC1155 tokens</Text>
</Box>
),
},

@ -19,7 +19,7 @@ import {
TRelatedTransaction,
} from "src/api/client.interface";
import { Inventory } from "./tabs/inventory/Inventory";
import { getAllBalance, hmy_getDelegationsByDelegator, StakingDelegation } from "src/api/rpc";
import { getAllBalance, wiki_getDelegationsByDelegator, StakingDelegation } from "src/api/rpc";
import { ISourceCode, loadSourceCode } from "../../api/explorerV1";
import { AddressDetails, RelatedTransaction, ShardID } from "../../types";
import { ContractDetails } from "./ContractDetails";
@ -140,7 +140,7 @@ export function AddressPage() {
useEffect(() => {
const getStakingInfo = async () => {
try {
const data = await hmy_getDelegationsByDelegator(id)
const data = await wiki_getDelegationsByDelegator(id)
setDelegations(data)
} catch (e) {
console.error('Cannot get staking info', (e as Error).message)
@ -249,7 +249,7 @@ export function AddressPage() {
const erc1155Token = erc1155Map[id] || {};
if (type === "erc20") {
return `HRC20 ${erc20Token.name || ''}`;
return `WRC20 ${erc20Token.name || ''}`;
}
if (type === "erc721") {
@ -257,7 +257,7 @@ export function AddressPage() {
}
if (type === "erc1155") {
const title = `HRC1155 ${erc1155Token.name || ""}`;
const title = `WRC1155 ${erc1155Token.name || ""}`;
const { meta = {}, ...restErc1155 } = erc1155Token;
return meta.image ? (
<Box direction={"row"} align={"center"}>
@ -340,7 +340,7 @@ export function AddressPage() {
<Transactions {...txsCommonProps} type={"internal_transaction"} />
</Tab>
<Tab title={<Text size="small">HRC20 Transfers</Text>}>
<Tab title={<Text size="small">WRC20 Transfers</Text>}>
<Transactions {...txsCommonProps} type={"erc20"} />
</Tab>

@ -3,7 +3,7 @@ import styled from "styled-components";
import { IUserERC721Assets } from "src/api/client.interface";
import { Box, Spinner, Text } from "grommet";
import { Address } from "src/components/ui";
import HarmonyLogo from '../../../../assets/Logo.svg';
import WoopLogo from '../../../../assets/Logo.svg';
export interface IInventoryItemProps {
item: IUserERC721Assets;
@ -111,7 +111,7 @@ export function InventoryItem(props: IInventoryItemProps) {
>
{isLoading ? (
<ErrorPreview direction={"column"} justify={"center"} align={"center"}>
<Image src={HarmonyLogo} />
<Image src={WoopLogo} />
<Box style={{ position: 'absolute' }}>
<Spinner />
</Box>
@ -123,7 +123,7 @@ export function InventoryItem(props: IInventoryItemProps) {
justify={"center"}
align={"center"}
>
<Image src={HarmonyLogo} />
<Image src={WoopLogo} />
<Box style={{ position: 'absolute', bottom: '8px' }}>
<Text style={{ opacity: 0.5 }}>No Image</Text>
</Box>
@ -145,7 +145,7 @@ export function InventoryItem(props: IInventoryItemProps) {
justify={"center"}
align={"center"}
>
<Image src={HarmonyLogo} />
<Image src={WoopLogo} />
<Box style={{ position: 'absolute', bottom: '8px' }}>
<Text style={{ opacity: 0.5 }}>No Image</Text>
</Box>

@ -1,7 +1,7 @@
import { Box, Text } from "grommet";
import { useState } from "react";
import { ApprovalDetails, RPCTransactionHarmony } from "src/types";
import { HarmonyAddress } from "src/utils";
import { ApprovalDetails, RPCTransactionWoop } from "src/types";
import { WoopAddress } from "src/utils";
import { ApprovalsHeader } from "src/components/approvals/approvalsHeader";
import { Wallet } from "../../ContractDetails/ConnectWallets";
import { ApprovalsRenderer } from "src/components/approvals/approvalsRenderer";
@ -40,18 +40,18 @@ export function TokenApprovals(props: { contractAddress?: string }) {
return;
}
const harmonyAddress = new HarmonyAddress(account);
const contractHarmonyAddr = contractAddress.length > 0 ? new HarmonyAddress(contractAddress) : null;
const woopAddress = new WoopAddress(account);
const contractWoopAddr = contractAddress.length > 0 ? new WoopAddress(contractAddress) : null;
const key = account + (contractHarmonyAddr ? contractAddress : "");
const key = account + (contractWoopAddr ? contractAddress : "");
const pageSize = 100;
let pageIndex = ApprovalCache.get(account + "-" + key + "-index") || 0;
let result: { txnHistory: ApprovalDetails[], dataObj: RPCTransactionHarmony[] } = { txnHistory: ApprovalCache.get(account + "-" + key + "-txnHistory") || [], dataObj: [] };
let result: { txnHistory: ApprovalDetails[], dataObj: RPCTransactionWoop[] } = { txnHistory: ApprovalCache.get(account + "-" + key + "-txnHistory") || [], dataObj: [] };
try {
do {
result = await getAllApprovalsForTokens(harmonyAddress.basicHex,
contractHarmonyAddr?.basicHex || "",
result = await getAllApprovalsForTokens(woopAddress.basicHex,
contractWoopAddr?.basicHex || "",
pageIndex,
pageSize,
result.txnHistory,

@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
import { Box, Heading, Text } from "grommet";
import { BasePage, BaseContainer } from "src/components/ui";
import { TransactionsTable } from "../../components/tables/TransactionsTable";
import { Filter, RPCTransactionHarmony } from "../../types";
import { Filter, RPCTransactionWoop } from "../../types";
import { useHistory } from "react-router-dom";
import { getTransactions, getCount } from "src/api/client";
import { ShardDropdown } from "src/components/ui/ShardDropdown";
@ -19,7 +19,7 @@ export function AllTransactionsPage() {
filters: [{ type: "gte", property: "block_number", value: 0 }],
};
const [trxs, setTrxs] = useState<RPCTransactionHarmony[]>([]);
const [trxs, setTrxs] = useState<RPCTransactionWoop[]>([]);
const [count, setCount] = useState<string>("");
const [filter, setFilter] = useState<Filter>(initFilter);
@ -56,7 +56,7 @@ export function AllTransactionsPage() {
try {
let trxs = await getTransactions([+shardNumber, filter]);
setTrxs(trxs as RPCTransactionHarmony[]);
setTrxs(trxs as RPCTransactionWoop[]);
} catch (err) {
console.log(err);
}

@ -2,14 +2,14 @@ import React, { useEffect, useState } from "react";
import { Box, Heading, Tab, Tabs, Text } from "grommet";
import { BasePage, BaseContainer } from "src/components/ui";
import { TransactionsTable } from "../../components/tables/TransactionsTable";
import { ApprovalDetails, Filter, RPCTransactionHarmony } from "../../types";
import { ApprovalDetails, Filter, RPCTransactionWoop } from "../../types";
import { useHistory } from "react-router-dom";
import { getTransactions, getCount } from "src/api/client";
import { ShardDropdown } from "src/components/ui/ShardDropdown";
import { useParams } from "react-router-dom";
import { ToolsTab } from "../AddressPage/tabs/tools";
import { ApprovalsRenderer } from "src/components/approvals/approvalsRenderer";
import { HarmonyAddress } from "src/utils";
import { WoopAddress } from "src/utils";
import { ApiCache } from "src/api/ApiCache";
import { getAllApprovalsForTokens } from "src/api/rpc";
import { revokePermission } from "src/utils/approvals";
@ -50,15 +50,15 @@ export function ApprovalPage() {
return;
}
const harmonyAddress = new HarmonyAddress(account);
const woopAddress = new WoopAddress(account);
const key = account;
let pageIndex = ApprovalCache.get(key + "-index") || 0;
const pageSize = 100;
let result: { txnHistory: ApprovalDetails[], dataObj: RPCTransactionHarmony[] } = { txnHistory: ApprovalCache.get(key + "-txnHistory") || [], dataObj: [] };
let result: { txnHistory: ApprovalDetails[], dataObj: RPCTransactionWoop[] } = { txnHistory: ApprovalCache.get(key + "-txnHistory") || [], dataObj: [] };
try {
do {
result = await getAllApprovalsForTokens(harmonyAddress.basicHex,
result = await getAllApprovalsForTokens(woopAddress.basicHex,
"",
pageIndex,
pageSize,
@ -117,7 +117,7 @@ export function ApprovalPage() {
return (
<BaseContainer pad={{ horizontal: "0" }}>
<Heading size="small" margin={{ bottom: "medium", top: "0" }}>
Harmony Token Approvals
Woop Token Approvals
</Heading>
<BasePage pad={"small"} style={{ overflow: "inherit" }}>
<Box direction="column">
@ -149,30 +149,30 @@ export function ApprovalPage() {
}}
>
<Tab title={<Text size="small">HRC20</Text>}>
<Tab title={<Text size="small">WRC20</Text>}>
</Tab>
<Tab title={<Text size="small">HRC1155</Text>}>
<Tab title={<Text size="small">WRC1155</Text>}>
</Tab>
<Tab title={<Text size="small">HRC721</Text>}>
<Tab title={<Text size="small">WRC721</Text>}>
</Tab>
</Tabs>
<Box margin={{top: "small"}}>
{
activeIndex === 0 &&
<ApprovalsRenderer data={data.filter(details => erc20Pool[details.assetAddress])} isLoading={isLoading} revokeClicked={revokePermissions} account={metamaskAddress} title="for all HRC20" />
<ApprovalsRenderer data={data.filter(details => erc20Pool[details.assetAddress])} isLoading={isLoading} revokeClicked={revokePermissions} account={metamaskAddress} title="for all WRC20" />
}
{
activeIndex === 1 &&
<ApprovalsRenderer data={data.filter(details => erc1155Pool[details.assetAddress])} isLoading={isLoading} revokeClicked={revokePermissions} account={metamaskAddress} title="for all HRC1155" />
<ApprovalsRenderer data={data.filter(details => erc1155Pool[details.assetAddress])} isLoading={isLoading} revokeClicked={revokePermissions} account={metamaskAddress} title="for all WRC1155" />
}
{
activeIndex === 2 &&
<ApprovalsRenderer data={data.filter(details => erc721Pool[details.assetAddress])} isLoading={isLoading} revokeClicked={revokePermissions} account={metamaskAddress} title="for all HRC721" />
<ApprovalsRenderer data={data.filter(details => erc721Pool[details.assetAddress])} isLoading={isLoading} revokeClicked={revokePermissions} account={metamaskAddress} title="for all WRC721" />
}
</Box>
</Box>}

@ -28,15 +28,15 @@ export const ActiveAddresses = () => {
}, [])
const dailyPageProps = {
title: 'Harmony Daily Active Addresses',
title: 'Woop Daily Active Addresses',
description: 'The Active Address chart shows the daily number of unique addresses that were active on the network as a sender or receiver',
unitLabel: 'addresses',
items,
isLoading,
loadingError,
chart: {
yAxisLabel: 'Active Harmony Addresses',
tooltipLabel: 'Active Harmony Addresses'
yAxisLabel: 'Active Woop Addresses',
tooltipLabel: 'Active Woop Addresses'
},
renderMaxValue: (value: string, date: string) => {
return `Highest number of ${value} addresses on ${date}`

@ -28,7 +28,7 @@ export const AverageBlockSize = () => {
}, [])
const dailyPageProps = {
title: 'Harmony Average Block Size',
title: 'Woop Average Block Size',
unitLabel: 'blocksize',
items,
isLoading,

@ -28,7 +28,7 @@ export const AverageFee = () => {
}, [])
const dailyPageProps = {
title: 'Harmony Daily Average Fee',
title: 'Woop Daily Average Fee',
unitLabel: 'fee',
items,
isLoading,

@ -28,7 +28,7 @@ export const DailyTransactions = () => {
}, [])
const dailyPageProps = {
title: 'Harmony Daily Transactions',
title: 'Woop Daily Transactions',
unitLabel: 'transactions',
items,
isLoading,

@ -1,6 +1,6 @@
import {useEffect, useState} from 'react'
import { StatPage } from './StatPage';
import { hmyv2_getNodeMetadata } from 'src/api/rpc';
import { wikiv2_getNodeMetadata } from 'src/api/rpc';
import { config } from 'src/config';
const CONSENSUS = "consensus"
@ -19,7 +19,7 @@ export const ViewChangeStats = () => {
try {
setIsLoading(true)
for (let i in availableShards) {
const nodeMetadata = await hmyv2_getNodeMetadata(i)
const nodeMetadata = await wikiv2_getNodeMetadata(i)
const blockHeight = nodeMetadata[CONSENSUS][BLOCK_NUM]
const viewId = nodeMetadata[CONSENSUS][VIEW_ID]
const viewChange = viewId - blockHeight
@ -41,7 +41,7 @@ export const ViewChangeStats = () => {
}, [])
const viewChangeProps = {
title: 'Harmony View Change Statistics',
title: 'Woop View Change Statistics',
description: '',
items: items,
keys: ['viewChange', 'viewId', 'blockHeight'],

@ -85,7 +85,7 @@ export function ChartsPage() {
return (
<BaseContainer pad={{ horizontal: "0" }}>
<Heading size="small" margin={{ bottom: "medium", top: "0" }}>
<Box direction={"row"}>Harmony One Charts</Box>
<Box direction={"row"}>Woop One Charts</Box>
</Heading>
<BasePage pad={'0'} style={{overflow: 'inherit'}}>
<Box border={{ side: 'bottom' }} pad={"small"}>

@ -145,7 +145,7 @@ function getColumns(props: any) {
render: (data: Erc20) => <Box direction={'row'} style={{ display: 'flex', alignItems: 'center' }}>
<Text size={'small'}>{data.name}</Text>
{data.isBridged && <div style={{ marginLeft: "4px", height: '14px', cursor: 'pointer' }}>
<Tip dropProps={{ align: { bottom: "top" }}} content={<TipContent showArrow={true} message={'Token is available on Harmony Bridge'} />}>
<Tip dropProps={{ align: { bottom: "top" }}} content={<TipContent showArrow={true} message={'Token is available on Woop Bridge'} />}>
<StatusGood size={'14px'} color={'successText'} />
</Tip>
</div>}

@ -78,7 +78,7 @@ export const ERC1155List = () => {
return (
<>
<Heading size="xsmall" margin={{ top: "0" }}>
HRC1155 Tokens
WRC1155 Tokens
</Heading>
<BasePage>
<Box width="100%" pad={{ bottom: "medium" }}>

@ -131,7 +131,7 @@ function getColumns(props: any) {
render: (data: Erc20) => <Box direction={'row'} style={{ display: 'flex', alignItems: 'center' }}>
<Text size={'small'}>{data.name}</Text>
{data.isBridged && <div style={{ marginLeft: "4px", height: '14px', cursor: 'pointer' }}>
<Tip dropProps={{ align: { bottom: "top" }}} content={<TipContent showArrow={true} message={'Token is available on Harmony Bridge'} />}>
<Tip dropProps={{ align: { bottom: "top" }}} content={<TipContent showArrow={true} message={'Token is available on Woop Bridge'} />}>
<StatusGood size={'14px'} color={'successText'} />
</Tip>
</div>}

@ -79,7 +79,7 @@ export const ERC20List = () => {
return (
<>
<Heading size="xsmall" margin={{ top: "0" }}>
HRC20 Tokens
WRC20 Tokens
</Heading>
<BasePage>
<Box width="100%" pad={{ bottom: "medium" }}>

@ -130,7 +130,7 @@ function getColumns(props: any) {
render: (data: Erc20) => <Box direction={'row'} style={{ display: 'flex', alignItems: 'center' }}>
<Text size={'small'}>{data.name}</Text>
{data.isBridged && <div style={{ marginLeft: "4px", height: '14px', cursor: 'pointer' }}>
<Tip dropProps={{ align: { bottom: "top" }}} content={<TipContent showArrow={true} message={'Token is available on Harmony Bridge'} />}>
<Tip dropProps={{ align: { bottom: "top" }}} content={<TipContent showArrow={true} message={'Token is available on Woop Bridge'} />}>
<StatusGood size={'14px'} color={'successText'} />
</Tip>
</div>}

@ -78,7 +78,7 @@ export const ERC721List = () => {
return (
<>
<Heading size="xsmall" margin={{ top: "0" }}>
HRC721 Tokens
WRC721 Tokens
</Heading>
<BasePage>
<Box width="100%" pad={{ bottom: "medium" }}>

@ -41,7 +41,7 @@ const mapRelatedTxToExport = (ownerAddress: string, tx: RelatedTransaction, oneP
}
}
const mapHrc20TxToExport = (ownerAddress: string, tx: any, erc20Map: Record<string, Erc20>, erc721Map: Record<string, ERC721>, erc1155Map: Record<string, ERC1155>) => {
const mapWrc20TxToExport = (ownerAddress: string, tx: any, erc20Map: Record<string, Erc20>, erc721Map: Record<string, ERC721>, erc1155Map: Record<string, ERC1155>) => {
const txDate = dayjs(tx.timestamp)
const token = erc20Map[tx.address] || erc721Map[tx.address] || erc1155Map[tx.address]
const precision = token ? token.decimals : 18
@ -95,7 +95,7 @@ export const downloadCSV = (params: IDownloadCsvParams, filename: string) => {
const mapTx = (tx: any) => {
if(type === 'erc20') {
return mapHrc20TxToExport(address, tx, erc20Map, erc721Map, erc1155Map)
return mapWrc20TxToExport(address, tx, erc20Map, erc721Map, erc1155Map)
} else if (type === 'internal_transaction') {
return mapInternalTxToExport(address, tx, onePrice)
}

@ -14,7 +14,7 @@ import {useERC20Pool} from "../../hooks/ERC20_Pool";
import {useERC721Pool} from "../../hooks/ERC721_Pool";
import {useERC1155Pool} from "../../hooks/ERC1155_Pool";
const erc20TransfersURL = 'https://api-hrc-tx.t.hmny.io'
const erc20TransfersURL = 'https://api-wrc-tx.t.hmny.io'
const IconError = styled(StatusCritical)`
margin-right: 5px;

@ -10,7 +10,7 @@ import {Address, BasePage} from "src/components/ui";
import {ERC1155, useERC1155Pool} from "src/hooks/ERC1155_Pool";
import {ERC721, useERC721Pool} from "src/hooks/ERC721_Pool";
import styled from "styled-components";
import HarmonyLogo from '../../assets/Logo.svg';
import WoopLogo from '../../assets/Logo.svg';
import { linkedContractsMap, config } from '../../config'
import {ERC1155Icon} from "../../components/ui/ERC1155Icon";
import dayjs from "dayjs";
@ -79,7 +79,7 @@ const NFTImage = (props: NFTImageProps) => {
return <ImageContainer width={'inherit'} height={'inherit'} justify={'center'} align={'center'}>
{isLoading &&
<Image src={HarmonyLogo} style={{ height: '50%' }} />
<Image src={WoopLogo} style={{ height: '50%' }} />
}
<Image
src={imageUrl}

@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react";
import { Box, DataTable, Spinner, Text } from "grommet";
import { RPCTransactionHarmony } from "src/types";
import { RPCTransactionWoop } from "src/types";
import { useHistory } from "react-router-dom";
import { Address } from "src/components/ui";
import { getTransactions } from "src/api/client";
@ -20,7 +20,7 @@ function getColumns(props: any) {
Shard
</Text>
),
render: (data: RPCTransactionHarmony) => (
render: (data: RPCTransactionWoop) => (
<Box direction="row" gap="3px" align="center">
<Text size="small">{data.shardID}</Text>
<FormNextLink
@ -39,7 +39,7 @@ function getColumns(props: any) {
Hash
</Text>
),
render: (data: RPCTransactionHarmony) => (
render: (data: RPCTransactionWoop) => (
<Text size="small" style={{ cursor: "pointer" }} color="brand">
<Address
type={"tx"}
@ -58,7 +58,7 @@ function getColumns(props: any) {
From
</Text>
),
render: (data: RPCTransactionHarmony) => (
render: (data: RPCTransactionWoop) => (
<Address address={data.from} isShort hideCopyBtn />
),
},
@ -69,7 +69,7 @@ function getColumns(props: any) {
To
</Text>
),
render: (data: RPCTransactionHarmony) => (
render: (data: RPCTransactionWoop) => (
<Address address={data.to} isShort hideCopyBtn />
),
},
@ -80,7 +80,7 @@ function getColumns(props: any) {
Timestamp
</Text>
),
render: (data: RPCTransactionHarmony) => (
render: (data: RPCTransactionWoop) => (
<DateTime
date={new Date(data.timestamp)}
/>
@ -102,7 +102,7 @@ export function LatestTransactionsTable() {
const hidden = useWindowFocused();
const history = useHistory();
const [transactions, setTransactions] = useState<RPCTransactionHarmony[]>([]);
const [transactions, setTransactions] = useState<RPCTransactionWoop[]>([]);
const { availableShards } = config
useEffect(() => {
@ -128,7 +128,7 @@ export function LatestTransactionsTable() {
setTransactions(
trxsList
.sort((a, b) => (a.timestamp < b.timestamp ? 1 : -1))
.slice(0, 10) as RPCTransactionHarmony[]
.slice(0, 10) as RPCTransactionWoop[]
);
} catch (err) {
console.log(err);

@ -1,4 +1,4 @@
import { RPCStakingTransactionHarmony } from "src/types";
import { RPCStakingTransactionWoop } from "src/types";
import { BasePage } from "src/components/ui";
import { useParams } from "react-router-dom";
@ -8,13 +8,13 @@ import { getStakingTransactionByField } from "src/api/client";
import { TransactionDetails } from "src/components/transaction/TransactionDetails";
import { StakingTransactionType } from "src/types";
import { TransactionSubType } from "src/components/transaction/helpers";
import { hmyv2_getTransactionReceipt } from "src/api/rpc";
import { wikiv2_getTransactionReceipt } from "src/api/rpc";
import { config } from "../../config";
export const StakingTransactionPage = () => {
// @ts-ignore
const { id } = useParams();
const [tx, setTx] = useState<RPCStakingTransactionHarmony | null>(null);
const [tx, setTx] = useState<RPCStakingTransactionWoop | null>(null);
const { availableShards } = config
@ -41,7 +41,7 @@ export const StakingTransactionPage = () => {
}
try {
const txnReceipt = await hmyv2_getTransactionReceipt([id], shardNumber)
const txnReceipt = await wikiv2_getTransactionReceipt([id], shardNumber)
if (txnReceipt && txnReceipt.result) {
if (tx.type === "CollectRewards" && tx.amount === null) {
tx.amount = txnReceipt.result.logs[0].data
@ -54,7 +54,7 @@ export const StakingTransactionPage = () => {
}
} catch {}
}
setTx(tx as RPCStakingTransactionHarmony);
setTx(tx as RPCStakingTransactionWoop);
};
exec();
}, [id]);

@ -3,7 +3,7 @@ import {Box, Text} from "grommet";
import {MetricsTopItem, MetricsTopType} from "../../types";
import styled from "styled-components";
import {Address} from "../../components/ui";
import {ReactComponent as HarmonyLogo} from '../../assets/Logo.svg';
import {ReactComponent as WoopLogo} from '../../assets/Logo.svg';
export interface TopTableProps {
@ -92,7 +92,7 @@ const TopTableRow = (props: TopTableRowProps) => {
</Box>
<Box width={columnsWidth[2]} direction={'row'} align={'center'} gap={'6px'}>
{isOneTransfer && <LogoWrapper>
<HarmonyLogo width={'12px'} height={'12px'} />
<WoopLogo width={'12px'} height={'12px'} />
</LogoWrapper> }
<Text size={'xsmall'}>{valueFormatEn}</Text>
</Box>

@ -1,7 +1,7 @@
import { TransactionDetails } from "src/components/transaction/TransactionDetails";
import { InternalTransactionList } from "src/components/transaction/InternalTransactionList";
import { TransactionLogs } from "src/components/transaction/TransactionLogs";
import {IHexSignature, InternalTransaction, RPCTransactionHarmony, TxReceipt} from "src/types";
import {IHexSignature, InternalTransaction, RPCTransactionWoop, TxReceipt} from "src/types";
import { BaseContainer, BasePage } from "src/components/ui";
import { useHistory, useParams } from "react-router-dom";
@ -14,7 +14,7 @@ import {
getByteCodeSignatureByHash,
} from "src/api/client";
import { revertErrorMessage } from "src/web3/parseByteCode";
import { hmyv2_getTransactionReceipt } from "src/api/rpc";
import { wikiv2_getTransactionReceipt } from "src/api/rpc";
import useQuery from "../../hooks/useQuery";
import { config } from "../../config";
@ -29,7 +29,7 @@ const extractError = (err: any) => {
return errorMessage || err;
};
const getTxInputSignature = async (trx: RPCTransactionHarmony) => {
const getTxInputSignature = async (trx: RPCTransactionWoop) => {
let signature
try {
const signatures = await getByteCodeSignatureByHash([trx.input.slice(0, 10)])
@ -42,7 +42,7 @@ const getTxInputSignature = async (trx: RPCTransactionHarmony) => {
return signature
}
const getTransactionErrorMessage = (txHash: string, tx: RPCTransactionHarmony) => {
const getTransactionErrorMessage = (txHash: string, tx: RPCTransactionWoop) => {
if(txHash.length !== 66) {
return 'Invalid Txn hash'
}
@ -59,7 +59,7 @@ export const TransactionPage = () => {
const activeTab = query.get('activeTab') || '0';
// hash or number
const [tx, setTx] = useState<RPCTransactionHarmony>({} as RPCTransactionHarmony);
const [tx, setTx] = useState<RPCTransactionWoop>({} as RPCTransactionWoop);
const [txReceipt, setTxReceipt] = useState<TxReceipt>();
const [trxs, setTrxs] = useState<InternalTransaction[]>([]);
const [logs, setLogs] = useState<any[]>([]);
@ -94,7 +94,7 @@ export const TransactionPage = () => {
}
if (trx) {
const txnReceipt = await hmyv2_getTransactionReceipt([id], shard);
const txnReceipt = await wikiv2_getTransactionReceipt([id], shard);
if (txnReceipt && txnReceipt.result) {
setTxReceipt(txnReceipt.result)
if(txnReceipt.result.gasUsed) {
@ -108,7 +108,7 @@ export const TransactionPage = () => {
}
const txData = trx || {}
setTx(txData as RPCTransactionHarmony);
setTx(txData as RPCTransactionWoop);
setInputSignature(trxInputSignature)
return txData
};

@ -95,7 +95,7 @@ const erc20ABIManager = ABIManager(ERC20ABI as IABI)
const erc721ABIManager = ABIManager(ERC721ABI as IABI)
const erc1155ABIManager = ABIManager(ERC1155ABI as IABI)
export function CheckHRC() {
export function CheckWRC() {
const query = useQuery();
const history = useHistory();
const queryAddress = query.get('address') || '';
@ -178,7 +178,7 @@ export function CheckHRC() {
setMatchedEvents([])
if (contractAddress) {
history.push({
pathname: "/tools/checkHrc",
pathname: "/tools/checkWrc",
search: `?address=${contractAddress}`
});
getContract()
@ -202,7 +202,7 @@ export function CheckHRC() {
return (
<BaseContainer pad={{ horizontal: "0" }}>
<Heading size="small" margin={{ bottom: "medium", top: "0" }}>
Check HRC
Check WRC
</Heading>
<BasePage pad={"small"} style={{ overflow: "inherit" }}>
<Box>

@ -2,7 +2,7 @@ import * as blockchain from './blockchain'
export type FilterType = 'gt' | 'gte' | 'lt' | 'lte' | 'eq'
export type FilterProperty = 'number' | 'block_number' | 'address' | 'to'
export type TransactionQueryField = 'block_number' | 'block_hash' | 'hash' | 'hash_harmony'
export type TransactionQueryField = 'block_number' | 'block_hash' | 'hash' | 'hash_woop'
export type StakingTransactionQueryField = 'block_number' | 'block_hash' | 'hash'
export type TransactionQueryValue =
| blockchain.BlockNumber

@ -5,10 +5,10 @@ export type RPCETHMethod =
| "eth_getBlocks"
| "trace_block";
export type RPCHarmonyMethod =
| "hmy_getBlockByNumber"
| "hmy_getTransactionByHash"
| "hmy_getBlocks"
export type RPCWoopMethod =
| "wiki_getBlockByNumber"
| "wiki_getTransactionByHash"
| "wiki_getBlocks"
| "debug_traceTransaction";
export type ShardID = 0 | 1 | 2 | 3;
@ -46,7 +46,7 @@ export type TokenType =
| "ERC1155"
| "ERC721";
export type RPCBlockHarmony = {
export type RPCBlockWoop = {
difficulty: string;
extraData: string;
gasLimit: string;
@ -63,8 +63,8 @@ export type RPCBlockHarmony = {
size: string;
stateRoot: string;
timestamp: string;
transactions: RPCTransactionHarmony[];
stakingTransactions: RPCStakingTransactionHarmony[];
transactions: RPCTransactionWoop[];
stakingTransactions: RPCStakingTransactionWoop[];
transactionsRoot: string;
uncles: string[];
epoch: string;
@ -74,7 +74,7 @@ export type RPCBlockHarmony = {
type Modify<T, R> = Omit<T, keyof R> & R;
export type Block = Modify<
RPCBlockHarmony,
RPCBlockWoop,
{
number: string;
epoch: string;
@ -88,10 +88,10 @@ export type Block = Modify<
>;
export type Address = string;
export type AddressHarmony = string;
export type AddressWoop = string;
export type TransactionHash = string;
export type TransactionHarmonyHash = string;
export type TransactionWoopHash = string;
export type RPCTransaction = {
blockHash: BlockHash;
@ -111,15 +111,15 @@ export type RPCTransaction = {
value: string;
};
export type RPCTransactionHarmony = {
export type RPCTransactionWoop = {
blockHash: BlockHash;
blockNumber: BlockHexNumber;
from: AddressHarmony;
to: AddressHarmony;
from: AddressWoop;
to: AddressWoop;
gas: string;
gasPrice: string;
gasLimit: string;
hash: TransactionHarmonyHash;
hash: TransactionWoopHash;
ethHash: TransactionHash;
input: ByteCode;
nonce: string;
@ -139,16 +139,16 @@ export type StakingTransactionType =
| "Undelegate"
| "Delegate";
export type RPCStakingTransactionHarmony = {
export type RPCStakingTransactionWoop = {
type: StakingTransactionType;
blockHash: BlockHash;
blockNumber: BlockHexNumber;
from: AddressHarmony;
to: AddressHarmony;
from: AddressWoop;
to: AddressWoop;
gas: string;
gasPrice: string;
gasLimit: string;
hash: TransactionHarmonyHash;
hash: TransactionWoopHash;
input: ByteCode;
nonce: string;
r: string;
@ -163,7 +163,7 @@ export type RPCStakingTransactionHarmony = {
};
// todo
export type StakingTransaction = RPCStakingTransactionHarmony;
export type StakingTransaction = RPCStakingTransactionWoop;
export type Topic = string;
export type ByteCode = string;
@ -235,7 +235,7 @@ export type InternalTransaction = {
};
export type Transaction = {
harmony: RPCTransactionHarmony;
woop: RPCTransactionWoop;
eth: RPCTransaction;
};
@ -245,7 +245,7 @@ export type AddressTransactionType =
| "internal_transaction";
export type Address2Transaction = {
blockNumber: BlockNumber;
transactionHash: TransactionHash | TransactionHarmonyHash;
transactionHash: TransactionHash | TransactionWoopHash;
address: Address;
transactionType: AddressTransactionType;
};

@ -1,5 +1,5 @@
import { HarmonyAddress } from "./getAddress/GetAddress";
import { ApprovalDetails, RPCTransactionHarmony, TokenType } from "../types/blockchain";
import { WoopAddress } from "./getAddress/GetAddress";
import { ApprovalDetails, RPCTransactionWoop, TokenType } from "../types/blockchain";
import Web3 from "web3";
import { AbiItem } from 'web3-utils';
import detectEthereumProvider from "@metamask/detect-provider";
@ -42,7 +42,7 @@ const approvalNonFungibleABI: AbiItem[] = [
];
export const convertTxnToObj = (tx: any, type: TokenType): ApprovalDetails => {
const assetAddress = new HarmonyAddress(tx.to).basicHex;
const assetAddress = new WoopAddress(tx.to).basicHex;
const approvedObj: ApprovalDetails = {
hash: tx.hash,
@ -51,7 +51,7 @@ export const convertTxnToObj = (tx: any, type: TokenType): ApprovalDetails => {
spender: "0x" + tx.input.substring(34, 74),
allowance: allowanceAmount(tx),
action: "action",
account: new HarmonyAddress(tx.from).basicHex,
account: new WoopAddress(tx.from).basicHex,
contract: tx.to,
type: type
};
@ -92,11 +92,11 @@ const unlimitedAllowance = "ffffffffffffffffffffffffffffffffffffffffffffffffffff
const EMPTY_ADDRESS = "0x0000000000000000000000000000000000000000";
export const matchesApproveAllNonFungible = (tx: RPCTransactionHarmony): boolean => {
export const matchesApproveAllNonFungible = (tx: RPCTransactionWoop): boolean => {
return tx.input.includes(approvalAll1155Hash) || tx.input.includes(approvalAll721Hash);
}
export const matchesApprovalMethod = (tx: RPCTransactionHarmony): boolean => {
export const matchesApprovalMethod = (tx: RPCTransactionWoop): boolean => {
return tx.input.includes(approval20Hash) ||
tx.input.includes(approval721Hash) ||
@ -105,14 +105,14 @@ export const matchesApprovalMethod = (tx: RPCTransactionHarmony): boolean => {
tx.input.includes(approvalAll721Hash);
}
export const filterTransactions = (tx: RPCTransactionHarmony,
export const filterTransactions = (tx: RPCTransactionWoop,
txnHistory: ApprovalDetails[],
spender: string,
erc20: ERC20_Pool = {},
erc1155: ERC1155_Pool = {},
erc721: ERC721_Pool = {}): ApprovalDetails[] => {
// filter txn history. if erc20 then just remove
const to = new HarmonyAddress(tx.to).basicHex;
const to = new WoopAddress(tx.to).basicHex;
if (erc20[to]) {
// remove any other occurrence of the spender and the contract in the list of txn (current tx is latest)
txnHistory = txnHistory.filter(transaction => !(transaction.spender === spender && transaction.contract === tx.to));
@ -139,7 +139,7 @@ export const filterTransactions = (tx: RPCTransactionHarmony,
}
export const hasAllowance = (tx: RPCTransactionHarmony, spender: string, type: TokenType): boolean => {
export const hasAllowance = (tx: RPCTransactionWoop, spender: string, type: TokenType): boolean => {
if (type === "ERC20" && tx.input.includes(approval20Hash)) {
const allowance = tx.input.substring(74);
return parseInt(allowance, 16) !== 0;
@ -156,7 +156,7 @@ export const hasAllowance = (tx: RPCTransactionHarmony, spender: string, type: T
return false;
}
export const allowanceAmount = (tx: RPCTransactionHarmony): string => {
export const allowanceAmount = (tx: RPCTransactionWoop): string => {
if (tx.input.includes(approval20Hash)) {
const allowance = tx.input.substring(74);
if (allowance.includes(unlimitedAllowance)) {
@ -178,19 +178,19 @@ export const revokePermission = async (tx: ApprovalDetails) => {
// web3.eth.abi.encodeFunctionSignature
const hmyWeb3 = new Web3(web3Provider);
const wikiWeb3 = new Web3(web3Provider);
if (tx.type === "ERC20") {
const contract = new hmyWeb3.eth.Contract(approvalERC20ABI, contractAddress);
const contract = new wikiWeb3.eth.Contract(approvalERC20ABI, contractAddress);
await contract.methods.approve(spender, 0).send({ from: account });
}
else if (tx.type === "ERC1155" || tx.type === "ERC721") {
if (tx.isFullApproval) {
const contract = new hmyWeb3.eth.Contract(approvalNonFungibleABI, contractAddress);
const contract = new wikiWeb3.eth.Contract(approvalNonFungibleABI, contractAddress);
await contract.methods.setApprovalForAll(spender, false).send({ from: account }); // clear approvals for all
}
else {
const contract = new hmyWeb3.eth.Contract(approvalNonFungibleABI, contractAddress);
const contract = new wikiWeb3.eth.Contract(approvalNonFungibleABI, contractAddress);
await contract.methods.approve(EMPTY_ADDRESS, tx.tokenId).send({ from: account }); // clear approval for tokenId
}
}

@ -11,25 +11,25 @@ import { fromBech32, toBech32, HRP, tHRP } from "./bech32";
*
* ```
* // Step 1: import the class
* const { HarmonyAddress } = require('@harmony-js/crypto');
* const { WoopAddress } = require('@woop-js/crypto');
*
* // Step 2: call functions
* const addr = 'one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7'
* const res = HarmonyAddress.isValidBech32(addr);
* const res = WoopAddress.isValidBech32(addr);
* console.log(res);
* ```
*/
export class HarmonyAddress {
export class WoopAddress {
/**
* @example
* ```
* const addr = 'one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7'
* const res = HarmonyAddress.isValidBech32(addr);
* const res = WoopAddress.isValidBech32(addr);
* console.log(res);
* ```
*/
static isValidBasic(str: string) {
const toTest = new HarmonyAddress(str);
const toTest = new WoopAddress(str);
return toTest.raw === toTest.basic;
}
@ -37,12 +37,12 @@ export class HarmonyAddress {
* @example
* ```
* const addr = 'one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7'
* const res = HarmonyAddress.isValidBech32(addr);
* const res = WoopAddress.isValidBech32(addr);
* console.log(res);
* ```
*/
static isValidBech32(str: string) {
const toTest = new HarmonyAddress(str);
const toTest = new WoopAddress(str);
return toTest.raw === toTest.bech32;
}
@ -50,12 +50,12 @@ export class HarmonyAddress {
* @example
* ```
* const addr = 'one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7'
* const res = HarmonyAddress.isValidBech32TestNet(addr);
* const res = WoopAddress.isValidBech32TestNet(addr);
* console.log(res);
* ```
*/
static isValidBech32TestNet(str: string) {
const toTest = new HarmonyAddress(str);
const toTest = new WoopAddress(str);
return toTest.raw === toTest.bech32TestNet;
}
@ -68,7 +68,7 @@ export class HarmonyAddress {
* @example
* ```
* const addr = 'one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7'
* const instance = new HarmonyAddress(addr);
* const instance = new WoopAddress(addr);
* console.log(instance.basicHex);
* ```
*/
@ -80,7 +80,7 @@ export class HarmonyAddress {
* @example
* ```
* const addr = 'one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7'
* const instance = new HarmonyAddress(addr);
* const instance = new WoopAddress(addr);
* console.log(instance.bech32);
* ```
*/
@ -92,7 +92,7 @@ export class HarmonyAddress {
* @example
* ```
* const addr = 'one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7'
* const instance = new HarmonyAddress(addr);
* const instance = new WoopAddress(addr);
* console.log(instance.bech32TestNet);
* ```
*/
@ -113,7 +113,7 @@ export class HarmonyAddress {
* @example
* ```
* const addr = 'one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7'
* const instance = new HarmonyAddress(addr);
* const instance = new WoopAddress(addr);
* const res = instance.getBasic(addr);
* console.log(res)
* ```
@ -142,32 +142,32 @@ export class HarmonyAddress {
}
/**
* Using this function to get Harmony format address
* Using this function to get Woop format address
*
* @param address
*
* @example
* ```javascript
* const { Harmony } = require('@harmony-js/core');
* const { ChainID, ChainType } = require('@harmony-js/utils');
* const { randomBytes } = require('@harmony-js/crypto')
* const { Woop } = require('@woop-js/core');
* const { ChainID, ChainType } = require('@woop-js/utils');
* const { randomBytes } = require('@woop-js/crypto')
*
* const hmy = new Harmony(
* const wiki = new Woop(
* 'http://localhost:9500',
* {
* chainType: ChainType.Harmony,
* chainId: ChainID.HmyLocal,
* chainType: ChainType.Woop,
* chainId: ChainID.WikiLocal,
* },
* );
*
* const bytes = randomBytes(20);
* const hAddress = hmy.crypto.getAddress(bytes);
* const hAddress = wiki.crypto.getAddress(bytes);
* console.log(hAddress)
* ```
*/
export function getAddress(address: string) {
try {
return new HarmonyAddress(address);
return new WoopAddress(address);
} catch (error) {
throw error;
}

@ -1,6 +1,6 @@
/**
* @packageDocumentation
* @module harmony-crypto
* @module woop-crypto
* @hidden
*/
@ -127,7 +127,7 @@ export const bech32Decode = (bechString: string) => {
return { hrp, data: Buffer.from(data.slice(0, data.length - 6)) };
};
// HRP is the human-readable part of Harmony bech32 addresses
// HRP is the human-readable part of Woop bech32 addresses
export const HRP = "one";
export const tHRP = "tone";
@ -184,14 +184,14 @@ export const convertBits = (
/**
* toBech32Address
*
* bech32Encodes a canonical 20-byte Ethereum-style address as a bech32 Harmony
* bech32Encodes a canonical 20-byte Ethereum-style address as a bech32 Woop
* address.
*
* The expected format is one1<address><checksum> where address and checksum
* are the result of bech32 encoding a Buffer containing the address bytes.
*
* @param {string} 20 byte canonical address
* @returns {string} 38 char bech32 bech32Encoded Harmony address
* @returns {string} 38 char bech32 bech32Encoded Woop address
*/
export const toBech32 = (address: string, useHRP: string = HRP): string => {
if (!isAddress(address)) {
@ -214,7 +214,7 @@ export const toBech32 = (address: string, useHRP: string = HRP): string => {
/**
* fromBech32Address
*
* @param {string} address - a valid Harmony bech32 address
* @param {string} address - a valid Woop bech32 address
* @returns {string} a canonical 20-byte Ethereum-style address
*/
export const fromBech32 = (address: string, useHRP: string = HRP): string => {

@ -1,6 +1,6 @@
/**
* @packageDocumentation
* @module harmony-crypto
* @module woop-crypto
* @hidden
*/

@ -1,9 +1,9 @@
/**
# @harmony-js/crypto
# @woop-js/crypto
This package provides a collection of apis related to address management, kestore, encoding, and encrypt/decrypt.
## Installation
```
npm install @harmony-js/crypto
npm install @woop-js/crypto
```
## Usage
```javascript
@ -13,23 +13,23 @@ npm install @harmony-js/crypto
* randomBytes,
* toBech32,
* fromBech32,
* HarmonyAddress,
* WoopAddress,
* generatePrivateKey,
* getPubkeyFromPrivateKey,
* getAddressFromPublicKey,
* getAddressFromPrivateKey,
* encryptPhrase,
* decryptPhrase
* } = require('@harmony-js/crypto');
* const { isPrivateKey, isAddress, isPublicKey } = require('@harmony-js/utils');
* } = require('@woop-js/crypto');
* const { isPrivateKey, isAddress, isPublicKey } = require('@woop-js/utils');
```
Address apis
```javascript
const bytes = randomBytes(20);
const addr = new HarmonyAddress(bytes);
const addr = new WoopAddress(bytes);
console.log(addr.checksum);
console.log(addr.bech32);
console.log(HarmonyAddress.isValidBech32(addr.bech32));
console.log(WoopAddress.isValidBech32(addr.bech32));
```
RLP apis
```javascript
@ -51,7 +51,7 @@ console.log(isAddress(addrPrv));
```
Encrypt/decrypt apis
```javascript
* const { Wallet } = require('@harmony-js/account');
* const { Wallet } = require('@woop-js/account');
* const myPhrase = new Wallet().newMnemonic();
* console.log(myPhrase);
* const pwd = '1234';
@ -64,7 +64,7 @@ Encrypt/decrypt apis
```
*
* @packageDocumentation
* @module harmony-crypto
* @module woop-crypto
*/
// This file is ported from ether.js/src.ts/errors.ts

@ -1,6 +1,6 @@
/**
* @packageDocumentation
* @module harmony-crypto
* @module woop-crypto
* @ignore
*/

@ -1,6 +1,6 @@
/**
* @packageDocumentation
* @module harmony-utils
* @module woop-utils
*/
export const isKeyString = (keyString: string, lengh: number): boolean => {

@ -1,6 +1,6 @@
import dayjs from "dayjs";
import Big from "big.js";
import { RelatedTransaction, RelatedTransactionType, RPCTransactionHarmony, TransactionExtraMark } from "../types";
import { RelatedTransaction, RelatedTransactionType, RPCTransactionWoop, TransactionExtraMark } from "../types";
import { getAddress } from "./getAddress/GetAddress";
import { bridgeTokensMap } from "src/config";
@ -33,7 +33,7 @@ export const copyTextToClipboard = (value: string) => {
};
export const mapBlockchainTxToRelated = (
tx: RPCTransactionHarmony,
tx: RPCTransactionWoop,
type: RelatedTransactionType = 'transaction'
): RelatedTransaction => {
const resultedTx = {

Loading…
Cancel
Save