Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98fc320a86 | ||
|
|
5712650074 | ||
|
|
1b0bc87efb | ||
|
|
a3472a1331 |
@@ -13,7 +13,7 @@ concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# To use Remote Caching, uncomment the next lines and follow the steps below.
|
||||
# To use Remote Caching, uncomment the next lines and follow the steps below.
|
||||
env:
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||
@@ -84,7 +84,12 @@ jobs:
|
||||
key: ${{ github.sha }}-${{ github.run_number }}
|
||||
|
||||
- run: yarn test
|
||||
|
||||
|
||||
- name: Upload coverage reports to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
files: ./packages/sdk/coverage/evm/lcov.info,./packages/sdk/coverage/solana/lcov.info,
|
||||
|
||||
e2e:
|
||||
name: E2E Tests
|
||||
runs-on: ubuntu-latest-16
|
||||
@@ -110,33 +115,3 @@ jobs:
|
||||
run: yarn e2e
|
||||
env:
|
||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
||||
|
||||
size:
|
||||
name: Size Comparison
|
||||
runs-on: ubuntu-latest-8
|
||||
needs: build
|
||||
timeout-minutes: 30
|
||||
# only run on pull requests that are targeting main
|
||||
if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main'
|
||||
|
||||
steps:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
check-latest: true
|
||||
|
||||
- uses: actions/cache@v3
|
||||
timeout-minutes: 5
|
||||
id: restore-build
|
||||
with:
|
||||
path: ./*
|
||||
key: ${{ github.sha }}-${{ github.run_number }}
|
||||
|
||||
- uses: preactjs/compressed-size-action@v2
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
strip-hash: "\\-(\\w{8})(?:\\.esm|\\.cjs)"
|
||||
minimum-change-threshold: 100
|
||||
# exclude source maps, node modules and any test related files
|
||||
exclude: "{**/*.map,**/node_modules/**,**/test/**}"
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
<h1 align="center"><a href='http://thirdweb.com/'>thirdweb</a> JavaScript/TypeScript monorepo</h1>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml">
|
||||
<img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml/badge.svg"/>
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml">
|
||||
<img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml/badge.svg"/>
|
||||
</a>
|
||||
<a href="https://discord.gg/thirdweb">
|
||||
<img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/>
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@
|
||||
"mocha": "^10.2.0",
|
||||
"postinstall-postinstall": "^2.1.0",
|
||||
"prettier": "^2.7.1",
|
||||
"turbo": "^1.4.6",
|
||||
"turbo": "^1.8.2",
|
||||
"yalc": "^1.0.0-pre.53"
|
||||
},
|
||||
"manypkg": {
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
</p>
|
||||
<h1 align="center">thirdweb Auth</h1>
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/@thirdweb-dev/auth"><img src="https://img.shields.io/npm/v/@thirdweb-dev/auth?color=red&label=npm&logo=npm" alt="npm version"/></a>
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml/badge.svg"/></a>
|
||||
<a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a>
|
||||
|
||||
</p>
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @thirdweb-dev/chains
|
||||
|
||||
## 0.1.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#613](https://github.com/thirdweb-dev/js/pull/613) [`a3472a1`](https://github.com/thirdweb-dev/js/commit/a3472a133175826d052ee986907de014e3cf3ad9) Thanks [@jnsdls](https://github.com/jnsdls)! - Update Chains
|
||||
|
||||
- [#616](https://github.com/thirdweb-dev/js/pull/616) [`5712650`](https://github.com/thirdweb-dev/js/commit/5712650074e2415bbea4173a0bb68d727ff2db90) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - new chains
|
||||
|
||||
## 0.1.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -5,12 +5,32 @@
|
||||
</p>
|
||||
<h1 align="center">thirdweb chains</h1>
|
||||
<p align="center">
|
||||
<!-- <a href="https://www.npmjs.com/package/@thirdweb-dev/sdk"><img src="https://img.shields.io/npm/v/@thirdweb-dev/sdk?color=red&label=npm&logo=npm" alt="npm version"/></a> -->
|
||||
<!-- <a href="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml/badge.svg"/></a> -->
|
||||
<!-- <a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a> -->
|
||||
<a href="https://www.npmjs.com/package/@thirdweb-dev/chains"><img src="https://img.shields.io/npm/v/@thirdweb-dev/chains?color=red&label=npm&logo=npm" alt="npm version"/></a>
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml/badge.svg"/></a>
|
||||
<a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a>
|
||||
|
||||
</p>
|
||||
<!-- <p align="center"><strong>Best in class Web3 SDK for Browser, Node and Mobile apps</strong></p> -->
|
||||
<br />
|
||||
|
||||
### todo
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
yarn add @thirdweb-dev/chains
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
### Adding / Overriding Chain Data
|
||||
|
||||
Chain data is automatically pulled in from [ethereum-lists/chains](https://github.com/ethereum-lists/chains) on every build.
|
||||
|
||||
#### Overriding Chain Data
|
||||
|
||||
Chain data can be overridden by running `yarn override-chain` and following the prompts.
|
||||
|
||||
#### Adding A New Chain
|
||||
|
||||
In cases where a chain is not listed in the [ethereum-lists/chains](https://github.com/ethereum-lists/chains) repo, you can add it manually by running `yarn add-chain` and following the prompts.
|
||||
|
||||
> Prefer adding chains to the ethereum-lists/chains repo instead of manually adding them here.
|
||||
|
||||
@@ -22,6 +22,12 @@ export default {
|
||||
"standard": "none"
|
||||
}
|
||||
],
|
||||
"icon": {
|
||||
"url": "ipfs://Qmc9AJGg9aNhoH56n3deaZeUc8Ty1jDYJsW6Lu6hgSZH4S",
|
||||
"height": 512,
|
||||
"width": 512,
|
||||
"format": "png"
|
||||
},
|
||||
"testnet": false,
|
||||
"slug": "gather-network"
|
||||
} as const;
|
||||
@@ -5,7 +5,9 @@ export default {
|
||||
"https://gather-testnet-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://testnet.gather.network"
|
||||
],
|
||||
"faucets": [],
|
||||
"faucets": [
|
||||
"https://testnet-faucet.gather.network/"
|
||||
],
|
||||
"nativeCurrency": {
|
||||
"name": "Gather",
|
||||
"symbol": "GTH",
|
||||
@@ -23,5 +25,11 @@ export default {
|
||||
}
|
||||
],
|
||||
"testnet": true,
|
||||
"icon": {
|
||||
"url": "ipfs://Qmc9AJGg9aNhoH56n3deaZeUc8Ty1jDYJsW6Lu6hgSZH4S",
|
||||
"height": 512,
|
||||
"width": 512,
|
||||
"format": "png"
|
||||
},
|
||||
"slug": "gather-testnet-network"
|
||||
} as const;
|
||||
@@ -1,6 +1,7 @@
|
||||
export default {
|
||||
"name": "Hika Devnet",
|
||||
"chain": "Hika Network Testnet",
|
||||
"name": "Hika Network",
|
||||
"title": "Hika Network Testnet",
|
||||
"chain": "HIK",
|
||||
"icon": {
|
||||
"url": "ipfs://QmW44FPm3CMM2JDs8BQxLNvUtykkUtrGkQkQsUDJSi3Gmp",
|
||||
"width": 350,
|
||||
@@ -8,7 +9,7 @@ export default {
|
||||
"format": "png"
|
||||
},
|
||||
"rpc": [
|
||||
"https://hika-devnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://hika-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc-testnet.hika.network/"
|
||||
],
|
||||
"faucets": [],
|
||||
@@ -29,5 +30,5 @@ export default {
|
||||
}
|
||||
],
|
||||
"testnet": true,
|
||||
"slug": "hika-devnet"
|
||||
"slug": "hika-network"
|
||||
} as const;
|
||||
@@ -0,0 +1,27 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Omit<Chain, "slug">} */
|
||||
export default {
|
||||
name: "Localhost",
|
||||
chain: "ETH",
|
||||
rpc: ["http://localhost:8545"],
|
||||
faucets: [],
|
||||
nativeCurrency: {
|
||||
name: "Ether",
|
||||
symbol: "ETH",
|
||||
decimals: 18,
|
||||
},
|
||||
// hard code eth icon for now
|
||||
icon: {
|
||||
url: "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/ethereum/512.png",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
sizes: [16, 32, 64, 128, 256, 512],
|
||||
},
|
||||
shortName: "local",
|
||||
chainId: 1337,
|
||||
networkId: 1337,
|
||||
testnet: true,
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
icon: {
|
||||
url: "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/ethereum/512.png",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
sizes: [16, 32, 64, 128, 256, 512],
|
||||
},
|
||||
rpc: ["https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}"],
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
icon: {
|
||||
url: "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/optimism/512.png",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
sizes: [16, 32, 64, 128, 256, 512],
|
||||
},
|
||||
rpc: [
|
||||
"https://optimism-mainnet.infura.io/v3/${INFURA_API_KEY}",
|
||||
"https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
icon: {
|
||||
url: "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/polygon/512.png",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
sizes: [16, 32, 64, 128, 256, 512],
|
||||
},
|
||||
rpc: [
|
||||
"https://polygon-mainnet.infura.io/v3/${INFURA_API_KEY}",
|
||||
"https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
chainId: 192837465,
|
||||
icon: {
|
||||
url: "ipfs://Qmc9AJGg9aNhoH56n3deaZeUc8Ty1jDYJsW6Lu6hgSZH4S",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
icon: {
|
||||
url: "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/fantom/512.png",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
sizes: [16, 32, 64, 128, 256, 512],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
chainId: 356256156,
|
||||
testnet: true,
|
||||
icon: {
|
||||
url: "ipfs://Qmc9AJGg9aNhoH56n3deaZeUc8Ty1jDYJsW6Lu6hgSZH4S",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
},
|
||||
faucets: ["https://testnet-faucet.gather.network/"],
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
icon: {
|
||||
url: "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/fantom/512.png",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
sizes: [16, 32, 64, 128, 256, 512],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
icon: {
|
||||
url: "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/optimism/512.png",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
sizes: [16, 32, 64, 128, 256, 512],
|
||||
},
|
||||
rpc: [
|
||||
"https://optimism-goerli.infura.io/v3/${INFURA_API_KEY}",
|
||||
"https://opt-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
icon: {
|
||||
url: "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/arbitrum/512.png",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
sizes: [16, 32, 64, 128, 256, 512],
|
||||
},
|
||||
rpc: ["https://arb-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}"],
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
icon: {
|
||||
url: "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/arbitrum/512.png",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
sizes: [16, 32, 64, 128, 256, 512],
|
||||
},
|
||||
rpc: [
|
||||
"https://abritrum-goerli.infura.io/v3/${INFURA_API_KEY}",
|
||||
"https://arb-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
icon: {
|
||||
url: "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/avalanche/512.png",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
sizes: [16, 32, 64, 128, 256, 512],
|
||||
},
|
||||
rpc: ["https://avalanche-fuji.infura.io/v3/${INFURA_API_KEY}"],
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
icon: {
|
||||
url: "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/avalanche/512.png",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
sizes: [16, 32, 64, 128, 256, 512],
|
||||
},
|
||||
rpc: ["https://avalanche-mainnet.infura.io/v3/${INFURA_API_KEY}"],
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
icon: {
|
||||
url: "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/ethereum/512.png",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
sizes: [16, 32, 64, 128, 256, 512],
|
||||
},
|
||||
rpc: ["https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}"],
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
icon: {
|
||||
url: "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/binance-coin/512.png",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
sizes: [16, 32, 64, 128, 256, 512],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
icon: {
|
||||
url: "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/polygon/512.png",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
sizes: [16, 32, 64, 128, 256, 512],
|
||||
},
|
||||
rpc: [
|
||||
"https://polygon-mumbai.infura.io/v3/${INFURA_API_KEY}",
|
||||
"https://polygon-mumbai.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
icon: {
|
||||
url: "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/binance-coin/512.png",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
sizes: [16, 32, 64, 128, 256, 512],
|
||||
},
|
||||
};
|
||||
@@ -1,153 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"icon": {
|
||||
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/ethereum/512.png",
|
||||
"height": 512,
|
||||
"width": 512,
|
||||
"format": "png",
|
||||
"sizes": [16, 32, 64, 128, 256, 512]
|
||||
},
|
||||
"rpc": ["https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}"]
|
||||
},
|
||||
"5": {
|
||||
"icon": {
|
||||
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/ethereum/512.png",
|
||||
"height": 512,
|
||||
"width": 512,
|
||||
"format": "png",
|
||||
"sizes": [16, 32, 64, 128, 256, 512]
|
||||
},
|
||||
"rpc": ["https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}"]
|
||||
},
|
||||
"137": {
|
||||
"icon": {
|
||||
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/polygon/512.png",
|
||||
"height": 512,
|
||||
"width": 512,
|
||||
"format": "png",
|
||||
"sizes": [16, 32, 64, 128, 256, 512]
|
||||
},
|
||||
"rpc": [
|
||||
"https://polygon-mainnet.infura.io/v3/${INFURA_API_KEY}",
|
||||
"https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}"
|
||||
]
|
||||
},
|
||||
"80001": {
|
||||
"icon": {
|
||||
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/polygon/512.png",
|
||||
"height": 512,
|
||||
"width": 512,
|
||||
"format": "png",
|
||||
"sizes": [16, 32, 64, 128, 256, 512]
|
||||
},
|
||||
"rpc": [
|
||||
"https://polygon-mumbai.infura.io/v3/${INFURA_API_KEY}",
|
||||
"https://polygon-mumbai.g.alchemy.com/v2/${ALCHEMY_API_KEY}"
|
||||
]
|
||||
},
|
||||
"250": {
|
||||
"icon": {
|
||||
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/fantom/512.png",
|
||||
"height": 512,
|
||||
"width": 512,
|
||||
"format": "png",
|
||||
"sizes": [16, 32, 64, 128, 256, 512]
|
||||
}
|
||||
},
|
||||
"4002": {
|
||||
"icon": {
|
||||
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/fantom/512.png",
|
||||
"height": 512,
|
||||
"width": 512,
|
||||
"format": "png",
|
||||
"sizes": [16, 32, 64, 128, 256, 512]
|
||||
}
|
||||
},
|
||||
"43114": {
|
||||
"icon": {
|
||||
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/avalanche/512.png",
|
||||
"height": 512,
|
||||
"width": 512,
|
||||
"format": "png",
|
||||
"sizes": [16, 32, 64, 128, 256, 512]
|
||||
},
|
||||
"rpc": ["https://avalanche-mainnet.infura.io/v3/${INFURA_API_KEY}"]
|
||||
},
|
||||
"43113": {
|
||||
"icon": {
|
||||
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/avalanche/512.png",
|
||||
"height": 512,
|
||||
"width": 512,
|
||||
"format": "png",
|
||||
"sizes": [16, 32, 64, 128, 256, 512]
|
||||
},
|
||||
"rpc": ["https://avalanche-fuji.infura.io/v3/${INFURA_API_KEY}"]
|
||||
},
|
||||
"10": {
|
||||
"icon": {
|
||||
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/optimism/512.png",
|
||||
"height": 512,
|
||||
"width": 512,
|
||||
"format": "png",
|
||||
"sizes": [16, 32, 64, 128, 256, 512]
|
||||
},
|
||||
"rpc": [
|
||||
"https://optimism-mainnet.infura.io/v3/${INFURA_API_KEY}",
|
||||
"https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}"
|
||||
]
|
||||
},
|
||||
"420": {
|
||||
"icon": {
|
||||
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/optimism/512.png",
|
||||
"height": 512,
|
||||
"width": 512,
|
||||
"format": "png",
|
||||
"sizes": [16, 32, 64, 128, 256, 512]
|
||||
},
|
||||
"rpc": [
|
||||
"https://optimism-goerli.infura.io/v3/${INFURA_API_KEY}",
|
||||
"https://opt-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}"
|
||||
]
|
||||
},
|
||||
"42161": {
|
||||
"icon": {
|
||||
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/arbitrum/512.png",
|
||||
"height": 512,
|
||||
"width": 512,
|
||||
"format": "png",
|
||||
"sizes": [16, 32, 64, 128, 256, 512]
|
||||
},
|
||||
"rpc": ["https://arb-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}"]
|
||||
},
|
||||
"421613": {
|
||||
"icon": {
|
||||
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/arbitrum/512.png",
|
||||
"height": 512,
|
||||
"width": 512,
|
||||
"format": "png",
|
||||
"sizes": [16, 32, 64, 128, 256, 512]
|
||||
},
|
||||
"rpc": [
|
||||
"https://abritrum-goerli.infura.io/v3/${INFURA_API_KEY}",
|
||||
"https://arb-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}"
|
||||
]
|
||||
},
|
||||
"56": {
|
||||
"icon": {
|
||||
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/binance-coin/512.png",
|
||||
"height": 512,
|
||||
"width": 512,
|
||||
"format": "png",
|
||||
"sizes": [16, 32, 64, 128, 256, 512]
|
||||
}
|
||||
},
|
||||
"97": {
|
||||
"icon": {
|
||||
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/binance-coin/512.png",
|
||||
"height": 512,
|
||||
"width": 512,
|
||||
"format": "png",
|
||||
"sizes": [16, 32, 64, 128, 256, 512]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/chains",
|
||||
"version": "0.1.3",
|
||||
"version": "0.1.4",
|
||||
"main": "dist/thirdweb-dev-chains.cjs.js",
|
||||
"module": "dist/thirdweb-dev-chains.esm.js",
|
||||
"exports": {
|
||||
@@ -18,6 +18,7 @@
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"devDependencies": {
|
||||
"axios": "^0.27.2",
|
||||
"plop": "^3.1.2",
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"preconstruct": {
|
||||
@@ -29,6 +30,9 @@
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"build": "node ./scripts/generate-package.mjs && tsc && preconstruct build",
|
||||
"push": "yalc push"
|
||||
"push": "yalc push",
|
||||
"plop": "plop",
|
||||
"add-chain": "plop add-chain",
|
||||
"override-chain": "plop override-chain"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Omit<Chain, "slug">} */
|
||||
export default {
|
||||
{{> namePartial}}
|
||||
{{> chainPartial}}
|
||||
{{> shortNamePartial}}
|
||||
{{> chainIdPartial}}
|
||||
{{> isTestnetPartial}}
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
// @ts-check
|
||||
/** @typedef { import("../../src/types").Chain } Chain */
|
||||
|
||||
/** @type {Partial<Chain>} */
|
||||
export default {
|
||||
{{!-- if we have a name --}}
|
||||
{{#if name}}
|
||||
{{> namePartial}}
|
||||
{{/if}}
|
||||
{{!-- if we have a chain --}}
|
||||
{{#if chain}}
|
||||
{{> chainPartial}}
|
||||
{{/if}}
|
||||
{{#if shortName}}
|
||||
{{> shortNamePartial}}
|
||||
{{/if}}
|
||||
{{!-- chainId always exists --}}
|
||||
{{> chainIdPartial}}
|
||||
{{#if isTestnet}}
|
||||
{{> isTestnetPartial}}
|
||||
{{/if}}
|
||||
};
|
||||
@@ -0,0 +1,80 @@
|
||||
const chainIdPrompt = {
|
||||
type: "number",
|
||||
name: "chainId",
|
||||
message: "Chain ID",
|
||||
validate: (value) => {
|
||||
if (value.length === 0) {
|
||||
return "ChainId is required";
|
||||
}
|
||||
if (!/^\d+$/.test(value)) {
|
||||
return "ChainId must be a number";
|
||||
}
|
||||
return true;
|
||||
},
|
||||
};
|
||||
|
||||
const stringPrompt = (id, title, isRequired) => ({
|
||||
type: "input",
|
||||
name: id,
|
||||
message: title,
|
||||
validate: (value) => {
|
||||
if (isRequired && value.length === 0) {
|
||||
return `${title} is required`;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
});
|
||||
|
||||
const testnetPrompt = {
|
||||
type: "confirm",
|
||||
name: "isTestnet",
|
||||
message: "Is this a testnet?",
|
||||
};
|
||||
|
||||
export default function (
|
||||
/** @type {import('plop').NodePlopAPI} */
|
||||
plop,
|
||||
) {
|
||||
// add partials
|
||||
plop.setPartial("chainIdPartial", "chainId: {{chainId}},\n");
|
||||
plop.setPartial("namePartial", `name: "{{name}}",\n`);
|
||||
plop.setPartial("chainPartial", `chain: "{{chain}}",\n`);
|
||||
plop.setPartial("shortNamePartial", `shortName: "{{shortName}}",\n`);
|
||||
plop.setPartial("isTestnetPartial", `testnet: {{isTestnet}},\n`);
|
||||
|
||||
plop.setGenerator("add-chain", {
|
||||
description: "add a new chain",
|
||||
prompts: [
|
||||
chainIdPrompt,
|
||||
stringPrompt("name", "Name", true),
|
||||
stringPrompt("chain", "Chain", true),
|
||||
stringPrompt("shortName", "Short Name", true),
|
||||
testnetPrompt,
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
type: "add",
|
||||
path: "data/additional/{{chainId}}.mjs",
|
||||
templateFile: "plop-templates/add-chain.hbs",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
plop.setGenerator("override-chain", {
|
||||
description: "add an override for a chain",
|
||||
prompts: [
|
||||
chainIdPrompt,
|
||||
stringPrompt("name", "Name"),
|
||||
stringPrompt("chain", "Chain"),
|
||||
stringPrompt("shortName", "Short Name"),
|
||||
testnetPrompt,
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
type: "add",
|
||||
path: "data/overrides/{{chainId}}.mjs",
|
||||
templateFile: "plop-templates/chain-override.hbs",
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
@@ -1,11 +1,15 @@
|
||||
// @ts-check
|
||||
import axios from "axios";
|
||||
import merge from "deepmerge";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
const combineMerge = (target, source, options) => {
|
||||
/** @typedef {import("../src/types").Chain} Chain */
|
||||
|
||||
const combineMerge = (target, source) => {
|
||||
let destination = target.slice();
|
||||
|
||||
source.forEach((item, index) => {
|
||||
source.forEach((item) => {
|
||||
if (target.indexOf(item) === -1) {
|
||||
destination = [item, ...destination];
|
||||
}
|
||||
@@ -15,16 +19,39 @@ const combineMerge = (target, source, options) => {
|
||||
|
||||
const chainsDir = "./chains";
|
||||
|
||||
/** @typedef {{name: string, chain: string, icon: string, rpc: string[], faucets?: any[], nativeCurrency: {name: string, symbol: string, decimals: number}, infoURL?: string, shortName: string, chainId: number, networkId: number, slip44?: number, ens: {registry: string}, explorers?: {name: string, url: string, standard: string}[] }} Chain */
|
||||
|
||||
const chainsJsonUrl = "https://chainid.network/chains.json";
|
||||
const iconRoute =
|
||||
"https://raw.githubusercontent.com/ethereum-lists/chains/master/_data/icons";
|
||||
|
||||
const overrides = JSON.parse(fs.readFileSync("./overrides.json"));
|
||||
/** @type {Record<number, Partial<Chain>>} */
|
||||
let overrides = {};
|
||||
|
||||
// get all overides by reading the overrides directory and importing them
|
||||
const overridesDir = path.join(process.cwd(), "./data/overrides");
|
||||
const overridesFiles = fs.readdirSync(overridesDir);
|
||||
for (const file of overridesFiles) {
|
||||
const override = await import(path.join(overridesDir, file));
|
||||
// get file name without extension
|
||||
const chainId = parseInt(file.split(".")[0]);
|
||||
overrides[chainId] = override.default;
|
||||
}
|
||||
|
||||
// chains from remote src
|
||||
|
||||
/** @type {Chain[]} */
|
||||
let chains = (await axios.get(chainsJsonUrl)).data;
|
||||
// immediately filter out localhost
|
||||
chains = chains.filter((c) => c.chainId !== 1337);
|
||||
|
||||
// additional chains
|
||||
|
||||
// get all additional chains by reading the additional chains directory and importing them
|
||||
const additionalChainsDir = path.join(process.cwd(), "./data/additional");
|
||||
const additionalChainsFiles = fs.readdirSync(additionalChainsDir);
|
||||
for (const file of additionalChainsFiles) {
|
||||
const additionalChain = await import(path.join(additionalChainsDir, file));
|
||||
chains.push(additionalChain.default);
|
||||
}
|
||||
|
||||
chains = chains
|
||||
.filter((c) => c.status !== "deprecated")
|
||||
@@ -44,32 +71,6 @@ chains = chains
|
||||
};
|
||||
});
|
||||
|
||||
chains = chains.filter((c) => c.chainId !== 1337);
|
||||
// inject in localhost
|
||||
chains.push({
|
||||
name: "Localhost",
|
||||
chain: "ETH",
|
||||
rpc: ["http://localhost:8545"],
|
||||
faucets: [],
|
||||
nativeCurrency: {
|
||||
name: "Ether",
|
||||
symbol: "ETH",
|
||||
decimals: 18,
|
||||
},
|
||||
// hard code eth icon for now
|
||||
icon: {
|
||||
url: "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/ethereum/512.png",
|
||||
height: 512,
|
||||
width: 512,
|
||||
format: "png",
|
||||
sizes: [16, 32, 64, 128, 256, 512],
|
||||
},
|
||||
shortName: "local",
|
||||
chainId: 1337,
|
||||
networkId: 1337,
|
||||
testnet: true,
|
||||
});
|
||||
|
||||
const imports = [];
|
||||
const exports = [];
|
||||
const exportNames = [];
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -33,6 +33,7 @@ export type Chain = {
|
||||
testnet: boolean;
|
||||
slug: string;
|
||||
slip44?: number;
|
||||
status?: string;
|
||||
};
|
||||
|
||||
// MinimalChain is a subset of Chain with only the fields that are required / non-optional
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# thirdweb
|
||||
|
||||
## 0.9.24
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`5712650`](https://github.com/thirdweb-dev/js/commit/5712650074e2415bbea4173a0bb68d727ff2db90)]:
|
||||
- @thirdweb-dev/sdk@3.9.4
|
||||
|
||||
## 0.9.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<h1 align="center">thirdweb CLI</h1>
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/@thirdweb-dev/cli"><img src="https://img.shields.io/npm/v/@thirdweb-dev/cli?color=red&logo=npm" alt="npm version"/></a>
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml/badge.svg"/></a>
|
||||
<a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a>
|
||||
|
||||
</p>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "thirdweb",
|
||||
"main": "dist/cli/index.js",
|
||||
"version": "0.9.23",
|
||||
"version": "0.9.24",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/cli",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
</p>
|
||||
<h1 align="center">thirdweb wallets</h1>
|
||||
<p align="center">
|
||||
<!-- <a href="https://www.npmjs.com/package/@thirdweb-dev/sdk"><img src="https://img.shields.io/npm/v/@thirdweb-dev/sdk?color=red&label=npm&logo=npm" alt="npm version"/></a> -->
|
||||
<!-- <a href="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml/badge.svg"/></a> -->
|
||||
<!-- <a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a> -->
|
||||
<a href="https://www.npmjs.com/package/@thirdweb-dev/wallets"><img src="https://img.shields.io/npm/v/@thirdweb-dev/wallets?color=red&label=npm&logo=npm" alt="npm version"/></a>
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml/badge.svg"/></a>
|
||||
<a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a>
|
||||
|
||||
</p>
|
||||
<!-- <p align="center"><strong>Best in class Web3 SDK for Browser, Node and Mobile apps</strong></p> -->
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @thirdweb-dev/react-core
|
||||
|
||||
## 3.9.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`a3472a1`](https://github.com/thirdweb-dev/js/commit/a3472a133175826d052ee986907de014e3cf3ad9), [`5712650`](https://github.com/thirdweb-dev/js/commit/5712650074e2415bbea4173a0bb68d727ff2db90)]:
|
||||
- @thirdweb-dev/chains@0.1.4
|
||||
|
||||
## 3.9.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
</p>
|
||||
<h1 align="center">thirdweb React Core SDK</h1>
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/@thirdweb-dev/react"><img src="https://img.shields.io/npm/v/@thirdweb-dev/react?color=red&label=npm&logo=npm" alt="npm version"/></a>
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml/badge.svg"/></a>
|
||||
<a href="https://www.npmjs.com/package/@thirdweb-dev/react-core"><img src="https://img.shields.io/npm/v/@thirdweb-dev/react-core?color=red&label=npm&logo=npm" alt="npm version"/></a>
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml/badge.svg"/></a>
|
||||
<a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a>
|
||||
|
||||
</p>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react-core",
|
||||
"version": "3.9.3",
|
||||
"version": "3.9.4",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-core",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
# @thirdweb-dev/react-native-compat
|
||||
<p align="center">
|
||||
<br />
|
||||
<a href="https://thirdweb.com"><img src="https://github.com/thirdweb-dev/js/blob/main/packages/sdk/logo.svg?raw=true" width="200" alt=""/></a>
|
||||
<br />
|
||||
</p>
|
||||
<h1 align="center">thirdweb React Native Compat</h1>
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/@thirdweb-dev/react-native-compat"><img src="https://img.shields.io/npm/v/@thirdweb-dev/react-native-compat?color=red&label=npm&logo=npm" alt="npm version"/></a>
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml/badge.svg"/></a>
|
||||
<a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a>
|
||||
|
||||
Shims for Thirdweb in React Native Projects
|
||||
</p>
|
||||
<p align="center"><strong>Shims for thirdweb in React Native Projects</strong></p>
|
||||
<br />
|
||||
|
||||
## 👷🚧 Alpha 🚧👷
|
||||
|
||||
<br />
|
||||
|
||||
## Getting Started
|
||||
|
||||
Head over to the [documentation](https://portal.thirdweb.com/react-native) to learn more
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# @thirdweb-dev/react-native
|
||||
|
||||
## 0.1.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`a3472a1`](https://github.com/thirdweb-dev/js/commit/a3472a133175826d052ee986907de014e3cf3ad9), [`5712650`](https://github.com/thirdweb-dev/js/commit/5712650074e2415bbea4173a0bb68d727ff2db90), [`5712650`](https://github.com/thirdweb-dev/js/commit/5712650074e2415bbea4173a0bb68d727ff2db90)]:
|
||||
- @thirdweb-dev/chains@0.1.4
|
||||
- @thirdweb-dev/sdk@3.9.4
|
||||
- @thirdweb-dev/react-core@3.9.4
|
||||
|
||||
## 0.1.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
</p>
|
||||
<h1 align="center">thirdweb React Native SDK</h1>
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/@thirdweb-dev/react-native"><img src="https://img.shields.io/npm/v/@thirdweb-dev/react?color=red&label=npm&logo=npm" alt="npm version"/></a>
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml/badge.svg"/></a>
|
||||
<a href="https://www.npmjs.com/package/@thirdweb-dev/react-native"><img src="https://img.shields.io/npm/v/@thirdweb-dev/react-native?color=red&label=npm&logo=npm" alt="npm version"/></a>
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml/badge.svg"/></a>
|
||||
<a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a>
|
||||
|
||||
</p>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react-native",
|
||||
"version": "0.1.3",
|
||||
"version": "0.1.4",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# @thirdweb-dev/react
|
||||
|
||||
## 3.9.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`a3472a1`](https://github.com/thirdweb-dev/js/commit/a3472a133175826d052ee986907de014e3cf3ad9), [`5712650`](https://github.com/thirdweb-dev/js/commit/5712650074e2415bbea4173a0bb68d727ff2db90)]:
|
||||
- @thirdweb-dev/chains@0.1.4
|
||||
- @thirdweb-dev/react-core@3.9.4
|
||||
- @thirdweb-dev/wallets@0.2.5
|
||||
|
||||
## 3.9.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<h1 align="center">thirdweb React SDK</h1>
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/@thirdweb-dev/react"><img src="https://img.shields.io/npm/v/@thirdweb-dev/react?color=red&label=npm&logo=npm" alt="npm version"/></a>
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml/badge.svg"/></a>
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml/badge.svg"/></a>
|
||||
<a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a>
|
||||
|
||||
</p>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react",
|
||||
"version": "3.9.3",
|
||||
"version": "3.9.4",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2,4 +2,6 @@ docs/
|
||||
etc/
|
||||
temp/
|
||||
temp-evm/
|
||||
temp-solana/
|
||||
temp-solana/
|
||||
.nyc_output/
|
||||
coverage/
|
||||
@@ -1,5 +1,14 @@
|
||||
# @thirdweb-dev/sdk
|
||||
|
||||
## 3.9.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#616](https://github.com/thirdweb-dev/js/pull/616) [`5712650`](https://github.com/thirdweb-dev/js/commit/5712650074e2415bbea4173a0bb68d727ff2db90) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Handle custom currencies for all chains
|
||||
|
||||
- Updated dependencies [[`a3472a1`](https://github.com/thirdweb-dev/js/commit/a3472a133175826d052ee986907de014e3cf3ad9), [`5712650`](https://github.com/thirdweb-dev/js/commit/5712650074e2415bbea4173a0bb68d727ff2db90)]:
|
||||
- @thirdweb-dev/chains@0.1.4
|
||||
|
||||
## 3.9.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<h1 align="center">thirdweb TypeScript SDK</h1>
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/@thirdweb-dev/sdk"><img src="https://img.shields.io/npm/v/@thirdweb-dev/sdk?color=red&label=npm&logo=npm" alt="npm version"/></a>
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml/badge.svg"/></a>
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml/badge.svg"/></a>
|
||||
<a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a>
|
||||
|
||||
</p>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/sdk",
|
||||
"version": "3.9.3",
|
||||
"version": "3.9.4",
|
||||
"description": "The main thirdweb SDK.",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/sdk",
|
||||
"license": "Apache-2.0",
|
||||
@@ -51,12 +51,12 @@
|
||||
"generate-docs:solana": "api-extractor run --local --config ./config/api-extractor-solana.json && api-documenter markdown -i ./temp -o ./docs/solana && rm -rf ./temp-solana && mv ./temp ./temp-solana",
|
||||
"generate-snippets": "node ./scripts/generate-snippets.mjs && node ./scripts/generate-feature-snippets-evm.mjs",
|
||||
"build": "tsc && preconstruct build",
|
||||
"test:evm:all": "SWC_NODE_PROJECT=./tsconfig.test.json mocha --config './test/evm/.mocharc.json' --timeout 90000 --parallel './test/evm/**/*.test.ts'",
|
||||
"test:evm:all": "SWC_NODE_PROJECT=./tsconfig.test.json nyc --reporter lcovonly --report-dir ./coverage/evm mocha --config './test/evm/.mocharc.json' --timeout 90000 --parallel './test/evm/**/*.test.ts'",
|
||||
"test:evm": "make test-evm",
|
||||
"test:evm:single": "SWC_NODE_PROJECT=./tsconfig.test.json mocha --config './test/evm/.mocharc.json' --timeout 90000",
|
||||
"node:solana:start": "DEBUG='amman:(info|error|debug)' amman start --forceClone",
|
||||
"node:solana:stop": "amman stop",
|
||||
"test:solana:all": "SWC_NODE_PROJECT=./tsconfig.test.json mocha --config './test/solana/.mocharc.json' --timeout 30000 --parallel './test/solana/**/*.test.ts'",
|
||||
"test:solana:all": "SWC_NODE_PROJECT=./tsconfig.test.json nyc --reporter lcovonly --report-dir ./coverage/solana mocha --config './test/solana/.mocharc.json' --timeout 30000 --parallel './test/solana/**/*.test.ts'",
|
||||
"test:solana": "make test-sol",
|
||||
"test:solana:single": "SWC_NODE_PROJECT=./tsconfig.test.json mocha --config './test/solana/.mocharc.json' --timeout 30000",
|
||||
"push": "yalc push"
|
||||
@@ -66,14 +66,14 @@
|
||||
"@metaplex-foundation/amman-client": "^0.2.1",
|
||||
"@metaplex-foundation/js": "^0.17.6",
|
||||
"@metaplex-foundation/mpl-token-metadata": "^2.3.3",
|
||||
"@project-serum/anchor": "^0.25.0",
|
||||
"@solana/spl-token": "^0.3.5",
|
||||
"@solana/web3.js": "^1.62.0",
|
||||
"@microsoft/api-documenter": "^7.19.4",
|
||||
"@microsoft/api-extractor": "^7.29.2",
|
||||
"@microsoft/tsdoc": "^0.14.1",
|
||||
"@nomiclabs/hardhat-ethers": "^2.0.5",
|
||||
"@preconstruct/cli": "^2.2.1",
|
||||
"@project-serum/anchor": "^0.25.0",
|
||||
"@solana/spl-token": "^0.3.5",
|
||||
"@solana/web3.js": "^1.62.0",
|
||||
"@swc-node/register": "^1.5.1",
|
||||
"@swc/core": "^1.2.177",
|
||||
"@thirdweb-dev/wallets": "*",
|
||||
@@ -95,6 +95,7 @@
|
||||
"ethers": "^5.7.2",
|
||||
"hardhat": "^2.9.3",
|
||||
"mocha": "^10.0.0",
|
||||
"nyc": "^15.1.0",
|
||||
"prettier": "^2.7.1",
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
@@ -132,9 +133,9 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@thirdweb-dev/chains": "*",
|
||||
"@thirdweb-dev/contracts-js": "*",
|
||||
"@thirdweb-dev/storage": "*",
|
||||
"@thirdweb-dev/chains": "*",
|
||||
"bn.js": "^5.2.1",
|
||||
"bs58": "^5.0.0",
|
||||
"cross-fetch": "^3.1.5",
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import { ChainInfo } from "../schema";
|
||||
import { defaultChains } from "@thirdweb-dev/chains";
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
@@ -62,3 +65,25 @@ export const SUPPORTED_CHAIN_IDS: SUPPORTED_CHAIN_ID[] = [
|
||||
ChainId.Hardhat,
|
||||
ChainId.Localhost,
|
||||
];
|
||||
|
||||
// @ts-expect-error
|
||||
let supportedChains: ChainInfo[] = defaultChains;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function setSupportedChains(chains: ChainInfo[] | undefined) {
|
||||
if (chains && chains.length > 0) {
|
||||
supportedChains = chains;
|
||||
} else {
|
||||
// @ts-expect-error
|
||||
supportedChains = defaultChains;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function getSupportedChains() {
|
||||
return supportedChains;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { NativeToken } from "../types/currency";
|
||||
import { ChainId, SUPPORTED_CHAIN_ID } from "./chains";
|
||||
import { ChainId, getSupportedChains, SUPPORTED_CHAIN_ID } from "./chains";
|
||||
import { ethers } from "ethers";
|
||||
|
||||
/**
|
||||
@@ -185,6 +185,19 @@ export const NATIVE_TOKENS: Record<
|
||||
* @public
|
||||
*/
|
||||
export function getNativeTokenByChainId(chainId: ChainId): NativeToken {
|
||||
const chain = getSupportedChains().find((c) => c.chainId === chainId);
|
||||
if (chain && chain.nativeCurrency) {
|
||||
return {
|
||||
name: chain.nativeCurrency.name,
|
||||
symbol: chain.nativeCurrency.symbol,
|
||||
decimals: 18,
|
||||
wrapped: {
|
||||
address: ethers.constants.AddressZero,
|
||||
name: `Wrapped ${chain.nativeCurrency.name}`,
|
||||
symbol: `W${chain.nativeCurrency.symbol}`,
|
||||
},
|
||||
};
|
||||
}
|
||||
return (
|
||||
NATIVE_TOKENS[chainId as SUPPORTED_CHAIN_ID] || {
|
||||
name: "Ether",
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { fetchCurrencyValue } from "../common";
|
||||
import { getCompositePluginABI } from "../common/plugin";
|
||||
import { getChainProvider, NATIVE_TOKEN_ADDRESS } from "../constants";
|
||||
import {
|
||||
getChainProvider,
|
||||
NATIVE_TOKEN_ADDRESS,
|
||||
setSupportedChains,
|
||||
} from "../constants";
|
||||
import {
|
||||
getContractTypeForRemoteName,
|
||||
PREBUILT_CONTRACTS_MAP,
|
||||
@@ -176,6 +180,7 @@ export class ThirdwebSDK extends RPCConnectionHandler {
|
||||
network = network.chainId;
|
||||
}
|
||||
super(network, options);
|
||||
setSupportedChains(options?.supportedChains);
|
||||
this.storageHandler = storage;
|
||||
this.storage = storage;
|
||||
this.wallet = new UserWallet(network, options);
|
||||
|
||||
@@ -72,7 +72,7 @@ export const ChainInfoInputSchema = z.object({
|
||||
nativeCurrency: z.object({
|
||||
name: z.string(),
|
||||
symbol: z.string(),
|
||||
decimals: z.number().default(18),
|
||||
decimals: z.literal(18),
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
</p>
|
||||
<h1 align="center">thirdweb Storage</h1>
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/@thirdweb-dev/storage"><img src="https://img.shields.io/npm/v/@thirdweb-dev/storage?color=red&label=npm&logo=npm" alt="npm version"/></a>
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml/badge.svg"/></a>
|
||||
<a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a>
|
||||
|
||||
</p>
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @thirdweb-dev/unity-js-bridge
|
||||
|
||||
## 0.2.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`5712650`](https://github.com/thirdweb-dev/js/commit/5712650074e2415bbea4173a0bb68d727ff2db90)]:
|
||||
- @thirdweb-dev/sdk@3.9.4
|
||||
- @thirdweb-dev/wallets@0.2.5
|
||||
|
||||
## 0.2.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/unity-js-bridge",
|
||||
"version": "0.2.11",
|
||||
"version": "0.2.12",
|
||||
"main": "dist/thirdweb-unity-bridge.js",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/unity-js-bridge",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# @thirdweb-dev/wallets
|
||||
|
||||
## 0.2.5
|
||||
|
||||
## 0.2.4
|
||||
|
||||
## 0.2.3
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
</p>
|
||||
<h1 align="center">thirdweb wallets</h1>
|
||||
<p align="center">
|
||||
<!-- <a href="https://www.npmjs.com/package/@thirdweb-dev/sdk"><img src="https://img.shields.io/npm/v/@thirdweb-dev/sdk?color=red&label=npm&logo=npm" alt="npm version"/></a> -->
|
||||
<!-- <a href="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/CI.yml/badge.svg"/></a> -->
|
||||
<!-- <a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a> -->
|
||||
<a href="https://www.npmjs.com/package/@thirdweb-dev/wallets"><img src="https://img.shields.io/npm/v/@thirdweb-dev/wallets?color=red&label=npm&logo=npm" alt="npm version"/></a>
|
||||
<a href="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml/badge.svg"/></a>
|
||||
<a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a>
|
||||
|
||||
</p>
|
||||
<!-- <p align="center"><strong>Best in class Web3 SDK for Browser, Node and Mobile apps</strong></p> -->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/wallets",
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.5",
|
||||
"main": "dist/thirdweb-dev-wallets.cjs.js",
|
||||
"module": "dist/thirdweb-dev-wallets.esm.js",
|
||||
"exports": {
|
||||
|
||||
+2
-2
@@ -66,12 +66,12 @@
|
||||
"dependsOn": ["build"]
|
||||
},
|
||||
"test:solana": {
|
||||
"outputs": [],
|
||||
"outputs": ["coverage/solana/**"],
|
||||
"inputs": ["src/core/**", "src/solana/**", "test/solana/**"],
|
||||
"dependsOn": ["build"]
|
||||
},
|
||||
"test:evm": {
|
||||
"outputs": [],
|
||||
"outputs": ["coverage/evm/**"],
|
||||
"inputs": ["src/core/**", "src/evm/**", "test/evm/**"],
|
||||
"dependsOn": ["build"]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user