Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af01c63b45 | ||
|
|
3796204372 | ||
|
|
9c7fbc1603 | ||
|
|
156950423b | ||
|
|
f80f6307a3 | ||
|
|
5f243bba0d | ||
|
|
7d8697ec3f | ||
|
|
ab44b8f0ae | ||
|
|
ad135b67b9 | ||
|
|
5a648f7e74 | ||
|
|
e87292ab60 | ||
|
|
d5d7d542ce |
@@ -1,5 +1,19 @@
|
||||
# @thirdweb-dev/auth
|
||||
|
||||
## 4.1.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`ab44b8f`](https://github.com/thirdweb-dev/js/commit/ab44b8f0ae760065f400f76d69703e26bcbcc022), [`f80f630`](https://github.com/thirdweb-dev/js/commit/f80f6307a3ebe1adaaf072dd2e02aecf83bfa43f)]:
|
||||
- @thirdweb-dev/wallets@2.4.14
|
||||
|
||||
## 4.1.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @thirdweb-dev/wallets@2.4.13
|
||||
|
||||
## 4.1.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/auth",
|
||||
"version": "4.1.34",
|
||||
"version": "4.1.36",
|
||||
"main": "dist/thirdweb-dev-auth.cjs.js",
|
||||
"module": "dist/thirdweb-dev-auth.esm.js",
|
||||
"browser": {
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# @thirdweb-dev/chains
|
||||
|
||||
## 0.1.76
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2378](https://github.com/thirdweb-dev/js/pull/2378) [`5f243bb`](https://github.com/thirdweb-dev/js/commit/5f243bba0ded5dace9344c79e8904a4a342d16af) Thanks [@github-actions](https://github.com/apps/github-actions)! - Synced Chains Package
|
||||
|
||||
## 0.1.75
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2372](https://github.com/thirdweb-dev/js/pull/2372) [`e87292a`](https://github.com/thirdweb-dev/js/commit/e87292ab604897ddfc337d24d2d1fe0f3560baae) Thanks [@github-actions](https://github.com/apps/github-actions)! - Synced Chains Package
|
||||
|
||||
## 0.1.74
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -24,11 +24,10 @@ export default {
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://1001.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://klaytn-baobab.blockpi.network/v1/rpc/public",
|
||||
"https://api.baobab.klaytn.net:8651"
|
||||
],
|
||||
"shortName": "Baobab",
|
||||
"slip44": 1,
|
||||
"slug": "klaytn-testnet-baobab",
|
||||
"testnet": false
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 11198,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
|
||||
"width": 256,
|
||||
"height": 256,
|
||||
"format": "svg"
|
||||
},
|
||||
"infoURL": "https://avacloud.io",
|
||||
"name": "QI0304I2 Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "QI0304I2 Testnet Token",
|
||||
"symbol": "LOD",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 11198,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://11198.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QI0304I2 Testnet",
|
||||
"slug": "qi0304i2-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 11516,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
|
||||
"width": 256,
|
||||
"height": 256,
|
||||
"format": "svg"
|
||||
},
|
||||
"infoURL": "https://avacloud.io",
|
||||
"name": "Tenzro",
|
||||
"nativeCurrency": {
|
||||
"name": "Tenzro Token",
|
||||
"symbol": "TNZO",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 11516,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://11516.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/tenzro/testnet/rpc"
|
||||
],
|
||||
"shortName": "Tenzro",
|
||||
"slug": "tenzro",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 1614,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
|
||||
"width": 256,
|
||||
"height": 256,
|
||||
"format": "svg"
|
||||
},
|
||||
"infoURL": "https://avacloud.io",
|
||||
"name": "QI0305I1 Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "QI0305I1 Testnet Token",
|
||||
"symbol": "PDC",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 1614,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://1614.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QI0305I1 Testnet",
|
||||
"slug": "qi0305i1-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,36 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "ETINS",
|
||||
"chainId": 1617,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "Ethereum Inscription Explorer",
|
||||
"url": "https://explorer.etins.org",
|
||||
"standard": "none"
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"features": [
|
||||
{
|
||||
"name": "EIP155"
|
||||
},
|
||||
{
|
||||
"name": "EIP1559"
|
||||
}
|
||||
],
|
||||
"infoURL": "https://www.etins.org",
|
||||
"name": "Ethereum Inscription Mainnet",
|
||||
"nativeCurrency": {
|
||||
"name": "Ethereum Inscription",
|
||||
"symbol": "ETINS",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 1617,
|
||||
"rpc": [
|
||||
"https://1617.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc.etins.org"
|
||||
],
|
||||
"shortName": "etins",
|
||||
"slug": "ethereum-inscription",
|
||||
"testnet": false
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 18898,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
|
||||
"width": 256,
|
||||
"height": 256,
|
||||
"format": "svg"
|
||||
},
|
||||
"infoURL": "https://avacloud.io",
|
||||
"name": "QaUser4 Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "QaUser4 Testnet Token",
|
||||
"symbol": "NLD",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 18898,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://18898.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QaUser4 Testnet",
|
||||
"slug": "qauser4-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,36 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "FFG",
|
||||
"chainId": 191,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"features": [
|
||||
{
|
||||
"name": "EIP155"
|
||||
},
|
||||
{
|
||||
"name": "EIP1559"
|
||||
}
|
||||
],
|
||||
"icon": {
|
||||
"url": "ipfs://bafkreihsas2rwakc7lllmtb4pcgwutlel2woibmqmhd4aiin342zgtpmwy",
|
||||
"width": 512,
|
||||
"height": 512,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://filefilego.com",
|
||||
"name": "FileFileGo",
|
||||
"nativeCurrency": {
|
||||
"name": "FFG",
|
||||
"symbol": "FFG",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 191,
|
||||
"rpc": [
|
||||
"https://191.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc.filefilego.com/rpc"
|
||||
],
|
||||
"shortName": "ffg",
|
||||
"slug": "filefilego",
|
||||
"testnet": false
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 19112,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
|
||||
"width": 256,
|
||||
"height": 256,
|
||||
"format": "svg"
|
||||
},
|
||||
"infoURL": "https://avacloud.io",
|
||||
"name": "QI0304s1 Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "QI0304s1 Testnet Token",
|
||||
"symbol": "LKG",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 19112,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://19112.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QI0304s1 Testnet",
|
||||
"slug": "qi0304s1-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -8,7 +8,7 @@ export default {
|
||||
"name": "Swan Saturn Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "SWANETH",
|
||||
"symbol": "SWAN",
|
||||
"symbol": "sETH",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 2024,
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Auroria",
|
||||
"chainId": 205205,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "Auroria Testnet Explorer",
|
||||
"url": "https://auroria.explorer.stratisevm.com",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
],
|
||||
"faucets": [
|
||||
"https://auroria.faucet.stratisevm.com"
|
||||
],
|
||||
"icon": {
|
||||
"url": "ipfs://QmbkTh6qNYUnae5yNjied3qZqVyZcb4x3hfUpJ33bGg9QY",
|
||||
"width": 800,
|
||||
"height": 800,
|
||||
"format": "jpg"
|
||||
},
|
||||
"infoURL": "https://www.stratisplatform.com",
|
||||
"name": "Auroria Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "Auroria Stratis",
|
||||
"symbol": "tSTRAX",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 205205,
|
||||
"rpc": [
|
||||
"https://205205.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://auroria.rpc.stratisevm.com"
|
||||
],
|
||||
"shortName": "auroria",
|
||||
"slug": "auroria-testnet",
|
||||
"testnet": true,
|
||||
"title": "Stratis Testnet Auroria"
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,48 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "DEEPL",
|
||||
"chainId": 222555,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "DeepL Mainnet Explorer",
|
||||
"url": "https://scan.deeplnetwork.org",
|
||||
"standard": "EIP3091",
|
||||
"icon": {
|
||||
"url": "ipfs://bafybeihjwgy4qja5cee452malk5hpb25pzpipfaka7hjcyb437ldodxzaq",
|
||||
"width": 512,
|
||||
"height": 512,
|
||||
"format": "png"
|
||||
}
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"features": [
|
||||
{
|
||||
"name": "EIP155"
|
||||
},
|
||||
{
|
||||
"name": "EIP1559"
|
||||
}
|
||||
],
|
||||
"icon": {
|
||||
"url": "ipfs://bafybeihjwgy4qja5cee452malk5hpb25pzpipfaka7hjcyb437ldodxzaq",
|
||||
"width": 512,
|
||||
"height": 512,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://deeplnetwork.org",
|
||||
"name": "DeepL Mainnet",
|
||||
"nativeCurrency": {
|
||||
"name": "DeepL",
|
||||
"symbol": "DEEPL",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 222555,
|
||||
"rpc": [
|
||||
"https://222555.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc.deeplnetwork.org"
|
||||
],
|
||||
"shortName": "deepl",
|
||||
"slug": "deepl",
|
||||
"testnet": false
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,50 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "DEEPL",
|
||||
"chainId": 222666,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "DeepL Testnet Explorer",
|
||||
"url": "https://testnet-scan.deeplnetwork.org",
|
||||
"standard": "EIP3091",
|
||||
"icon": {
|
||||
"url": "ipfs://bafybeihjwgy4qja5cee452malk5hpb25pzpipfaka7hjcyb437ldodxzaq",
|
||||
"width": 512,
|
||||
"height": 512,
|
||||
"format": "png"
|
||||
}
|
||||
}
|
||||
],
|
||||
"faucets": [
|
||||
"https://faucet.deeplnetwork.org"
|
||||
],
|
||||
"features": [
|
||||
{
|
||||
"name": "EIP155"
|
||||
},
|
||||
{
|
||||
"name": "EIP1559"
|
||||
}
|
||||
],
|
||||
"icon": {
|
||||
"url": "ipfs://bafybeihjwgy4qja5cee452malk5hpb25pzpipfaka7hjcyb437ldodxzaq",
|
||||
"width": 512,
|
||||
"height": 512,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://deeplnetwork.org",
|
||||
"name": "DeepL Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "DeepL",
|
||||
"symbol": "DEEPL",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 222666,
|
||||
"rpc": [
|
||||
"https://222666.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://testnet.deeplnetwork.org"
|
||||
],
|
||||
"shortName": "tdeepl",
|
||||
"slug": "deepl-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -2,7 +2,13 @@ import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "FRAX",
|
||||
"chainId": 252,
|
||||
"explorers": [],
|
||||
"explorers": [
|
||||
{
|
||||
"name": "fraxscan",
|
||||
"url": "https://fraxscan.com",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
@@ -12,7 +18,7 @@ export default {
|
||||
"format": "PNG"
|
||||
},
|
||||
"infoURL": "https://mainnet.frax.com",
|
||||
"name": "Fraxtal Mainnet",
|
||||
"name": "Fraxtal",
|
||||
"nativeCurrency": {
|
||||
"name": "Frax Ether",
|
||||
"symbol": "frxETH",
|
||||
@@ -20,9 +26,12 @@ export default {
|
||||
},
|
||||
"networkId": 252,
|
||||
"redFlags": [],
|
||||
"rpc": [],
|
||||
"rpc": [
|
||||
"https://252.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc.frax.com"
|
||||
],
|
||||
"shortName": "fraxtal",
|
||||
"slug": "fraxtal",
|
||||
"status": "incubating",
|
||||
"status": "active",
|
||||
"testnet": false
|
||||
} as const satisfies Chain;
|
||||
@@ -2,7 +2,13 @@ import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "FRAX",
|
||||
"chainId": 2522,
|
||||
"explorers": [],
|
||||
"explorers": [
|
||||
{
|
||||
"name": "fraxscan",
|
||||
"url": "https://holesky.fraxscan.com",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "inEVM",
|
||||
"chainId": 2525,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"icon": {
|
||||
"url": "ipfs://QmU9KU1qgReJR7vyVxN5zwWB3nkhSs658ViArUjT7GCh4r",
|
||||
"width": 2000,
|
||||
"height": 2000,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://inevm.com",
|
||||
"name": "inEVM Mainnet",
|
||||
"nativeCurrency": {
|
||||
"name": "Injective",
|
||||
"symbol": "INJ",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 2525,
|
||||
"rpc": [
|
||||
"https://2525.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://mainnet.rpc.inevm.com/http"
|
||||
],
|
||||
"shortName": "inevm",
|
||||
"slug": "inevm",
|
||||
"status": "active",
|
||||
"testnet": false
|
||||
} as const satisfies Chain;
|
||||
@@ -16,6 +16,7 @@ export default {
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "ipfs://QmRkhUD6J3B9WhT4hEWLrcFVTrBhx3CQgNC783aJsrwxSN",
|
||||
"width": 512,
|
||||
@@ -39,6 +40,7 @@ export default {
|
||||
}
|
||||
]
|
||||
},
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://280.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://testnet.era.zksync.dev"
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 28106,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
|
||||
"width": 256,
|
||||
"height": 256,
|
||||
"format": "svg"
|
||||
},
|
||||
"infoURL": "https://avacloud.io",
|
||||
"name": "Mezzanine Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "Mezzanine Testnet Token",
|
||||
"symbol": "OWQ",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 28106,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://28106.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/mezzaninet/testnet/rpc"
|
||||
],
|
||||
"shortName": "Mezzanine Testnet",
|
||||
"slug": "mezzanine-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -10,6 +10,7 @@ export default {
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"infoURL": "https://community.optimism.io/docs/developers/bedrock",
|
||||
"name": "Optimism Bedrock (Goerli Alpha Testnet)",
|
||||
"nativeCurrency": {
|
||||
@@ -18,15 +19,16 @@ export default {
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 28528,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://28528.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://alpha-1-replica-0.bedrock-goerli.optimism.io",
|
||||
"https://alpha-1-replica-1.bedrock-goerli.optimism.io",
|
||||
"https://alpha-1-replica-2.bedrock-goerli.optimism.io",
|
||||
"https://alpha-1-replica-2.bedrock-goerli.optimism.io"
|
||||
],
|
||||
"shortName": "obgor",
|
||||
"slip44": 1,
|
||||
"slug": "optimism-bedrock-goerli-alpha-testnet",
|
||||
"status": "deprecated",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -10,6 +10,7 @@ export default {
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"infoURL": "https://boba.network",
|
||||
"name": "Boba Network Goerli Testnet",
|
||||
"nativeCurrency": {
|
||||
@@ -27,6 +28,7 @@ export default {
|
||||
}
|
||||
]
|
||||
},
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://2888.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://goerli.boba.network/",
|
||||
@@ -35,5 +37,6 @@ export default {
|
||||
"shortName": "BobaGoerli",
|
||||
"slip44": 1,
|
||||
"slug": "boba-network-goerli-testnet",
|
||||
"status": "deprecated",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -5,7 +5,7 @@ export default {
|
||||
"explorers": [
|
||||
{
|
||||
"name": "explorer-thebifrost",
|
||||
"url": "https://explorer.mainnet.thebifrost.io",
|
||||
"url": "https://explorer.mainnet.bifrostnetwork.com",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
],
|
||||
@@ -16,7 +16,7 @@ export default {
|
||||
"height": 480,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://thebifrost.io",
|
||||
"infoURL": "https://bifrostnetwork.com",
|
||||
"name": "Bifrost Mainnet",
|
||||
"nativeCurrency": {
|
||||
"name": "Bifrost",
|
||||
@@ -26,8 +26,8 @@ export default {
|
||||
"networkId": 3068,
|
||||
"rpc": [
|
||||
"https://3068.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://public-01.mainnet.thebifrost.io/rpc",
|
||||
"https://public-02.mainnet.thebifrost.io/rpc"
|
||||
"https://public-01.mainnet.bifrostnetwork.com/rpc",
|
||||
"https://public-02.mainnet.bifrostnetwork.com/rpc"
|
||||
],
|
||||
"shortName": "bfc",
|
||||
"slug": "bifrost",
|
||||
|
||||
@@ -7,6 +7,11 @@ export default {
|
||||
"name": "3xpl",
|
||||
"url": "https://3xpl.com/botanix",
|
||||
"standard": "EIP3091"
|
||||
},
|
||||
{
|
||||
"name": "Blockscout",
|
||||
"url": "https://blockscout.botanixlabs.dev",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
],
|
||||
"faucets": [
|
||||
|
||||
@@ -4,8 +4,8 @@ export default {
|
||||
"chainId": 3776,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "blockscout",
|
||||
"url": "https://astar-zkevm.explorer.startale.com/",
|
||||
"name": "Blockscout Astar zkEVM explorer",
|
||||
"url": "https://astar-zkevm.explorer.startale.com",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
],
|
||||
@@ -35,10 +35,12 @@ export default {
|
||||
]
|
||||
},
|
||||
"redFlags": [],
|
||||
"rpc": [],
|
||||
"rpc": [
|
||||
"https://3776.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc.startale.com/astar-zkevm"
|
||||
],
|
||||
"shortName": "astarzk",
|
||||
"slug": "astar-zkevm",
|
||||
"status": "incubating",
|
||||
"testnet": false,
|
||||
"title": "Astar zkEVM Mainnet"
|
||||
} as const satisfies Chain;
|
||||
@@ -5,7 +5,7 @@ export default {
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"infoURL": "https://docs.thefirechain.com/",
|
||||
"name": "Firechain zkEVM Testnet",
|
||||
"name": "Firechain zkEVM Ghostrider",
|
||||
"nativeCurrency": {
|
||||
"name": "Ether",
|
||||
"symbol": "ETH",
|
||||
@@ -16,8 +16,8 @@ export default {
|
||||
"https://3885.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc-zkevm-ghostrider.thefirechain.com"
|
||||
],
|
||||
"shortName": "firechain-zkEVM-ghostrider",
|
||||
"slug": "firechain-zkevm-testnet",
|
||||
"shortName": "firechain-zkEVM-testnet",
|
||||
"slug": "firechain-zkevm-ghostrider",
|
||||
"testnet": true,
|
||||
"title": "Firechain zkEVM Ghostrider"
|
||||
"title": "Firechain zkEVM Testnet"
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 41799,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
|
||||
"width": 256,
|
||||
"height": 256,
|
||||
"format": "svg"
|
||||
},
|
||||
"infoURL": "https://avacloud.io",
|
||||
"name": "Will's New Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "Will's New Testnet Token",
|
||||
"symbol": "ZBO",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 41799,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://41799.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "Will's New Testnet",
|
||||
"slug": "will-s-new-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -43,5 +43,6 @@ export default {
|
||||
"shortName": "ogor",
|
||||
"slip44": 1,
|
||||
"slug": "optimism-goerli",
|
||||
"status": "deprecated",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -44,6 +44,7 @@ export default {
|
||||
"shortName": "arb-goerli",
|
||||
"slip44": 1,
|
||||
"slug": "arbitrum-goerli",
|
||||
"status": "deprecated",
|
||||
"testnet": true,
|
||||
"title": "Arbitrum Goerli Rollup Testnet"
|
||||
} as const satisfies Chain;
|
||||
@@ -2,13 +2,7 @@ import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Xai Goerli Orbit Testnet",
|
||||
"chainId": 47279324479,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "Xai Goerli Testnet Explorer",
|
||||
"url": "https://testnet-explorer.xai-chain.net",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
],
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"infoURL": "https://xai.games/",
|
||||
@@ -20,11 +14,9 @@ export default {
|
||||
},
|
||||
"networkId": 47279324479,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://47279324479.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://testnet.xai-chain.net/rpc"
|
||||
],
|
||||
"rpc": [],
|
||||
"shortName": "xai-goerli",
|
||||
"slug": "xai-goerli-orbit",
|
||||
"status": "deprecated",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -5,7 +5,7 @@ export default {
|
||||
"explorers": [
|
||||
{
|
||||
"name": "explorer-thebifrost",
|
||||
"url": "https://explorer.testnet.thebifrost.io",
|
||||
"url": "https://explorer.testnet.bifrostnetwork.com",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
],
|
||||
@@ -16,7 +16,7 @@ export default {
|
||||
"height": 480,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://thebifrost.io",
|
||||
"infoURL": "https://bifrostnetwork.com",
|
||||
"name": "Bifrost Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "Bifrost",
|
||||
@@ -26,8 +26,8 @@ export default {
|
||||
"networkId": 49088,
|
||||
"rpc": [
|
||||
"https://49088.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://public-01.testnet.thebifrost.io/rpc",
|
||||
"https://public-02.testnet.thebifrost.io/rpc"
|
||||
"https://public-01.testnet.bifrostnetwork.com/rpc",
|
||||
"https://public-02.testnet.bifrostnetwork.com/rpc"
|
||||
],
|
||||
"shortName": "tbfc",
|
||||
"slip44": 1,
|
||||
|
||||
@@ -57,6 +57,7 @@ export default {
|
||||
"shortName": "gor",
|
||||
"slip44": 1,
|
||||
"slug": "goerli",
|
||||
"status": "deprecated",
|
||||
"testnet": true,
|
||||
"title": "Ethereum Testnet Goerli"
|
||||
} as const satisfies Chain;
|
||||
@@ -1,28 +1,28 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "ETHF",
|
||||
"chain": "DIS",
|
||||
"chainId": 513100,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "etherfair",
|
||||
"url": "https://www.oklink.com/ethf",
|
||||
"name": "DisChain",
|
||||
"url": "https://www.oklink.com/dis",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"infoURL": "https://etherfair.org",
|
||||
"name": "ethereum Fair",
|
||||
"infoURL": "https://dischain.xyz",
|
||||
"name": "DisChain",
|
||||
"nativeCurrency": {
|
||||
"name": "EthereumFair",
|
||||
"symbol": "ETHF",
|
||||
"name": "DisChain",
|
||||
"symbol": "DIS",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 513100,
|
||||
"rpc": [
|
||||
"https://513100.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc.etherfair.org"
|
||||
"https://rpc.dischain.xyz"
|
||||
],
|
||||
"shortName": "ethf",
|
||||
"slug": "ethereum-fair",
|
||||
"shortName": "dis",
|
||||
"slug": "dischain",
|
||||
"testnet": false
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 52150,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
|
||||
"width": 256,
|
||||
"height": 256,
|
||||
"format": "svg"
|
||||
},
|
||||
"infoURL": "https://avacloud.io",
|
||||
"name": "QI0304I1 Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "QI0304I1 Testnet Token",
|
||||
"symbol": "LOD",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 52150,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://52150.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QI0304I1 Testnet",
|
||||
"slug": "qi0304i1-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -26,8 +26,8 @@ export default {
|
||||
"https://rpc.ankr.com/syscoin/${ANKR_API_KEY}",
|
||||
"https://syscoin.public-rpc.com",
|
||||
"wss://rpc.syscoin.org/wss",
|
||||
"https://syscoin-evm-rpc.publicnode.com",
|
||||
"wss://syscoin-evm-rpc.publicnode.com"
|
||||
"https://syscoin-evm.publicnode.com",
|
||||
"wss://syscoin-evm.publicnode.com"
|
||||
],
|
||||
"shortName": "sys",
|
||||
"slug": "syscoin",
|
||||
|
||||
@@ -23,7 +23,9 @@ export default {
|
||||
"rpc": [
|
||||
"https://570.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc.rollux.com",
|
||||
"wss://rpc.rollux.com/wss"
|
||||
"wss://rpc.rollux.com/wss",
|
||||
"https://rollux.rpc.syscoin.org",
|
||||
"wss://rollux.rpc.syscoin.org/wss"
|
||||
],
|
||||
"shortName": "sys-rollux",
|
||||
"slug": "rollux",
|
||||
|
||||
@@ -24,8 +24,8 @@ export default {
|
||||
"https://5700.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc.tanenbaum.io",
|
||||
"wss://rpc.tanenbaum.io/wss",
|
||||
"https://syscoin-tanenbaum-evm-rpc.publicnode.com",
|
||||
"wss://syscoin-tanenbaum-evm-rpc.publicnode.com"
|
||||
"https://syscoin-tanenbaum-evm.publicnode.com",
|
||||
"wss://syscoin-tanenbaum-evm.publicnode.com"
|
||||
],
|
||||
"shortName": "tsys",
|
||||
"slip44": 1,
|
||||
|
||||
@@ -24,7 +24,9 @@ export default {
|
||||
"https://57000.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc-tanenbaum.rollux.com",
|
||||
"https://rpc.ankr.com/rollux_testnet/${ANKR_API_KEY}",
|
||||
"wss://rpc-tanenbaum.rollux.com/wss"
|
||||
"wss://rpc-tanenbaum.rollux.com/wss",
|
||||
"https://rollux.rpc.tanenbaum.io",
|
||||
"wss://rollux.rpc.tanenbaum.io/wss"
|
||||
],
|
||||
"shortName": "tsys-rollux",
|
||||
"slip44": 1,
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "BEYOND",
|
||||
"chainId": 59185,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "Beyond",
|
||||
"url": "https://explorerl2new-beyond-indigo-playground-xz87sjgmaj.t.conduit.xyz",
|
||||
"standard": "standard",
|
||||
"icon": {
|
||||
"url": "ipfs://QmbLxRVZ27Yy6RE9xAdYgSxGPB1TjPtcxahy6uNnp2Pt6T/Beyond.jpg",
|
||||
"width": 512,
|
||||
"height": 512,
|
||||
"format": "jpg"
|
||||
}
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "ipfs://QmbLxRVZ27Yy6RE9xAdYgSxGPB1TjPtcxahy6uNnp2Pt6T/Beyond.jpg",
|
||||
"width": 512,
|
||||
"height": 512,
|
||||
"format": "jpg"
|
||||
},
|
||||
"infoURL": "https://explorerl2new-beyond-indigo-playground-xz87sjgmaj.t.conduit.xyz",
|
||||
"name": "BeyondChain Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "BEYOND",
|
||||
"symbol": "BEYOND",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 59185,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://59185.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc-beyond-indigo-playground-xz87sjgmaj.t.conduit.xyz"
|
||||
],
|
||||
"shortName": "beyond-indigo-playground-xz87sjgmaj",
|
||||
"slug": "beyondchain-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -44,5 +44,6 @@ export default {
|
||||
"shortName": "metis-goerli",
|
||||
"slip44": 1,
|
||||
"slug": "metis-goerli-testnet",
|
||||
"status": "deprecated",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -4,7 +4,7 @@ export default {
|
||||
"chainId": 6038361,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "Blockscout zKyoto chain explorer",
|
||||
"name": "Blockscout zKyoto explorer",
|
||||
"url": "https://astar-zkyoto.blockscout.com",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
@@ -43,7 +43,6 @@ export default {
|
||||
],
|
||||
"shortName": "azkyt",
|
||||
"slug": "astar-zkyoto",
|
||||
"status": "incubating",
|
||||
"testnet": true,
|
||||
"title": "Astar zkEVM Testnet zKyoto"
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 61551,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
|
||||
"width": 256,
|
||||
"height": 256,
|
||||
"format": "svg"
|
||||
},
|
||||
"infoURL": "https://avacloud.io",
|
||||
"name": "QR0304T1TS Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "QR0304T1TS Testnet Token",
|
||||
"symbol": "OYU",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 61551,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://61551.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/qr0304t1ts/testnet/rpc"
|
||||
],
|
||||
"shortName": "QR0304T1TS Testnet",
|
||||
"slug": "qr0304t1ts-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,36 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "FlowEVM",
|
||||
"chainId": 646,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "Flow Diver",
|
||||
"url": "https://previewnet.flowdiver.io",
|
||||
"standard": "none"
|
||||
}
|
||||
],
|
||||
"faucets": [
|
||||
"https://previewnet-faucet.onflow.org"
|
||||
],
|
||||
"icon": {
|
||||
"url": "ipfs://QmQFugEvsfU3ARjjJ7YRLJwSxMfTk54WWzrofekTRBKFaC",
|
||||
"width": 2000,
|
||||
"height": 2000,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://developers.flow.com/evm/about",
|
||||
"name": "FlowEVM PreviewNet",
|
||||
"nativeCurrency": {
|
||||
"name": "FLOW",
|
||||
"symbol": "FLOW",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 646,
|
||||
"rpc": [
|
||||
"https://646.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://previewnet.evm.nodes.onflow.org"
|
||||
],
|
||||
"shortName": "flowevm-preview",
|
||||
"slug": "flowevm-previewnet",
|
||||
"testnet": false
|
||||
} as const satisfies Chain;
|
||||
@@ -24,13 +24,10 @@ export default {
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 65100001,
|
||||
"rpc": [
|
||||
"https://65100001.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc1.piccadilly.autonity.org/",
|
||||
"wss://rpc1.piccadilly.autonity.org/ws/"
|
||||
],
|
||||
"rpc": [],
|
||||
"shortName": "piccadilly-01",
|
||||
"slip44": 1,
|
||||
"slug": "autonity-piccadilly-barada-testnet",
|
||||
"status": "deprecated",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,36 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "AUT",
|
||||
"chainId": 65100002,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "autonity-blockscout",
|
||||
"url": "https://piccadilly.autonity.org",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"icon": {
|
||||
"url": "ipfs://Qme5nxFZZoNNpiT8u9WwcBot4HyLTg2jxMxRnsbc5voQwB",
|
||||
"width": 1000,
|
||||
"height": 1000,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://autonity.org/",
|
||||
"name": "Autonity Piccadilly (Sumida) Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "Piccadilly Auton",
|
||||
"symbol": "ATN",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 65100002,
|
||||
"rpc": [
|
||||
"https://65100002.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc1.piccadilly.autonity.org/",
|
||||
"wss://rpc1.piccadilly.autonity.org/ws/"
|
||||
],
|
||||
"shortName": "piccadilly-02",
|
||||
"slip44": 1,
|
||||
"slug": "autonity-piccadilly-sumida-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Degen",
|
||||
"chainId": 666666666,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"icon": {
|
||||
"url": "ipfs://Qmb6yAe4wXeBkxjfhxzoUT9TzETcmE7Vne59etm9GJaQf7",
|
||||
"width": 789,
|
||||
"height": 668,
|
||||
"format": "svg"
|
||||
},
|
||||
"infoURL": "https://degen.tips",
|
||||
"name": "Degen Chain",
|
||||
"nativeCurrency": {
|
||||
"name": "DEGEN",
|
||||
"symbol": "DEGEN",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 666666666,
|
||||
"rpc": [
|
||||
"https://666666666.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc.degen.tips"
|
||||
],
|
||||
"shortName": "degen-chain",
|
||||
"slug": "degen-chain",
|
||||
"status": "incubating",
|
||||
"testnet": false,
|
||||
"title": "Degen Chain"
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 70038,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
|
||||
"width": 256,
|
||||
"height": 256,
|
||||
"format": "svg"
|
||||
},
|
||||
"infoURL": "https://avacloud.io",
|
||||
"name": "John's Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "John's Testnet Token",
|
||||
"symbol": "FLG",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 70038,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://70038.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "John's Testnet",
|
||||
"slug": "john-s-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -2,9 +2,22 @@ import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 710420,
|
||||
"explorers": [],
|
||||
"explorers": [
|
||||
{
|
||||
"name": "TILTYARD Explorer",
|
||||
"url": "https://subnets.avax.network/tiltyard",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"features": [
|
||||
{
|
||||
"name": "EIP155"
|
||||
},
|
||||
{
|
||||
"name": "EIP1559"
|
||||
}
|
||||
],
|
||||
"icon": {
|
||||
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
|
||||
"width": 256,
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 7158,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
|
||||
"width": 256,
|
||||
"height": 256,
|
||||
"format": "svg"
|
||||
},
|
||||
"infoURL": "https://avacloud.io",
|
||||
"name": "TESTNet FirstTEST",
|
||||
"nativeCurrency": {
|
||||
"name": "TESTNet FirstTEST Token",
|
||||
"symbol": "TEST",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 7158,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://7158.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/testnetfir/testnet/rpc"
|
||||
],
|
||||
"shortName": "TESTNet FirstTEST",
|
||||
"slug": "testnet-firsttest",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 7326,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
|
||||
"width": 256,
|
||||
"height": 256,
|
||||
"format": "svg"
|
||||
},
|
||||
"infoURL": "https://avacloud.io",
|
||||
"name": "QI M 2403051 Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "QI M 2403051 Testnet Token",
|
||||
"symbol": "VVC",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 7326,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://7326.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QI M 2403051 Testnet",
|
||||
"slug": "qi-m-2403051-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,34 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "FlowEVM",
|
||||
"chainId": 747,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "Flow Diver",
|
||||
"url": "https://flowdiver.io",
|
||||
"standard": "none"
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"icon": {
|
||||
"url": "ipfs://QmQFugEvsfU3ARjjJ7YRLJwSxMfTk54WWzrofekTRBKFaC",
|
||||
"width": 2000,
|
||||
"height": 2000,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://developers.flow.com/evm/about",
|
||||
"name": "FlowEVM Mainnet",
|
||||
"nativeCurrency": {
|
||||
"name": "FLOW",
|
||||
"symbol": "FLOW",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 747,
|
||||
"rpc": [
|
||||
"https://747.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://mainnet.evm.nodes.onflow.org"
|
||||
],
|
||||
"shortName": "flowevm-mainnet",
|
||||
"slug": "flowevm",
|
||||
"testnet": false
|
||||
} as const satisfies Chain;
|
||||
@@ -4,19 +4,14 @@ export default {
|
||||
"chainId": 7700,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "Canto EVM Explorer (Blockscout)",
|
||||
"url": "https://evm.explorer.canto.io",
|
||||
"standard": "none"
|
||||
},
|
||||
{
|
||||
"name": "Canto Cosmos Explorer",
|
||||
"url": "https://cosmos-explorers.neobase.one",
|
||||
"standard": "none"
|
||||
"name": "Canto Explorer (OKLink)",
|
||||
"url": "https://www.oklink.com/canto",
|
||||
"standard": "EIP3091"
|
||||
},
|
||||
{
|
||||
"name": "Canto EVM Explorer (Blockscout)",
|
||||
"url": "https://tuber.build",
|
||||
"standard": "none"
|
||||
"standard": "EIP3091"
|
||||
},
|
||||
{
|
||||
"name": "dexguru",
|
||||
@@ -42,14 +37,9 @@ export default {
|
||||
"rpc": [
|
||||
"https://7700.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://canto.slingshot.finance",
|
||||
"https://canto.neobase.one",
|
||||
"https://canto-rpc.ansybl.io",
|
||||
"https://mainnode.plexnode.org:8545",
|
||||
"https://canto.gravitychain.io/",
|
||||
"https://canto.evm.chandrastation.com/",
|
||||
"https://jsonrpc.canto.nodestake.top/",
|
||||
"https://canto.dexvaults.com/",
|
||||
"wss://canto.gravitychain.io:8546",
|
||||
"wss://canto.dexvaults.com/ws"
|
||||
"https://canto.gravitychain.io/"
|
||||
],
|
||||
"shortName": "canto",
|
||||
"slug": "canto",
|
||||
|
||||
@@ -2,7 +2,30 @@ import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "ETH",
|
||||
"chainId": 81457,
|
||||
"explorers": [],
|
||||
"explorers": [
|
||||
{
|
||||
"name": "Blastscan",
|
||||
"url": "https://blastscan.io",
|
||||
"standard": "EIP3091",
|
||||
"icon": {
|
||||
"url": "ipfs://bafybeifc2h3x7jgy4x4nmg2m54ghbvmkfu6oweujambwefzqzew5vujhsi",
|
||||
"width": 400,
|
||||
"height": 400,
|
||||
"format": "jpg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Blast Explorer",
|
||||
"url": "https://blastexplorer.io",
|
||||
"standard": "EIP3091",
|
||||
"icon": {
|
||||
"url": "ipfs://bafybeifc2h3x7jgy4x4nmg2m54ghbvmkfu6oweujambwefzqzew5vujhsi",
|
||||
"width": 400,
|
||||
"height": 400,
|
||||
"format": "jpg"
|
||||
}
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"icon": {
|
||||
"url": "ipfs://bafybeifc2h3x7jgy4x4nmg2m54ghbvmkfu6oweujambwefzqzew5vujhsi",
|
||||
@@ -22,9 +45,16 @@ export default {
|
||||
"type": "L2",
|
||||
"chain": "eip155-1"
|
||||
},
|
||||
"rpc": [],
|
||||
"rpc": [
|
||||
"https://81457.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc.blast.io",
|
||||
"https://rpc.ankr.com/blast",
|
||||
"https://blast.din.dev/rpc",
|
||||
"https://blastl2-mainnet.public.blastapi.io",
|
||||
"https://blast.blockpi.network/v1/rpc/public"
|
||||
],
|
||||
"shortName": "blastmainnet",
|
||||
"slug": "blast-blastmainnet",
|
||||
"status": "incubating",
|
||||
"status": "active",
|
||||
"testnet": false
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,43 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Runic",
|
||||
"chainId": 822,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "RunicScan",
|
||||
"url": "https://scan.runic.build",
|
||||
"standard": "EIP3091",
|
||||
"icon": {
|
||||
"url": "ipfs://QmW3RZKwBq12F7jVV2pn6T9WzwU5rosLYkVqoRQckfKvXo",
|
||||
"width": 340,
|
||||
"height": 340,
|
||||
"format": "png"
|
||||
}
|
||||
}
|
||||
],
|
||||
"faucets": [
|
||||
"https://faucet.runic.build"
|
||||
],
|
||||
"icon": {
|
||||
"url": "ipfs://QmW3RZKwBq12F7jVV2pn6T9WzwU5rosLYkVqoRQckfKvXo",
|
||||
"width": 340,
|
||||
"height": 340,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://runic.build",
|
||||
"name": "Runic Chain Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "Bitcoin",
|
||||
"symbol": "rBTC",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 822,
|
||||
"rpc": [
|
||||
"https://822.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc-testnet.runic.build"
|
||||
],
|
||||
"shortName": "runic-testnet",
|
||||
"slug": "runic-chain-testnet",
|
||||
"status": "active",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -32,7 +32,7 @@ export default {
|
||||
"networkId": 84532,
|
||||
"rpc": [
|
||||
"https://84532.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://https://sepolia.base.org",
|
||||
"https://sepolia.base.org",
|
||||
"https://base-sepolia-rpc.publicnode.com",
|
||||
"wss://base-sepolia-rpc.publicnode.com"
|
||||
],
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 89327,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
|
||||
"width": 256,
|
||||
"height": 256,
|
||||
"format": "svg"
|
||||
},
|
||||
"infoURL": "https://avacloud.io",
|
||||
"name": "QI0304I3 Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "QI0304I3 Testnet Token",
|
||||
"symbol": "ZIK",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 89327,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://89327.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QI0304I3 Testnet",
|
||||
"slug": "qi0304i3-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -2,7 +2,13 @@ import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "FIRE",
|
||||
"chainId": 917,
|
||||
"explorers": [],
|
||||
"explorers": [
|
||||
{
|
||||
"name": "FireScan",
|
||||
"url": "https://rinia.firescan.io",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
],
|
||||
"faucets": [
|
||||
"https://faucet.thefirechain.com"
|
||||
],
|
||||
@@ -27,6 +33,5 @@ export default {
|
||||
"shortName": "tfire",
|
||||
"slip44": 1,
|
||||
"slug": "rinia-testnet",
|
||||
"status": "incubating",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/chains",
|
||||
"version": "0.1.74",
|
||||
"version": "0.1.76",
|
||||
"main": "dist/thirdweb-dev-chains.cjs.js",
|
||||
"module": "dist/thirdweb-dev-chains.esm.js",
|
||||
"exports": {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,25 @@
|
||||
# thirdweb
|
||||
|
||||
## 0.13.44
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`ab44b8f`](https://github.com/thirdweb-dev/js/commit/ab44b8f0ae760065f400f76d69703e26bcbcc022), [`9c7fbc1`](https://github.com/thirdweb-dev/js/commit/9c7fbc1603a7265209b6f56c2284fdb0e6b33a1d), [`f80f630`](https://github.com/thirdweb-dev/js/commit/f80f6307a3ebe1adaaf072dd2e02aecf83bfa43f), [`5f243bb`](https://github.com/thirdweb-dev/js/commit/5f243bba0ded5dace9344c79e8904a4a342d16af), [`7d8697e`](https://github.com/thirdweb-dev/js/commit/7d8697ec3ff72f33dda151e7eb82f5ff19c1f825)]:
|
||||
- @thirdweb-dev/wallets@2.4.14
|
||||
- @thirdweb-dev/sdk@4.0.39
|
||||
- @thirdweb-dev/chains@0.1.76
|
||||
- @thirdweb-dev/auth@4.1.36
|
||||
|
||||
## 0.13.43
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`e87292a`](https://github.com/thirdweb-dev/js/commit/e87292ab604897ddfc337d24d2d1fe0f3560baae)]:
|
||||
- @thirdweb-dev/chains@0.1.75
|
||||
- @thirdweb-dev/sdk@4.0.38
|
||||
- @thirdweb-dev/wallets@2.4.13
|
||||
- @thirdweb-dev/auth@4.1.35
|
||||
|
||||
## 0.13.42
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "thirdweb",
|
||||
"main": "dist/cli/index.js",
|
||||
"version": "0.13.42",
|
||||
"version": "0.13.44",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/cli",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
# @thirdweb-dev/react-core
|
||||
|
||||
## 4.4.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2382](https://github.com/thirdweb-dev/js/pull/2382) [`7d8697e`](https://github.com/thirdweb-dev/js/commit/7d8697ec3ff72f33dda151e7eb82f5ff19c1f825) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Added useUpdateNFTMetadata hook
|
||||
|
||||
- Updated dependencies [[`ab44b8f`](https://github.com/thirdweb-dev/js/commit/ab44b8f0ae760065f400f76d69703e26bcbcc022), [`9c7fbc1`](https://github.com/thirdweb-dev/js/commit/9c7fbc1603a7265209b6f56c2284fdb0e6b33a1d), [`f80f630`](https://github.com/thirdweb-dev/js/commit/f80f6307a3ebe1adaaf072dd2e02aecf83bfa43f), [`5f243bb`](https://github.com/thirdweb-dev/js/commit/5f243bba0ded5dace9344c79e8904a4a342d16af), [`7d8697e`](https://github.com/thirdweb-dev/js/commit/7d8697ec3ff72f33dda151e7eb82f5ff19c1f825)]:
|
||||
- @thirdweb-dev/wallets@2.4.14
|
||||
- @thirdweb-dev/sdk@4.0.39
|
||||
- @thirdweb-dev/chains@0.1.76
|
||||
- @thirdweb-dev/auth@4.1.36
|
||||
|
||||
## 4.4.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`e87292a`](https://github.com/thirdweb-dev/js/commit/e87292ab604897ddfc337d24d2d1fe0f3560baae)]:
|
||||
- @thirdweb-dev/chains@0.1.75
|
||||
- @thirdweb-dev/sdk@4.0.38
|
||||
- @thirdweb-dev/wallets@2.4.13
|
||||
- @thirdweb-dev/auth@4.1.35
|
||||
|
||||
## 4.4.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react-core",
|
||||
"version": "4.4.10",
|
||||
"version": "4.4.12",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-core",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { BasicNFTInput } from "@thirdweb-dev/sdk";
|
||||
import type { BasicNFTInput, NFTMetadataInput } from "@thirdweb-dev/sdk";
|
||||
import {
|
||||
requiredParamInvariant,
|
||||
RequiredParam,
|
||||
@@ -335,7 +335,7 @@ export function useTotalCirculatingSupply(
|
||||
* @param ownerWalletAddress -
|
||||
* The wallet address to get owned tokens for. Likely, you will want to view the connected wallet’s NFTs. use the `useAddress` hook to get this value.
|
||||
*
|
||||
* @param queryParams -
|
||||
* @param queryParams -
|
||||
* Paginate the results by providing a `queryParams` object as an argument.
|
||||
*
|
||||
* ```jsx
|
||||
@@ -354,7 +354,7 @@ export function useTotalCirculatingSupply(
|
||||
* );
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @returns Query result object that includes the list of owned `NFT` objects
|
||||
*
|
||||
* @twfeature ERC721Enumerable | ERC1155Enumerable | ERC721Supply
|
||||
@@ -1052,3 +1052,41 @@ export function useSetSharedMetadata<TContract extends NFTContract>(
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update nft metadata
|
||||
* @param contract - Instance of a `NFTContract`
|
||||
* @param tokenId - The token ID of the NFT you want to fetch.
|
||||
* @public
|
||||
* @twfeature ERC721UpdatableMetadata | ERC1155UpdatableMetadata
|
||||
* @nft
|
||||
*/
|
||||
export function useUpdateNFTMetadata<TContract extends NFTContract>(
|
||||
contract: RequiredParam<TContract>,
|
||||
) {
|
||||
const activeChainId = useSDKChainId();
|
||||
const contractAddress = contract?.getAddress();
|
||||
const queryClient = useQueryClient();
|
||||
const { erc721, erc1155 } = getErcs(contract);
|
||||
|
||||
return useMutation(
|
||||
async (data: { tokenId: BigNumberish; metadata: NFTMetadataInput }) => {
|
||||
const { tokenId, metadata } = data;
|
||||
if (erc721) {
|
||||
return await erc721.updateMetadata(tokenId, metadata);
|
||||
}
|
||||
if (erc1155) {
|
||||
return await erc1155.updateMetadata(tokenId, metadata);
|
||||
}
|
||||
invariant(false, "Unknown NFT type");
|
||||
},
|
||||
{
|
||||
onSettled: () =>
|
||||
invalidateContractAndBalances(
|
||||
queryClient,
|
||||
contractAddress,
|
||||
activeChainId,
|
||||
),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -173,6 +173,7 @@ export {
|
||||
useBurnNFT,
|
||||
useSharedMetadata,
|
||||
useSetSharedMetadata,
|
||||
useUpdateNFTMetadata,
|
||||
} from "./hooks/async/nft";
|
||||
|
||||
// roles
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,9 @@
|
||||
# @thirdweb-dev/react-native-compat
|
||||
|
||||
## 0.7.9
|
||||
|
||||
## 0.7.8
|
||||
|
||||
## 0.7.7
|
||||
|
||||
## 0.7.6
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react-native-compat",
|
||||
"description": "Shims for Thirdweb in React Native Projects",
|
||||
"version": "0.7.7",
|
||||
"version": "0.7.9",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native-compat",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
# @thirdweb-dev/react-native
|
||||
|
||||
## 0.7.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`ab44b8f`](https://github.com/thirdweb-dev/js/commit/ab44b8f0ae760065f400f76d69703e26bcbcc022), [`9c7fbc1`](https://github.com/thirdweb-dev/js/commit/9c7fbc1603a7265209b6f56c2284fdb0e6b33a1d), [`f80f630`](https://github.com/thirdweb-dev/js/commit/f80f6307a3ebe1adaaf072dd2e02aecf83bfa43f), [`5f243bb`](https://github.com/thirdweb-dev/js/commit/5f243bba0ded5dace9344c79e8904a4a342d16af), [`7d8697e`](https://github.com/thirdweb-dev/js/commit/7d8697ec3ff72f33dda151e7eb82f5ff19c1f825)]:
|
||||
- @thirdweb-dev/wallets@2.4.14
|
||||
- @thirdweb-dev/sdk@4.0.39
|
||||
- @thirdweb-dev/chains@0.1.76
|
||||
- @thirdweb-dev/react-core@4.4.12
|
||||
|
||||
## 0.7.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`e87292a`](https://github.com/thirdweb-dev/js/commit/e87292ab604897ddfc337d24d2d1fe0f3560baae)]:
|
||||
- @thirdweb-dev/chains@0.1.75
|
||||
- @thirdweb-dev/react-core@4.4.11
|
||||
- @thirdweb-dev/sdk@4.0.38
|
||||
- @thirdweb-dev/wallets@2.4.13
|
||||
|
||||
## 0.7.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react-native",
|
||||
"version": "0.7.7",
|
||||
"version": "0.7.9",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
@@ -38,7 +38,7 @@
|
||||
"@thirdweb-dev/wallets": "workspace:*",
|
||||
"abitype": "^0.2.5",
|
||||
"aws-amplify": "^5.3.8",
|
||||
"expo-application": "^5.3.0",
|
||||
"expo-application": "5.7.0",
|
||||
"expo-clipboard": "^4.5.0",
|
||||
"expo-document-picker": "^11.2.2",
|
||||
"expo-file-system": "^15.2.2",
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,27 @@
|
||||
# @thirdweb-dev/react
|
||||
|
||||
## 4.4.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`ab44b8f`](https://github.com/thirdweb-dev/js/commit/ab44b8f0ae760065f400f76d69703e26bcbcc022), [`9c7fbc1`](https://github.com/thirdweb-dev/js/commit/9c7fbc1603a7265209b6f56c2284fdb0e6b33a1d), [`f80f630`](https://github.com/thirdweb-dev/js/commit/f80f6307a3ebe1adaaf072dd2e02aecf83bfa43f), [`5f243bb`](https://github.com/thirdweb-dev/js/commit/5f243bba0ded5dace9344c79e8904a4a342d16af), [`7d8697e`](https://github.com/thirdweb-dev/js/commit/7d8697ec3ff72f33dda151e7eb82f5ff19c1f825)]:
|
||||
- @thirdweb-dev/wallets@2.4.14
|
||||
- @thirdweb-dev/sdk@4.0.39
|
||||
- @thirdweb-dev/chains@0.1.76
|
||||
- @thirdweb-dev/react-core@4.4.12
|
||||
|
||||
## 4.4.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2376](https://github.com/thirdweb-dev/js/pull/2376) [`d5d7d54`](https://github.com/thirdweb-dev/js/commit/d5d7d542ceb76ae40529ba1418c2a78af126c222) Thanks [@MananTank](https://github.com/MananTank)! - Make OTPInput used in EmbeddedWallet numeric
|
||||
|
||||
- Updated dependencies [[`e87292a`](https://github.com/thirdweb-dev/js/commit/e87292ab604897ddfc337d24d2d1fe0f3560baae)]:
|
||||
- @thirdweb-dev/chains@0.1.75
|
||||
- @thirdweb-dev/react-core@4.4.11
|
||||
- @thirdweb-dev/sdk@4.0.38
|
||||
- @thirdweb-dev/wallets@2.4.13
|
||||
|
||||
## 4.4.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react",
|
||||
"version": "4.4.10",
|
||||
"version": "4.4.12",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -12,9 +12,9 @@ export function OTPInput(props: {
|
||||
setValue: (value: string) => void;
|
||||
onEnter?: () => void;
|
||||
}) {
|
||||
const otp = props.value.split("");
|
||||
const otp = props.value.split("").map(Number);
|
||||
|
||||
const setOTP = (newOTP: string[]) => {
|
||||
const setOTP = (newOTP: number[]) => {
|
||||
props.setValue(newOTP.join(""));
|
||||
};
|
||||
|
||||
@@ -38,13 +38,18 @@ export function OTPInput(props: {
|
||||
ref={(e) => (boxEls.current[i] = e)}
|
||||
key={i}
|
||||
value={otp[i] ?? ""}
|
||||
type="text"
|
||||
pattern="[a-zA-Z0-9]*"
|
||||
type="number"
|
||||
pattern="[0-9]*"
|
||||
variant="outline"
|
||||
inputMode="text"
|
||||
inputMode="numeric"
|
||||
onPaste={(e) => {
|
||||
const pastedData = e.clipboardData.getData("text/plain");
|
||||
const newOTP = pastedData.slice(0, props.digits).split("");
|
||||
const newOTP = pastedData
|
||||
.slice(0, props.digits)
|
||||
.split("")
|
||||
.filter((n) => /\d/.test(n))
|
||||
.map(Number);
|
||||
|
||||
setOTP(newOTP);
|
||||
e.preventDefault();
|
||||
}}
|
||||
@@ -106,7 +111,7 @@ export function OTPInput(props: {
|
||||
const newOTP = [...otp];
|
||||
const index = i > inputToFocusIndex - 1 ? inputToFocusIndex : i;
|
||||
|
||||
newOTP[index] = value;
|
||||
newOTP[index] = Number(value);
|
||||
setOTP(newOTP);
|
||||
}}
|
||||
/>
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,25 @@
|
||||
# @thirdweb-dev/sdk
|
||||
|
||||
## 4.0.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2379](https://github.com/thirdweb-dev/js/pull/2379) [`ab44b8f`](https://github.com/thirdweb-dev/js/commit/ab44b8f0ae760065f400f76d69703e26bcbcc022) Thanks [@0xFirekeeper](https://github.com/0xFirekeeper)! - [Smart Wallet] Do not deploy to sign typed data, allow presigned deploy+session key
|
||||
|
||||
- [#2404](https://github.com/thirdweb-dev/js/pull/2404) [`9c7fbc1`](https://github.com/thirdweb-dev/js/commit/9c7fbc1603a7265209b6f56c2284fdb0e6b33a1d) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Updateable metadata for DropERC721 contracts
|
||||
|
||||
- [#2382](https://github.com/thirdweb-dev/js/pull/2382) [`7d8697e`](https://github.com/thirdweb-dev/js/commit/7d8697ec3ff72f33dda151e7eb82f5ff19c1f825) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Added useUpdateNFTMetadata hook
|
||||
|
||||
- Updated dependencies [[`5f243bb`](https://github.com/thirdweb-dev/js/commit/5f243bba0ded5dace9344c79e8904a4a342d16af)]:
|
||||
- @thirdweb-dev/chains@0.1.76
|
||||
|
||||
## 4.0.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`e87292a`](https://github.com/thirdweb-dev/js/commit/e87292ab604897ddfc337d24d2d1fe0f3560baae)]:
|
||||
- @thirdweb-dev/chains@0.1.75
|
||||
|
||||
## 4.0.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/sdk",
|
||||
"version": "4.0.37",
|
||||
"version": "4.0.39",
|
||||
"description": "The main thirdweb SDK.",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/sdk",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -21,6 +21,7 @@ import { type QueryAllParams } from "../../../core/schema/QueryParams";
|
||||
import type {
|
||||
NFT,
|
||||
NFTMetadata,
|
||||
NFTMetadataInput,
|
||||
NFTMetadataOrUri,
|
||||
} from "../../../core/schema/nft";
|
||||
import { resolveAddress } from "../../common/ens/resolveAddress";
|
||||
@@ -749,8 +750,11 @@ export class Erc721<
|
||||
* ```
|
||||
* @twfeature ERC721UpdatableMetadata
|
||||
*/
|
||||
update = /* @__PURE__ */ buildTransactionFunction(
|
||||
async (tokenId: BigNumberish, metadata: NFTMetadataOrUri) => {
|
||||
updateMetadata = /* @__PURE__ */ buildTransactionFunction(
|
||||
async (tokenId: BigNumberish, metadata: NFTMetadataInput) => {
|
||||
if (this.lazyMintable) {
|
||||
return this.lazyMintable.updateMetadata.prepare(tokenId, metadata);
|
||||
}
|
||||
return assertEnabled(
|
||||
this.updatableMetadata,
|
||||
FEATURE_NFT_UPDATABLE_METADATA,
|
||||
@@ -758,6 +762,11 @@ export class Erc721<
|
||||
},
|
||||
);
|
||||
|
||||
// alias for backwards compat
|
||||
async update(tokenId: BigNumberish, metadata: NFTMetadataInput) {
|
||||
return this.updateMetadata(tokenId, metadata);
|
||||
}
|
||||
|
||||
////// ERC721 Claimable Extension //////
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,6 @@ import type {
|
||||
IAccountPermissions_V1,
|
||||
} from "@thirdweb-dev/contracts-js";
|
||||
import invariant from "tiny-invariant";
|
||||
import { detectContractFeature } from "../../../../common/feature-detection/detectContractFeature";
|
||||
import { resolveAddress } from "../../../../common/ens/resolveAddress";
|
||||
import { resolveOrGenerateId } from "../../../../common/signature-minting";
|
||||
import { buildTransactionFunction } from "../../../../common/transactions";
|
||||
@@ -94,37 +93,6 @@ export class AccountPermissions implements DetectableFeature {
|
||||
permissions: SignerPermissionsOutput,
|
||||
adminFlag: AdminFlag,
|
||||
): Promise<Transaction> {
|
||||
if (
|
||||
detectContractFeature<IAccountPermissions_V1>(
|
||||
this.contractWrapper,
|
||||
"AccountPermissionsV1",
|
||||
)
|
||||
) {
|
||||
// legacy account permissions contract
|
||||
// admin is set only via EOA
|
||||
// signer permissions are set via EOA or admin but no wildcard
|
||||
if (
|
||||
adminFlag === AdminFlag.AddAdmin ||
|
||||
adminFlag === AdminFlag.RemoveAdmin
|
||||
) {
|
||||
return Transaction.fromContractWrapper({
|
||||
contractWrapper: this.contractWrapper,
|
||||
method: "setAdmin",
|
||||
args: [signerAddress, adminFlag === AdminFlag.AddAdmin],
|
||||
});
|
||||
} else {
|
||||
const { payload, signature } = await this.generateLegacyPayload(
|
||||
signerAddress,
|
||||
permissions,
|
||||
);
|
||||
return Transaction.fromContractWrapper({
|
||||
contractWrapper: this.contractWrapper,
|
||||
method: "setPermissionsForSigner",
|
||||
args: [payload, signature],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const { payload, signature } = await this.generatePayload(
|
||||
signerAddress,
|
||||
permissions,
|
||||
@@ -435,21 +403,8 @@ export class AccountPermissions implements DetectableFeature {
|
||||
permissions: SignerPermissionsInput,
|
||||
): Promise<Transaction> => {
|
||||
const resolvedSignerAddress = await resolveAddress(signerAddress);
|
||||
const resolvedPermissions = await SignerPermissionsSchema.parseAsync(
|
||||
permissions,
|
||||
);
|
||||
|
||||
if (await this.isAdmin(resolvedSignerAddress)) {
|
||||
throw new Error(
|
||||
"Signer is already an admin. Cannot grant permissions to an existing admin.",
|
||||
);
|
||||
}
|
||||
|
||||
if (await this.isSigner(resolvedSignerAddress)) {
|
||||
throw new Error(
|
||||
"Signer already has permissions. Cannot grant permissions to an existing signer. You can update permissions using `updatePermissions`.",
|
||||
);
|
||||
}
|
||||
const resolvedPermissions =
|
||||
await SignerPermissionsSchema.parseAsync(permissions);
|
||||
|
||||
return await this.sendSignerPermissionRequest(
|
||||
resolvedSignerAddress,
|
||||
@@ -481,9 +436,8 @@ export class AccountPermissions implements DetectableFeature {
|
||||
permissions: SignerPermissionsInput,
|
||||
): Promise<Transaction> => {
|
||||
const resolvedSignerAddress = await resolveAddress(signerAddress);
|
||||
const resolvedPermissions = await SignerPermissionsSchema.parseAsync(
|
||||
permissions,
|
||||
);
|
||||
const resolvedPermissions =
|
||||
await SignerPermissionsSchema.parseAsync(permissions);
|
||||
|
||||
if (await this.isAdmin(resolvedSignerAddress)) {
|
||||
throw new Error(
|
||||
@@ -524,18 +478,6 @@ export class AccountPermissions implements DetectableFeature {
|
||||
async (signerAddress: AddressOrEns): Promise<Transaction> => {
|
||||
const resolvedSignerAddress = await resolveAddress(signerAddress);
|
||||
|
||||
if (await this.isAdmin(resolvedSignerAddress)) {
|
||||
throw new Error(
|
||||
"Signer is already an admin. Cannot revoke permissions of an admin.",
|
||||
);
|
||||
}
|
||||
|
||||
if (!(await this.isSigner(resolvedSignerAddress))) {
|
||||
throw new Error(
|
||||
"Signer does not already have permissions. You can grant permissions using `grantPermissions`.",
|
||||
);
|
||||
}
|
||||
|
||||
return await this.sendSignerPermissionRequest(
|
||||
resolvedSignerAddress,
|
||||
{
|
||||
@@ -693,9 +635,8 @@ export class AccountPermissions implements DetectableFeature {
|
||||
async (
|
||||
permissionSnapshot: PermissionSnapshotInput,
|
||||
): Promise<Transaction> => {
|
||||
const resolvedSnapshot = await PermissionSnapshotSchema.parseAsync(
|
||||
permissionSnapshot,
|
||||
);
|
||||
const resolvedSnapshot =
|
||||
await PermissionSnapshotSchema.parseAsync(permissionSnapshot);
|
||||
|
||||
/**
|
||||
* All cases
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type {
|
||||
NFTMetadata,
|
||||
NFTMetadataInput,
|
||||
NFTMetadataOrUri,
|
||||
} from "../../../../../core/schema/nft";
|
||||
import { detectContractFeature } from "../../../../common/feature-detection/detectContractFeature";
|
||||
@@ -15,7 +16,7 @@ import type { TransactionResultWithId } from "../../../types";
|
||||
import type { ContractWrapper } from "../contract-wrapper";
|
||||
import { Transaction } from "../../transactions";
|
||||
import type { ThirdwebStorage } from "@thirdweb-dev/storage";
|
||||
import { utils } from "ethers";
|
||||
import { BigNumber, BigNumberish, utils } from "ethers";
|
||||
import {
|
||||
getBaseUriFromBatch,
|
||||
uploadOrExtractURIs,
|
||||
@@ -24,6 +25,7 @@ import type { BaseDelayedRevealERC721 } from "../../../../types/eips";
|
||||
import { DelayedReveal } from "../../delayed-reveal";
|
||||
import type { TokensLazyMintedEvent } from "@thirdweb-dev/contracts-js/dist/declarations/src/LazyMint";
|
||||
import type { Erc721 } from "../../erc-721";
|
||||
import type { DropERC721 } from "@thirdweb-dev/contracts-js";
|
||||
|
||||
/**
|
||||
* Lazily mint and claim ERC721 NFTs
|
||||
@@ -159,6 +161,74 @@ export class Erc721LazyMintable implements DetectableFeature {
|
||||
},
|
||||
);
|
||||
|
||||
updateMetadata = /* @__PURE__ */ buildTransactionFunction(
|
||||
async (
|
||||
tokenId: BigNumberish,
|
||||
metadata: NFTMetadataInput,
|
||||
options?: {
|
||||
onProgress: (event: UploadProgressEvent) => void;
|
||||
},
|
||||
) => {
|
||||
const batchCount = await this.contractWrapper.read("getBaseURICount", []);
|
||||
if (batchCount.eq(0)) {
|
||||
throw new Error(
|
||||
"No base URI set. Please set a base URI before updating metadata",
|
||||
);
|
||||
}
|
||||
const targetTokenId = BigNumber.from(tokenId);
|
||||
let startTokenId = BigNumber.from(0);
|
||||
let endTokenId = BigNumber.from(0);
|
||||
let batchIndex = 0;
|
||||
for (let i = 0; i < batchCount.toNumber(); i++) {
|
||||
batchIndex = i;
|
||||
endTokenId = await this.contractWrapper.read("getBatchIdAtIndex", [
|
||||
batchIndex,
|
||||
]);
|
||||
if (endTokenId.gt(targetTokenId)) {
|
||||
break;
|
||||
}
|
||||
startTokenId = endTokenId;
|
||||
}
|
||||
// for the entire batch,
|
||||
// 1. download all of the metadata as a list of nft metadata
|
||||
const range = Array.from(
|
||||
{ length: endTokenId.sub(startTokenId).toNumber() },
|
||||
(v, k) => k + startTokenId.toNumber(),
|
||||
);
|
||||
const metadatas = await Promise.all(
|
||||
range.map((id) => this.erc721.getTokenMetadata(id)),
|
||||
);
|
||||
// 2. replace the metadata of the tokenId desired
|
||||
const newMetadatas = [];
|
||||
for (let i = 0; i < metadatas.length; i++) {
|
||||
const { id, uri, ...rest } = metadatas[i];
|
||||
if (BigNumber.from(targetTokenId).eq(BigNumber.from(id))) {
|
||||
newMetadatas.push(metadata);
|
||||
} else {
|
||||
void uri; // linter
|
||||
newMetadatas.push(rest);
|
||||
}
|
||||
}
|
||||
// 3. re-upload the entire batch with the correct starting number
|
||||
const batch = await uploadOrExtractURIs(
|
||||
newMetadatas,
|
||||
this.storage,
|
||||
startTokenId.toNumber(),
|
||||
options,
|
||||
);
|
||||
const baseUri = batch[0].substring(0, batch[0].lastIndexOf("/"));
|
||||
// 4. update the base uri for the entire batch
|
||||
return Transaction.fromContractWrapper({
|
||||
contractWrapper: this.contractWrapper as ContractWrapper<DropERC721>, // TODO contract detection
|
||||
method: "updateBatchBaseURI",
|
||||
args: [
|
||||
batchIndex,
|
||||
`${baseUri.endsWith("/") ? baseUri : `${baseUri}/`}`,
|
||||
],
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
/** ******************************
|
||||
* PRIVATE FUNCTIONS
|
||||
*******************************/
|
||||
|
||||
@@ -143,9 +143,8 @@ describe("Accounts with account factory", function () {
|
||||
"Correct admin for account.",
|
||||
);
|
||||
|
||||
const associatedAccounts = await accountFactory.getAssociatedAccounts(
|
||||
admin,
|
||||
);
|
||||
const associatedAccounts =
|
||||
await accountFactory.getAssociatedAccounts(admin);
|
||||
|
||||
assert.isTrue(
|
||||
associatedAccounts.length === 1,
|
||||
@@ -361,24 +360,38 @@ describe("Accounts with account factory", function () {
|
||||
);
|
||||
});
|
||||
|
||||
it("Should not be able to grant restricted access to a signer who already has access.", async () => {
|
||||
it("Should be able to update permissions by granting restricted access to a signer who already has access.", async () => {
|
||||
// Grant access to signer1
|
||||
await account.grantPermissions(signer1Wallet.address, {
|
||||
nativeTokenLimitPerTransaction: "1",
|
||||
approvedCallTargets: [adminWallet.address],
|
||||
});
|
||||
|
||||
// Store permissions
|
||||
const signersWithRestrictions = await account.getAllSigners();
|
||||
const restrictions = signersWithRestrictions.find(
|
||||
(result) =>
|
||||
utils.getAddress(result.signer) ===
|
||||
utils.getAddress(signer1Wallet.address),
|
||||
)?.permissions as SignerPermissions;
|
||||
|
||||
// Try granting access to signer1 again
|
||||
try {
|
||||
await account.grantPermissions(signer1Wallet.address, {
|
||||
approvedCallTargets: [adminWallet.address],
|
||||
});
|
||||
expect.fail();
|
||||
} catch (err: any) {
|
||||
expect(err.message).to.equal(
|
||||
"Signer already has permissions. Cannot grant permissions to an existing signer. You can update permissions using `updatePermissions`.",
|
||||
);
|
||||
}
|
||||
await account.grantPermissions(signer1Wallet.address, {
|
||||
approvedCallTargets: [adminWallet.address, signer2Wallet.address],
|
||||
});
|
||||
|
||||
const newSignersWithRestrictions = await account.getAllSigners();
|
||||
const newRestrictions = newSignersWithRestrictions.find(
|
||||
(result) =>
|
||||
utils.getAddress(result.signer) ===
|
||||
utils.getAddress(signer1Wallet.address),
|
||||
)?.permissions as SignerPermissions;
|
||||
|
||||
assert.strictEqual(
|
||||
newRestrictions.approvedCallTargets.length,
|
||||
2,
|
||||
"New signer1 should have two approved call targets.",
|
||||
);
|
||||
});
|
||||
|
||||
it("Should be able to revoke restricted access from an authorized signer.", async () => {
|
||||
@@ -418,7 +431,7 @@ describe("Accounts with account factory", function () {
|
||||
);
|
||||
});
|
||||
|
||||
it("Should not be able to revoke restricted access from a signer who doesn't have access.", async () => {
|
||||
it("Should be able to revoke restricted access from a signer who doesn't have access with no effect.", async () => {
|
||||
const signersWithRestrictions = await account.getAllSigners();
|
||||
assert.isFalse(
|
||||
signersWithRestrictions
|
||||
@@ -428,14 +441,15 @@ describe("Accounts with account factory", function () {
|
||||
);
|
||||
|
||||
// Try revoking access from signer1
|
||||
try {
|
||||
await account.revokeAccess(signer1Wallet.address);
|
||||
expect.fail();
|
||||
} catch (err: any) {
|
||||
expect(err.message).to.equal(
|
||||
"Signer does not already have permissions. You can grant permissions using `grantPermissions`.",
|
||||
);
|
||||
}
|
||||
await account.revokeAccess(signer1Wallet.address);
|
||||
|
||||
const newSignersWithRestrictions = await account.getAllSigners();
|
||||
assert.isFalse(
|
||||
newSignersWithRestrictions
|
||||
.map((result) => utils.getAddress(result.signer))
|
||||
.includes(signer1Wallet.address),
|
||||
"New signer should not have access to the account.",
|
||||
);
|
||||
});
|
||||
|
||||
it("Should be able to update access of an authorized signer.", async () => {
|
||||
|
||||
@@ -40,9 +40,11 @@ describe("NFT Drop Contract (v4)", async () => {
|
||||
platform_fee_basis_points: 10,
|
||||
platform_fee_recipient: AddressZero,
|
||||
},
|
||||
await sdk.deployer.getLatestBuiltInContractVersion(
|
||||
NFTDropInitializer.contractType,
|
||||
),
|
||||
(
|
||||
await sdk.deployer.getLatestBuiltInContractVersion(
|
||||
NFTDropInitializer.contractType,
|
||||
)
|
||||
).toString(),
|
||||
);
|
||||
dropContract = await sdk.getNFTDrop(address);
|
||||
});
|
||||
@@ -357,8 +359,8 @@ describe("NFT Drop Contract (v4)", async () => {
|
||||
i % 3 === 0
|
||||
? w.address.toLowerCase()
|
||||
: i % 3 === 1
|
||||
? w.address.toUpperCase().replace("0X", "0x")
|
||||
: w.address,
|
||||
? w.address.toUpperCase().replace("0X", "0x")
|
||||
: w.address,
|
||||
)
|
||||
.map((a) => ({
|
||||
address: a,
|
||||
@@ -1289,4 +1291,100 @@ describe("NFT Drop Contract (v4)", async () => {
|
||||
await dropContract.revealer.reveal(1, "my secret password");
|
||||
});
|
||||
});
|
||||
|
||||
describe("Update metadata", () => {
|
||||
it("should update metadata", async () => {
|
||||
const tokens = [
|
||||
{
|
||||
name: "test 0",
|
||||
},
|
||||
{
|
||||
name: "test 1",
|
||||
},
|
||||
{
|
||||
name: "test 2",
|
||||
},
|
||||
{
|
||||
name: "test 3",
|
||||
},
|
||||
{
|
||||
name: "test 4",
|
||||
},
|
||||
];
|
||||
const result = await dropContract.createBatch(tokens);
|
||||
assert.lengthOf(result, tokens.length);
|
||||
for (const token of tokens) {
|
||||
const found = result.find(
|
||||
async (t) => (await t.data()).name === token.name,
|
||||
);
|
||||
assert.isDefined(found);
|
||||
}
|
||||
|
||||
const token = await dropContract.get(1);
|
||||
expect(token.metadata.name).to.eq("test 1");
|
||||
await dropContract.erc721.updateMetadata(1, {
|
||||
name: "test 123",
|
||||
});
|
||||
const token2 = await dropContract.get(1);
|
||||
expect(token2.metadata.name).to.eq("test 123");
|
||||
});
|
||||
|
||||
it("should update metadata from diff batch", async () => {
|
||||
const tokens = [
|
||||
{
|
||||
name: "test 0",
|
||||
},
|
||||
{
|
||||
name: "test 1",
|
||||
},
|
||||
{
|
||||
name: "test 2",
|
||||
},
|
||||
];
|
||||
const result = await dropContract.createBatch(tokens);
|
||||
assert.lengthOf(result, tokens.length);
|
||||
|
||||
const tokens2 = [
|
||||
{
|
||||
name: "test 3",
|
||||
},
|
||||
{
|
||||
name: "test 4",
|
||||
},
|
||||
];
|
||||
const result2 = await dropContract.createBatch(tokens2);
|
||||
assert.lengthOf(result2, tokens2.length);
|
||||
|
||||
let token = await dropContract.get("3");
|
||||
expect(token.metadata.name).to.eq("test 3");
|
||||
await dropContract.erc721.updateMetadata(3, {
|
||||
name: "test 123",
|
||||
});
|
||||
token = await dropContract.get("3");
|
||||
expect(token.metadata.name).to.eq("test 123");
|
||||
});
|
||||
|
||||
it("metadata update after reveal correctly", async () => {
|
||||
await dropContract.revealer.createDelayedRevealBatch(
|
||||
{
|
||||
name: "Placeholder #1",
|
||||
},
|
||||
[{ name: "NFT #1" }, { name: "NFT #2" }],
|
||||
"my secret password",
|
||||
);
|
||||
|
||||
expect((await dropContract.get("0")).metadata.name).to.be.equal(
|
||||
"Placeholder #1",
|
||||
);
|
||||
|
||||
await dropContract.revealer.reveal(0, "my secret password");
|
||||
await dropContract.erc721.updateMetadata(0, {
|
||||
name: "NFT 123",
|
||||
});
|
||||
|
||||
expect((await dropContract.get("0")).metadata.name).to.be.equal(
|
||||
"NFT 123",
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,29 @@
|
||||
# @thirdweb-dev/unity-js-bridge
|
||||
|
||||
## 0.4.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2379](https://github.com/thirdweb-dev/js/pull/2379) [`ab44b8f`](https://github.com/thirdweb-dev/js/commit/ab44b8f0ae760065f400f76d69703e26bcbcc022) Thanks [@0xFirekeeper](https://github.com/0xFirekeeper)! - [Smart Wallet] Do not deploy to sign typed data, allow presigned deploy+session key
|
||||
|
||||
- [#2388](https://github.com/thirdweb-dev/js/pull/2388) [`f80f630`](https://github.com/thirdweb-dev/js/commit/f80f6307a3ebe1adaaf072dd2e02aecf83bfa43f) Thanks [@0xFirekeeper](https://github.com/0xFirekeeper)! - [Smart Wallet] ERC20Paymaster Generic Support
|
||||
|
||||
- Updated dependencies [[`ab44b8f`](https://github.com/thirdweb-dev/js/commit/ab44b8f0ae760065f400f76d69703e26bcbcc022), [`9c7fbc1`](https://github.com/thirdweb-dev/js/commit/9c7fbc1603a7265209b6f56c2284fdb0e6b33a1d), [`f80f630`](https://github.com/thirdweb-dev/js/commit/f80f6307a3ebe1adaaf072dd2e02aecf83bfa43f), [`5f243bb`](https://github.com/thirdweb-dev/js/commit/5f243bba0ded5dace9344c79e8904a4a342d16af), [`7d8697e`](https://github.com/thirdweb-dev/js/commit/7d8697ec3ff72f33dda151e7eb82f5ff19c1f825)]:
|
||||
- @thirdweb-dev/wallets@2.4.14
|
||||
- @thirdweb-dev/sdk@4.0.39
|
||||
- @thirdweb-dev/chains@0.1.76
|
||||
- @thirdweb-dev/auth@4.1.36
|
||||
|
||||
## 0.4.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`e87292a`](https://github.com/thirdweb-dev/js/commit/e87292ab604897ddfc337d24d2d1fe0f3560baae)]:
|
||||
- @thirdweb-dev/chains@0.1.75
|
||||
- @thirdweb-dev/sdk@4.0.38
|
||||
- @thirdweb-dev/wallets@2.4.13
|
||||
- @thirdweb-dev/auth@4.1.35
|
||||
|
||||
## 0.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/unity-js-bridge",
|
||||
"version": "0.4.0",
|
||||
"version": "0.4.2",
|
||||
"main": "dist/thirdweb-unity-bridge.js",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/unity-js-bridge",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -144,7 +144,7 @@ class ThirdwebBridge implements TWBridge {
|
||||
}
|
||||
(globalThis as any).X_SDK_NAME = "UnitySDK_WebGL";
|
||||
(globalThis as any).X_SDK_PLATFORM = "unity";
|
||||
(globalThis as any).X_SDK_VERSION = "4.7.1";
|
||||
(globalThis as any).X_SDK_VERSION = "4.7.5";
|
||||
(globalThis as any).X_SDK_OS = browser?.os ?? "unknown";
|
||||
}
|
||||
this.initializedChain = chain;
|
||||
@@ -244,6 +244,9 @@ class ThirdwebBridge implements TWBridge {
|
||||
paymasterUrl: sdkOptions.smartWalletConfig?.paymasterUrl,
|
||||
// paymasterAPI: sdkOptions.smartWalletConfig?.paymasterAPI,
|
||||
entryPointAddress: sdkOptions.smartWalletConfig?.entryPointAddress,
|
||||
erc20PaymasterAddress:
|
||||
sdkOptions.smartWalletConfig?.erc20PaymasterAddress,
|
||||
erc20TokenAddress: sdkOptions.smartWalletConfig?.erc20TokenAddress,
|
||||
};
|
||||
walletInstance = new SmartWallet(config);
|
||||
break;
|
||||
@@ -381,6 +384,7 @@ class ThirdwebBridge implements TWBridge {
|
||||
personalWallet,
|
||||
authOptions,
|
||||
);
|
||||
await this.switchNetwork(chainId); // workaround for polygon/mumbai
|
||||
if (this.activeWallet) {
|
||||
// Pass EOA and reconnect to initialize smart wallet
|
||||
await this.initializeSmartWallet(
|
||||
@@ -513,7 +517,10 @@ class ThirdwebBridge implements TWBridge {
|
||||
// ccipReadEnabled: txInput.ccipReadEnabled,
|
||||
});
|
||||
|
||||
if (routeArgs[2].includes("send")) {
|
||||
if (routeArgs[2].includes("sign")) {
|
||||
const result = await tx.sign();
|
||||
return JSON.stringify({ result: result }, bigNumberReplacer);
|
||||
} else if (routeArgs[2].includes("send")) {
|
||||
tx.setGaslessOptions(
|
||||
routeArgs[2] === "sendGasless"
|
||||
? this.activeSDK.options.gasless
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
# @thirdweb-dev/wallets
|
||||
|
||||
## 2.4.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2379](https://github.com/thirdweb-dev/js/pull/2379) [`ab44b8f`](https://github.com/thirdweb-dev/js/commit/ab44b8f0ae760065f400f76d69703e26bcbcc022) Thanks [@0xFirekeeper](https://github.com/0xFirekeeper)! - [Smart Wallet] Do not deploy to sign typed data, allow presigned deploy+session key
|
||||
|
||||
- [#2388](https://github.com/thirdweb-dev/js/pull/2388) [`f80f630`](https://github.com/thirdweb-dev/js/commit/f80f6307a3ebe1adaaf072dd2e02aecf83bfa43f) Thanks [@0xFirekeeper](https://github.com/0xFirekeeper)! - [Smart Wallet] ERC20Paymaster Generic Support
|
||||
|
||||
- Updated dependencies [[`ab44b8f`](https://github.com/thirdweb-dev/js/commit/ab44b8f0ae760065f400f76d69703e26bcbcc022), [`9c7fbc1`](https://github.com/thirdweb-dev/js/commit/9c7fbc1603a7265209b6f56c2284fdb0e6b33a1d), [`5f243bb`](https://github.com/thirdweb-dev/js/commit/5f243bba0ded5dace9344c79e8904a4a342d16af), [`7d8697e`](https://github.com/thirdweb-dev/js/commit/7d8697ec3ff72f33dda151e7eb82f5ff19c1f825)]:
|
||||
- @thirdweb-dev/sdk@4.0.39
|
||||
- @thirdweb-dev/chains@0.1.76
|
||||
|
||||
## 2.4.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`e87292a`](https://github.com/thirdweb-dev/js/commit/e87292ab604897ddfc337d24d2d1fe0f3560baae)]:
|
||||
- @thirdweb-dev/chains@0.1.75
|
||||
- @thirdweb-dev/sdk@4.0.38
|
||||
|
||||
## 2.4.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/wallets",
|
||||
"version": "2.4.12",
|
||||
"version": "2.4.14",
|
||||
"main": "dist/thirdweb-dev-wallets.cjs.js",
|
||||
"module": "dist/thirdweb-dev-wallets.esm.js",
|
||||
"browser": {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
TransactionOptions,
|
||||
UserOpOptions,
|
||||
} from "./types";
|
||||
import { ENTRYPOINT_ADDRESS } from "./lib/constants";
|
||||
import { ACCOUNT_CORE_ABI, ENTRYPOINT_ADDRESS } from "./lib/constants";
|
||||
import { EVMWallet } from "../../interfaces";
|
||||
import { ERC4337EthersSigner } from "./lib/erc4337-signer";
|
||||
import { BigNumber, constants, ethers, providers, utils } from "ethers";
|
||||
@@ -75,6 +75,8 @@ export class SmartWalletConnector extends Connector<SmartWalletConnectionArgs> {
|
||||
accountInfo: config.accountInfo || this.defaultAccountInfo(),
|
||||
clientId: config.clientId,
|
||||
secretKey: config.secretKey,
|
||||
erc20PaymasterAddress: config.erc20PaymasterAddress,
|
||||
erc20TokenAddress: config.erc20TokenAddress,
|
||||
};
|
||||
this.personalWallet = params.personalWallet;
|
||||
const accountApi = new AccountAPI(providerConfig, originalProvider);
|
||||
@@ -448,25 +450,21 @@ export class SmartWalletConnector extends Connector<SmartWalletConnectionArgs> {
|
||||
target: string,
|
||||
permissions: SignerPermissionsInput,
|
||||
): Promise<TransactionResult> {
|
||||
await this.deployIfNeeded();
|
||||
const accountContract = await this.getAccountContract();
|
||||
return accountContract.account.grantPermissions(target, permissions);
|
||||
}
|
||||
|
||||
async revokePermissions(target: string): Promise<TransactionResult> {
|
||||
await this.deployIfNeeded();
|
||||
const accountContract = await this.getAccountContract();
|
||||
return accountContract.account.revokeAccess(target);
|
||||
}
|
||||
|
||||
async addAdmin(target: string): Promise<TransactionResult> {
|
||||
await this.deployIfNeeded();
|
||||
const accountContract = await this.getAccountContract();
|
||||
return accountContract.account.grantAdminPermissions(target);
|
||||
}
|
||||
|
||||
async removeAdmin(target: string): Promise<TransactionResult> {
|
||||
await this.deployIfNeeded();
|
||||
const accountContract = await this.getAccountContract();
|
||||
return accountContract.account.revokeAdminPermissions(target);
|
||||
}
|
||||
@@ -501,12 +499,6 @@ export class SmartWalletConnector extends Connector<SmartWalletConnectionArgs> {
|
||||
* @returns The account contract of the smart wallet.
|
||||
*/
|
||||
async getAccountContract(): Promise<SmartContract> {
|
||||
const isDeployed = await this.isDeployed();
|
||||
if (!isDeployed) {
|
||||
throw new Error(
|
||||
"Account contract is not deployed yet. You can deploy it manually using SmartWallet.deploy(), or by executing a transaction from this wallet.",
|
||||
);
|
||||
}
|
||||
// getting a new instance everytime
|
||||
// to avoid caching issues pre/post deployment
|
||||
const sdk = ThirdwebSDK.fromSigner(
|
||||
@@ -523,7 +515,7 @@ export class SmartWalletConnector extends Connector<SmartWalletConnectionArgs> {
|
||||
this.config.accountInfo.abi,
|
||||
);
|
||||
} else {
|
||||
return sdk.getContract(await this.getAddress());
|
||||
return sdk.getContract(await this.getAddress(), ACCOUNT_CORE_ABI);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -591,6 +583,7 @@ export class SmartWalletConnector extends Connector<SmartWalletConnectionArgs> {
|
||||
this.getProvider(),
|
||||
this.isDeployed(),
|
||||
]);
|
||||
|
||||
if (!isDeployed) {
|
||||
deployGasLimit = await this.estimateDeploymentGasLimit();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,15 @@ import {
|
||||
ThirdwebSDK,
|
||||
Transaction,
|
||||
} from "@thirdweb-dev/sdk";
|
||||
import { BigNumberish, BigNumber, ethers, utils, BytesLike } from "ethers";
|
||||
import {
|
||||
BigNumberish,
|
||||
BigNumber,
|
||||
ethers,
|
||||
utils,
|
||||
BytesLike,
|
||||
providers,
|
||||
Contract,
|
||||
} from "ethers";
|
||||
import { ProviderConfig } from "../types";
|
||||
import { BaseAccountAPI } from "./base-api";
|
||||
import { ACCOUNT_CORE_ABI } from "./constants";
|
||||
@@ -59,21 +67,11 @@ export class AccountAPI extends BaseAccountAPI {
|
||||
|
||||
async getAccountInitCode(): Promise<string> {
|
||||
const factory = await this.getFactoryContract();
|
||||
console.log("Deploying smart wallet via factory");
|
||||
const localSigner = await this.params.localSigner.getAddress();
|
||||
const tx = await this.params.factoryInfo.createAccount(
|
||||
factory,
|
||||
localSigner,
|
||||
);
|
||||
try {
|
||||
console.log(
|
||||
"Cost to deploy smart wallet: ",
|
||||
(await tx.estimateGasCost()).ether,
|
||||
"ETH",
|
||||
);
|
||||
} catch (e) {
|
||||
console.error("Cost to deploy smart wallet: unknown", e);
|
||||
}
|
||||
return utils.hexConcat([factory.getAddress(), tx.encode()]);
|
||||
}
|
||||
|
||||
@@ -143,4 +141,53 @@ export class AccountAPI extends BaseAccountAPI {
|
||||
async isAcountDeployed() {
|
||||
return !(await this.checkAccountPhantom());
|
||||
}
|
||||
|
||||
async isAccountApproved() {
|
||||
if (!this.params.erc20PaymasterAddress || !this.params.erc20TokenAddress) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const swAddress = await this.getCounterFactualAddress();
|
||||
const ERC20Abi = (
|
||||
await import("@thirdweb-dev/contracts-js/dist/abis/IERC20.json")
|
||||
).default;
|
||||
const erc20Token = await this.sdk.getContract(
|
||||
this.params.erc20TokenAddress,
|
||||
ERC20Abi,
|
||||
);
|
||||
|
||||
const allowance = await erc20Token.call("allowance", [
|
||||
swAddress,
|
||||
this.params.erc20PaymasterAddress,
|
||||
]);
|
||||
|
||||
return allowance.gte(BigNumber.from(2).pow(96).sub(1));
|
||||
}
|
||||
|
||||
async createApproveTx(): Promise<providers.TransactionRequest | undefined> {
|
||||
if (await this.isAccountApproved()) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const amountToApprove = BigNumber.from(2).pow(96).sub(1);
|
||||
const ethersSigner = new ethers.Wallet(LOCAL_NODE_PKEY, this.provider);
|
||||
const erc20Contract = new Contract(
|
||||
this.params.erc20TokenAddress as string,
|
||||
[
|
||||
"function approve(address spender, uint256 amount) public returns (bool)",
|
||||
],
|
||||
ethersSigner,
|
||||
);
|
||||
const tx: ethers.providers.TransactionRequest = {
|
||||
to: this.params.erc20TokenAddress,
|
||||
from: await this.getAccountAddress(),
|
||||
value: 0,
|
||||
data: erc20Contract.interface.encodeFunctionData("approve", [
|
||||
this.params.erc20PaymasterAddress,
|
||||
amountToApprove,
|
||||
]),
|
||||
};
|
||||
|
||||
return tx;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@ export abstract class BaseAccountAPI {
|
||||
paymasterAPI: PaymasterAPI;
|
||||
accountAddress?: string;
|
||||
gasless?: boolean;
|
||||
erc20PaymasterAddress?: string;
|
||||
erc20TokenAddress?: string;
|
||||
|
||||
/**
|
||||
* base constructor.
|
||||
@@ -54,6 +56,8 @@ export abstract class BaseAccountAPI {
|
||||
this.accountAddress = params.accountAddress;
|
||||
this.paymasterAPI = params.paymasterAPI;
|
||||
this.gasless = params.gasless;
|
||||
this.erc20PaymasterAddress = params.erc20PaymasterAddress;
|
||||
this.erc20TokenAddress = params.erc20TokenAddress;
|
||||
|
||||
// factory "connect" define the contract address. the contract "connect" defines the "from" address.
|
||||
this.entryPointView = EntryPoint__factory.connect(
|
||||
@@ -113,6 +117,10 @@ export abstract class BaseAccountAPI {
|
||||
return this.isPhantom;
|
||||
}
|
||||
|
||||
abstract isAccountApproved(): Promise<boolean>;
|
||||
|
||||
abstract createApproveTx(): Promise<providers.TransactionRequest | undefined>;
|
||||
|
||||
/**
|
||||
* return initCode value to into the UserOp.
|
||||
* (either deployment code, or empty hex if contract already deployed)
|
||||
@@ -230,7 +238,26 @@ export abstract class BaseAccountAPI {
|
||||
// paymaster data + maybe used for estimation as well
|
||||
const gasless =
|
||||
options?.gasless !== undefined ? options.gasless : this.gasless;
|
||||
if (gasless) {
|
||||
const useErc20Paymaster =
|
||||
this.erc20PaymasterAddress &&
|
||||
this.erc20TokenAddress &&
|
||||
(await this.isAccountApproved());
|
||||
if (useErc20Paymaster) {
|
||||
partialOp.paymasterAndData = this.erc20PaymasterAddress as string;
|
||||
let estimates;
|
||||
try {
|
||||
estimates = await httpRpcClient.estimateUserOpGas(partialOp);
|
||||
} catch (error: any) {
|
||||
throw this.unwrapBundlerError(error);
|
||||
}
|
||||
partialOp.callGasLimit = BigNumber.from(estimates.callGasLimit);
|
||||
partialOp.verificationGasLimit = BigNumber.from(
|
||||
estimates.verificationGasLimit,
|
||||
);
|
||||
partialOp.preVerificationGas = BigNumber.from(
|
||||
estimates.preVerificationGas,
|
||||
);
|
||||
} else if (gasless) {
|
||||
const paymasterResult =
|
||||
await this.paymasterAPI.getPaymasterAndData(partialOp);
|
||||
const paymasterAndData = paymasterResult.paymasterAndData;
|
||||
|
||||
@@ -18,6 +18,7 @@ export class ERC4337EthersSigner extends Signer {
|
||||
erc4337provider: ERC4337EthersProvider;
|
||||
httpRpcClient: HttpRpcClient;
|
||||
smartAccountAPI: BaseAccountAPI;
|
||||
approving: boolean;
|
||||
|
||||
// TODO: we have 'erc4337provider', remove shared dependencies or avoid two-way reference
|
||||
constructor(
|
||||
@@ -34,6 +35,7 @@ export class ERC4337EthersSigner extends Signer {
|
||||
this.erc4337provider = erc4337provider;
|
||||
this.httpRpcClient = httpRpcClient;
|
||||
this.smartAccountAPI = smartAccountAPI;
|
||||
this.approving = false;
|
||||
}
|
||||
|
||||
address?: string;
|
||||
@@ -43,6 +45,14 @@ export class ERC4337EthersSigner extends Signer {
|
||||
transaction: utils.Deferrable<providers.TransactionRequest>,
|
||||
options?: UserOpOptions,
|
||||
): Promise<providers.TransactionResponse> {
|
||||
if (!this.approving) {
|
||||
this.approving = true;
|
||||
const tx = await this.smartAccountAPI.createApproveTx();
|
||||
if (tx) {
|
||||
await (await this.sendTransaction(tx)).wait();
|
||||
}
|
||||
this.approving = false;
|
||||
}
|
||||
const tx = await ethers.utils.resolveProperties(transaction);
|
||||
await this.verifyAllNecessaryFields(tx);
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ export type SmartWalletConfig = {
|
||||
paymasterUrl?: string;
|
||||
paymasterAPI?: PaymasterAPI;
|
||||
entryPointAddress?: string;
|
||||
erc20PaymasterAddress?: string;
|
||||
erc20TokenAddress?: string;
|
||||
} & ContractInfoInput &
|
||||
WalletConnectReceiverConfig;
|
||||
|
||||
@@ -42,6 +44,8 @@ export interface ProviderConfig extends ContractInfo {
|
||||
accountAddress?: string;
|
||||
paymasterAPI: PaymasterAPI;
|
||||
gasless: boolean;
|
||||
erc20PaymasterAddress?: string;
|
||||
erc20TokenAddress?: string;
|
||||
}
|
||||
|
||||
export type ContractInfoInput = {
|
||||
@@ -116,6 +120,8 @@ export interface BaseApiParams {
|
||||
paymasterAPI: PaymasterAPI;
|
||||
accountAddress?: string;
|
||||
gasless: boolean;
|
||||
erc20PaymasterAddress?: string;
|
||||
erc20TokenAddress?: string;
|
||||
}
|
||||
|
||||
export interface UserOpResult {
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
/* eslint-disable better-tree-shaking/no-top-level-side-effects */
|
||||
import { SmartWallet } from "../src/evm/wallets/smart-wallet";
|
||||
import { LocalWallet } from "../src/evm/wallets/local-wallet";
|
||||
import { BaseSepoliaTestnet } from "@thirdweb-dev/chains";
|
||||
import { ThirdwebSDK, SmartContract } from "@thirdweb-dev/sdk";
|
||||
import { BigNumber, ethers } from "ethers";
|
||||
|
||||
require("dotenv-mono").load();
|
||||
jest.setTimeout(240_000);
|
||||
|
||||
let smartWallet: SmartWallet;
|
||||
let smartWalletAddress: string;
|
||||
let personalWallet: LocalWallet;
|
||||
let contract: SmartContract;
|
||||
let sdk: ThirdwebSDK;
|
||||
const factoryAddress = "0x0Ef392D2CCe0f1cb2ed1309BCae11A0d6c59f872";
|
||||
const chain = BaseSepoliaTestnet;
|
||||
const erc20PaymasterAddress = "0xFA854D9C6f279bA798C67BD22ffAEcf090B5a87c"; // SimpleERC20Paymaster
|
||||
const erc20TokenAddress = "0xF7235993A1BB401620e7c384D541e78D18081090"; // Base DIA
|
||||
|
||||
const describeIf = (condition: boolean) =>
|
||||
condition ? describe : describe.skip;
|
||||
|
||||
beforeAll(async () => {
|
||||
personalWallet = new LocalWallet();
|
||||
await personalWallet.generate();
|
||||
smartWallet = new SmartWallet({
|
||||
chain,
|
||||
factoryAddress,
|
||||
gasless: true,
|
||||
secretKey: process.env.TW_SECRET_KEY,
|
||||
erc20PaymasterAddress: erc20PaymasterAddress,
|
||||
erc20TokenAddress: erc20TokenAddress,
|
||||
});
|
||||
smartWalletAddress = await smartWallet.connect({ personalWallet });
|
||||
sdk = await ThirdwebSDK.fromWallet(smartWallet, chain);
|
||||
contract = await sdk.getContract(
|
||||
"0xF7235993A1BB401620e7c384D541e78D18081090", // using same token for payment and claim
|
||||
);
|
||||
});
|
||||
|
||||
describeIf(!!process.env.TW_SECRET_KEY)("ERC20Paymaster core tests", () => {
|
||||
it("can connect", async () => {
|
||||
expect(smartWalletAddress).toHaveLength(42);
|
||||
});
|
||||
|
||||
it("should deploy+approve (gasless) and execute a tx", async () => {
|
||||
const tokenContract = await sdk.getContract(erc20TokenAddress);
|
||||
|
||||
// initial checks
|
||||
let approvedAmount = (
|
||||
await tokenContract.erc20.allowanceOf(
|
||||
smartWalletAddress,
|
||||
erc20PaymasterAddress,
|
||||
)
|
||||
).value;
|
||||
expect(approvedAmount.toNumber()).toEqual(0);
|
||||
|
||||
let isDeployed = await smartWallet.isDeployed();
|
||||
expect(isDeployed).toEqual(false);
|
||||
|
||||
let balance = (await contract.erc20.balance()).value;
|
||||
expect(balance.toNumber()).toEqual(0);
|
||||
|
||||
// airdrop tokens for payment
|
||||
const tempLocalWallet = new LocalWallet();
|
||||
await tempLocalWallet.generate();
|
||||
const tempSmartWallet = new SmartWallet({
|
||||
chain,
|
||||
factoryAddress,
|
||||
gasless: true,
|
||||
secretKey: process.env.TW_SECRET_KEY,
|
||||
});
|
||||
await tempSmartWallet.connect({
|
||||
personalWallet: tempLocalWallet,
|
||||
});
|
||||
const claimTx = await contract.erc20.claimTo.prepare(smartWalletAddress, 1); // tx costs 1
|
||||
const claimReceipt = await tempSmartWallet.execute(claimTx);
|
||||
expect(claimReceipt.receipt.transactionHash).toHaveLength(66);
|
||||
balance = (await contract.erc20.balance()).value;
|
||||
expect(balance).toEqual(ethers.utils.parseEther("1"));
|
||||
|
||||
// transact with newly funded smart wallet using erc20 exclusively
|
||||
const preparedTx = await contract.erc20.claim.prepare(1);
|
||||
const tx = await smartWallet.execute(preparedTx);
|
||||
expect(tx.receipt.transactionHash).toHaveLength(66);
|
||||
|
||||
approvedAmount = (
|
||||
await tokenContract.erc20.allowanceOf(
|
||||
smartWalletAddress,
|
||||
erc20PaymasterAddress,
|
||||
)
|
||||
).value;
|
||||
expect(approvedAmount).toEqual(
|
||||
BigNumber.from(2).pow(96).sub(1).sub(ethers.utils.parseEther("1")), // 2^96 - 1 - 1^18 <- 1^18 is the tx cost removed from allowance
|
||||
);
|
||||
|
||||
isDeployed = await smartWallet.isDeployed();
|
||||
expect(isDeployed).toEqual(true);
|
||||
|
||||
balance = (await contract.erc20.balance()).value;
|
||||
expect(balance).toEqual(ethers.utils.parseEther("1")); // we spent 1 token to claim 1 token
|
||||
});
|
||||
});
|
||||
@@ -12,7 +12,8 @@ let smartWallet: SmartWallet;
|
||||
let smartWalletAddress: string;
|
||||
let personalWallet: LocalWallet;
|
||||
let contract: SmartContract;
|
||||
const factoryAddress = "0x13947435c2fe6BE51ED82F6f59C38617a323dB9B";
|
||||
const factoryAddress = "0x13947435c2fe6BE51ED82F6f59C38617a323dB9B"; // pre 712
|
||||
const factoryAddressV2 = "0xC64d04AedecA895b3F20DC6866b4b532e0b22634"; // post 712
|
||||
const chain = Mumbai;
|
||||
|
||||
const describeIf = (condition: boolean) =>
|
||||
@@ -98,7 +99,33 @@ describeIf(!!process.env.TW_SECRET_KEY)("SmartWallet core tests", () => {
|
||||
expect(balance.toNumber()).toEqual(7);
|
||||
});
|
||||
|
||||
it("can sign and verify 1271", async () => {
|
||||
it("can sign and verify 1271 old factory", async () => {
|
||||
const message = "0x1234";
|
||||
const sig = await smartWallet.signMessage(message);
|
||||
const isValidV1 = await smartWallet.verifySignature(
|
||||
message,
|
||||
sig,
|
||||
smartWalletAddress,
|
||||
chain.chainId,
|
||||
);
|
||||
expect(isValidV1).toEqual(true);
|
||||
const isValidV2 = await checkContractWalletSignature(
|
||||
message,
|
||||
sig,
|
||||
smartWalletAddress,
|
||||
chain.chainId,
|
||||
);
|
||||
expect(isValidV2).toEqual(true);
|
||||
});
|
||||
|
||||
it("can sign and verify 1271 new factory", async () => {
|
||||
smartWallet = new SmartWallet({
|
||||
chain,
|
||||
factoryAddress: factoryAddressV2,
|
||||
gasless: true,
|
||||
secretKey: process.env.TW_SECRET_KEY,
|
||||
});
|
||||
smartWalletAddress = await smartWallet.connect({ personalWallet });
|
||||
const message = "0x1234";
|
||||
const sig = await smartWallet.signMessage(message);
|
||||
const isValidV1 = await smartWallet.verifySignature(
|
||||
|
||||
Binary file not shown.
Generated
+4
-4
@@ -905,8 +905,8 @@ importers:
|
||||
specifier: '>=47'
|
||||
version: 47.0.14(@babel/[email protected])
|
||||
expo-application:
|
||||
specifier: ^5.3.0
|
||||
version: 5.3.0([email protected])
|
||||
specifier: 5.7.0
|
||||
version: 5.7.0([email protected])
|
||||
expo-clipboard:
|
||||
specifier: ^4.5.0
|
||||
version: 4.8.0([email protected])
|
||||
@@ -18944,8 +18944,8 @@ packages:
|
||||
expo: 47.0.14(@babel/[email protected])
|
||||
dev: false
|
||||
|
||||
/expo-application@5.3.0([email protected]):
|
||||
resolution: {integrity: sha512-XLkaELwmiXW6JjFVkwuiFQaGZoNKAxNAcSJkFdz8s4rCljEwehylbzoPk37QHw3cxqb4v0/2EICtg4C4kpEVCA==}
|
||||
/expo-application@5.7.0([email protected]):
|
||||
resolution: {integrity: sha512-C4pB/dANnDZRcxfZz3ULbg7p8Bxp9ntNpM9/WFIYFBbnW0uusrQx3cxyvSjRHOmgeYbvEXQILVDC3Bd+0QKDtQ==}
|
||||
peerDependencies:
|
||||
expo: '*'
|
||||
dependencies:
|
||||
|
||||
Reference in New Issue
Block a user