Skip to content

Commit

Permalink
worldchain support (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNe0x1 authored Sep 12, 2024
1 parent 6301715 commit c93ac5b
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 35 deletions.
2 changes: 1 addition & 1 deletion dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://cdn.ethers.io/lib/ethers-5.7.umd.min.js" type="application/javascript"></script>
<script crossorigin src="https://unpkg.com/@depay/solana-web3.js@1"></script>
<script crossorigin src="https://unpkg.com/@depay/web3-blockchains@9.5.3"></script>
<script crossorigin src="https://unpkg.com/@depay/web3-blockchains@9.6.0"></script>
<script src="tmp/index.dev.js"></script>
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions dist/esm/index.evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ var EVM = {
setProvider: setProvider$1,
};

let supported = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base'];
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base'];
let supported = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain'];
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain'];
supported.solana = [];

function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
Expand Down
4 changes: 2 additions & 2 deletions dist/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,8 @@ var Solana = {
setProvider: setProvider$1,
};

let supported = ['ethereum', 'bsc', 'polygon', 'solana', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base'];
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base'];
let supported = ['ethereum', 'bsc', 'polygon', 'solana', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain'];
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain'];
supported.solana = ['solana'];

function _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
Expand Down
4 changes: 2 additions & 2 deletions dist/umd/index.evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@
setProvider: setProvider$1,
};

let supported = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base'];
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base'];
let supported = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain'];
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain'];
supported.solana = [];

function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
Expand Down
4 changes: 2 additions & 2 deletions dist/umd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,8 @@
setProvider: setProvider$1,
};

let supported = ['ethereum', 'bsc', 'polygon', 'solana', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base'];
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base'];
let supported = ['ethereum', 'bsc', 'polygon', 'solana', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain'];
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain'];
supported.solana = ['solana'];

function _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
Expand Down
4 changes: 2 additions & 2 deletions package.evm.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/web3-client-evm",
"moduleName": "Web3Client",
"version": "10.18.16",
"version": "10.19.0",
"description": "A web3 client to fetch blockchain data just like you are used to with HTTP clients.",
"main": "dist/umd/index.evm.js",
"module": "dist/esm/index.evm.js",
Expand All @@ -23,7 +23,7 @@
"homepage": "https://depay.com",
"private": false,
"peerDependencies": {
"@depay/web3-blockchains": "^9.5.3",
"@depay/web3-blockchains": "^9.6.0",
"ethers": "^5.7.1"
},
"engines": {
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/web3-client",
"moduleName": "Web3Client",
"version": "10.18.16",
"version": "10.19.0",
"description": "A web3 client to fetch blockchain data just like you are used to with HTTP clients.",
"main": "dist/umd/index.js",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -34,7 +34,7 @@
"private": false,
"peerDependencies": {
"@depay/solana-web3.js": "^1.26.0",
"@depay/web3-blockchains": "^9.5.3",
"@depay/web3-blockchains": "^9.6.0",
"ethers": "^5.7.1"
},
"engines": {
Expand All @@ -44,8 +44,8 @@
"@babel/core": "^7.12.9",
"@babel/preset-env": "^7.12.7",
"@depay/solana-web3.js": "^1.26.0",
"@depay/web3-blockchains": "^9.5.3",
"@depay/web3-mock": "^14.18.0",
"@depay/web3-blockchains": "^9.6.0",
"@depay/web3-mock": "^14.19.0",
"@rollup/plugin-commonjs": "^22.0.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.3.0",
Expand Down
4 changes: 2 additions & 2 deletions package.solana.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/web3-client-solana",
"moduleName": "Web3Client",
"version": "10.18.16",
"version": "10.19.0",
"description": "A web3 client to fetch blockchain data just like you are used to with HTTP clients.",
"main": "dist/umd/index.solana.js",
"module": "dist/esm/index.solana.js",
Expand All @@ -23,7 +23,7 @@
"homepage": "https://depay.com",
"private": false,
"peerDependencies": {
"@depay/web3-blockchains": "^9.5.3",
"@depay/web3-blockchains": "^9.6.0",
"@depay/solana-web3.js": "^1.26.0",
"ethers": "^5.7.1"
},
Expand Down
8 changes: 4 additions & 4 deletions src/blockchains.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*#if _EVM
let supported = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base']
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base']
let supported = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain']
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain']
supported.solana = []
/*#elif _SOLANA
Expand All @@ -12,8 +12,8 @@ supported.solana = ['solana']
//#else */

let supported = ['ethereum', 'bsc', 'polygon', 'solana', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base']
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base']
let supported = ['ethereum', 'bsc', 'polygon', 'solana', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain']
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain']
supported.solana = ['solana']

//#endif
Expand Down
23 changes: 9 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -903,23 +903,18 @@
dependencies:
bs58 "^5.0.0"

"@depay/web3-blockchains@^9.1.4":
version "9.1.4"
resolved "https://registry.yarnpkg.com/@depay/web3-blockchains/-/web3-blockchains-9.1.4.tgz#f006c29c887c433e1824e2bfabf8f39ad13da907"
integrity sha512-CQnXCNAt3sA1MphZDMPbrhAPtemzeQ/NKeHcd2aBF61nTjJCRUmSh1Ox8Z6rlSjgDP66842iy6JAoRiFDtlmFw==
"@depay/web3-blockchains@^9.6.0":
version "9.6.0"
resolved "https://registry.yarnpkg.com/@depay/web3-blockchains/-/web3-blockchains-9.6.0.tgz#51bcd4cd6bcc9542b61f7792eabdccbe6385b476"
integrity sha512-+REyl5vva1e6t4yvSJKJE2IgidTNDPB7imn4xxAqqeVOFJryLBwaPddyh5C9pnX9GMpLhR6s6Su4AgrdLSZ/JQ==

"@depay/web3-blockchains@^9.5.3":
version "9.5.3"
resolved "https://registry.yarnpkg.com/@depay/web3-blockchains/-/web3-blockchains-9.5.3.tgz#6669bfe2cb4ea7708649393ac43e60a2b9a1dce5"
integrity sha512-ZVSMoHaLTJVRwSlegXFiySN7AXOZS4SvnVlOPuPsvZh0c4KE3fDncNMdACds/A/x8pa+adEROeouwCrOuFq7Dw==

"@depay/web3-mock@^14.18.0":
version "14.18.0"
resolved "https://registry.yarnpkg.com/@depay/web3-mock/-/web3-mock-14.18.0.tgz#149dcdc2e39f265beefa9b4ffa8a00512bc25d01"
integrity sha512-TGhb/8k4qHR6OlxQcFxAZXX8fuJzPA3wfobKtCRhldyKV0ZotNIUEgN5MXq0aNGJ7FAPVjZPjHk1T7bL4ipj0g==
"@depay/web3-mock@^14.19.0":
version "14.19.0"
resolved "https://registry.yarnpkg.com/@depay/web3-mock/-/web3-mock-14.19.0.tgz#2e5430cc8240dea8a5f477d31f7861dc4e9666d7"
integrity sha512-/uTeJdxQTYEA4RFAZd8mAoMn1B+33UZ9s98cPKXQlksoRXstJiBUbPO+O7IOyZ4QUDsmcKTw1sjLH2+eIi4XTg==
dependencies:
"@depay/solana-web3.js" "^1.26.0"
"@depay/web3-blockchains" "^9.1.4"
"@depay/web3-blockchains" "^9.6.0"
ethers "^5.7.1"

"@eslint/eslintrc@^0.4.3":
Expand Down

0 comments on commit c93ac5b

Please sign in to comment.