Skip to content

Commit

Permalink
feat: added snax chain (#2273)
Browse files Browse the repository at this point in the history
* feat: added snax chain

* feat: added chainId hex string

* ref: renamed token to SNAXETH

* ref: bumped dependencies

* ref: updated package versions for react, vue, solid

* Update packages/react/package.json

* Update packages/solid/package.json

* Update packages/vue/package.json

* Update package.json

* Update package.json

* Update package.json

* Update packages/react/package.json

* Update packages/solid/package.json

* Update packages/vue/package.json

---------

Co-authored-by: Adam Carpenter <[email protected]>
  • Loading branch information
MrX-SNX and Adamj1232 authored Aug 21, 2024
1 parent 7243aaf commit 032635d
Show file tree
Hide file tree
Showing 16 changed files with 130 additions and 86 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@web3-onboard/capsule": "^2.3.0",
"@web3-onboard/cede-store": "^2.3.1",
"@web3-onboard/coinbase": "^2.3.1",
"@web3-onboard/core": "^2.22.1",
"@web3-onboard/core": "^2.22.3-alpha.1",
"@web3-onboard/dcent": "^2.2.8",
"@web3-onboard/enkrypt": "^2.1.1",
"@web3-onboard/fortmatic": "^2.1.1",
Expand Down
20 changes: 13 additions & 7 deletions docs/src/lib/services/onboard.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import blocknativeIcon from '../components/icons/blocknative-icon'

let onboard
const getOnboard = async (passedTheme) => {
const getOnboard = async passedTheme => {
const key = 'svelteness::color-scheme'
const scheme = localStorage[key]
let theme = passedTheme || scheme
Expand All @@ -10,8 +10,8 @@ const getOnboard = async (passedTheme) => {
return onboard
}

const classMutationsCheck = (mutationsList) => {
mutationsList.forEach((mutation) => {
const classMutationsCheck = mutationsList => {
mutationsList.forEach(mutation => {
if (onboard && mutation.attributeName === 'class') {
if (mutation.target.className.includes('dark')) {
onboard.state.actions.updateTheme('dark')
Expand All @@ -28,7 +28,7 @@ const classMutationListener = () => {
mutationObserver.observe(document.querySelector('html'), { attributes: true })
}

const intiOnboard = async (theme) => {
const intiOnboard = async theme => {
const { default: Onboard } = await import('@web3-onboard/core')
const { default: injectedModule } = await import('@web3-onboard/injected-wallets')
const { default: trezorModule } = await import('@web3-onboard/trezor')
Expand Down Expand Up @@ -114,8 +114,8 @@ const intiOnboard = async (theme) => {
}
const trezor = trezorModule(trezorOptions)

const finoaConnectOptions = {};
const finoaconnect = finoaConnectModule(finoaConnectOptions);
const finoaConnectOptions = {}
const finoaconnect = finoaConnectModule(finoaConnectOptions)

const uauthOptions = {
clientID: 'a25c3a65-a1f2-46cc-a515-a46fe7acb78c',
Expand All @@ -139,7 +139,7 @@ const intiOnboard = async (theme) => {

const capsule = capsuleModule({
environment: Environment.DEVELOPMENT,
apiKey: '992bbd9146d5de8ad0419f141d9a7ca7'
apiKey: '992bbd9146d5de8ad0419f141d9a7ca7'
})

const particle = particleAuthModule({
Expand Down Expand Up @@ -253,6 +253,12 @@ const intiOnboard = async (theme) => {
token: 'DEGEN',
label: 'Degen',
rpcUrl: 'https://rpc.degen.tips'
},
{
id: 2192,
token: 'SNAXETH',
label: 'SNAX Chain',
rpcUrl: 'https://mainnet.snaxchain.io'
}
],
appMetadata: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Web3 Onboard supports all EVM networks. Supporting a new network is simply a mat
- BNB Chain
- Celo
- Degen
- SNAX
- Fantom
- Gnosis Chain
- Harmony One
Expand Down Expand Up @@ -140,6 +141,12 @@ const onboard = Onboard({
token: 'DEGEN',
label: 'Degen',
rpcUrl: 'https://rpc.degen.tips'
},
{
id: 2192,
token: 'SNAXETH',
label: 'SNAX Chain',
rpcUrl: 'https://mainnet.snaxchain.io'
}
]
})
Expand Down
6 changes: 6 additions & 0 deletions docs/src/routes/docs/[...3]modules/[...1]core/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,12 @@ const onboard = Onboard({
token: 'DEGEN',
label: 'Degen',
rpcUrl: 'https://rpc.degen.tips'
},
{
id: 2192,
token: 'SNAXETH',
label: 'SNAX Chain',
rpcUrl: 'https://mainnet.snaxchain.io'
}
],
appMetadata: {
Expand Down
12 changes: 12 additions & 0 deletions docs/src/routes/examples/[...1]connect-wallet/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ const chains = [
token: 'DEGEN',
label: 'Degen',
rpcUrl: 'https://rpc.degen.tips'
},
{
id: 2192,
token: 'SNAX',
label: 'SNAX Chain',
rpcUrl: 'https://mainnet.snaxchain.io'
}
]

Expand Down Expand Up @@ -441,6 +447,12 @@ const chains = [
token: 'DEGEN',
label: 'Degen',
rpcUrl: 'https://rpc.degen.tips'
},
{
id: 2192,
token: 'SNAXETH',
label: 'SNAX Chain',
rpcUrl: 'https://mainnet.snaxchain.io'
}
]

Expand Down
2 changes: 1 addition & 1 deletion examples/with-sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
"@fontsource/fira-mono": "^4.5.10",
"@rollup/plugin-commonjs": "^25.0.7",
"@web3-onboard/core": "^2.21.4",
"@web3-onboard/core": "^2.22.3-alpha.1",
"@web3-onboard/injected-wallets": "^2.8.5",
"@web3-onboard/walletconnect": "^2.3.6",
"assert": "^2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-vanilla-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"dependencies": {
"@web3-onboard/coinbase": "^2.2.2",
"@web3-onboard/core": "^2.21.0",
"@web3-onboard/core": "^2.22.3-alpha.1",
"@web3-onboard/injected-wallets": "^2.8.4",
"@web3-onboard/walletconnect": "^2.3.5"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/core",
"version": "2.22.2",
"version": "2.22.3-alpha.1",
"description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
"keywords": [
"Ethereum",
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ export { default as warningIcon } from './warning.js'
export { default as successIcon } from './success.js'
export { default as pendingIcon } from './pending.js'
export { default as degenIcon } from './degen.js'
export { default as snaxIcon } from './snax.js'
6 changes: 6 additions & 0 deletions packages/core/src/icons/snax.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default `<svg width="178" height="177" viewBox="0 0 178 177" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="89.0198" cy="88.4095" r="88.305" fill="#06061B"/>
<path d="M68.0815 75.158C67.5149 74.5153 66.8174 74.1932 65.9874 74.1932H49.0126C48.8618 74.1932 48.7384 74.1459 48.6455 74.0512C48.5511 73.9581 48.5039 73.8528 48.5039 73.7398V62.3958C48.5039 62.2828 48.5511 62.179 48.6455 62.0844C48.7384 61.9897 48.8618 61.9424 49.0126 61.9424H66.9499C71.4761 61.9424 75.381 63.7773 78.6629 67.4442L83.0201 72.7185L74.5327 82.9848L68.0815 75.158ZM99.4299 67.3877C102.712 63.7575 106.635 61.9424 111.199 61.9424H129.08C129.231 61.9424 129.344 61.9805 129.42 62.0553C129.495 62.1317 129.533 62.2446 129.533 62.3958V73.7398C129.533 73.8528 129.495 73.9581 129.42 74.0512C129.344 74.1459 129.231 74.1932 129.08 74.1932H112.105C111.275 74.1932 110.578 74.5153 110.011 75.158L97.5064 90.2452L110.068 105.445C110.634 106.051 111.312 106.354 112.105 106.354H129.08C129.231 106.354 129.344 106.401 129.42 106.496C129.495 106.59 129.533 106.714 129.533 106.864V118.208C129.533 118.321 129.495 118.426 129.42 118.519C129.344 118.614 129.231 118.661 129.08 118.661H111.199C106.635 118.661 102.73 116.828 99.4863 113.159L89.0754 100.568L78.6629 113.159C75.381 116.828 71.4578 118.661 66.8936 118.661H49.0126C48.8618 118.661 48.7476 118.614 48.673 118.519C48.5968 118.424 48.5603 118.302 48.5603 118.15V106.806C48.5603 106.693 48.5968 106.589 48.673 106.494C48.7476 106.399 48.8618 106.352 49.0126 106.352H65.9874C66.7793 106.352 67.4768 106.032 68.0815 105.387L80.3595 90.5276L99.4299 67.3877Z" fill="#00D1FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.62306 101.122C1.02459 96.9706 0.714844 92.7262 0.714844 88.4095C0.714844 85.5803 0.84789 82.7823 1.10807 80.0212L11.5198 67.3877C14.8017 63.7575 18.7248 61.9424 23.2891 61.9424H41.1701C41.3209 61.9424 41.4336 61.9805 41.5097 62.0553C41.5844 62.1317 41.6224 62.2446 41.6224 62.3958V73.7398C41.6224 73.8528 41.5844 73.9581 41.5097 74.0512C41.4336 74.1459 41.3209 74.1932 41.1701 74.1932H24.1953C23.3653 74.1932 22.6678 74.5153 22.1012 75.158L9.59627 90.2452L22.1576 105.445C22.7241 106.051 23.4018 106.354 24.1953 106.354H41.1701C41.3209 106.354 41.4336 106.401 41.5097 106.496C41.5844 106.59 41.6224 106.714 41.6224 106.864V118.208C41.6224 118.321 41.5844 118.426 41.5097 118.519C41.4336 118.614 41.3209 118.661 41.1701 118.661H23.2891C18.7248 118.661 14.82 116.828 11.5761 113.159L1.62306 101.122Z" fill="#00D1FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M176.393 101.284C177.007 97.0816 177.325 92.7827 177.325 88.4095C177.325 85.5791 177.192 82.7799 176.931 80.0176L168.27 90.5276L155.992 105.387C155.387 106.032 154.689 106.352 153.898 106.352H136.923C136.772 106.352 136.658 106.399 136.583 106.494C136.507 106.589 136.47 106.693 136.47 106.806V118.15C136.47 118.302 136.507 118.424 136.583 118.519C136.658 118.614 136.772 118.661 136.923 118.661H154.804C159.368 118.661 163.291 116.828 166.573 113.159L176.393 101.284ZM153.898 74.1932C154.728 74.1932 155.425 74.5153 155.992 75.158L162.443 82.9848L170.93 72.7185L166.573 67.4442C163.291 63.7773 159.386 61.9424 154.86 61.9424H136.923C136.772 61.9424 136.649 61.9897 136.556 62.0844C136.461 62.179 136.414 62.2828 136.414 62.3958V73.7398C136.414 73.8528 136.461 73.9581 136.556 74.0512C136.649 74.1459 136.772 74.1932 136.923 74.1932H153.898Z" fill="#00D1FF"/>
</svg>`
13 changes: 10 additions & 3 deletions packages/core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ import {
harmonyOneIcon,
arbitrumIcon,
baseIcon,
degenIcon
degenIcon,
snaxIcon
} from './icons/index.js'

import type { ChainStyle, ConnectedChain, NotifyEventStyles } from './types.js'
Expand Down Expand Up @@ -113,7 +114,8 @@ export const chainIdToLabel: Record<string, string> = {
'0x63564C40': 'Harmony One',
'0xa4b1': 'Arbitrum One',
'0xa4ba': 'Arbitrum Nova',
'0x27bc86aa': 'Degen'
'0x27bc86aa': 'Degen',
'0x890': 'SNAX'
}

export function validEnsChain(chainId: ChainId): string | null {
Expand Down Expand Up @@ -163,7 +165,8 @@ export const networkToChainId: Record<string, ChainId> = {
'matic-main': '0x89',
'fantom-main': '0xfa',
'matic-mumbai': '0x80001',
degen: '0x27bc86aa'
degen: '0x27bc86aa',
SNAX: '0x890'
}

export const chainStyles: Record<string, ChainStyle> = {
Expand Down Expand Up @@ -234,6 +237,10 @@ export const chainStyles: Record<string, ChainStyle> = {
'0x27bc86aa': {
icon: degenIcon,
color: '#a36dfe'
},
'0x890': {
icon: snaxIcon,
color: '#00D1FF'
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@web3-onboard/bloom": "2.0.0",
"@web3-onboard/capsule": "^2.3.0",
"@web3-onboard/cede-store": "^2.3.1",
"@web3-onboard/core": "2.22.2",
"@web3-onboard/core": "2.22.3-alpha.1",
"@web3-onboard/coinbase": "^2.4.1",
"@web3-onboard/dcent": "^2.2.7",
"@web3-onboard/enkrypt": "^2.1.1",
Expand Down
129 changes: 64 additions & 65 deletions packages/finoaconnect/package.json
Original file line number Diff line number Diff line change
@@ -1,66 +1,65 @@
{
"name": "@web3-onboard/finoaconnect",
"version": "2.0.0",
"description": "FinoaConnect enables DApp users to use Finoa's Institutional Custody services.",
"keywords": [
"Ethereum",
"Web3",
"EVM",
"dapp",
"Multichain",
"Wallet",
"Transaction",
"Provider",
"Hardware Wallet",
"Notifications",
"React",
"Svelte",
"Vue",
"Next",
"Nuxt",
"MetaMask",
"Coinbase",
"WalletConnect",
"Ledger",
"Trezor",
"Connect Wallet",
"Ethereum Hooks",
"Blocknative",
"Mempool",
"pending",
"confirmed",
"Injected Wallet",
"Crypto",
"Crypto Wallet",
"Tally Ho",
"FinoaConnect"
],
"repository": {
"type": "git",
"url": "https://github.com/blocknative/web3-onboard.git",
"directory": "packages/finoaconnect"
},
"homepage": "https://onboard.blocknative.com",
"bugs": "https://github.com/blocknative/web3-onboard/issues",
"module": "dist/index.js",
"browser": "dist/index.js",
"main": "dist/index.js",
"type": "module",
"typings": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "tsc",
"dev": "tsc -w",
"type-check": "tsc --noEmit"
},
"devDependencies": {
"typescript": "^5.4.5"
},
"dependencies": {
"@finoa/finoa-connect-sdk": "^1.0.4",
"@web3-onboard/core": "^2.20.4"
}

}
"name": "@web3-onboard/finoaconnect",
"version": "2.0.0",
"description": "FinoaConnect enables DApp users to use Finoa's Institutional Custody services.",
"keywords": [
"Ethereum",
"Web3",
"EVM",
"dapp",
"Multichain",
"Wallet",
"Transaction",
"Provider",
"Hardware Wallet",
"Notifications",
"React",
"Svelte",
"Vue",
"Next",
"Nuxt",
"MetaMask",
"Coinbase",
"WalletConnect",
"Ledger",
"Trezor",
"Connect Wallet",
"Ethereum Hooks",
"Blocknative",
"Mempool",
"pending",
"confirmed",
"Injected Wallet",
"Crypto",
"Crypto Wallet",
"Tally Ho",
"FinoaConnect"
],
"repository": {
"type": "git",
"url": "https://github.com/blocknative/web3-onboard.git",
"directory": "packages/finoaconnect"
},
"homepage": "https://onboard.blocknative.com",
"bugs": "https://github.com/blocknative/web3-onboard/issues",
"module": "dist/index.js",
"browser": "dist/index.js",
"main": "dist/index.js",
"type": "module",
"typings": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "tsc",
"dev": "tsc -w",
"type-check": "tsc --noEmit"
},
"devDependencies": {
"typescript": "^5.4.5"
},
"dependencies": {
"@finoa/finoa-connect-sdk": "^1.0.4",
"@web3-onboard/core": "^2.22.3-alpha.1"
}
}
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/react",
"version": "2.9.2",
"version": "2.9.3-alpha.1",
"description": "A collection of React hooks for integrating Web3-Onboard in to React and Next.js projects. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -61,7 +61,7 @@
"typescript": "^5.4.5"
},
"dependencies": {
"@web3-onboard/core": "2.22.2",
"@web3-onboard/core": "2.22.3-alpha.1",
"@web3-onboard/common": "^2.4.1",
"use-sync-external-store": "1.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/solid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/solid",
"version": "2.1.2",
"version": "2.1.3-alpha.1",
"description": "A collection of solid Composables for integrating Web3-Onboard in to a Solid project. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -63,7 +63,7 @@
},
"dependencies": {
"@web3-onboard/common": "^2.4.1",
"@web3-onboard/core": "2.22.2",
"@web3-onboard/core": "2.22.3-alpha.1",
"solid-js": "^1.8.1"
}
}
Loading

0 comments on commit 032635d

Please sign in to comment.