Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c8bdfd493 | ||
|
|
3810df57aa | ||
|
|
45677ad620 | ||
|
|
0b5bb015f9 | ||
|
|
20d73bf0eb | ||
|
|
773b70aa1c | ||
|
|
e77488217b | ||
|
|
b62dc4abb3 | ||
|
|
be8541054e | ||
|
|
38f3b2eb21 | ||
|
|
493bf8d2db | ||
|
|
a919b27c7a | ||
|
|
0ca69a9234 | ||
|
|
6d6e0ac694 |
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
# Platform team owns everything by default
|
||||
|
||||
- @jnsdls @joaquim-verges @MananTank
|
||||
- @jnsdls @joaquim-verges @MananTank @gregfromstl
|
||||
|
||||
# legacy packages
|
||||
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
# @thirdweb-dev/auth
|
||||
|
||||
## 4.1.66
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @thirdweb-dev/wallets@2.5.8
|
||||
|
||||
## 4.1.65
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @thirdweb-dev/wallets@2.5.7
|
||||
|
||||
## 4.1.64
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/auth",
|
||||
"version": "4.1.64",
|
||||
"version": "4.1.66",
|
||||
"main": "dist/thirdweb-dev-auth.cjs.js",
|
||||
"module": "dist/thirdweb-dev-auth.esm.js",
|
||||
"browser": {
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# @thirdweb-dev/chains
|
||||
|
||||
## 0.1.99
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2821](https://github.com/thirdweb-dev/js/pull/2821) [`45677ad`](https://github.com/thirdweb-dev/js/commit/45677ad62012c63e3443f2e236311eb9a2bad094) Thanks [@github-actions](https://github.com/apps/github-actions)! - Synced Chains Package
|
||||
|
||||
## 0.1.98
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2819](https://github.com/thirdweb-dev/js/pull/2819) [`6d6e0ac`](https://github.com/thirdweb-dev/js/commit/6d6e0ac69453d5a448ab771084976928313662ab) Thanks [@github-actions](https://github.com/apps/github-actions)! - Synced Chains Package
|
||||
|
||||
## 0.1.97
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -17,7 +17,7 @@ export default {
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://worldland.foundation",
|
||||
"name": "Worldland Mainnet",
|
||||
"name": "WorldLand Mainnet",
|
||||
"nativeCurrency": {
|
||||
"name": "Worldland",
|
||||
"symbol": "WLC",
|
||||
@@ -26,7 +26,8 @@ export default {
|
||||
"networkId": 103,
|
||||
"rpc": [
|
||||
"https://103.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://seoul.worldland.foundation"
|
||||
"https://seoul.worldland.foundation",
|
||||
"https://seoul2.worldland.foundation"
|
||||
],
|
||||
"shortName": "WLC",
|
||||
"slug": "worldland",
|
||||
|
||||
@@ -17,7 +17,7 @@ export default {
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://worldland.foundation",
|
||||
"name": "Worldland Testnet",
|
||||
"name": "WorldLand Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "Worldland",
|
||||
"symbol": "WLC",
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "SaitaBlockChain(SBC)",
|
||||
"chainId": 1209,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "Saitascan explorer",
|
||||
"url": "https://saitascan.io",
|
||||
"standard": "none",
|
||||
"icon": {
|
||||
"url": "ipfs://QmVFWTqfqnMXbiPKpDFucE9QSQ1SVsUWs4HxBqRGjgQCbu",
|
||||
"width": 974,
|
||||
"height": 263,
|
||||
"format": "png"
|
||||
}
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"icon": {
|
||||
"url": "ipfs://QmVFWTqfqnMXbiPKpDFucE9QSQ1SVsUWs4HxBqRGjgQCbu",
|
||||
"width": 974,
|
||||
"height": 263,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://saitachain.com",
|
||||
"name": "SaitaBlockChain(SBC)",
|
||||
"nativeCurrency": {
|
||||
"name": "SaitaBlockChain(SBC)",
|
||||
"symbol": "STC",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 1209,
|
||||
"rpc": [
|
||||
"https://1209.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc-nodes.saitascan.io"
|
||||
],
|
||||
"shortName": "SBC",
|
||||
"slug": "saitablockchain-sbc",
|
||||
"testnet": false
|
||||
} as const satisfies Chain;
|
||||
@@ -4,12 +4,6 @@ export default {
|
||||
"chainId": 1221,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"icon": {
|
||||
"url": "ipfs://QmeC4mKGbBpwmLfFxUSsareWkSWJomevUmex8ajjxo1zHx",
|
||||
"width": 500,
|
||||
"height": 500,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://www.cyclenetwork.io/",
|
||||
"name": "Cycle Network Testnet",
|
||||
"nativeCurrency": {
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "IGC",
|
||||
"chainId": 1499,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "IGC-Scan",
|
||||
"url": "https://igcscan.com",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"icon": {
|
||||
"url": "ipfs://QmeXuzaYXCDwHgQdpuE9L55JfEChzj11P73Ngrn8vDTE9T",
|
||||
"width": 1024,
|
||||
"height": 1024,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://idosgames.com/",
|
||||
"name": "iDos Games Chain Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "iDos Games Coin",
|
||||
"symbol": "IGC",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 1499,
|
||||
"rpc": [
|
||||
"https://1499.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc-testnet.idos.games"
|
||||
],
|
||||
"shortName": "IGC",
|
||||
"slug": "idos-games-chain-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,22 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "UPBEth",
|
||||
"chainId": 1918,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"infoURL": "https://mobylab.docs.crescdi.pub.ro/blog/UPB-CRESCDI-Testnet",
|
||||
"name": "UPB CRESCDI Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "UPBEth",
|
||||
"symbol": "UPBEth",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 1918,
|
||||
"rpc": [
|
||||
"https://1918.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://testnet.crescdi.pub.ro"
|
||||
],
|
||||
"shortName": "UPBEth",
|
||||
"slug": "upb-crescdi-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -13,6 +13,12 @@ export default {
|
||||
"https://www.okx.com/xlayer/faucet"
|
||||
],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "ipfs://QmSLkiAAr6VtJ6jEqEzz3QdZtVEHzR6Az7E4XD8qXwjuio",
|
||||
"width": 1000,
|
||||
"height": 1000,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://www.okx.com/xlayer",
|
||||
"name": "X Layer Testnet",
|
||||
"nativeCurrency": {
|
||||
|
||||
@@ -11,6 +11,12 @@ export default {
|
||||
],
|
||||
"faucets": [],
|
||||
"features": [],
|
||||
"icon": {
|
||||
"url": "ipfs://QmSLkiAAr6VtJ6jEqEzz3QdZtVEHzR6Az7E4XD8qXwjuio",
|
||||
"width": 1000,
|
||||
"height": 1000,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://www.okx.com/xlayer",
|
||||
"name": "X Layer Mainnet",
|
||||
"nativeCurrency": {
|
||||
|
||||
@@ -4,19 +4,19 @@ export default {
|
||||
"chainId": 2021,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "Edgscan by Bharathcoorg",
|
||||
"name": "Edgscan EdgeEVM explorer by Bharathcoorg",
|
||||
"url": "https://edgscan.live",
|
||||
"standard": "EIP3091"
|
||||
},
|
||||
{
|
||||
"name": "Subscan",
|
||||
"url": "https://edgeware.subscan.io",
|
||||
"name": "Edgscan EdgeWASM explorer by Bharathcoorg",
|
||||
"url": "https://edgscan.ink",
|
||||
"standard": "none",
|
||||
"icon": {
|
||||
"url": "ipfs://Qma2GfW5nQHuA7nGqdEfwaXPL63G9oTwRTQKaGTfjNtM2W",
|
||||
"width": 400,
|
||||
"height": 400,
|
||||
"format": "png"
|
||||
"url": "ipfs://QmVV7ibcq8pS44Nt77jWSLNY2RkfQooHBCZMBPSMdAfZ3d",
|
||||
"width": 88,
|
||||
"height": 88,
|
||||
"format": "svg"
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -30,10 +30,10 @@ export default {
|
||||
}
|
||||
],
|
||||
"icon": {
|
||||
"url": "ipfs://QmS3ERgAKYTmV7bSWcUPSvrrCC9wHQYxtZqEQYx9Rw4RGA",
|
||||
"width": 352,
|
||||
"height": 304,
|
||||
"format": "png"
|
||||
"url": "ipfs://QmWCSXYLigYE6qEiese4cso2icgKQyosV3x1adtxJnRyJ9",
|
||||
"width": 88,
|
||||
"height": 76,
|
||||
"format": "svg"
|
||||
},
|
||||
"infoURL": "https://edgeware.io",
|
||||
"name": "Edgeware EdgeEVM Mainnet",
|
||||
@@ -46,15 +46,15 @@ export default {
|
||||
"rpc": [
|
||||
"https://2021.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://edgeware-evm.jelliedowl.net",
|
||||
"https://mainnet2.edgewa.re/evm",
|
||||
"https://mainnet3.edgewa.re/evm",
|
||||
"https://mainnet4.edgewa.re/evm",
|
||||
"https://mainnet5.edgewa.re/evm",
|
||||
"https://edgeware-evm0.jelliedowl.net",
|
||||
"https://edgeware-evm1.jelliedowl.net",
|
||||
"https://edgeware-evm2.jelliedowl.net",
|
||||
"https://edgeware-evm3.jelliedowl.net",
|
||||
"wss://edgeware.jelliedowl.net",
|
||||
"wss://mainnet2.edgewa.re",
|
||||
"wss://mainnet3.edgewa.re",
|
||||
"wss://mainnet4.edgewa.re",
|
||||
"wss://mainnet5.edgewa.re"
|
||||
"wss://edgeware-rpc0.jelliedowl.net",
|
||||
"wss://edgeware-rpc1.jelliedowl.net",
|
||||
"wss://edgeware-rpc2.jelliedowl.net",
|
||||
"wss://edgeware-rpc3.jelliedowl.net"
|
||||
],
|
||||
"shortName": "edg",
|
||||
"slip44": 523,
|
||||
|
||||
@@ -2,7 +2,19 @@ import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "VANAR",
|
||||
"chainId": 2040,
|
||||
"explorers": [],
|
||||
"explorers": [
|
||||
{
|
||||
"name": "Vanar Explorer",
|
||||
"url": "https://explorer.vanarchain.com",
|
||||
"standard": "EIP3091",
|
||||
"icon": {
|
||||
"url": "ipfs://Qmbx25iq4Vn4zLooPit9bbguXJzdiogwtVQWtSseyQPuSC",
|
||||
"width": 1000,
|
||||
"height": 1628,
|
||||
"format": "png"
|
||||
}
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"features": [
|
||||
{
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "GitAGI",
|
||||
"chainId": 210049,
|
||||
"explorers": [],
|
||||
"faucets": [],
|
||||
"infoURL": "https://gitagi.org/",
|
||||
"name": "GitAGI Atlas Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "GitAGI",
|
||||
"symbol": "tGAGI",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 210049,
|
||||
"rpc": [
|
||||
"https://210049.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc.gitagi.org"
|
||||
],
|
||||
"shortName": "atlas",
|
||||
"slug": "gitagi-atlas-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 25968,
|
||||
"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": "QaUser5275",
|
||||
"nativeCurrency": {
|
||||
"name": "QaUser5275 Token",
|
||||
"symbol": "EZL",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 25968,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://25968.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QaUser5275",
|
||||
"slug": "qauser5275",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,47 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "MiYou Chain",
|
||||
"chainId": 30088,
|
||||
"ens": {
|
||||
"registry": "0xFEfa9B3061435977424DD947E756566cFB60473E"
|
||||
},
|
||||
"explorers": [
|
||||
{
|
||||
"name": "MiYou block explorer",
|
||||
"url": "https://myscan.miyou.io",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"features": [
|
||||
{
|
||||
"name": "EIP155"
|
||||
},
|
||||
{
|
||||
"name": "EIP1559"
|
||||
}
|
||||
],
|
||||
"icon": {
|
||||
"url": "ipfs://QmfP1QDK42B7EzYWsYN2PGfjkZUQtSjm1k5gNNT52ixsKL",
|
||||
"width": 216,
|
||||
"height": 216,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://www.miyou.io",
|
||||
"name": "MiYou Mainnet",
|
||||
"nativeCurrency": {
|
||||
"name": "Miyou",
|
||||
"symbol": "MY",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 30088,
|
||||
"rpc": [
|
||||
"https://30088.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://blockchain.miyou.io",
|
||||
"https://blockchain.miyoulab.com"
|
||||
],
|
||||
"shortName": "MiYou",
|
||||
"slip44": 60,
|
||||
"slug": "miyou",
|
||||
"testnet": false
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 313311,
|
||||
"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": "LT11",
|
||||
"nativeCurrency": {
|
||||
"name": "LT11 Token",
|
||||
"symbol": "LT",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 313311,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://313311.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/lt11/testnet/rpc"
|
||||
],
|
||||
"shortName": "LT11",
|
||||
"slug": "lt11",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 32366,
|
||||
"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": "QaUser4578 Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "QaUser4578 Testnet Token",
|
||||
"symbol": "EXP",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 32366,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://32366.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QaUser4578 Testnet",
|
||||
"slug": "qauser4578-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 33795,
|
||||
"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": "QaUser9260",
|
||||
"nativeCurrency": {
|
||||
"name": "QaUser9260 Token",
|
||||
"symbol": "SBM",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 33795,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://33795.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QaUser9260",
|
||||
"slug": "qauser9260",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 33841,
|
||||
"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": "QI0422s2 Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "QI0422s2 Testnet Token",
|
||||
"symbol": "HOS",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 33841,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://33841.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QI0422s2 Testnet",
|
||||
"slug": "qi0422s2-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 40100,
|
||||
"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": "QaUser4426",
|
||||
"nativeCurrency": {
|
||||
"name": "QaUser4426 Token",
|
||||
"symbol": "PMC",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 40100,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://40100.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QaUser4426",
|
||||
"slug": "qauser4426",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -4,7 +4,7 @@ export default {
|
||||
"chainId": 4200,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "blockscout",
|
||||
"name": "L2scan",
|
||||
"url": "https://scan.merlinchain.io",
|
||||
"standard": "EIP3091",
|
||||
"icon": {
|
||||
@@ -32,7 +32,8 @@ export default {
|
||||
"networkId": 4200,
|
||||
"rpc": [
|
||||
"https://4200.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc.merlinchain.io"
|
||||
"https://rpc.merlinchain.io",
|
||||
"https://merlin-mainnet-enterprise.unifra.io"
|
||||
],
|
||||
"shortName": "Merlin-Mainnet",
|
||||
"slug": "merlin",
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 47992,
|
||||
"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": "QaUser2555",
|
||||
"nativeCurrency": {
|
||||
"name": "QaUser2555 Token",
|
||||
"symbol": "PRY",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 47992,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://47992.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QaUser2555",
|
||||
"slug": "qauser2555",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 5041,
|
||||
"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": "OMOCHI",
|
||||
"nativeCurrency": {
|
||||
"name": "OMOCHI Token",
|
||||
"symbol": "OMCH",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 5041,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://5041.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/omochi/mainnet/rpc"
|
||||
],
|
||||
"shortName": "OMOCHI",
|
||||
"slug": "omochi",
|
||||
"testnet": false
|
||||
} as const satisfies Chain;
|
||||
@@ -25,6 +25,6 @@ export default {
|
||||
"https://subnets.avax.network/omochi/testnet/rpc"
|
||||
],
|
||||
"shortName": "OMOCHI",
|
||||
"slug": "omochi",
|
||||
"slug": "omochi-omochi",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 55246,
|
||||
"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": "QaUser6469",
|
||||
"nativeCurrency": {
|
||||
"name": "QaUser6469 Token",
|
||||
"symbol": "ZZX",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 55246,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://55246.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QaUser6469",
|
||||
"slug": "qauser6469",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -1,11 +1,17 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "EVMCC",
|
||||
"chain": "TANGO",
|
||||
"chainId": 5678,
|
||||
"explorers": [],
|
||||
"explorers": [
|
||||
{
|
||||
"name": "BlockScout",
|
||||
"url": "https://3001-blockscout.a.dancebox.tanssi.network",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"infoURL": "https://tanssi.network",
|
||||
"name": "Tanssi EVM ContainerChain",
|
||||
"infoURL": "https://docs.tanssi.network/builders/tanssi-network/networks/dancebox/demo-evm-containerchain",
|
||||
"name": "Tanssi Demo",
|
||||
"nativeCurrency": {
|
||||
"name": "TANGO",
|
||||
"symbol": "TANGO",
|
||||
@@ -17,7 +23,7 @@ export default {
|
||||
"https://fraa-dancebox-3001-rpc.a.dancebox.tanssi.network",
|
||||
"wss://fraa-dancebox-3001-rpc.a.dancebox.tanssi.network"
|
||||
],
|
||||
"shortName": "TanssiCC",
|
||||
"slug": "tanssi-evm-containerchain",
|
||||
"shortName": "tango",
|
||||
"slug": "tanssi-demo",
|
||||
"testnet": false
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 64643,
|
||||
"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": "qasim Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "qasim Testnet Token",
|
||||
"symbol": "SQJ",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 64643,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://64643.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "qasim Testnet",
|
||||
"slug": "qasim-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,34 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "UltronSmartchain",
|
||||
"chainId": 662,
|
||||
"explorers": [
|
||||
{
|
||||
"name": "ultronsmartchain explorer",
|
||||
"url": "https://scan.ultronsmartchain.io",
|
||||
"standard": "EIP3091"
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"icon": {
|
||||
"url": "ipfs://QmTns2FXAqDCq1QJsocUBGjhxsgWYK7pFfD4UrRZ9JBsF1",
|
||||
"width": 50,
|
||||
"height": 50,
|
||||
"format": "png"
|
||||
},
|
||||
"infoURL": "https://ultronsmartchain.io",
|
||||
"name": "UltronSmartchain",
|
||||
"nativeCurrency": {
|
||||
"name": "ulc",
|
||||
"symbol": "ULC",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 662,
|
||||
"rpc": [
|
||||
"https://662.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc.ultronsmartchain.io"
|
||||
],
|
||||
"shortName": "ultronsmartchain",
|
||||
"slug": "ultronsmartchain",
|
||||
"testnet": false
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 68064,
|
||||
"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": "QaUser3451 Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "QaUser3451 Testnet Token",
|
||||
"symbol": "NKL",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 68064,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://68064.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QaUser3451 Testnet",
|
||||
"slug": "qauser3451-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -2,7 +2,19 @@ import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Cyber",
|
||||
"chainId": 7560,
|
||||
"explorers": [],
|
||||
"explorers": [
|
||||
{
|
||||
"name": "Cyber Mainnet Explorer",
|
||||
"url": "https://cyberscan.co",
|
||||
"standard": "EIP3091",
|
||||
"icon": {
|
||||
"url": "ipfs://QmYtUimyqHkkFxYdbXXRbUqNg2VLPUg6Uu2C2nmFWowiZM",
|
||||
"width": 551,
|
||||
"height": 540,
|
||||
"format": "png"
|
||||
}
|
||||
}
|
||||
],
|
||||
"faucets": [],
|
||||
"icon": {
|
||||
"url": "ipfs://QmP61yDNPv7fxY9ZzPs4CjQDbZLoKtF8eWWjszVYbwkabd",
|
||||
@@ -20,11 +32,19 @@ export default {
|
||||
"networkId": 7560,
|
||||
"parent": {
|
||||
"type": "L2",
|
||||
"chain": "eip155-1"
|
||||
"chain": "eip155-1",
|
||||
"bridges": [
|
||||
{
|
||||
"url": "https://cyber-bridge.alt.technology/deposit"
|
||||
}
|
||||
]
|
||||
},
|
||||
"rpc": [],
|
||||
"rpc": [
|
||||
"https://7560.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://cyber.alt.technology/",
|
||||
"wss://cyber-ws.alt.technology/"
|
||||
],
|
||||
"shortName": "cyeth",
|
||||
"slug": "cyber",
|
||||
"status": "incubating",
|
||||
"testnet": false
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 82261,
|
||||
"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": "QI0423s1 Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "QI0423s1 Testnet Token",
|
||||
"symbol": "PUU",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 82261,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://82261.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QI0423s1 Testnet",
|
||||
"slug": "qi0423s1-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 84860,
|
||||
"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": "QI0422I1 Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "QI0422I1 Testnet Token",
|
||||
"symbol": "LLV",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 84860,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://84860.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QI0422I1 Testnet",
|
||||
"slug": "qi0422i1-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -2,9 +2,6 @@ import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "ETH",
|
||||
"chainId": 90354,
|
||||
"ens": {
|
||||
"registry": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
|
||||
},
|
||||
"explorers": [
|
||||
{
|
||||
"name": "Block Explorer",
|
||||
@@ -26,7 +23,7 @@ export default {
|
||||
"height": 400,
|
||||
"format": "jpg"
|
||||
},
|
||||
"name": "Camp Network Testnet",
|
||||
"name": "Camp Network",
|
||||
"nativeCurrency": {
|
||||
"name": "Ether",
|
||||
"symbol": "ETH",
|
||||
@@ -38,7 +35,7 @@ export default {
|
||||
"https://90354.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://rpc-camp-network-4xje7wy105.t.conduit.xyz/"
|
||||
],
|
||||
"shortName": "campaign-l2-test",
|
||||
"slug": "camp-network-testnet",
|
||||
"testnet": true
|
||||
"shortName": "campaign-l2",
|
||||
"slug": "camp-network",
|
||||
"testnet": false
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 933039,
|
||||
"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": "QR0422T1TS Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "QR0422T1TS Testnet Token",
|
||||
"symbol": "DIF",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 933039,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://933039.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/qr0422t1ts/testnet/rpc"
|
||||
],
|
||||
"shortName": "QR0422T1TS Testnet",
|
||||
"slug": "qr0422t1ts-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 93797,
|
||||
"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": "QaUser8328",
|
||||
"nativeCurrency": {
|
||||
"name": "QaUser8328 Token",
|
||||
"symbol": "CPY",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 93797,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://93797.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QaUser8328",
|
||||
"slug": "qauser8328",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 9543,
|
||||
"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": "QaUser4523",
|
||||
"nativeCurrency": {
|
||||
"name": "QaUser4523 Token",
|
||||
"symbol": "NBW",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 9543,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://9543.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QaUser4523",
|
||||
"slug": "qauser4523",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 95549,
|
||||
"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": "Borne Testnet Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "Borne Testnet Testnet Token",
|
||||
"symbol": "BORNE",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 95549,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://95549.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/borne/testnet/rpc"
|
||||
],
|
||||
"shortName": "Borne Testnet Testnet",
|
||||
"slug": "borne-testnet-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { Chain } from "../src/types";
|
||||
export default {
|
||||
"chain": "Avalanche",
|
||||
"chainId": 96081,
|
||||
"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": "QaUser2213 Testnet",
|
||||
"nativeCurrency": {
|
||||
"name": "QaUser2213 Testnet Token",
|
||||
"symbol": "QLV",
|
||||
"decimals": 18
|
||||
},
|
||||
"networkId": 96081,
|
||||
"redFlags": [],
|
||||
"rpc": [
|
||||
"https://96081.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
|
||||
],
|
||||
"shortName": "QaUser2213 Testnet",
|
||||
"slug": "qauser2213-testnet",
|
||||
"testnet": true
|
||||
} as const satisfies Chain;
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/chains",
|
||||
"version": "0.1.97",
|
||||
"version": "0.1.99",
|
||||
"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.74
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`45677ad`](https://github.com/thirdweb-dev/js/commit/45677ad62012c63e3443f2e236311eb9a2bad094)]:
|
||||
- @thirdweb-dev/chains@0.1.99
|
||||
- @thirdweb-dev/sdk@4.0.68
|
||||
- @thirdweb-dev/wallets@2.5.8
|
||||
- @thirdweb-dev/auth@4.1.66
|
||||
|
||||
## 0.13.73
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`6d6e0ac`](https://github.com/thirdweb-dev/js/commit/6d6e0ac69453d5a448ab771084976928313662ab)]:
|
||||
- @thirdweb-dev/chains@0.1.98
|
||||
- @thirdweb-dev/sdk@4.0.67
|
||||
- @thirdweb-dev/wallets@2.5.7
|
||||
- @thirdweb-dev/auth@4.1.65
|
||||
|
||||
## 0.13.72
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/cli",
|
||||
"main": "dist/cli/index.js",
|
||||
"version": "0.13.72",
|
||||
"version": "0.13.74",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/legacy_packages/cli",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -424,7 +424,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/legacy_packages/contracts-js",
|
||||
"dependencies": {
|
||||
"@thirdweb-dev/contracts": "3.13.0"
|
||||
"@thirdweb-dev/contracts": "3.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ethersproject/abi": "^5.7.0",
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
# @thirdweb-dev/react-core
|
||||
|
||||
## 4.6.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`45677ad`](https://github.com/thirdweb-dev/js/commit/45677ad62012c63e3443f2e236311eb9a2bad094)]:
|
||||
- @thirdweb-dev/chains@0.1.99
|
||||
- @thirdweb-dev/sdk@4.0.68
|
||||
- @thirdweb-dev/wallets@2.5.8
|
||||
- @thirdweb-dev/auth@4.1.66
|
||||
|
||||
## 4.6.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`6d6e0ac`](https://github.com/thirdweb-dev/js/commit/6d6e0ac69453d5a448ab771084976928313662ab)]:
|
||||
- @thirdweb-dev/chains@0.1.98
|
||||
- @thirdweb-dev/sdk@4.0.67
|
||||
- @thirdweb-dev/wallets@2.5.7
|
||||
- @thirdweb-dev/auth@4.1.65
|
||||
|
||||
## 4.6.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react-core",
|
||||
"version": "4.6.5",
|
||||
"version": "4.6.7",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/legacy_packages/react-core",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,9 @@
|
||||
# @thirdweb-dev/react-native-compat
|
||||
|
||||
## 0.7.39
|
||||
|
||||
## 0.7.38
|
||||
|
||||
## 0.7.37
|
||||
|
||||
## 0.7.36
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react-native-compat",
|
||||
"description": "Shims for Thirdweb in React Native Projects",
|
||||
"version": "0.7.37",
|
||||
"version": "0.7.39",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/legacy_packages/react-native-compat",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
# @thirdweb-dev/react-native
|
||||
|
||||
## 0.7.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`45677ad`](https://github.com/thirdweb-dev/js/commit/45677ad62012c63e3443f2e236311eb9a2bad094)]:
|
||||
- @thirdweb-dev/chains@0.1.99
|
||||
- @thirdweb-dev/sdk@4.0.68
|
||||
- @thirdweb-dev/react-core@4.6.7
|
||||
- @thirdweb-dev/wallets@2.5.8
|
||||
|
||||
## 0.7.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`6d6e0ac`](https://github.com/thirdweb-dev/js/commit/6d6e0ac69453d5a448ab771084976928313662ab)]:
|
||||
- @thirdweb-dev/chains@0.1.98
|
||||
- @thirdweb-dev/sdk@4.0.67
|
||||
- @thirdweb-dev/react-core@4.6.6
|
||||
- @thirdweb-dev/wallets@2.5.7
|
||||
|
||||
## 0.7.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react-native",
|
||||
"version": "0.7.37",
|
||||
"version": "0.7.39",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/legacy_packages/react-native",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,25 @@
|
||||
# @thirdweb-dev/react
|
||||
|
||||
## 4.6.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`45677ad`](https://github.com/thirdweb-dev/js/commit/45677ad62012c63e3443f2e236311eb9a2bad094)]:
|
||||
- @thirdweb-dev/chains@0.1.99
|
||||
- @thirdweb-dev/sdk@4.0.68
|
||||
- @thirdweb-dev/react-core@4.6.7
|
||||
- @thirdweb-dev/wallets@2.5.8
|
||||
|
||||
## 4.6.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`6d6e0ac`](https://github.com/thirdweb-dev/js/commit/6d6e0ac69453d5a448ab771084976928313662ab)]:
|
||||
- @thirdweb-dev/chains@0.1.98
|
||||
- @thirdweb-dev/sdk@4.0.67
|
||||
- @thirdweb-dev/react-core@4.6.6
|
||||
- @thirdweb-dev/wallets@2.5.7
|
||||
|
||||
## 4.6.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react",
|
||||
"version": "4.6.5",
|
||||
"version": "4.6.7",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/legacy_packages/react",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,21 @@
|
||||
# @thirdweb-dev/sdk
|
||||
|
||||
## 4.0.68
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`3810df5`](https://github.com/thirdweb-dev/js/commit/3810df57aa9590b0a2fa14071a5c061bd94b1ec6), [`45677ad`](https://github.com/thirdweb-dev/js/commit/45677ad62012c63e3443f2e236311eb9a2bad094)]:
|
||||
- thirdweb@5.10.1
|
||||
- @thirdweb-dev/chains@0.1.99
|
||||
|
||||
## 4.0.67
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`be85410`](https://github.com/thirdweb-dev/js/commit/be8541054e392a12678ffee534284e7d1b203ad4), [`a919b27`](https://github.com/thirdweb-dev/js/commit/a919b27c7af41dc003ddb643eb0641eaa8aefc07), [`38f3b2e`](https://github.com/thirdweb-dev/js/commit/38f3b2eb21e74e5947f03cc594dee22c96099f8b), [`6d6e0ac`](https://github.com/thirdweb-dev/js/commit/6d6e0ac69453d5a448ab771084976928313662ab)]:
|
||||
- thirdweb@5.10.0
|
||||
- @thirdweb-dev/chains@0.1.98
|
||||
|
||||
## 4.0.66
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/sdk",
|
||||
"version": "4.0.66",
|
||||
"version": "4.0.68",
|
||||
"description": "The main thirdweb SDK.",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/legacy_packages/sdk",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,27 @@
|
||||
# @thirdweb-dev/unity-js-bridge
|
||||
|
||||
## 0.6.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`45677ad`](https://github.com/thirdweb-dev/js/commit/45677ad62012c63e3443f2e236311eb9a2bad094)]:
|
||||
- @thirdweb-dev/chains@0.1.99
|
||||
- @thirdweb-dev/sdk@4.0.68
|
||||
- @thirdweb-dev/wallets@2.5.8
|
||||
- @thirdweb-dev/auth@4.1.66
|
||||
|
||||
## 0.6.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2824](https://github.com/thirdweb-dev/js/pull/2824) [`0ca69a9`](https://github.com/thirdweb-dev/js/commit/0ca69a92341d6711991ca7462d2dbbd7eca261a9) Thanks [@0xFirekeeper](https://github.com/0xFirekeeper)! - Unity 4.12.2
|
||||
|
||||
- Updated dependencies [[`6d6e0ac`](https://github.com/thirdweb-dev/js/commit/6d6e0ac69453d5a448ab771084976928313662ab)]:
|
||||
- @thirdweb-dev/chains@0.1.98
|
||||
- @thirdweb-dev/sdk@4.0.67
|
||||
- @thirdweb-dev/wallets@2.5.7
|
||||
- @thirdweb-dev/auth@4.1.65
|
||||
|
||||
## 0.6.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/unity-js-bridge",
|
||||
"version": "0.6.15",
|
||||
"version": "0.6.17",
|
||||
"main": "dist/thirdweb-unity-bridge.js",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/unity-js-bridge",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -171,7 +171,7 @@ class ThirdwebBridge implements TWBridge {
|
||||
// biome-ignore lint/suspicious/noExplicitAny: TODO: fix use of any
|
||||
(globalThis as any).X_SDK_PLATFORM = "unity";
|
||||
// biome-ignore lint/suspicious/noExplicitAny: TODO: fix use of any
|
||||
(globalThis as any).X_SDK_VERSION = "4.12.1";
|
||||
(globalThis as any).X_SDK_VERSION = "4.12.2";
|
||||
// biome-ignore lint/suspicious/noExplicitAny: TODO: fix use of any
|
||||
(globalThis as any).X_SDK_OS = browser?.os ?? "unknown";
|
||||
}
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
# @thirdweb-dev/wallets
|
||||
|
||||
## 2.5.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`45677ad`](https://github.com/thirdweb-dev/js/commit/45677ad62012c63e3443f2e236311eb9a2bad094)]:
|
||||
- @thirdweb-dev/chains@0.1.99
|
||||
- @thirdweb-dev/sdk@4.0.68
|
||||
|
||||
## 2.5.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`6d6e0ac`](https://github.com/thirdweb-dev/js/commit/6d6e0ac69453d5a448ab771084976928313662ab)]:
|
||||
- @thirdweb-dev/chains@0.1.98
|
||||
- @thirdweb-dev/sdk@4.0.67
|
||||
|
||||
## 2.5.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/wallets",
|
||||
"version": "2.5.6",
|
||||
"version": "2.5.8",
|
||||
"main": "dist/thirdweb-dev-wallets.cjs.js",
|
||||
"module": "dist/thirdweb-dev-wallets.esm.js",
|
||||
"browser": {
|
||||
@@ -537,7 +537,7 @@
|
||||
"@thirdweb-dev/crypto": "workspace:*",
|
||||
"@thirdweb-dev/sdk": "workspace:*",
|
||||
"@walletconnect/core": "^2.12.1",
|
||||
"@walletconnect/ethereum-provider": "2.12.1",
|
||||
"@walletconnect/ethereum-provider": "2.12.2",
|
||||
"@walletconnect/jsonrpc-utils": "^1.0.8",
|
||||
"@walletconnect/modal": "^2.6.2",
|
||||
"@walletconnect/types": "^2.12.1",
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,11 @@
|
||||
# @thirdweb-dev/service-utils
|
||||
|
||||
## 0.4.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2832](https://github.com/thirdweb-dev/js/pull/2832) [`773b70a`](https://github.com/thirdweb-dev/js/commit/773b70aa1c113c775a1c44f3262b5de0547b5359) Thanks [@farhanW3](https://github.com/farhanW3)! - added httpMethod to usage-tracker
|
||||
|
||||
## 0.4.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/service-utils",
|
||||
"version": "0.4.27",
|
||||
"version": "0.4.28",
|
||||
"main": "dist/thirdweb-dev-service-utils.cjs.js",
|
||||
"module": "dist/thirdweb-dev-service-utils.esm.js",
|
||||
"exports": {
|
||||
|
||||
@@ -70,6 +70,19 @@ const usageEventSchema = z.object({
|
||||
tokenAddress: z.string().optional(),
|
||||
amountWei: z.string().optional(),
|
||||
amountUSDCents: z.number().nonnegative().optional(),
|
||||
httpMethod: z
|
||||
.enum([
|
||||
"GET",
|
||||
"POST",
|
||||
"PUT",
|
||||
"DELETE",
|
||||
"PATCH",
|
||||
"HEAD",
|
||||
"CONNECT",
|
||||
"OPTIONS",
|
||||
"TRACE",
|
||||
])
|
||||
.optional(),
|
||||
});
|
||||
export type UsageEvent = z.infer<typeof usageEventSchema>;
|
||||
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
# thirdweb
|
||||
|
||||
## 5.10.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2836](https://github.com/thirdweb-dev/js/pull/2836) [`3810df5`](https://github.com/thirdweb-dev/js/commit/3810df57aa9590b0a2fa14071a5c061bd94b1ec6) Thanks [@jnsdls](https://github.com/jnsdls)! - add missing events for `erc721`, `erc1155` and `erc20`
|
||||
|
||||
## 5.10.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [#2822](https://github.com/thirdweb-dev/js/pull/2822) [`a919b27`](https://github.com/thirdweb-dev/js/commit/a919b27c7af41dc003ddb643eb0641eaa8aefc07) Thanks [@kien-ngo](https://github.com/kien-ngo)! - Add multicall3 extension
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2834](https://github.com/thirdweb-dev/js/pull/2834) [`be85410`](https://github.com/thirdweb-dev/js/commit/be8541054e392a12678ffee534284e7d1b203ad4) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - fix: erc1155 sigmint with additional supply
|
||||
|
||||
- [#2831](https://github.com/thirdweb-dev/js/pull/2831) [`38f3b2e`](https://github.com/thirdweb-dev/js/commit/38f3b2eb21e74e5947f03cc594dee22c96099f8b) Thanks [@MananTank](https://github.com/MananTank)! - Fix In-App + Smart wallet Connection issue
|
||||
|
||||
## 5.9.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "thirdweb",
|
||||
"version": "5.9.0",
|
||||
"version": "5.10.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/thirdweb-dev/js.git#main"
|
||||
|
||||
@@ -0,0 +1,440 @@
|
||||
[
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "target",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "callData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Call[]",
|
||||
"name": "calls",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"name": "aggregate",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "blockNumber",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes[]",
|
||||
"name": "returnData",
|
||||
"type": "bytes[]"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "target",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "allowFailure",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "callData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Call3[]",
|
||||
"name": "calls",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"name": "aggregate3",
|
||||
"outputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "success",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "returnData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Result[]",
|
||||
"name": "returnData",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "target",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "allowFailure",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "value",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "callData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Call3Value[]",
|
||||
"name": "calls",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"name": "aggregate3Value",
|
||||
"outputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "success",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "returnData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Result[]",
|
||||
"name": "returnData",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "target",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "callData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Call[]",
|
||||
"name": "calls",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"name": "blockAndAggregate",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "blockNumber",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "blockHash",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "success",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "returnData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Result[]",
|
||||
"name": "returnData",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getBasefee",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "basefee",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "blockNumber",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "getBlockHash",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "blockHash",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getBlockNumber",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "blockNumber",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getChainId",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "chainid",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getCurrentBlockCoinbase",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "coinbase",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getCurrentBlockDifficulty",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "difficulty",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getCurrentBlockGasLimit",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "gaslimit",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getCurrentBlockTimestamp",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "timestamp",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "addr",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "getEthBalance",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "balance",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "getLastBlockHash",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "blockHash",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "requireSuccess",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "target",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "callData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Call[]",
|
||||
"name": "calls",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"name": "tryAggregate",
|
||||
"outputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "success",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "returnData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Result[]",
|
||||
"name": "returnData",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "requireSuccess",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "target",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "callData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Call[]",
|
||||
"name": "calls",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"name": "tryBlockAndAggregate",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "blockNumber",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "blockHash",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "success",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "returnData",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct Multicall3.Result[]",
|
||||
"name": "returnData",
|
||||
"type": "tuple[]"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
@@ -55,6 +55,19 @@ describe("walletClient.toViem", () => {
|
||||
throw new Error("Account not found");
|
||||
}
|
||||
const txHash = await walletClient.sendTransaction({
|
||||
account: walletClient.account,
|
||||
chain: {
|
||||
id: ANVIL_CHAIN.id,
|
||||
name: ANVIL_CHAIN.name || "",
|
||||
rpcUrls: {
|
||||
default: { http: [ANVIL_CHAIN.rpc] },
|
||||
},
|
||||
nativeCurrency: {
|
||||
name: ANVIL_CHAIN.nativeCurrency?.name || "Ether",
|
||||
symbol: ANVIL_CHAIN.nativeCurrency?.symbol || "ETH",
|
||||
decimals: ANVIL_CHAIN.nativeCurrency?.decimals || 18,
|
||||
},
|
||||
},
|
||||
to: zeroAddress,
|
||||
value: 0n,
|
||||
});
|
||||
|
||||
@@ -74,24 +74,6 @@ export {
|
||||
} from "../../extensions/erc1155/__generated__/INFTMetadata/write/setTokenURI.js";
|
||||
export { freezeMetadata } from "../../extensions/erc1155/__generated__/INFTMetadata/write/freezeMetadata.js";
|
||||
|
||||
// EVENTS
|
||||
|
||||
export {
|
||||
transferSingleEvent,
|
||||
type TransferSingleEventFilters,
|
||||
} from "../../extensions/erc1155/__generated__/IERC1155/events/TransferSingle.js";
|
||||
export {
|
||||
transferBatchEvent,
|
||||
type TransferBatchEventFilters,
|
||||
} from "../../extensions/erc1155/__generated__/IERC1155/events/TransferBatch.js";
|
||||
export {
|
||||
approvalForAllEvent,
|
||||
type ApprovalForAllEventFilters,
|
||||
} from "../../extensions/erc1155/__generated__/IERC1155/events/ApprovalForAll.js";
|
||||
export { metadataUpdateEvent } from "../../extensions/erc1155/__generated__/INFTMetadata/events/MetadataUpdate.js";
|
||||
export { metadataFrozenEvent } from "../../extensions/erc1155/__generated__/INFTMetadata/events/MetadataFrozen.js";
|
||||
export { batchMetadataUpdateEvent } from "../../extensions/erc1155/__generated__/INFTMetadata/events/BatchMetadataUpdate.js";
|
||||
|
||||
/**
|
||||
* DROPS extension for ERC1155
|
||||
*/
|
||||
@@ -123,3 +105,22 @@ export {
|
||||
// EVENTS
|
||||
export { tokensLazyMintedEvent } from "../../extensions/erc1155/__generated__/ILazyMint/events/TokensLazyMinted.js";
|
||||
export { tokensClaimedEvent } from "../../extensions/erc1155/__generated__/IDrop1155/events/TokensClaimed.js";
|
||||
export {
|
||||
transferSingleEvent,
|
||||
type TransferSingleEventFilters,
|
||||
} from "../../extensions/erc1155/__generated__/IERC1155/events/TransferSingle.js";
|
||||
export {
|
||||
transferBatchEvent,
|
||||
type TransferBatchEventFilters,
|
||||
} from "../../extensions/erc1155/__generated__/IERC1155/events/TransferBatch.js";
|
||||
export {
|
||||
approvalForAllEvent,
|
||||
type ApprovalForAllEventFilters,
|
||||
} from "../../extensions/erc1155/__generated__/IERC1155/events/ApprovalForAll.js";
|
||||
export { metadataUpdateEvent } from "../../extensions/erc1155/__generated__/INFTMetadata/events/MetadataUpdate.js";
|
||||
export { metadataFrozenEvent } from "../../extensions/erc1155/__generated__/INFTMetadata/events/MetadataFrozen.js";
|
||||
export { batchMetadataUpdateEvent } from "../../extensions/erc1155/__generated__/INFTMetadata/events/BatchMetadataUpdate.js";
|
||||
export {
|
||||
tokensMintedWithSignatureEvent,
|
||||
type TokensMintedWithSignatureEventFilters,
|
||||
} from "../../extensions/erc1155/__generated__/ISignatureMintERC1155/events/TokensMintedWithSignature.js";
|
||||
|
||||
@@ -45,25 +45,6 @@ export {
|
||||
type BurnFromParams,
|
||||
} from "../../extensions/erc20/__generated__/IBurnableERC20/write/burnFrom.js";
|
||||
|
||||
// EVENTS
|
||||
export {
|
||||
transferEvent,
|
||||
type TransferEventFilters,
|
||||
} from "../../extensions/erc20/__generated__/IERC20/events/Transfer.js";
|
||||
export {
|
||||
approvalEvent,
|
||||
type ApprovalEventFilters,
|
||||
} from "../../extensions/erc20/__generated__/IERC20/events/Approval.js";
|
||||
export {
|
||||
tokensMintedEvent,
|
||||
type TokensMintedEventFilters,
|
||||
} from "../../extensions/erc20/__generated__/IMintableERC20/events/TokensMinted.js";
|
||||
export {
|
||||
tokensClaimedEvent,
|
||||
type TokensClaimedEventFilters,
|
||||
} from "../../extensions/erc20/__generated__/IDropERC20/events/TokensClaimed.js";
|
||||
export { claimConditionsUpdatedEvent } from "../../extensions/erc20/__generated__/IDropERC20/events/ClaimConditionsUpdated.js";
|
||||
|
||||
/**
|
||||
* DROPS extension for ERC20
|
||||
*/
|
||||
@@ -98,3 +79,26 @@ export {
|
||||
withdraw,
|
||||
type WithdrawParams,
|
||||
} from "../../extensions/erc20/__generated__/IWETH/write/withdraw.js";
|
||||
|
||||
// EVENTS
|
||||
export {
|
||||
transferEvent,
|
||||
type TransferEventFilters,
|
||||
} from "../../extensions/erc20/__generated__/IERC20/events/Transfer.js";
|
||||
export {
|
||||
approvalEvent,
|
||||
type ApprovalEventFilters,
|
||||
} from "../../extensions/erc20/__generated__/IERC20/events/Approval.js";
|
||||
export {
|
||||
tokensMintedEvent,
|
||||
type TokensMintedEventFilters,
|
||||
} from "../../extensions/erc20/__generated__/IMintableERC20/events/TokensMinted.js";
|
||||
export {
|
||||
tokensClaimedEvent,
|
||||
type TokensClaimedEventFilters,
|
||||
} from "../../extensions/erc20/__generated__/IDropERC20/events/TokensClaimed.js";
|
||||
export { claimConditionsUpdatedEvent } from "../../extensions/erc20/__generated__/IDropERC20/events/ClaimConditionsUpdated.js";
|
||||
export {
|
||||
tokensMintedWithSignatureEvent,
|
||||
type TokensMintedWithSignatureEventFilters,
|
||||
} from "../../extensions/erc20/__generated__/ISignatureMintERC20/events/TokensMintedWithSignature.js";
|
||||
|
||||
@@ -79,18 +79,6 @@ export {
|
||||
type SetTokenURIParams,
|
||||
} from "../../extensions/erc721/__generated__/INFTMetadata/write/setTokenURI.js";
|
||||
|
||||
/**
|
||||
* EVENTS extension for ERC721
|
||||
*/
|
||||
export {
|
||||
transferEvent,
|
||||
type TransferEventFilters,
|
||||
} from "../../extensions/erc721/__generated__/IERC721A/events/Transfer.js";
|
||||
export {
|
||||
tokensLazyMintedEvent,
|
||||
type TokensLazyMintedEventFilters,
|
||||
} from "../../extensions/erc721/__generated__/ILazyMint/events/TokensLazyMinted.js";
|
||||
|
||||
/**
|
||||
* DROPS extension for ERC721
|
||||
*/
|
||||
@@ -126,3 +114,37 @@ export {
|
||||
setSharedMetadata,
|
||||
type SetSharedMetadataParams,
|
||||
} from "../../extensions/erc721/write/setSharedMetadata.js";
|
||||
|
||||
/**
|
||||
* EVENTS extension for ERC721
|
||||
*/
|
||||
export {
|
||||
transferEvent,
|
||||
type TransferEventFilters,
|
||||
} from "../../extensions/erc721/__generated__/IERC721A/events/Transfer.js";
|
||||
export {
|
||||
tokensLazyMintedEvent,
|
||||
type TokensLazyMintedEventFilters,
|
||||
} from "../../extensions/erc721/__generated__/ILazyMint/events/TokensLazyMinted.js";
|
||||
export {
|
||||
approvalEvent,
|
||||
type ApprovalEventFilters,
|
||||
} from "../../extensions/erc721/__generated__/IERC721A/events/Approval.js";
|
||||
export {
|
||||
approvalForAllEvent,
|
||||
type ApprovalForAllEventFilters,
|
||||
} from "../../extensions/erc721/__generated__/IERC721A/events/ApprovalForAll.js";
|
||||
export {
|
||||
tokensMintedWithSignatureEvent,
|
||||
type TokensMintedWithSignatureEventFilters,
|
||||
} from "../../extensions/erc721/__generated__/ISignatureMintERC721/events/TokensMintedWithSignature.js";
|
||||
export { claimConditionsUpdatedEvent } from "../../extensions/erc721/__generated__/IDrop/events/ClaimConditionsUpdated.js";
|
||||
export {
|
||||
tokensClaimedEvent,
|
||||
type TokensClaimedEventFilters,
|
||||
} from "../../extensions/erc721/__generated__/IDrop/events/TokensClaimed.js";
|
||||
export { sharedMetadataUpdatedEvent } from "../../extensions/erc721/__generated__/ISharedMetadata/events/SharedMetadataUpdated.js";
|
||||
export {
|
||||
tokenURIRevealedEvent,
|
||||
type TokenURIRevealedEventFilters,
|
||||
} from "../../extensions/erc721/__generated__/IDelayedReveal/events/TokenURIRevealed.js";
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
// READ
|
||||
export { getBasefee } from "../../extensions/multicall3/__generated__/IMulticall3/read/getBasefee.js";
|
||||
export {
|
||||
getBlockHash,
|
||||
type GetBlockHashParams,
|
||||
} from "../../extensions/multicall3/__generated__/IMulticall3/read/getBlockHash.js";
|
||||
export { getBlockNumber } from "../../extensions/multicall3/__generated__/IMulticall3/read/getBlockNumber.js";
|
||||
export { getChainId } from "../../extensions/multicall3/__generated__/IMulticall3/read/getChainId.js";
|
||||
export { getCurrentBlockCoinbase } from "../../extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockCoinbase.js";
|
||||
export { getCurrentBlockDifficulty } from "../../extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockDifficulty.js";
|
||||
export { getCurrentBlockGasLimit } from "../../extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockGasLimit.js";
|
||||
export { getCurrentBlockTimestamp } from "../../extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockTimestamp.js";
|
||||
export {
|
||||
getEthBalance,
|
||||
type GetEthBalanceParams,
|
||||
} from "../../extensions/multicall3/__generated__/IMulticall3/read/getEthBalance.js";
|
||||
export { getLastBlockHash } from "../../extensions/multicall3/__generated__/IMulticall3/read/getLastBlockHash.js";
|
||||
|
||||
// WRITE
|
||||
export {
|
||||
aggregate,
|
||||
type AggregateParams,
|
||||
} from "../../extensions/multicall3/__generated__/IMulticall3/write/aggregate.js";
|
||||
export {
|
||||
aggregate3,
|
||||
type Aggregate3Params,
|
||||
} from "../../extensions/multicall3/__generated__/IMulticall3/write/aggregate3.js";
|
||||
export {
|
||||
aggregate3Value,
|
||||
type Aggregate3ValueParams,
|
||||
} from "../../extensions/multicall3/__generated__/IMulticall3/write/aggregate3Value.js";
|
||||
export {
|
||||
blockAndAggregate,
|
||||
type BlockAndAggregateParams,
|
||||
} from "../../extensions/multicall3/__generated__/IMulticall3/write/blockAndAggregate.js";
|
||||
export {
|
||||
tryAggregate,
|
||||
type TryAggregateParams,
|
||||
} from "../../extensions/multicall3/__generated__/IMulticall3/write/tryAggregate.js";
|
||||
export {
|
||||
tryBlockAndAggregate,
|
||||
type TryBlockAndAggregateParams,
|
||||
} from "../../extensions/multicall3/__generated__/IMulticall3/write/tryBlockAndAggregate.js";
|
||||
@@ -123,7 +123,9 @@ export async function generateMintSignature(
|
||||
uid,
|
||||
pricePerToken,
|
||||
tokenId:
|
||||
"tokenId" in mintRequest ? mintRequest.tokenId || maxUint256 : maxUint256,
|
||||
"tokenId" in mintRequest && mintRequest.tokenId !== undefined
|
||||
? mintRequest.tokenId
|
||||
: maxUint256,
|
||||
quantity: mintRequest.quantity,
|
||||
to: mintRequest.to,
|
||||
royaltyRecipient: mintRequest.royaltyRecipient || account.address,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { maxUint256 } from "viem";
|
||||
import { beforeAll, describe, expect, it } from "vitest";
|
||||
import { ANVIL_CHAIN } from "../../../../test/src/chains.js";
|
||||
import { TEST_CLIENT } from "../../../../test/src/test-clients.js";
|
||||
@@ -14,6 +15,7 @@ import { sendTransaction } from "../../../transaction/actions/send-transaction.j
|
||||
import { toHex } from "../../../utils/encoding/hex.js";
|
||||
import { deployERC20Contract } from "../../prebuilts/deploy-erc20.js";
|
||||
import { deployERC1155Contract } from "../../prebuilts/deploy-erc1155.js";
|
||||
import { getNFT } from "../read/getNFT.js";
|
||||
import { generateMintSignature, mintWithSignature } from "./sigMint.js";
|
||||
|
||||
// skip this test suite if there is no secret key available to test with
|
||||
@@ -78,6 +80,46 @@ describe.runIf(process.env.TW_SECRET_KEY)("generateMintSignature1155", () => {
|
||||
account: TEST_ACCOUNT_A,
|
||||
});
|
||||
expect(transactionHash.length).toBe(66);
|
||||
const nft = await getNFT({
|
||||
contract: erc1155Contract,
|
||||
tokenId: 0n,
|
||||
});
|
||||
if (nft.type !== "ERC1155") throw new Error("Expected ERC1155 NFT");
|
||||
expect(nft.id).toBe(0n);
|
||||
expect(nft.supply).toBe(10n);
|
||||
expect(nft.metadata.name).toBe("My NFT");
|
||||
expect(nft.metadata.description).toBe("This is my NFT");
|
||||
});
|
||||
|
||||
it("should mint additional supply", async () => {
|
||||
const { payload, signature } = await generateMintSignature({
|
||||
mintRequest: {
|
||||
to: TEST_ACCOUNT_B.address,
|
||||
quantity: 5n,
|
||||
tokenId: 0n,
|
||||
},
|
||||
account: TEST_ACCOUNT_A,
|
||||
contract: erc1155Contract,
|
||||
});
|
||||
const transaction = mintWithSignature({
|
||||
contract: erc1155Contract,
|
||||
payload,
|
||||
signature,
|
||||
});
|
||||
const { transactionHash } = await sendTransaction({
|
||||
transaction,
|
||||
account: TEST_ACCOUNT_A,
|
||||
});
|
||||
expect(transactionHash.length).toBe(66);
|
||||
const nft = await getNFT({
|
||||
contract: erc1155Contract,
|
||||
tokenId: 0n,
|
||||
});
|
||||
if (nft.type !== "ERC1155") throw new Error("Expected ERC1155 NFT");
|
||||
expect(nft.id).toBe(0n);
|
||||
expect(nft.supply).toBe(15n);
|
||||
expect(nft.metadata.name).toBe("My NFT");
|
||||
expect(nft.metadata.description).toBe("This is my NFT");
|
||||
});
|
||||
|
||||
it("should generate a mint signature with default values", async () => {
|
||||
@@ -92,6 +134,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("generateMintSignature1155", () => {
|
||||
});
|
||||
|
||||
expect(payload.to).toBe(TEST_ACCOUNT_B.address);
|
||||
expect(payload.tokenId).toBe(maxUint256);
|
||||
expect(payload.royaltyRecipient).toBe(TEST_ACCOUNT_A.address);
|
||||
expect(payload.royaltyBps).toBe(0n);
|
||||
expect(payload.primarySaleRecipient).toBe(TEST_ACCOUNT_A.address);
|
||||
@@ -125,7 +168,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("generateMintSignature1155", () => {
|
||||
royaltyRecipient: TEST_ACCOUNT_B.address,
|
||||
royaltyBps: 500,
|
||||
primarySaleRecipient: TEST_ACCOUNT_A.address,
|
||||
metadata: "https://example.com/token",
|
||||
tokenId: 0n,
|
||||
pricePerToken: "0.2",
|
||||
currency: erc20TokenContract.address,
|
||||
validityStartTimestamp: new Date(1635724800),
|
||||
@@ -137,10 +180,11 @@ describe.runIf(process.env.TW_SECRET_KEY)("generateMintSignature1155", () => {
|
||||
});
|
||||
|
||||
expect(payload.to).toBe(TEST_ACCOUNT_B.address);
|
||||
expect(payload.tokenId).toBe(0n);
|
||||
expect(payload.royaltyRecipient).toBe(TEST_ACCOUNT_B.address);
|
||||
expect(payload.royaltyBps).toBe(500n);
|
||||
expect(payload.primarySaleRecipient).toBe(TEST_ACCOUNT_A.address);
|
||||
expect(payload.uri).toBe("https://example.com/token");
|
||||
expect(payload.uri).toBe("");
|
||||
expect(payload.pricePerToken).toBe(200000000000000000n);
|
||||
expect(payload.quantity).toBe(10n);
|
||||
expect(payload.currency).toBe(erc20TokenContract.address);
|
||||
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
import { readContract } from "../../../../../transaction/read-contract.js";
|
||||
import type { BaseTransactionOptions } from "../../../../../transaction/types.js";
|
||||
|
||||
import { decodeAbiParameters } from "viem";
|
||||
import type { Hex } from "../../../../../utils/encoding/hex.js";
|
||||
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
||||
import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
|
||||
|
||||
export const FN_SELECTOR = "0x3e64a696" as const;
|
||||
const FN_INPUTS = [] as const;
|
||||
const FN_OUTPUTS = [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "basefee",
|
||||
type: "uint256",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Checks if the `getBasefee` method is supported by the given contract.
|
||||
* @param contract The ThirdwebContract.
|
||||
* @returns A promise that resolves to a boolean indicating if the `getBasefee` method is supported.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { isGetBasefeeSupported } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const supported = await isGetBasefeeSupported(contract);
|
||||
* ```
|
||||
*/
|
||||
export async function isGetBasefeeSupported(contract: ThirdwebContract<any>) {
|
||||
return detectMethod({
|
||||
contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes the result of the getBasefee function call.
|
||||
* @param result - The hexadecimal result to decode.
|
||||
* @returns The decoded result as per the FN_OUTPUTS definition.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { decodeGetBasefeeResult } from "thirdweb/extensions/multicall3";
|
||||
* const result = decodeGetBasefeeResult("...");
|
||||
* ```
|
||||
*/
|
||||
export function decodeGetBasefeeResult(result: Hex) {
|
||||
return decodeAbiParameters(FN_OUTPUTS, result)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the "getBasefee" function on the contract.
|
||||
* @param options - The options for the getBasefee function.
|
||||
* @returns The parsed result of the function call.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { getBasefee } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const result = await getBasefee();
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export async function getBasefee(options: BaseTransactionOptions) {
|
||||
return readContract({
|
||||
contract: options.contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
params: [],
|
||||
});
|
||||
}
|
||||
Generated
+133
@@ -0,0 +1,133 @@
|
||||
import type { AbiParameterToPrimitiveType } from "abitype";
|
||||
import { readContract } from "../../../../../transaction/read-contract.js";
|
||||
import type { BaseTransactionOptions } from "../../../../../transaction/types.js";
|
||||
import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js";
|
||||
import { decodeAbiParameters } from "viem";
|
||||
import type { Hex } from "../../../../../utils/encoding/hex.js";
|
||||
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
||||
import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
|
||||
|
||||
/**
|
||||
* Represents the parameters for the "getBlockHash" function.
|
||||
*/
|
||||
export type GetBlockHashParams = {
|
||||
blockNumber: AbiParameterToPrimitiveType<{
|
||||
internalType: "uint256";
|
||||
name: "blockNumber";
|
||||
type: "uint256";
|
||||
}>;
|
||||
};
|
||||
|
||||
export const FN_SELECTOR = "0xee82ac5e" as const;
|
||||
const FN_INPUTS = [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "blockNumber",
|
||||
type: "uint256",
|
||||
},
|
||||
] as const;
|
||||
const FN_OUTPUTS = [
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "blockHash",
|
||||
type: "bytes32",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Checks if the `getBlockHash` method is supported by the given contract.
|
||||
* @param contract The ThirdwebContract.
|
||||
* @returns A promise that resolves to a boolean indicating if the `getBlockHash` method is supported.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { isGetBlockHashSupported } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const supported = await isGetBlockHashSupported(contract);
|
||||
* ```
|
||||
*/
|
||||
export async function isGetBlockHashSupported(contract: ThirdwebContract<any>) {
|
||||
return detectMethod({
|
||||
contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes the parameters for the "getBlockHash" function.
|
||||
* @param options - The options for the getBlockHash function.
|
||||
* @returns The encoded ABI parameters.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { encodeGetBlockHashParams } "thirdweb/extensions/multicall3";
|
||||
* const result = encodeGetBlockHashParams({
|
||||
* blockNumber: ...,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function encodeGetBlockHashParams(options: GetBlockHashParams) {
|
||||
return encodeAbiParameters(FN_INPUTS, [options.blockNumber]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes the "getBlockHash" function into a Hex string with its parameters.
|
||||
* @param options - The options for the getBlockHash function.
|
||||
* @returns The encoded hexadecimal string.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { encodeGetBlockHash } "thirdweb/extensions/multicall3";
|
||||
* const result = encodeGetBlockHash({
|
||||
* blockNumber: ...,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function encodeGetBlockHash(options: GetBlockHashParams) {
|
||||
// we do a "manual" concat here to avoid the overhead of the "concatHex" function
|
||||
// we can do this because we know the specific formats of the values
|
||||
return (FN_SELECTOR +
|
||||
encodeGetBlockHashParams(options).slice(
|
||||
2,
|
||||
)) as `${typeof FN_SELECTOR}${string}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes the result of the getBlockHash function call.
|
||||
* @param result - The hexadecimal result to decode.
|
||||
* @returns The decoded result as per the FN_OUTPUTS definition.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { decodeGetBlockHashResult } from "thirdweb/extensions/multicall3";
|
||||
* const result = decodeGetBlockHashResult("...");
|
||||
* ```
|
||||
*/
|
||||
export function decodeGetBlockHashResult(result: Hex) {
|
||||
return decodeAbiParameters(FN_OUTPUTS, result)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the "getBlockHash" function on the contract.
|
||||
* @param options - The options for the getBlockHash function.
|
||||
* @returns The parsed result of the function call.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { getBlockHash } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const result = await getBlockHash({
|
||||
* blockNumber: ...,
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export async function getBlockHash(
|
||||
options: BaseTransactionOptions<GetBlockHashParams>,
|
||||
) {
|
||||
return readContract({
|
||||
contract: options.contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
params: [options.blockNumber],
|
||||
});
|
||||
}
|
||||
Generated
+74
@@ -0,0 +1,74 @@
|
||||
import { readContract } from "../../../../../transaction/read-contract.js";
|
||||
import type { BaseTransactionOptions } from "../../../../../transaction/types.js";
|
||||
|
||||
import { decodeAbiParameters } from "viem";
|
||||
import type { Hex } from "../../../../../utils/encoding/hex.js";
|
||||
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
||||
import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
|
||||
|
||||
export const FN_SELECTOR = "0x42cbb15c" as const;
|
||||
const FN_INPUTS = [] as const;
|
||||
const FN_OUTPUTS = [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "blockNumber",
|
||||
type: "uint256",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Checks if the `getBlockNumber` method is supported by the given contract.
|
||||
* @param contract The ThirdwebContract.
|
||||
* @returns A promise that resolves to a boolean indicating if the `getBlockNumber` method is supported.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { isGetBlockNumberSupported } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const supported = await isGetBlockNumberSupported(contract);
|
||||
* ```
|
||||
*/
|
||||
export async function isGetBlockNumberSupported(
|
||||
contract: ThirdwebContract<any>,
|
||||
) {
|
||||
return detectMethod({
|
||||
contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes the result of the getBlockNumber function call.
|
||||
* @param result - The hexadecimal result to decode.
|
||||
* @returns The decoded result as per the FN_OUTPUTS definition.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { decodeGetBlockNumberResult } from "thirdweb/extensions/multicall3";
|
||||
* const result = decodeGetBlockNumberResult("...");
|
||||
* ```
|
||||
*/
|
||||
export function decodeGetBlockNumberResult(result: Hex) {
|
||||
return decodeAbiParameters(FN_OUTPUTS, result)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the "getBlockNumber" function on the contract.
|
||||
* @param options - The options for the getBlockNumber function.
|
||||
* @returns The parsed result of the function call.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { getBlockNumber } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const result = await getBlockNumber();
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export async function getBlockNumber(options: BaseTransactionOptions) {
|
||||
return readContract({
|
||||
contract: options.contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
params: [],
|
||||
});
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
import { readContract } from "../../../../../transaction/read-contract.js";
|
||||
import type { BaseTransactionOptions } from "../../../../../transaction/types.js";
|
||||
|
||||
import { decodeAbiParameters } from "viem";
|
||||
import type { Hex } from "../../../../../utils/encoding/hex.js";
|
||||
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
||||
import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
|
||||
|
||||
export const FN_SELECTOR = "0x3408e470" as const;
|
||||
const FN_INPUTS = [] as const;
|
||||
const FN_OUTPUTS = [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "chainid",
|
||||
type: "uint256",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Checks if the `getChainId` method is supported by the given contract.
|
||||
* @param contract The ThirdwebContract.
|
||||
* @returns A promise that resolves to a boolean indicating if the `getChainId` method is supported.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { isGetChainIdSupported } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const supported = await isGetChainIdSupported(contract);
|
||||
* ```
|
||||
*/
|
||||
export async function isGetChainIdSupported(contract: ThirdwebContract<any>) {
|
||||
return detectMethod({
|
||||
contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes the result of the getChainId function call.
|
||||
* @param result - The hexadecimal result to decode.
|
||||
* @returns The decoded result as per the FN_OUTPUTS definition.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { decodeGetChainIdResult } from "thirdweb/extensions/multicall3";
|
||||
* const result = decodeGetChainIdResult("...");
|
||||
* ```
|
||||
*/
|
||||
export function decodeGetChainIdResult(result: Hex) {
|
||||
return decodeAbiParameters(FN_OUTPUTS, result)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the "getChainId" function on the contract.
|
||||
* @param options - The options for the getChainId function.
|
||||
* @returns The parsed result of the function call.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { getChainId } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const result = await getChainId();
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export async function getChainId(options: BaseTransactionOptions) {
|
||||
return readContract({
|
||||
contract: options.contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
params: [],
|
||||
});
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
import { readContract } from "../../../../../transaction/read-contract.js";
|
||||
import type { BaseTransactionOptions } from "../../../../../transaction/types.js";
|
||||
|
||||
import { decodeAbiParameters } from "viem";
|
||||
import type { Hex } from "../../../../../utils/encoding/hex.js";
|
||||
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
||||
import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
|
||||
|
||||
export const FN_SELECTOR = "0xa8b0574e" as const;
|
||||
const FN_INPUTS = [] as const;
|
||||
const FN_OUTPUTS = [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "coinbase",
|
||||
type: "address",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Checks if the `getCurrentBlockCoinbase` method is supported by the given contract.
|
||||
* @param contract The ThirdwebContract.
|
||||
* @returns A promise that resolves to a boolean indicating if the `getCurrentBlockCoinbase` method is supported.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { isGetCurrentBlockCoinbaseSupported } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const supported = await isGetCurrentBlockCoinbaseSupported(contract);
|
||||
* ```
|
||||
*/
|
||||
export async function isGetCurrentBlockCoinbaseSupported(
|
||||
contract: ThirdwebContract<any>,
|
||||
) {
|
||||
return detectMethod({
|
||||
contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes the result of the getCurrentBlockCoinbase function call.
|
||||
* @param result - The hexadecimal result to decode.
|
||||
* @returns The decoded result as per the FN_OUTPUTS definition.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { decodeGetCurrentBlockCoinbaseResult } from "thirdweb/extensions/multicall3";
|
||||
* const result = decodeGetCurrentBlockCoinbaseResult("...");
|
||||
* ```
|
||||
*/
|
||||
export function decodeGetCurrentBlockCoinbaseResult(result: Hex) {
|
||||
return decodeAbiParameters(FN_OUTPUTS, result)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the "getCurrentBlockCoinbase" function on the contract.
|
||||
* @param options - The options for the getCurrentBlockCoinbase function.
|
||||
* @returns The parsed result of the function call.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { getCurrentBlockCoinbase } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const result = await getCurrentBlockCoinbase();
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export async function getCurrentBlockCoinbase(options: BaseTransactionOptions) {
|
||||
return readContract({
|
||||
contract: options.contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
params: [],
|
||||
});
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
import { readContract } from "../../../../../transaction/read-contract.js";
|
||||
import type { BaseTransactionOptions } from "../../../../../transaction/types.js";
|
||||
|
||||
import { decodeAbiParameters } from "viem";
|
||||
import type { Hex } from "../../../../../utils/encoding/hex.js";
|
||||
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
||||
import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
|
||||
|
||||
export const FN_SELECTOR = "0x72425d9d" as const;
|
||||
const FN_INPUTS = [] as const;
|
||||
const FN_OUTPUTS = [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "difficulty",
|
||||
type: "uint256",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Checks if the `getCurrentBlockDifficulty` method is supported by the given contract.
|
||||
* @param contract The ThirdwebContract.
|
||||
* @returns A promise that resolves to a boolean indicating if the `getCurrentBlockDifficulty` method is supported.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { isGetCurrentBlockDifficultySupported } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const supported = await isGetCurrentBlockDifficultySupported(contract);
|
||||
* ```
|
||||
*/
|
||||
export async function isGetCurrentBlockDifficultySupported(
|
||||
contract: ThirdwebContract<any>,
|
||||
) {
|
||||
return detectMethod({
|
||||
contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes the result of the getCurrentBlockDifficulty function call.
|
||||
* @param result - The hexadecimal result to decode.
|
||||
* @returns The decoded result as per the FN_OUTPUTS definition.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { decodeGetCurrentBlockDifficultyResult } from "thirdweb/extensions/multicall3";
|
||||
* const result = decodeGetCurrentBlockDifficultyResult("...");
|
||||
* ```
|
||||
*/
|
||||
export function decodeGetCurrentBlockDifficultyResult(result: Hex) {
|
||||
return decodeAbiParameters(FN_OUTPUTS, result)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the "getCurrentBlockDifficulty" function on the contract.
|
||||
* @param options - The options for the getCurrentBlockDifficulty function.
|
||||
* @returns The parsed result of the function call.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { getCurrentBlockDifficulty } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const result = await getCurrentBlockDifficulty();
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export async function getCurrentBlockDifficulty(
|
||||
options: BaseTransactionOptions,
|
||||
) {
|
||||
return readContract({
|
||||
contract: options.contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
params: [],
|
||||
});
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
import { readContract } from "../../../../../transaction/read-contract.js";
|
||||
import type { BaseTransactionOptions } from "../../../../../transaction/types.js";
|
||||
|
||||
import { decodeAbiParameters } from "viem";
|
||||
import type { Hex } from "../../../../../utils/encoding/hex.js";
|
||||
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
||||
import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
|
||||
|
||||
export const FN_SELECTOR = "0x86d516e8" as const;
|
||||
const FN_INPUTS = [] as const;
|
||||
const FN_OUTPUTS = [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "gaslimit",
|
||||
type: "uint256",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Checks if the `getCurrentBlockGasLimit` method is supported by the given contract.
|
||||
* @param contract The ThirdwebContract.
|
||||
* @returns A promise that resolves to a boolean indicating if the `getCurrentBlockGasLimit` method is supported.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { isGetCurrentBlockGasLimitSupported } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const supported = await isGetCurrentBlockGasLimitSupported(contract);
|
||||
* ```
|
||||
*/
|
||||
export async function isGetCurrentBlockGasLimitSupported(
|
||||
contract: ThirdwebContract<any>,
|
||||
) {
|
||||
return detectMethod({
|
||||
contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes the result of the getCurrentBlockGasLimit function call.
|
||||
* @param result - The hexadecimal result to decode.
|
||||
* @returns The decoded result as per the FN_OUTPUTS definition.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { decodeGetCurrentBlockGasLimitResult } from "thirdweb/extensions/multicall3";
|
||||
* const result = decodeGetCurrentBlockGasLimitResult("...");
|
||||
* ```
|
||||
*/
|
||||
export function decodeGetCurrentBlockGasLimitResult(result: Hex) {
|
||||
return decodeAbiParameters(FN_OUTPUTS, result)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the "getCurrentBlockGasLimit" function on the contract.
|
||||
* @param options - The options for the getCurrentBlockGasLimit function.
|
||||
* @returns The parsed result of the function call.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { getCurrentBlockGasLimit } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const result = await getCurrentBlockGasLimit();
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export async function getCurrentBlockGasLimit(options: BaseTransactionOptions) {
|
||||
return readContract({
|
||||
contract: options.contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
params: [],
|
||||
});
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
import { readContract } from "../../../../../transaction/read-contract.js";
|
||||
import type { BaseTransactionOptions } from "../../../../../transaction/types.js";
|
||||
|
||||
import { decodeAbiParameters } from "viem";
|
||||
import type { Hex } from "../../../../../utils/encoding/hex.js";
|
||||
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
||||
import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
|
||||
|
||||
export const FN_SELECTOR = "0x0f28c97d" as const;
|
||||
const FN_INPUTS = [] as const;
|
||||
const FN_OUTPUTS = [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "timestamp",
|
||||
type: "uint256",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Checks if the `getCurrentBlockTimestamp` method is supported by the given contract.
|
||||
* @param contract The ThirdwebContract.
|
||||
* @returns A promise that resolves to a boolean indicating if the `getCurrentBlockTimestamp` method is supported.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { isGetCurrentBlockTimestampSupported } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const supported = await isGetCurrentBlockTimestampSupported(contract);
|
||||
* ```
|
||||
*/
|
||||
export async function isGetCurrentBlockTimestampSupported(
|
||||
contract: ThirdwebContract<any>,
|
||||
) {
|
||||
return detectMethod({
|
||||
contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes the result of the getCurrentBlockTimestamp function call.
|
||||
* @param result - The hexadecimal result to decode.
|
||||
* @returns The decoded result as per the FN_OUTPUTS definition.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { decodeGetCurrentBlockTimestampResult } from "thirdweb/extensions/multicall3";
|
||||
* const result = decodeGetCurrentBlockTimestampResult("...");
|
||||
* ```
|
||||
*/
|
||||
export function decodeGetCurrentBlockTimestampResult(result: Hex) {
|
||||
return decodeAbiParameters(FN_OUTPUTS, result)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the "getCurrentBlockTimestamp" function on the contract.
|
||||
* @param options - The options for the getCurrentBlockTimestamp function.
|
||||
* @returns The parsed result of the function call.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { getCurrentBlockTimestamp } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const result = await getCurrentBlockTimestamp();
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export async function getCurrentBlockTimestamp(
|
||||
options: BaseTransactionOptions,
|
||||
) {
|
||||
return readContract({
|
||||
contract: options.contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
params: [],
|
||||
});
|
||||
}
|
||||
Generated
+135
@@ -0,0 +1,135 @@
|
||||
import type { AbiParameterToPrimitiveType } from "abitype";
|
||||
import { readContract } from "../../../../../transaction/read-contract.js";
|
||||
import type { BaseTransactionOptions } from "../../../../../transaction/types.js";
|
||||
import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js";
|
||||
import { decodeAbiParameters } from "viem";
|
||||
import type { Hex } from "../../../../../utils/encoding/hex.js";
|
||||
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
||||
import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
|
||||
|
||||
/**
|
||||
* Represents the parameters for the "getEthBalance" function.
|
||||
*/
|
||||
export type GetEthBalanceParams = {
|
||||
addr: AbiParameterToPrimitiveType<{
|
||||
internalType: "address";
|
||||
name: "addr";
|
||||
type: "address";
|
||||
}>;
|
||||
};
|
||||
|
||||
export const FN_SELECTOR = "0x4d2301cc" as const;
|
||||
const FN_INPUTS = [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "addr",
|
||||
type: "address",
|
||||
},
|
||||
] as const;
|
||||
const FN_OUTPUTS = [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "balance",
|
||||
type: "uint256",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Checks if the `getEthBalance` method is supported by the given contract.
|
||||
* @param contract The ThirdwebContract.
|
||||
* @returns A promise that resolves to a boolean indicating if the `getEthBalance` method is supported.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { isGetEthBalanceSupported } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const supported = await isGetEthBalanceSupported(contract);
|
||||
* ```
|
||||
*/
|
||||
export async function isGetEthBalanceSupported(
|
||||
contract: ThirdwebContract<any>,
|
||||
) {
|
||||
return detectMethod({
|
||||
contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes the parameters for the "getEthBalance" function.
|
||||
* @param options - The options for the getEthBalance function.
|
||||
* @returns The encoded ABI parameters.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { encodeGetEthBalanceParams } "thirdweb/extensions/multicall3";
|
||||
* const result = encodeGetEthBalanceParams({
|
||||
* addr: ...,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function encodeGetEthBalanceParams(options: GetEthBalanceParams) {
|
||||
return encodeAbiParameters(FN_INPUTS, [options.addr]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes the "getEthBalance" function into a Hex string with its parameters.
|
||||
* @param options - The options for the getEthBalance function.
|
||||
* @returns The encoded hexadecimal string.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { encodeGetEthBalance } "thirdweb/extensions/multicall3";
|
||||
* const result = encodeGetEthBalance({
|
||||
* addr: ...,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function encodeGetEthBalance(options: GetEthBalanceParams) {
|
||||
// we do a "manual" concat here to avoid the overhead of the "concatHex" function
|
||||
// we can do this because we know the specific formats of the values
|
||||
return (FN_SELECTOR +
|
||||
encodeGetEthBalanceParams(options).slice(
|
||||
2,
|
||||
)) as `${typeof FN_SELECTOR}${string}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes the result of the getEthBalance function call.
|
||||
* @param result - The hexadecimal result to decode.
|
||||
* @returns The decoded result as per the FN_OUTPUTS definition.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { decodeGetEthBalanceResult } from "thirdweb/extensions/multicall3";
|
||||
* const result = decodeGetEthBalanceResult("...");
|
||||
* ```
|
||||
*/
|
||||
export function decodeGetEthBalanceResult(result: Hex) {
|
||||
return decodeAbiParameters(FN_OUTPUTS, result)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the "getEthBalance" function on the contract.
|
||||
* @param options - The options for the getEthBalance function.
|
||||
* @returns The parsed result of the function call.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { getEthBalance } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const result = await getEthBalance({
|
||||
* addr: ...,
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export async function getEthBalance(
|
||||
options: BaseTransactionOptions<GetEthBalanceParams>,
|
||||
) {
|
||||
return readContract({
|
||||
contract: options.contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
params: [options.addr],
|
||||
});
|
||||
}
|
||||
Generated
+74
@@ -0,0 +1,74 @@
|
||||
import { readContract } from "../../../../../transaction/read-contract.js";
|
||||
import type { BaseTransactionOptions } from "../../../../../transaction/types.js";
|
||||
|
||||
import { decodeAbiParameters } from "viem";
|
||||
import type { Hex } from "../../../../../utils/encoding/hex.js";
|
||||
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
||||
import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
|
||||
|
||||
export const FN_SELECTOR = "0x27e86d6e" as const;
|
||||
const FN_INPUTS = [] as const;
|
||||
const FN_OUTPUTS = [
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "blockHash",
|
||||
type: "bytes32",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Checks if the `getLastBlockHash` method is supported by the given contract.
|
||||
* @param contract The ThirdwebContract.
|
||||
* @returns A promise that resolves to a boolean indicating if the `getLastBlockHash` method is supported.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { isGetLastBlockHashSupported } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const supported = await isGetLastBlockHashSupported(contract);
|
||||
* ```
|
||||
*/
|
||||
export async function isGetLastBlockHashSupported(
|
||||
contract: ThirdwebContract<any>,
|
||||
) {
|
||||
return detectMethod({
|
||||
contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes the result of the getLastBlockHash function call.
|
||||
* @param result - The hexadecimal result to decode.
|
||||
* @returns The decoded result as per the FN_OUTPUTS definition.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { decodeGetLastBlockHashResult } from "thirdweb/extensions/multicall3";
|
||||
* const result = decodeGetLastBlockHashResult("...");
|
||||
* ```
|
||||
*/
|
||||
export function decodeGetLastBlockHashResult(result: Hex) {
|
||||
return decodeAbiParameters(FN_OUTPUTS, result)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the "getLastBlockHash" function on the contract.
|
||||
* @param options - The options for the getLastBlockHash function.
|
||||
* @returns The parsed result of the function call.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { getLastBlockHash } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const result = await getLastBlockHash();
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export async function getLastBlockHash(options: BaseTransactionOptions) {
|
||||
return readContract({
|
||||
contract: options.contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
params: [],
|
||||
});
|
||||
}
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
import type { AbiParameterToPrimitiveType } from "abitype";
|
||||
import type {
|
||||
BaseTransactionOptions,
|
||||
WithOverrides,
|
||||
} from "../../../../../transaction/types.js";
|
||||
import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js";
|
||||
import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js";
|
||||
import { once } from "../../../../../utils/promise/once.js";
|
||||
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
||||
import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
|
||||
|
||||
/**
|
||||
* Represents the parameters for the "aggregate" function.
|
||||
*/
|
||||
export type AggregateParams = WithOverrides<{
|
||||
calls: AbiParameterToPrimitiveType<{
|
||||
components: [
|
||||
{ internalType: "address"; name: "target"; type: "address" },
|
||||
{ internalType: "bytes"; name: "callData"; type: "bytes" },
|
||||
];
|
||||
internalType: "struct Multicall3.Call[]";
|
||||
name: "calls";
|
||||
type: "tuple[]";
|
||||
}>;
|
||||
}>;
|
||||
|
||||
export const FN_SELECTOR = "0x252dba42" as const;
|
||||
const FN_INPUTS = [
|
||||
{
|
||||
components: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "target",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "callData",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct Multicall3.Call[]",
|
||||
name: "calls",
|
||||
type: "tuple[]",
|
||||
},
|
||||
] as const;
|
||||
const FN_OUTPUTS = [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "blockNumber",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "bytes[]",
|
||||
name: "returnData",
|
||||
type: "bytes[]",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Checks if the `aggregate` method is supported by the given contract.
|
||||
* @param contract The ThirdwebContract.
|
||||
* @returns A promise that resolves to a boolean indicating if the `aggregate` method is supported.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { isAggregateSupported } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const supported = await isAggregateSupported(contract);
|
||||
* ```
|
||||
*/
|
||||
export async function isAggregateSupported(contract: ThirdwebContract<any>) {
|
||||
return detectMethod({
|
||||
contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes the parameters for the "aggregate" function.
|
||||
* @param options - The options for the aggregate function.
|
||||
* @returns The encoded ABI parameters.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { encodeAggregateParams } "thirdweb/extensions/multicall3";
|
||||
* const result = encodeAggregateParams({
|
||||
* calls: ...,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function encodeAggregateParams(options: AggregateParams) {
|
||||
return encodeAbiParameters(FN_INPUTS, [options.calls]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes the "aggregate" function into a Hex string with its parameters.
|
||||
* @param options - The options for the aggregate function.
|
||||
* @returns The encoded hexadecimal string.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { encodeAggregate } "thirdweb/extensions/multicall3";
|
||||
* const result = encodeAggregate({
|
||||
* calls: ...,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function encodeAggregate(options: AggregateParams) {
|
||||
// we do a "manual" concat here to avoid the overhead of the "concatHex" function
|
||||
// we can do this because we know the specific formats of the values
|
||||
return (FN_SELECTOR +
|
||||
encodeAggregateParams(options).slice(
|
||||
2,
|
||||
)) as `${typeof FN_SELECTOR}${string}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the "aggregate" function on the contract.
|
||||
* @param options - The options for the "aggregate" function.
|
||||
* @returns A prepared transaction object.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { aggregate } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const transaction = aggregate({
|
||||
* contract,
|
||||
* calls: ...,
|
||||
* });
|
||||
*
|
||||
* // Send the transaction
|
||||
* ...
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export function aggregate(
|
||||
options: BaseTransactionOptions<
|
||||
| AggregateParams
|
||||
| {
|
||||
asyncParams: () => Promise<AggregateParams>;
|
||||
}
|
||||
>,
|
||||
) {
|
||||
const asyncOptions = once(async () => {
|
||||
return "asyncParams" in options ? await options.asyncParams() : options;
|
||||
});
|
||||
|
||||
return prepareContractCall({
|
||||
contract: options.contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
params: async () => {
|
||||
const resolvedOptions = await asyncOptions();
|
||||
return [resolvedOptions.calls] as const;
|
||||
},
|
||||
value: async () => (await asyncOptions()).overrides?.value,
|
||||
});
|
||||
}
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
import type { AbiParameterToPrimitiveType } from "abitype";
|
||||
import type {
|
||||
BaseTransactionOptions,
|
||||
WithOverrides,
|
||||
} from "../../../../../transaction/types.js";
|
||||
import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js";
|
||||
import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js";
|
||||
import { once } from "../../../../../utils/promise/once.js";
|
||||
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
||||
import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
|
||||
|
||||
/**
|
||||
* Represents the parameters for the "aggregate3" function.
|
||||
*/
|
||||
export type Aggregate3Params = WithOverrides<{
|
||||
calls: AbiParameterToPrimitiveType<{
|
||||
components: [
|
||||
{ internalType: "address"; name: "target"; type: "address" },
|
||||
{ internalType: "bool"; name: "allowFailure"; type: "bool" },
|
||||
{ internalType: "bytes"; name: "callData"; type: "bytes" },
|
||||
];
|
||||
internalType: "struct Multicall3.Call3[]";
|
||||
name: "calls";
|
||||
type: "tuple[]";
|
||||
}>;
|
||||
}>;
|
||||
|
||||
export const FN_SELECTOR = "0x82ad56cb" as const;
|
||||
const FN_INPUTS = [
|
||||
{
|
||||
components: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "target",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "allowFailure",
|
||||
type: "bool",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "callData",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct Multicall3.Call3[]",
|
||||
name: "calls",
|
||||
type: "tuple[]",
|
||||
},
|
||||
] as const;
|
||||
const FN_OUTPUTS = [
|
||||
{
|
||||
components: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "success",
|
||||
type: "bool",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "returnData",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct Multicall3.Result[]",
|
||||
name: "returnData",
|
||||
type: "tuple[]",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Checks if the `aggregate3` method is supported by the given contract.
|
||||
* @param contract The ThirdwebContract.
|
||||
* @returns A promise that resolves to a boolean indicating if the `aggregate3` method is supported.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { isAggregate3Supported } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const supported = await isAggregate3Supported(contract);
|
||||
* ```
|
||||
*/
|
||||
export async function isAggregate3Supported(contract: ThirdwebContract<any>) {
|
||||
return detectMethod({
|
||||
contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes the parameters for the "aggregate3" function.
|
||||
* @param options - The options for the aggregate3 function.
|
||||
* @returns The encoded ABI parameters.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { encodeAggregate3Params } "thirdweb/extensions/multicall3";
|
||||
* const result = encodeAggregate3Params({
|
||||
* calls: ...,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function encodeAggregate3Params(options: Aggregate3Params) {
|
||||
return encodeAbiParameters(FN_INPUTS, [options.calls]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes the "aggregate3" function into a Hex string with its parameters.
|
||||
* @param options - The options for the aggregate3 function.
|
||||
* @returns The encoded hexadecimal string.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { encodeAggregate3 } "thirdweb/extensions/multicall3";
|
||||
* const result = encodeAggregate3({
|
||||
* calls: ...,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function encodeAggregate3(options: Aggregate3Params) {
|
||||
// we do a "manual" concat here to avoid the overhead of the "concatHex" function
|
||||
// we can do this because we know the specific formats of the values
|
||||
return (FN_SELECTOR +
|
||||
encodeAggregate3Params(options).slice(
|
||||
2,
|
||||
)) as `${typeof FN_SELECTOR}${string}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the "aggregate3" function on the contract.
|
||||
* @param options - The options for the "aggregate3" function.
|
||||
* @returns A prepared transaction object.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { aggregate3 } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const transaction = aggregate3({
|
||||
* contract,
|
||||
* calls: ...,
|
||||
* });
|
||||
*
|
||||
* // Send the transaction
|
||||
* ...
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export function aggregate3(
|
||||
options: BaseTransactionOptions<
|
||||
| Aggregate3Params
|
||||
| {
|
||||
asyncParams: () => Promise<Aggregate3Params>;
|
||||
}
|
||||
>,
|
||||
) {
|
||||
const asyncOptions = once(async () => {
|
||||
return "asyncParams" in options ? await options.asyncParams() : options;
|
||||
});
|
||||
|
||||
return prepareContractCall({
|
||||
contract: options.contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
params: async () => {
|
||||
const resolvedOptions = await asyncOptions();
|
||||
return [resolvedOptions.calls] as const;
|
||||
},
|
||||
value: async () => (await asyncOptions()).overrides?.value,
|
||||
});
|
||||
}
|
||||
Generated
+179
@@ -0,0 +1,179 @@
|
||||
import type { AbiParameterToPrimitiveType } from "abitype";
|
||||
import type {
|
||||
BaseTransactionOptions,
|
||||
WithOverrides,
|
||||
} from "../../../../../transaction/types.js";
|
||||
import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js";
|
||||
import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js";
|
||||
import { once } from "../../../../../utils/promise/once.js";
|
||||
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
||||
import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
|
||||
|
||||
/**
|
||||
* Represents the parameters for the "aggregate3Value" function.
|
||||
*/
|
||||
export type Aggregate3ValueParams = WithOverrides<{
|
||||
calls: AbiParameterToPrimitiveType<{
|
||||
components: [
|
||||
{ internalType: "address"; name: "target"; type: "address" },
|
||||
{ internalType: "bool"; name: "allowFailure"; type: "bool" },
|
||||
{ internalType: "uint256"; name: "value"; type: "uint256" },
|
||||
{ internalType: "bytes"; name: "callData"; type: "bytes" },
|
||||
];
|
||||
internalType: "struct Multicall3.Call3Value[]";
|
||||
name: "calls";
|
||||
type: "tuple[]";
|
||||
}>;
|
||||
}>;
|
||||
|
||||
export const FN_SELECTOR = "0x174dea71" as const;
|
||||
const FN_INPUTS = [
|
||||
{
|
||||
components: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "target",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "allowFailure",
|
||||
type: "bool",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "value",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "callData",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct Multicall3.Call3Value[]",
|
||||
name: "calls",
|
||||
type: "tuple[]",
|
||||
},
|
||||
] as const;
|
||||
const FN_OUTPUTS = [
|
||||
{
|
||||
components: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "success",
|
||||
type: "bool",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "returnData",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct Multicall3.Result[]",
|
||||
name: "returnData",
|
||||
type: "tuple[]",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Checks if the `aggregate3Value` method is supported by the given contract.
|
||||
* @param contract The ThirdwebContract.
|
||||
* @returns A promise that resolves to a boolean indicating if the `aggregate3Value` method is supported.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { isAggregate3ValueSupported } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const supported = await isAggregate3ValueSupported(contract);
|
||||
* ```
|
||||
*/
|
||||
export async function isAggregate3ValueSupported(
|
||||
contract: ThirdwebContract<any>,
|
||||
) {
|
||||
return detectMethod({
|
||||
contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes the parameters for the "aggregate3Value" function.
|
||||
* @param options - The options for the aggregate3Value function.
|
||||
* @returns The encoded ABI parameters.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { encodeAggregate3ValueParams } "thirdweb/extensions/multicall3";
|
||||
* const result = encodeAggregate3ValueParams({
|
||||
* calls: ...,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function encodeAggregate3ValueParams(options: Aggregate3ValueParams) {
|
||||
return encodeAbiParameters(FN_INPUTS, [options.calls]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes the "aggregate3Value" function into a Hex string with its parameters.
|
||||
* @param options - The options for the aggregate3Value function.
|
||||
* @returns The encoded hexadecimal string.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { encodeAggregate3Value } "thirdweb/extensions/multicall3";
|
||||
* const result = encodeAggregate3Value({
|
||||
* calls: ...,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function encodeAggregate3Value(options: Aggregate3ValueParams) {
|
||||
// we do a "manual" concat here to avoid the overhead of the "concatHex" function
|
||||
// we can do this because we know the specific formats of the values
|
||||
return (FN_SELECTOR +
|
||||
encodeAggregate3ValueParams(options).slice(
|
||||
2,
|
||||
)) as `${typeof FN_SELECTOR}${string}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the "aggregate3Value" function on the contract.
|
||||
* @param options - The options for the "aggregate3Value" function.
|
||||
* @returns A prepared transaction object.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { aggregate3Value } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const transaction = aggregate3Value({
|
||||
* contract,
|
||||
* calls: ...,
|
||||
* });
|
||||
*
|
||||
* // Send the transaction
|
||||
* ...
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export function aggregate3Value(
|
||||
options: BaseTransactionOptions<
|
||||
| Aggregate3ValueParams
|
||||
| {
|
||||
asyncParams: () => Promise<Aggregate3ValueParams>;
|
||||
}
|
||||
>,
|
||||
) {
|
||||
const asyncOptions = once(async () => {
|
||||
return "asyncParams" in options ? await options.asyncParams() : options;
|
||||
});
|
||||
|
||||
return prepareContractCall({
|
||||
contract: options.contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
params: async () => {
|
||||
const resolvedOptions = await asyncOptions();
|
||||
return [resolvedOptions.calls] as const;
|
||||
},
|
||||
value: async () => (await asyncOptions()).overrides?.value,
|
||||
});
|
||||
}
|
||||
Generated
+179
@@ -0,0 +1,179 @@
|
||||
import type { AbiParameterToPrimitiveType } from "abitype";
|
||||
import type {
|
||||
BaseTransactionOptions,
|
||||
WithOverrides,
|
||||
} from "../../../../../transaction/types.js";
|
||||
import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js";
|
||||
import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js";
|
||||
import { once } from "../../../../../utils/promise/once.js";
|
||||
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
||||
import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
|
||||
|
||||
/**
|
||||
* Represents the parameters for the "blockAndAggregate" function.
|
||||
*/
|
||||
export type BlockAndAggregateParams = WithOverrides<{
|
||||
calls: AbiParameterToPrimitiveType<{
|
||||
components: [
|
||||
{ internalType: "address"; name: "target"; type: "address" },
|
||||
{ internalType: "bytes"; name: "callData"; type: "bytes" },
|
||||
];
|
||||
internalType: "struct Multicall3.Call[]";
|
||||
name: "calls";
|
||||
type: "tuple[]";
|
||||
}>;
|
||||
}>;
|
||||
|
||||
export const FN_SELECTOR = "0xc3077fa9" as const;
|
||||
const FN_INPUTS = [
|
||||
{
|
||||
components: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "target",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "callData",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct Multicall3.Call[]",
|
||||
name: "calls",
|
||||
type: "tuple[]",
|
||||
},
|
||||
] as const;
|
||||
const FN_OUTPUTS = [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "blockNumber",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "blockHash",
|
||||
type: "bytes32",
|
||||
},
|
||||
{
|
||||
components: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "success",
|
||||
type: "bool",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "returnData",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct Multicall3.Result[]",
|
||||
name: "returnData",
|
||||
type: "tuple[]",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Checks if the `blockAndAggregate` method is supported by the given contract.
|
||||
* @param contract The ThirdwebContract.
|
||||
* @returns A promise that resolves to a boolean indicating if the `blockAndAggregate` method is supported.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { isBlockAndAggregateSupported } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const supported = await isBlockAndAggregateSupported(contract);
|
||||
* ```
|
||||
*/
|
||||
export async function isBlockAndAggregateSupported(
|
||||
contract: ThirdwebContract<any>,
|
||||
) {
|
||||
return detectMethod({
|
||||
contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes the parameters for the "blockAndAggregate" function.
|
||||
* @param options - The options for the blockAndAggregate function.
|
||||
* @returns The encoded ABI parameters.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { encodeBlockAndAggregateParams } "thirdweb/extensions/multicall3";
|
||||
* const result = encodeBlockAndAggregateParams({
|
||||
* calls: ...,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function encodeBlockAndAggregateParams(
|
||||
options: BlockAndAggregateParams,
|
||||
) {
|
||||
return encodeAbiParameters(FN_INPUTS, [options.calls]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes the "blockAndAggregate" function into a Hex string with its parameters.
|
||||
* @param options - The options for the blockAndAggregate function.
|
||||
* @returns The encoded hexadecimal string.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { encodeBlockAndAggregate } "thirdweb/extensions/multicall3";
|
||||
* const result = encodeBlockAndAggregate({
|
||||
* calls: ...,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function encodeBlockAndAggregate(options: BlockAndAggregateParams) {
|
||||
// we do a "manual" concat here to avoid the overhead of the "concatHex" function
|
||||
// we can do this because we know the specific formats of the values
|
||||
return (FN_SELECTOR +
|
||||
encodeBlockAndAggregateParams(options).slice(
|
||||
2,
|
||||
)) as `${typeof FN_SELECTOR}${string}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the "blockAndAggregate" function on the contract.
|
||||
* @param options - The options for the "blockAndAggregate" function.
|
||||
* @returns A prepared transaction object.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { blockAndAggregate } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const transaction = blockAndAggregate({
|
||||
* contract,
|
||||
* calls: ...,
|
||||
* });
|
||||
*
|
||||
* // Send the transaction
|
||||
* ...
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export function blockAndAggregate(
|
||||
options: BaseTransactionOptions<
|
||||
| BlockAndAggregateParams
|
||||
| {
|
||||
asyncParams: () => Promise<BlockAndAggregateParams>;
|
||||
}
|
||||
>,
|
||||
) {
|
||||
const asyncOptions = once(async () => {
|
||||
return "asyncParams" in options ? await options.asyncParams() : options;
|
||||
});
|
||||
|
||||
return prepareContractCall({
|
||||
contract: options.contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
params: async () => {
|
||||
const resolvedOptions = await asyncOptions();
|
||||
return [resolvedOptions.calls] as const;
|
||||
},
|
||||
value: async () => (await asyncOptions()).overrides?.value,
|
||||
});
|
||||
}
|
||||
Generated
+181
@@ -0,0 +1,181 @@
|
||||
import type { AbiParameterToPrimitiveType } from "abitype";
|
||||
import type {
|
||||
BaseTransactionOptions,
|
||||
WithOverrides,
|
||||
} from "../../../../../transaction/types.js";
|
||||
import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js";
|
||||
import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js";
|
||||
import { once } from "../../../../../utils/promise/once.js";
|
||||
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
||||
import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
|
||||
|
||||
/**
|
||||
* Represents the parameters for the "tryAggregate" function.
|
||||
*/
|
||||
export type TryAggregateParams = WithOverrides<{
|
||||
requireSuccess: AbiParameterToPrimitiveType<{
|
||||
internalType: "bool";
|
||||
name: "requireSuccess";
|
||||
type: "bool";
|
||||
}>;
|
||||
calls: AbiParameterToPrimitiveType<{
|
||||
components: [
|
||||
{ internalType: "address"; name: "target"; type: "address" },
|
||||
{ internalType: "bytes"; name: "callData"; type: "bytes" },
|
||||
];
|
||||
internalType: "struct Multicall3.Call[]";
|
||||
name: "calls";
|
||||
type: "tuple[]";
|
||||
}>;
|
||||
}>;
|
||||
|
||||
export const FN_SELECTOR = "0xbce38bd7" as const;
|
||||
const FN_INPUTS = [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "requireSuccess",
|
||||
type: "bool",
|
||||
},
|
||||
{
|
||||
components: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "target",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "callData",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct Multicall3.Call[]",
|
||||
name: "calls",
|
||||
type: "tuple[]",
|
||||
},
|
||||
] as const;
|
||||
const FN_OUTPUTS = [
|
||||
{
|
||||
components: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "success",
|
||||
type: "bool",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "returnData",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct Multicall3.Result[]",
|
||||
name: "returnData",
|
||||
type: "tuple[]",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Checks if the `tryAggregate` method is supported by the given contract.
|
||||
* @param contract The ThirdwebContract.
|
||||
* @returns A promise that resolves to a boolean indicating if the `tryAggregate` method is supported.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { isTryAggregateSupported } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const supported = await isTryAggregateSupported(contract);
|
||||
* ```
|
||||
*/
|
||||
export async function isTryAggregateSupported(contract: ThirdwebContract<any>) {
|
||||
return detectMethod({
|
||||
contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes the parameters for the "tryAggregate" function.
|
||||
* @param options - The options for the tryAggregate function.
|
||||
* @returns The encoded ABI parameters.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { encodeTryAggregateParams } "thirdweb/extensions/multicall3";
|
||||
* const result = encodeTryAggregateParams({
|
||||
* requireSuccess: ...,
|
||||
* calls: ...,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function encodeTryAggregateParams(options: TryAggregateParams) {
|
||||
return encodeAbiParameters(FN_INPUTS, [
|
||||
options.requireSuccess,
|
||||
options.calls,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes the "tryAggregate" function into a Hex string with its parameters.
|
||||
* @param options - The options for the tryAggregate function.
|
||||
* @returns The encoded hexadecimal string.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { encodeTryAggregate } "thirdweb/extensions/multicall3";
|
||||
* const result = encodeTryAggregate({
|
||||
* requireSuccess: ...,
|
||||
* calls: ...,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function encodeTryAggregate(options: TryAggregateParams) {
|
||||
// we do a "manual" concat here to avoid the overhead of the "concatHex" function
|
||||
// we can do this because we know the specific formats of the values
|
||||
return (FN_SELECTOR +
|
||||
encodeTryAggregateParams(options).slice(
|
||||
2,
|
||||
)) as `${typeof FN_SELECTOR}${string}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the "tryAggregate" function on the contract.
|
||||
* @param options - The options for the "tryAggregate" function.
|
||||
* @returns A prepared transaction object.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { tryAggregate } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const transaction = tryAggregate({
|
||||
* contract,
|
||||
* requireSuccess: ...,
|
||||
* calls: ...,
|
||||
* });
|
||||
*
|
||||
* // Send the transaction
|
||||
* ...
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export function tryAggregate(
|
||||
options: BaseTransactionOptions<
|
||||
| TryAggregateParams
|
||||
| {
|
||||
asyncParams: () => Promise<TryAggregateParams>;
|
||||
}
|
||||
>,
|
||||
) {
|
||||
const asyncOptions = once(async () => {
|
||||
return "asyncParams" in options ? await options.asyncParams() : options;
|
||||
});
|
||||
|
||||
return prepareContractCall({
|
||||
contract: options.contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
params: async () => {
|
||||
const resolvedOptions = await asyncOptions();
|
||||
return [resolvedOptions.requireSuccess, resolvedOptions.calls] as const;
|
||||
},
|
||||
value: async () => (await asyncOptions()).overrides?.value,
|
||||
});
|
||||
}
|
||||
Generated
+197
@@ -0,0 +1,197 @@
|
||||
import type { AbiParameterToPrimitiveType } from "abitype";
|
||||
import type {
|
||||
BaseTransactionOptions,
|
||||
WithOverrides,
|
||||
} from "../../../../../transaction/types.js";
|
||||
import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js";
|
||||
import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js";
|
||||
import { once } from "../../../../../utils/promise/once.js";
|
||||
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
||||
import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
|
||||
|
||||
/**
|
||||
* Represents the parameters for the "tryBlockAndAggregate" function.
|
||||
*/
|
||||
export type TryBlockAndAggregateParams = WithOverrides<{
|
||||
requireSuccess: AbiParameterToPrimitiveType<{
|
||||
internalType: "bool";
|
||||
name: "requireSuccess";
|
||||
type: "bool";
|
||||
}>;
|
||||
calls: AbiParameterToPrimitiveType<{
|
||||
components: [
|
||||
{ internalType: "address"; name: "target"; type: "address" },
|
||||
{ internalType: "bytes"; name: "callData"; type: "bytes" },
|
||||
];
|
||||
internalType: "struct Multicall3.Call[]";
|
||||
name: "calls";
|
||||
type: "tuple[]";
|
||||
}>;
|
||||
}>;
|
||||
|
||||
export const FN_SELECTOR = "0x399542e9" as const;
|
||||
const FN_INPUTS = [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "requireSuccess",
|
||||
type: "bool",
|
||||
},
|
||||
{
|
||||
components: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "target",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "callData",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct Multicall3.Call[]",
|
||||
name: "calls",
|
||||
type: "tuple[]",
|
||||
},
|
||||
] as const;
|
||||
const FN_OUTPUTS = [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "blockNumber",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "blockHash",
|
||||
type: "bytes32",
|
||||
},
|
||||
{
|
||||
components: [
|
||||
{
|
||||
internalType: "bool",
|
||||
name: "success",
|
||||
type: "bool",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "returnData",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct Multicall3.Result[]",
|
||||
name: "returnData",
|
||||
type: "tuple[]",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Checks if the `tryBlockAndAggregate` method is supported by the given contract.
|
||||
* @param contract The ThirdwebContract.
|
||||
* @returns A promise that resolves to a boolean indicating if the `tryBlockAndAggregate` method is supported.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { isTryBlockAndAggregateSupported } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const supported = await isTryBlockAndAggregateSupported(contract);
|
||||
* ```
|
||||
*/
|
||||
export async function isTryBlockAndAggregateSupported(
|
||||
contract: ThirdwebContract<any>,
|
||||
) {
|
||||
return detectMethod({
|
||||
contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes the parameters for the "tryBlockAndAggregate" function.
|
||||
* @param options - The options for the tryBlockAndAggregate function.
|
||||
* @returns The encoded ABI parameters.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { encodeTryBlockAndAggregateParams } "thirdweb/extensions/multicall3";
|
||||
* const result = encodeTryBlockAndAggregateParams({
|
||||
* requireSuccess: ...,
|
||||
* calls: ...,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function encodeTryBlockAndAggregateParams(
|
||||
options: TryBlockAndAggregateParams,
|
||||
) {
|
||||
return encodeAbiParameters(FN_INPUTS, [
|
||||
options.requireSuccess,
|
||||
options.calls,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes the "tryBlockAndAggregate" function into a Hex string with its parameters.
|
||||
* @param options - The options for the tryBlockAndAggregate function.
|
||||
* @returns The encoded hexadecimal string.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { encodeTryBlockAndAggregate } "thirdweb/extensions/multicall3";
|
||||
* const result = encodeTryBlockAndAggregate({
|
||||
* requireSuccess: ...,
|
||||
* calls: ...,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function encodeTryBlockAndAggregate(
|
||||
options: TryBlockAndAggregateParams,
|
||||
) {
|
||||
// we do a "manual" concat here to avoid the overhead of the "concatHex" function
|
||||
// we can do this because we know the specific formats of the values
|
||||
return (FN_SELECTOR +
|
||||
encodeTryBlockAndAggregateParams(options).slice(
|
||||
2,
|
||||
)) as `${typeof FN_SELECTOR}${string}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the "tryBlockAndAggregate" function on the contract.
|
||||
* @param options - The options for the "tryBlockAndAggregate" function.
|
||||
* @returns A prepared transaction object.
|
||||
* @extension MULTICALL3
|
||||
* @example
|
||||
* ```ts
|
||||
* import { tryBlockAndAggregate } from "thirdweb/extensions/multicall3";
|
||||
*
|
||||
* const transaction = tryBlockAndAggregate({
|
||||
* contract,
|
||||
* requireSuccess: ...,
|
||||
* calls: ...,
|
||||
* });
|
||||
*
|
||||
* // Send the transaction
|
||||
* ...
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export function tryBlockAndAggregate(
|
||||
options: BaseTransactionOptions<
|
||||
| TryBlockAndAggregateParams
|
||||
| {
|
||||
asyncParams: () => Promise<TryBlockAndAggregateParams>;
|
||||
}
|
||||
>,
|
||||
) {
|
||||
const asyncOptions = once(async () => {
|
||||
return "asyncParams" in options ? await options.asyncParams() : options;
|
||||
});
|
||||
|
||||
return prepareContractCall({
|
||||
contract: options.contract,
|
||||
method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
|
||||
params: async () => {
|
||||
const resolvedOptions = await asyncOptions();
|
||||
return [resolvedOptions.requireSuccess, resolvedOptions.calls] as const;
|
||||
},
|
||||
value: async () => (await asyncOptions()).overrides?.value,
|
||||
});
|
||||
}
|
||||
@@ -109,7 +109,7 @@ export function useSetActiveWallet() {
|
||||
* @example
|
||||
* ```jsx
|
||||
* import { useConnect } from "thirdweb/react";
|
||||
* import { metamaskWallet } from "thirdweb/wallets";
|
||||
* import { createWallet } from "thirdweb/wallets";
|
||||
*
|
||||
* function Example() {
|
||||
* const { connect, isConnecting, error } = useConnect();
|
||||
@@ -118,7 +118,7 @@ export function useSetActiveWallet() {
|
||||
* onClick={() =>
|
||||
* connect(async () => {
|
||||
* // instantiate wallet
|
||||
* const wallet = metamaskWallet();
|
||||
* const wallet = createWallet("io.metamask");
|
||||
* // connect wallet
|
||||
* await wallet.connect();
|
||||
* // return the wallet
|
||||
|
||||
@@ -89,6 +89,7 @@ export const ConnectModalContent = (props: {
|
||||
}}
|
||||
done={handleConnected}
|
||||
goBack={wallets.length > 1 ? handleBack : undefined}
|
||||
setModalVisibility={setModalVisibility}
|
||||
/>
|
||||
);
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import { Text } from "../components/text.js";
|
||||
import { useCustomTheme } from "../design-system/CustomThemeProvider.js";
|
||||
import { StyledDiv, StyledUl } from "../design-system/elements.js";
|
||||
import { fontSize, iconSize, radius, spacing } from "../design-system/index.js";
|
||||
import { SmartConnectUI } from "./Modal/SmartWalletConnectUI.js";
|
||||
import { TOS } from "./Modal/TOS.js";
|
||||
import { PoweredByThirdweb } from "./PoweredByTW.js";
|
||||
import { WalletButton, WalletEntryButton } from "./WalletEntryButton.js";
|
||||
@@ -39,10 +40,7 @@ const InAppWalletSelectionUI = /* @__PURE__ */ lazy(
|
||||
// const localWalletId = "local";
|
||||
const inAppWalletId: WalletId = "inApp";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const WalletSelector: React.FC<{
|
||||
type WalletSelectorProps = {
|
||||
wallets: Wallet[];
|
||||
selectWallet: (wallet: Wallet) => void;
|
||||
onGetStarted: () => void;
|
||||
@@ -50,7 +48,46 @@ export const WalletSelector: React.FC<{
|
||||
done: (wallet: Wallet) => void;
|
||||
goBack?: () => void;
|
||||
onShowAll: () => void;
|
||||
}> = (props) => {
|
||||
setModalVisibility: (value: boolean) => void;
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function WalletSelector(props: WalletSelectorProps) {
|
||||
const { accountAbstraction } = useConnectUI();
|
||||
const [personalWallet, setPersonalWallet] = useState<Wallet | null>(null);
|
||||
|
||||
if (!accountAbstraction) {
|
||||
return <WalletSelectorInner {...props} />;
|
||||
}
|
||||
|
||||
if (personalWallet) {
|
||||
return (
|
||||
<SmartConnectUI
|
||||
accountAbstraction={accountAbstraction}
|
||||
done={props.done}
|
||||
personalWallet={personalWallet}
|
||||
setModalVisibility={props.setModalVisibility}
|
||||
onBack={props.goBack}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<WalletSelectorInner
|
||||
{...props}
|
||||
done={(w) => {
|
||||
setPersonalWallet(w);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
const WalletSelectorInner: React.FC<WalletSelectorProps> = (props) => {
|
||||
const { connectModal, isEmbed, client } = useConnectUI();
|
||||
const isCompact = connectModal.size === "compact";
|
||||
const [isWalletGroupExpanded, setIsWalletGroupExpanded] = useState(false);
|
||||
|
||||
Binary file not shown.
Generated
+19
-102
@@ -545,8 +545,8 @@ importers:
|
||||
legacy_packages/contracts-js:
|
||||
dependencies:
|
||||
'@thirdweb-dev/contracts':
|
||||
specifier: 3.13.0
|
||||
version: 3.13.0
|
||||
specifier: 3.14.0
|
||||
version: 3.14.0
|
||||
devDependencies:
|
||||
'@ethersproject/abi':
|
||||
specifier: ^5.7.0
|
||||
@@ -1484,8 +1484,8 @@ importers:
|
||||
specifier: ^2.12.1
|
||||
version: 2.12.1
|
||||
'@walletconnect/ethereum-provider':
|
||||
specifier: 2.12.1
|
||||
version: 2.12.1(@types/[email protected])([email protected])
|
||||
specifier: 2.12.2
|
||||
version: 2.12.2(@types/[email protected])([email protected])
|
||||
'@walletconnect/jsonrpc-utils':
|
||||
specifier: ^1.0.8
|
||||
version: 1.0.8
|
||||
@@ -1667,7 +1667,7 @@ importers:
|
||||
version: 2.12.2(@types/[email protected])([email protected])
|
||||
abitype:
|
||||
specifier: 1.0.0
|
||||
version: 1.0.0([email protected].5)([email protected])
|
||||
version: 1.0.0([email protected].4)([email protected])
|
||||
ethers:
|
||||
specifier: ^5 || ^6
|
||||
version: 6.11.1
|
||||
@@ -1679,7 +1679,7 @@ importers:
|
||||
version: 7.0.0
|
||||
mipd:
|
||||
specifier: 0.0.7
|
||||
version: 0.0.7([email protected].5)
|
||||
version: 0.0.7([email protected].4)
|
||||
node-libs-browser:
|
||||
specifier: 2.2.1
|
||||
version: 2.2.1
|
||||
@@ -1694,7 +1694,7 @@ importers:
|
||||
version: 0.1.2
|
||||
viem:
|
||||
specifier: 2.9.18
|
||||
version: 2.9.18([email protected].5)([email protected])
|
||||
version: 2.9.18([email protected].4)([email protected])
|
||||
devDependencies:
|
||||
'@types/cross-spawn':
|
||||
specifier: ^6.0.6
|
||||
@@ -11371,8 +11371,8 @@ packages:
|
||||
resolution: {integrity: sha512-P5XgYoAw/vfW65byBbJQCw+cagdXDT/qH6wmABiLt4v4YBT2q2vqCOhihe+D1Nt325F/S/0Tkv6C5z0Lv+VBQQ==}
|
||||
dev: false
|
||||
|
||||
/@thirdweb-dev/[email protected]3.0:
|
||||
resolution: {integrity: sha512-v2ol+Wqf/W/7LGaP3xgStns6iUDB492b+rxUvkNPL89uGqj4Y+dJHdt0BfLF+Lm4IdWVXvxAintbF9uIoZCbJA==}
|
||||
/@thirdweb-dev/[email protected]4.0:
|
||||
resolution: {integrity: sha512-4LxNj/RgcbVlHESUx/FTKA2AXb/LhWqSjUgmM4glBW6fyZysUKFZUuL+zvZwxY+zbVpMdPqDjMPF0mET2LF25Q==}
|
||||
engines: {node: '>=18.0.0'}
|
||||
dependencies:
|
||||
'@openzeppelin/contracts': 4.9.6
|
||||
@@ -12274,13 +12274,13 @@ packages:
|
||||
'@ethersproject/transactions': 5.7.0
|
||||
'@stablelib/random': 1.0.2
|
||||
'@stablelib/sha256': 1.0.1
|
||||
'@walletconnect/core': 2.12.1
|
||||
'@walletconnect/core': 2.12.2
|
||||
'@walletconnect/events': 1.0.1
|
||||
'@walletconnect/heartbeat': 1.2.1
|
||||
'@walletconnect/jsonrpc-utils': 1.0.8
|
||||
'@walletconnect/logger': 2.1.0
|
||||
'@walletconnect/logger': 2.1.2
|
||||
'@walletconnect/time': 1.0.2
|
||||
'@walletconnect/utils': 2.12.1
|
||||
'@walletconnect/utils': 2.12.2
|
||||
events: 3.3.0
|
||||
isomorphic-unfetch: 3.1.0
|
||||
transitivePeerDependencies:
|
||||
@@ -12389,41 +12389,6 @@ packages:
|
||||
tslib: 1.14.1
|
||||
dev: false
|
||||
|
||||
/@walletconnect/[email protected](@types/[email protected])([email protected]):
|
||||
resolution: {integrity: sha512-C57sIcKDNKx6UgnW4EVrmBGAXGddfjgC88vpkOTBrClFF8zhSfdf/fKnLLo70spr8z3u77IppD36m6DGhJ+xpw==}
|
||||
dependencies:
|
||||
'@walletconnect/jsonrpc-http-connection': 1.0.7
|
||||
'@walletconnect/jsonrpc-provider': 1.0.13
|
||||
'@walletconnect/jsonrpc-types': 1.0.3
|
||||
'@walletconnect/jsonrpc-utils': 1.0.8
|
||||
'@walletconnect/modal': 2.6.2(@types/[email protected])([email protected])
|
||||
'@walletconnect/sign-client': 2.12.1
|
||||
'@walletconnect/types': 2.12.1
|
||||
'@walletconnect/universal-provider': 2.12.1
|
||||
'@walletconnect/utils': 2.12.1
|
||||
events: 3.3.0
|
||||
transitivePeerDependencies:
|
||||
- '@azure/app-configuration'
|
||||
- '@azure/cosmos'
|
||||
- '@azure/data-tables'
|
||||
- '@azure/identity'
|
||||
- '@azure/keyvault-secrets'
|
||||
- '@azure/storage-blob'
|
||||
- '@capacitor/preferences'
|
||||
- '@netlify/blobs'
|
||||
- '@planetscale/database'
|
||||
- '@react-native-async-storage/async-storage'
|
||||
- '@types/react'
|
||||
- '@upstash/redis'
|
||||
- '@vercel/kv'
|
||||
- bufferutil
|
||||
- encoding
|
||||
- ioredis
|
||||
- react
|
||||
- uWebSockets.js
|
||||
- utf-8-validate
|
||||
dev: false
|
||||
|
||||
/@walletconnect/[email protected](@types/[email protected])([email protected]):
|
||||
resolution: {integrity: sha512-vBl2zCnNm2iPaomJdr5YT16cT7aa8cH2WFs6879XPngU5i7HXS3bU6TamhyhKKl13sdIfifmCkCC+RWn5GdPMw==}
|
||||
dependencies:
|
||||
@@ -12651,7 +12616,7 @@ packages:
|
||||
'@walletconnect/events': 1.0.1
|
||||
'@walletconnect/heartbeat': 1.2.1
|
||||
'@walletconnect/jsonrpc-utils': 1.0.8
|
||||
'@walletconnect/logger': 2.1.0
|
||||
'@walletconnect/logger': 2.1.2
|
||||
'@walletconnect/time': 1.0.2
|
||||
'@walletconnect/types': 2.12.1
|
||||
'@walletconnect/utils': 2.12.1
|
||||
@@ -12747,7 +12712,7 @@ packages:
|
||||
'@walletconnect/heartbeat': 1.2.1
|
||||
'@walletconnect/jsonrpc-types': 1.0.3
|
||||
'@walletconnect/keyvaluestorage': 1.1.1
|
||||
'@walletconnect/logger': 2.1.0
|
||||
'@walletconnect/logger': 2.1.2
|
||||
events: 3.3.0
|
||||
transitivePeerDependencies:
|
||||
- '@azure/app-configuration'
|
||||
@@ -12766,38 +12731,6 @@ packages:
|
||||
- uWebSockets.js
|
||||
dev: false
|
||||
|
||||
/@walletconnect/[email protected]:
|
||||
resolution: {integrity: sha512-ZLl5+wY3A7pss5UbIOKBcTwoFQmhW6ilDq33vX2Hu69yUnK+OEKlKcgAy4vjN2wAWakUctO4j7RhpionKBZfCw==}
|
||||
dependencies:
|
||||
'@walletconnect/jsonrpc-http-connection': 1.0.7
|
||||
'@walletconnect/jsonrpc-provider': 1.0.13
|
||||
'@walletconnect/jsonrpc-types': 1.0.3
|
||||
'@walletconnect/jsonrpc-utils': 1.0.8
|
||||
'@walletconnect/logger': 2.1.0
|
||||
'@walletconnect/sign-client': 2.12.1
|
||||
'@walletconnect/types': 2.12.1
|
||||
'@walletconnect/utils': 2.12.1
|
||||
events: 3.3.0
|
||||
transitivePeerDependencies:
|
||||
- '@azure/app-configuration'
|
||||
- '@azure/cosmos'
|
||||
- '@azure/data-tables'
|
||||
- '@azure/identity'
|
||||
- '@azure/keyvault-secrets'
|
||||
- '@azure/storage-blob'
|
||||
- '@capacitor/preferences'
|
||||
- '@netlify/blobs'
|
||||
- '@planetscale/database'
|
||||
- '@react-native-async-storage/async-storage'
|
||||
- '@upstash/redis'
|
||||
- '@vercel/kv'
|
||||
- bufferutil
|
||||
- encoding
|
||||
- ioredis
|
||||
- uWebSockets.js
|
||||
- utf-8-validate
|
||||
dev: false
|
||||
|
||||
/@walletconnect/[email protected]:
|
||||
resolution: {integrity: sha512-0k5ZgSkABopQLVhkiwl2gRGG7dAP4SWiI915pIlyN5sRvWV+qX1ALhWAmRcdv0TXWlKHDcDgPJw/q2sCSAHuMQ==}
|
||||
dependencies:
|
||||
@@ -13137,21 +13070,6 @@ packages:
|
||||
typescript: 5.4.4
|
||||
zod: 3.22.4
|
||||
|
||||
/[email protected]([email protected])([email protected]):
|
||||
resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==}
|
||||
peerDependencies:
|
||||
typescript: '>=5.0.4'
|
||||
zod: ^3 >=3.22.0
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
zod:
|
||||
optional: true
|
||||
dependencies:
|
||||
typescript: 5.4.5
|
||||
zod: 3.22.4
|
||||
dev: false
|
||||
|
||||
/[email protected]:
|
||||
resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==}
|
||||
engines: {node: '>=6.5'}
|
||||
@@ -16885,7 +16803,6 @@ packages:
|
||||
dependencies:
|
||||
is-hex-prefixed: 1.0.0
|
||||
strip-hex-prefix: 1.0.0
|
||||
bundledDependencies: false
|
||||
|
||||
/[email protected]:
|
||||
resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==}
|
||||
@@ -20920,7 +20837,7 @@ packages:
|
||||
yallist: 4.0.0
|
||||
dev: false
|
||||
|
||||
/[email protected]([email protected].5):
|
||||
/[email protected]([email protected].4):
|
||||
resolution: {integrity: sha512-aAPZPNDQ3uMTdKbuO2YmAw2TxLHO0moa4YKAyETM/DTj5FloZo+a+8tU+iv4GmW+sOxKLSRwcSFuczk+Cpt6fg==}
|
||||
peerDependencies:
|
||||
typescript: '>=5.0.4'
|
||||
@@ -20928,7 +20845,7 @@ packages:
|
||||
typescript:
|
||||
optional: true
|
||||
dependencies:
|
||||
typescript: 5.4.5
|
||||
typescript: 5.4.4
|
||||
dev: false
|
||||
|
||||
/[email protected]:
|
||||
@@ -25790,7 +25707,7 @@ packages:
|
||||
semver: 7.6.0
|
||||
dev: true
|
||||
|
||||
/[email protected]([email protected].5)([email protected]):
|
||||
/[email protected]([email protected].4)([email protected]):
|
||||
resolution: {integrity: sha512-QULuau6DWDVRjGDVIUPuUybqiYu8mxscvwkKQ7dqNRl6w/t8RWs92aJZSQpqEULoERlKYyFFlj7cz4mWFEchsg==}
|
||||
peerDependencies:
|
||||
typescript: '>=5.0.4'
|
||||
@@ -25803,9 +25720,9 @@ packages:
|
||||
'@noble/hashes': 1.3.2
|
||||
'@scure/bip32': 1.3.2
|
||||
'@scure/bip39': 1.2.1
|
||||
abitype: 1.0.0([email protected].5)([email protected])
|
||||
abitype: 1.0.0([email protected].4)([email protected])
|
||||
isows: 1.0.3([email protected])
|
||||
typescript: 5.4.5
|
||||
typescript: 5.4.4
|
||||
ws: 8.13.0
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
|
||||
Reference in New Issue
Block a user