Skip to content

Commit

Permalink
refactor: replace blockchain-api.xyz references with assets (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkrem authored Dec 19, 2023
1 parent bfc633e commit 54d4027
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 28 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/dapp/public/assets/eip155:1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/dapp/public/assets/eip155:10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/dapp/public/assets/eip155:100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/dapp/public/assets/eip155:137.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions examples/dapp/public/assets/eip155:324.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/dapp/public/assets/eip155:420.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/dapp/public/assets/eip155:42161.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/dapp/public/assets/eip155:421611.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/dapp/public/assets/eip155:42220.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/dapp/public/assets/eip155:44787.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/dapp/public/assets/eip155:80001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions examples/dapp/src/chains/cosmos.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { JsonRpcRequest } from "@walletconnect/jsonrpc-utils";

import { BLOCKCHAIN_LOGO_BASE_URL } from "../constants";

import { NamespaceMetadata, ChainMetadata, ChainRequestRender } from "../helpers";

export const CosmosMetadata: NamespaceMetadata = {
"cosmoshub-4": {
logo: BLOCKCHAIN_LOGO_BASE_URL + "cosmos:cosmoshub-4.png",
logo: "/assets/cosmos:cosmoshub-4.png",
rgb: "27, 31, 53",
},
};
Expand Down
37 changes: 16 additions & 21 deletions examples/dapp/src/chains/eip155.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
convertHexToNumber,
convertHexToUtf8,
} from "../helpers";
import { BLOCKCHAIN_LOGO_BASE_URL } from "../constants";

export const EIP155Colors = {
ethereum: "99, 125, 234",
Expand All @@ -22,55 +21,55 @@ export const EIP155Colors = {
export const EIP155Metadata: NamespaceMetadata = {
"1": {
name: "Ethereum",
logo: BLOCKCHAIN_LOGO_BASE_URL + "eip155:1.png",
logo: `/assets/eip155:1.png`,
rgb: EIP155Colors.ethereum,
},
"5": {
logo: BLOCKCHAIN_LOGO_BASE_URL + "eip155:5.png",
rgb: EIP155Colors.goerli,
logo: `/assets/eip155:1.png`,
rgb: EIP155Colors.ethereum,
},
"10": {
name: "Optimism",
logo: BLOCKCHAIN_LOGO_BASE_URL + "eip155:10.png",
logo: `/assets/eip155:10.png`,
rgb: EIP155Colors.optimism,
},
"42": {
logo: BLOCKCHAIN_LOGO_BASE_URL + "eip155:42.png",
logo: `/assets/eip155:42.png`,
rgb: EIP155Colors.ethereum,
},
"69": {
logo: BLOCKCHAIN_LOGO_BASE_URL + "eip155:69.png",
"420": {
logo: `/assets/eip155:420.png`,
rgb: EIP155Colors.optimism,
},
"100": {
logo: BLOCKCHAIN_LOGO_BASE_URL + "eip155:100.png",
logo: `/assets/eip155:100.png`,
rgb: EIP155Colors.xdai,
},
"137": {
name: "Polygon",
logo: BLOCKCHAIN_LOGO_BASE_URL + "eip155:137.png",
logo: `/assets/eip155:137.png`,
rgb: EIP155Colors.polygon,
},
"80001": {
logo: BLOCKCHAIN_LOGO_BASE_URL + "eip155:80001.png",
logo: `/assets/eip155:80001.png`,
rgb: EIP155Colors.polygon,
},
"42161": {
name: "Arbitrum",
logo: BLOCKCHAIN_LOGO_BASE_URL + "eip155:42161.png",
logo: `/assets/eip155:42161.png`,
rgb: EIP155Colors.arbitrum,
},
"42220": {
name: "Celo",
logo: BLOCKCHAIN_LOGO_BASE_URL + "eip155:42220.png",
logo: `/assets/eip155:42220.png`,
rgb: EIP155Colors.celo,
},
"44787": {
logo: BLOCKCHAIN_LOGO_BASE_URL + "eip155:44787.png",
logo: `/assets/eip155:44787.png`,
rgb: EIP155Colors.celo,
},
"421611": {
logo: BLOCKCHAIN_LOGO_BASE_URL + "eip155:421611.png",
logo: `/assets/eip155:421611.png`,
rgb: EIP155Colors.arbitrum,
},
};
Expand All @@ -84,9 +83,7 @@ export function getChainMetadata(chainId: string): ChainMetadata {
return metadata;
}

export function getChainRequestRender(
request: JsonRpcRequest
): ChainRequestRender[] {
export function getChainRequestRender(request: JsonRpcRequest): ChainRequestRender[] {
let params = [{ label: "Method", value: request.method }];

switch (request.method) {
Expand Down Expand Up @@ -114,9 +111,7 @@ export function getChainRequestRender(
},
{
label: "Value",
value: request.params[0].value
? convertHexToNumber(request.params[0].value)
: "",
value: request.params[0].value ? convertHexToNumber(request.params[0].value) : "",
},
{ label: "Data", value: request.params[0].data },
];
Expand Down
3 changes: 1 addition & 2 deletions examples/dapp/src/chains/polkadot.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { JsonRpcRequest } from "@walletconnect/jsonrpc-utils";
import { BLOCKCHAIN_LOGO_BASE_URL } from "../constants";

import { NamespaceMetadata, ChainMetadata, ChainRequestRender } from "../helpers";

export const PolkadotMetadata: NamespaceMetadata = {
// eslint-disable-next-line no-useless-computed-key
["91b171bb158e2d3848fa23a9f1c25182"]: {
logo: BLOCKCHAIN_LOGO_BASE_URL + "polkadot:91b171bb158e2d3848fa23a9f1c25182.png",
logo: "/assets/polkadot:91b171bb158e2d3848fa23a9f1c25182.png",
rgb: "230, 1, 122",
},
};
Expand Down
1 change: 0 additions & 1 deletion examples/dapp/src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from "./default";
export * from "./logo";
1 change: 0 additions & 1 deletion examples/dapp/src/constants/logo.ts

This file was deleted.

2 comments on commit 54d4027

@vercel
Copy link

@vercel vercel bot commented on 54d4027 Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

se-sdk-dapp – ./examples/dapp/

se-sdk-dapp-git-main-walletconnect1.vercel.app
se-sdk-dapp.vercel.app
se-sdk-dapp-walletconnect1.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 54d4027 Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

se-sdk-wallet – ./examples/wallet/

se-sdk-wallet-git-main-walletconnect1.vercel.app
se-sdk-wallet.vercel.app
se-sdk-wallet-walletconnect1.vercel.app

Please sign in to comment.