browser-rpc 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -32
- package/dist/index.js +49 -3
- package/package.json +1 -1
- package/web-dist/assets/{add-Bt6ug9as.js → add-CSurud0_.js} +1 -1
- package/web-dist/assets/{all-wallets-ClkSG7YV.js → all-wallets-CuPxktej.js} +1 -1
- package/web-dist/assets/{app-store-BnzgCmML.js → app-store-Bh7SMjK6.js} +1 -1
- package/web-dist/assets/{apple-D3CNMHuT.js → apple-C4EgoShq.js} +1 -1
- package/web-dist/assets/{arrow-bottom-BrYwqDZR.js → arrow-bottom-CzdtCJaR.js} +1 -1
- package/web-dist/assets/{arrow-bottom-circle-CBoHFkqN.js → arrow-bottom-circle-CzKcAzTC.js} +1 -1
- package/web-dist/assets/{arrow-left-CHVgplmz.js → arrow-left-DCA-23-P.js} +1 -1
- package/web-dist/assets/{arrow-right-Do5EdrXQ.js → arrow-right-DjWMZCbU.js} +1 -1
- package/web-dist/assets/{arrow-top-BOPLd2d5.js → arrow-top-DdmR7t9T.js} +1 -1
- package/web-dist/assets/{bank-DafdJl1O.js → bank-C_5L-YDS.js} +1 -1
- package/web-dist/assets/{basic-CLeG2Fx1.js → basic-CqHaUvPy.js} +1 -1
- package/web-dist/assets/{browser-DRuHXezx.js → browser-DrecPVgr.js} +1 -1
- package/web-dist/assets/{card-YgaTGJnf.js → card-B8Kpmq0P.js} +1 -1
- package/web-dist/assets/{ccip-ConwrR6S.js → ccip-DULOFBuD.js} +1 -1
- package/web-dist/assets/{ccip-B4x4TU0w.js → ccip-JXkAn6l_.js} +1 -1
- package/web-dist/assets/{checkmark-bold-b4BEKMa-.js → checkmark-bold-C5CQv-Aa.js} +1 -1
- package/web-dist/assets/{checkmark-Dgr_oUfC.js → checkmark-pd5FsFzg.js} +1 -1
- package/web-dist/assets/{chevron-bottom-BlzLXicX.js → chevron-bottom-BLvDr8vF.js} +1 -1
- package/web-dist/assets/{chevron-left-DWsjEedN.js → chevron-left-Bn5fXcit.js} +1 -1
- package/web-dist/assets/{chevron-right-B-GnUH_e.js → chevron-right-Bp7Npo8k.js} +1 -1
- package/web-dist/assets/{chevron-top-lK6t2THp.js → chevron-top-DC_l4mwZ.js} +1 -1
- package/web-dist/assets/{chrome-store-CbBGk8YS.js → chrome-store-B0wZ3pqA.js} +1 -1
- package/web-dist/assets/{clock-ByEA0e_s.js → clock-l4cNQcqu.js} +1 -1
- package/web-dist/assets/{close-BxDaavrr.js → close-DGUe_y81.js} +1 -1
- package/web-dist/assets/{coinPlaceholder-B9aaOU5j.js → coinPlaceholder-BP01UQKP.js} +1 -1
- package/web-dist/assets/{compass-CBP6oSW9.js → compass-o-R_PR5i.js} +1 -1
- package/web-dist/assets/{copy-Dp304nbr.js → copy-BAr81PLi.js} +1 -1
- package/web-dist/assets/{core-Bf6VrE6v.js → core-D7szIsgf.js} +4 -4
- package/web-dist/assets/{cursor-WUohjLCE.js → cursor-D3GZTRrk.js} +1 -1
- package/web-dist/assets/{cursor-transparent-CutfCQQz.js → cursor-transparent-DljOOQBY.js} +1 -1
- package/web-dist/assets/{desktop-kZiy9C-p.js → desktop-jiAHOLvJ.js} +1 -1
- package/web-dist/assets/{disconnect-CG5TDY_m.js → disconnect-CS8uxHay.js} +1 -1
- package/web-dist/assets/{discord-JyHSI7q0.js → discord-DHnKyemy.js} +1 -1
- package/web-dist/assets/{etherscan-CyB1NBm9.js → etherscan-CVkxPkFS.js} +1 -1
- package/web-dist/assets/{exclamation-triangle-7y5nglSL.js → exclamation-triangle-CS4ruWfK.js} +1 -1
- package/web-dist/assets/{extension-BjB3--xE.js → extension-DnLfOwO6.js} +1 -1
- package/web-dist/assets/{external-link-BW0O7z6_.js → external-link-D-P_33dB.js} +1 -1
- package/web-dist/assets/{facebook-682BXGmP.js → facebook-jLzamRKN.js} +1 -1
- package/web-dist/assets/{farcaster-BOaaCMAh.js → farcaster-B4A0ZZeM.js} +1 -1
- package/web-dist/assets/{filters-DFWbfLJh.js → filters-2IeJyFyu.js} +1 -1
- package/web-dist/assets/{github-DpRqYyal.js → github-CYDpN-_e.js} +1 -1
- package/web-dist/assets/{google-CgUt7hYq.js → google-BZkNEgmj.js} +1 -1
- package/web-dist/assets/{help-circle-DwVgKpjs.js → help-circle-DMZ8-Cna.js} +1 -1
- package/web-dist/assets/{id-BaTvs6Gs.js → id-38gfBvri.js} +1 -1
- package/web-dist/assets/{image-BieDxoY2.js → image-C9_OStLn.js} +1 -1
- package/web-dist/assets/{index-C4Lbscxg.js → index--LSQjR_2.js} +66 -66
- package/web-dist/assets/{index-GJH9xypQ.css → index-CCSv1eAh.css} +1 -1
- package/web-dist/assets/{index-CteTNahN.js → index-Ccy1t-C4.js} +4 -4
- package/web-dist/assets/{index-aVimijSo.js → index-Cg8hiVbn.js} +3 -3
- package/web-dist/assets/{index-C5m0fBnu.js → index-CiTEL--Y.js} +1 -1
- package/web-dist/assets/{index-DgKl8WD4.js → index-QgYpnbyq.js} +1 -1
- package/web-dist/assets/{index-Burh8TwV.js → index-dCn6axXg.js} +1 -1
- package/web-dist/assets/{index.es-Me6_HSoS.js → index.es-C1H8G2CD.js} +4 -4
- package/web-dist/assets/{info-circle-Dgdf-_kY.js → info-circle-BTNeoxa6.js} +1 -1
- package/web-dist/assets/{info-CaUhPhOk.js → info-n2qoFrAe.js} +1 -1
- package/web-dist/assets/{lightbulb-h5NbP99t.js → lightbulb-Clk-Jmgu.js} +1 -1
- package/web-dist/assets/{mail-DUTW6gdU.js → mail-Cds1jWOG.js} +1 -1
- package/web-dist/assets/{mobile-BFFFlSgH.js → mobile-3m8bvDwV.js} +1 -1
- package/web-dist/assets/{more-s9g8TvGr.js → more-D4wapBmR.js} +1 -1
- package/web-dist/assets/{network-placeholder-DBVOULy6.js → network-placeholder-Byofvks3.js} +1 -1
- package/web-dist/assets/{nftPlaceholder-D8q6GiE5.js → nftPlaceholder-CZSQO35I.js} +1 -1
- package/web-dist/assets/{off-7mG5bayL.js → off-BwFiGI61.js} +1 -1
- package/web-dist/assets/{play-store-BFa605Jk.js → play-store-BGBmqVQP.js} +1 -1
- package/web-dist/assets/{plus-BgZ-WP7A.js → plus-CuD4QENc.js} +1 -1
- package/web-dist/assets/{qr-code-B_1WHzPs.js → qr-code-CmkeyQ3q.js} +1 -1
- package/web-dist/assets/{recycle-horizontal-CuuA7YIy.js → recycle-horizontal-Bro_qysx.js} +1 -1
- package/web-dist/assets/{refresh-CSXbxAuT.js → refresh-Edry900n.js} +1 -1
- package/web-dist/assets/{reown-logo-OK1pdOfH.js → reown-logo-BMZ4Cq9x.js} +1 -1
- package/web-dist/assets/{search-b77MGgNN.js → search-AVAp5Fyx.js} +1 -1
- package/web-dist/assets/{secp256k1-CqlnLpBV.js → secp256k1-BgQIr3rN.js} +1 -1
- package/web-dist/assets/{secp256k1-xC50DJGj.js → secp256k1-DekXzlV8.js} +1 -1
- package/web-dist/assets/{send-DlJtxaMX.js → send-4MYVLgeW.js} +1 -1
- package/web-dist/assets/{swapHorizontal-BmG4i-CJ.js → swapHorizontal-cVSOFLpi.js} +1 -1
- package/web-dist/assets/{swapHorizontalBold-CrnzAaq6.js → swapHorizontalBold-Bw-7VNbr.js} +1 -1
- package/web-dist/assets/{swapHorizontalMedium-DuPE93B2.js → swapHorizontalMedium-mcrKCBp-.js} +1 -1
- package/web-dist/assets/{swapHorizontalRoundedBold-clkEaP-W.js → swapHorizontalRoundedBold-BDxAi3q4.js} +1 -1
- package/web-dist/assets/{swapVertical-DXvCmf9g.js → swapVertical-BcwB3ulc.js} +1 -1
- package/web-dist/assets/{telegram-uHX2mx77.js → telegram-DuHUM8tr.js} +1 -1
- package/web-dist/assets/{three-dots-BoFVtYRM.js → three-dots-Aq6TxP_i.js} +1 -1
- package/web-dist/assets/{twitch-BbZVXa-k.js → twitch-C3_nAU2s.js} +1 -1
- package/web-dist/assets/{twitterIcon-DTDEnPwP.js → twitterIcon-xVvhgLtz.js} +1 -1
- package/web-dist/assets/{verify-DSwt0ow9.js → verify-Bk6Q4N8f.js} +1 -1
- package/web-dist/assets/{verify-filled-Dd2saJZ0.js → verify-filled-P4SRtWaq.js} +1 -1
- package/web-dist/assets/{w3m-modal-Dkca-GXY.js → w3m-modal-BV8xYuAk.js} +1 -1
- package/web-dist/assets/{wallet-DFQUKIzv.js → wallet-Cwos8iS9.js} +1 -1
- package/web-dist/assets/{wallet-placeholder-DBESmMOJ.js → wallet-placeholder-DZOZgWPG.js} +1 -1
- package/web-dist/assets/{walletconnect-Byk_h0ya.js → walletconnect-BEXWbbOU.js} +1 -1
- package/web-dist/assets/{warning-circle-BjOhgUMO.js → warning-circle-BjUwobMn.js} +1 -1
- package/web-dist/assets/{x-qhswnC92.js → x-CwzeXSXa.js} +1 -1
- package/web-dist/index.html +2 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Browser RPC Proxy
|
|
2
2
|
|
|
3
3
|
A local RPC proxy that routes Ethereum transactions through your browser wallet instead of requiring private keys in `.env` files.
|
|
4
4
|
|
|
@@ -48,36 +48,15 @@ npx browser-rpc --rpc https://mainnet.base.org
|
|
|
48
48
|
browser-rpc --rpc https://mainnet.base.org
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
3. Run your script - when it sends a transaction, your browser will open for approval
|
|
54
|
-
|
|
55
|
-
### With Foundry
|
|
51
|
+
If you're using Hardhat, you'll also need to specify the wallet address you'll use to sign transactions:
|
|
56
52
|
|
|
57
53
|
```bash
|
|
58
|
-
|
|
59
|
-
browser-rpc --rpc https://mainnet.base.org
|
|
60
|
-
|
|
61
|
-
# In another terminal, run your script
|
|
62
|
-
forge script script/Deploy.s.sol --rpc-url http://localhost:8545 --broadcast
|
|
54
|
+
browser-rpc --rpc https://mainnet.base.org --from 0xYourWalletAddress
|
|
63
55
|
```
|
|
64
56
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
```javascript
|
|
68
|
-
// hardhat.config.js
|
|
69
|
-
module.exports = {
|
|
70
|
-
networks: {
|
|
71
|
-
browserRpc: {
|
|
72
|
-
url: 'http://localhost:8545',
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
}
|
|
76
|
-
```
|
|
57
|
+
2. Configure your script to use `http://localhost:8545` as the RPC URL
|
|
77
58
|
|
|
78
|
-
|
|
79
|
-
npx hardhat run scripts/deploy.js --network browserRpc
|
|
80
|
-
```
|
|
59
|
+
3. Run your script - when it sends a transaction, your browser will open for approval
|
|
81
60
|
|
|
82
61
|
### With viem
|
|
83
62
|
|
|
@@ -87,23 +66,56 @@ import { base } from 'viem/chains'
|
|
|
87
66
|
|
|
88
67
|
const client = createWalletClient({
|
|
89
68
|
chain: base,
|
|
90
|
-
transport: http('http://localhost:8545'
|
|
69
|
+
transport: http('http://localhost:8545', {
|
|
70
|
+
timeout: 60_000, // 1 minute to sign in the browser
|
|
71
|
+
}),
|
|
91
72
|
})
|
|
92
73
|
|
|
93
74
|
// This will open your browser for approval
|
|
94
75
|
const hash = await client.sendTransaction({
|
|
76
|
+
account: null,
|
|
95
77
|
to: '0x...',
|
|
96
78
|
value: parseEther('0.01'),
|
|
97
79
|
})
|
|
98
80
|
```
|
|
99
81
|
|
|
82
|
+
### With Foundry
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
forge script script/Deploy.s.sol \
|
|
86
|
+
--rpc-url http://localhost:8545 \
|
|
87
|
+
--broadcast \
|
|
88
|
+
--unlocked \
|
|
89
|
+
--sender 0xYourWalletAddress
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
> **Note:** The `--unlocked` flag tells Foundry to send `eth_sendTransaction` to the RPC instead of signing locally. The `--sender` flag specifies which public address you'll deploy from.
|
|
93
|
+
|
|
94
|
+
### With Hardhat 3
|
|
95
|
+
|
|
96
|
+
```javascript
|
|
97
|
+
// hardhat.config.js
|
|
98
|
+
const config = {
|
|
99
|
+
networks: {
|
|
100
|
+
base: {
|
|
101
|
+
type: 'http',
|
|
102
|
+
chainType: 'op',
|
|
103
|
+
url: 'http://localhost:8545',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
> **Note:** The `--from` flag is required for Hardhat. Hardhat calls `eth_accounts` to get the signer address for nonce lookups and gas estimation. The address must match the wallet you'll use to sign in the browser.
|
|
110
|
+
|
|
100
111
|
## CLI Options
|
|
101
112
|
|
|
102
|
-
| Flag | Default | Description
|
|
103
|
-
| -------------- | ---------- |
|
|
104
|
-
| `--rpc`, `-r` | (required) | Upstream RPC URL for read calls
|
|
105
|
-
| `--
|
|
106
|
-
| `--
|
|
113
|
+
| Flag | Default | Description |
|
|
114
|
+
| -------------- | ---------- | -------------------------------------------- |
|
|
115
|
+
| `--rpc`, `-r` | (required) | Upstream RPC URL for read calls |
|
|
116
|
+
| `--from`, `-f` | (none) | Wallet address (returned for `eth_accounts`) |
|
|
117
|
+
| `--port`, `-p` | `8545` | Port for the proxy server |
|
|
118
|
+
| `--no-open` | `false` | Disable auto-opening the browser |
|
|
107
119
|
|
|
108
120
|
## How It Works
|
|
109
121
|
|
package/dist/index.js
CHANGED
|
@@ -3929,6 +3929,14 @@ function getInterceptedMethodType(method) {
|
|
|
3929
3929
|
// src/rpc/handler.ts
|
|
3930
3930
|
async function handleRpcRequest(request, config) {
|
|
3931
3931
|
const { method, params, id } = request;
|
|
3932
|
+
if (method === "eth_accounts" || method === "eth_requestAccounts") {
|
|
3933
|
+
const accounts = config.fromAddress ? [config.fromAddress] : [];
|
|
3934
|
+
return {
|
|
3935
|
+
jsonrpc: "2.0",
|
|
3936
|
+
id,
|
|
3937
|
+
result: accounts
|
|
3938
|
+
};
|
|
3939
|
+
}
|
|
3932
3940
|
if (shouldIntercept(method)) {
|
|
3933
3941
|
return handleInterceptedMethod(request, config);
|
|
3934
3942
|
}
|
|
@@ -4096,6 +4104,7 @@ function createServer(config) {
|
|
|
4096
4104
|
const responses = await Promise.all(body.map((req) => handleRpcRequest(req, {
|
|
4097
4105
|
upstreamRpcUrl: config.upstreamRpcUrl,
|
|
4098
4106
|
uiBaseUrl: `http://localhost:${config.port}`,
|
|
4107
|
+
fromAddress: config.fromAddress,
|
|
4099
4108
|
onPendingRequest: config.onPendingRequest
|
|
4100
4109
|
})));
|
|
4101
4110
|
return c.json(responses);
|
|
@@ -4104,6 +4113,7 @@ function createServer(config) {
|
|
|
4104
4113
|
const response = await handleRpcRequest(body, {
|
|
4105
4114
|
upstreamRpcUrl: config.upstreamRpcUrl,
|
|
4106
4115
|
uiBaseUrl: `http://localhost:${config.port}`,
|
|
4116
|
+
fromAddress: config.fromAddress,
|
|
4107
4117
|
onPendingRequest: config.onPendingRequest
|
|
4108
4118
|
});
|
|
4109
4119
|
return c.json(response);
|
|
@@ -4121,6 +4131,9 @@ function createServer(config) {
|
|
|
4121
4131
|
app.post("/", handleRpc);
|
|
4122
4132
|
app.post("/rpc", handleRpc);
|
|
4123
4133
|
app.get("/health", (c) => c.json({ ok: true }));
|
|
4134
|
+
app.get("/api/config", (c) => c.json({
|
|
4135
|
+
fromAddress: config.fromAddress || null
|
|
4136
|
+
}));
|
|
4124
4137
|
app.use("/assets/*", serveStatic2({ root: webDistPath }));
|
|
4125
4138
|
app.get("*", async (c) => {
|
|
4126
4139
|
const indexPath = path.join(webDistPath, "index.html");
|
|
@@ -4134,7 +4147,35 @@ function createServer(config) {
|
|
|
4134
4147
|
}
|
|
4135
4148
|
|
|
4136
4149
|
// src/index.ts
|
|
4137
|
-
|
|
4150
|
+
if (process.argv.length <= 2) {
|
|
4151
|
+
console.log(`
|
|
4152
|
+
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
4153
|
+
\u2551 browser-rpc \u2551
|
|
4154
|
+
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
4155
|
+
|
|
4156
|
+
\x1B[1mUSAGE\x1B[0m
|
|
4157
|
+
|
|
4158
|
+
browser-rpc --rpc <upstream-url> [--from <address>]
|
|
4159
|
+
|
|
4160
|
+
\x1B[1mOPTIONS\x1B[0m
|
|
4161
|
+
|
|
4162
|
+
-r, --rpc <url> Upstream RPC URL (required)
|
|
4163
|
+
-f, --from <address> Your wallet address (required for Hardhat)
|
|
4164
|
+
-p, --port <number> Server port (default: 8545)
|
|
4165
|
+
--no-open Don't auto-open browser for signing
|
|
4166
|
+
|
|
4167
|
+
\x1B[1mHOW IT WORKS\x1B[0m
|
|
4168
|
+
|
|
4169
|
+
1. Point your dev tool at http://localhost:8545
|
|
4170
|
+
2. When a transaction is sent, your browser opens
|
|
4171
|
+
3. Connect wallet, review, and sign
|
|
4172
|
+
4. Transaction hash returns to your script
|
|
4173
|
+
|
|
4174
|
+
\x1B[2mDocs: https://github.com/gskril/browser-rpc\x1B[0m
|
|
4175
|
+
`);
|
|
4176
|
+
process.exit(0);
|
|
4177
|
+
}
|
|
4178
|
+
program.name("browser-rpc").description("Local RPC proxy for secure transaction signing via browser wallet").requiredOption("-r, --rpc <url>", "Upstream RPC URL for read calls").option("-p, --port <number>", "Server port", "8545").option("-f, --from <address>", "Default wallet address (returned for eth_accounts)").option("--no-open", "Disable auto-opening browser for transactions").parse();
|
|
4138
4179
|
var options = program.opts();
|
|
4139
4180
|
var port = parseInt(options.port, 10);
|
|
4140
4181
|
async function openBrowser(url) {
|
|
@@ -4157,6 +4198,7 @@ async function openBrowser(url) {
|
|
|
4157
4198
|
var server = createServer({
|
|
4158
4199
|
upstreamRpcUrl: options.rpc,
|
|
4159
4200
|
port,
|
|
4201
|
+
fromAddress: options.from,
|
|
4160
4202
|
onPendingRequest: (id, url) => {
|
|
4161
4203
|
console.log(`
|
|
4162
4204
|
\x1B[33m\u23F3 Awaiting approval:\x1B[0m ${url}`);
|
|
@@ -4176,11 +4218,15 @@ console.log(`
|
|
|
4176
4218
|
|
|
4177
4219
|
Server: http://localhost:${port}
|
|
4178
4220
|
Upstream: ${options.rpc}
|
|
4221
|
+
From: ${options.from || "(not set - use --from to specify)"}
|
|
4179
4222
|
Auto-open: ${options.open ? "enabled" : "disabled"}
|
|
4180
4223
|
|
|
4181
4224
|
Use http://localhost:${port} as your RPC URL in Foundry/Hardhat.
|
|
4182
4225
|
|
|
4183
4226
|
Example:
|
|
4184
|
-
forge script script/Deploy.s.sol --rpc-url http://localhost:${port}
|
|
4185
|
-
|
|
4227
|
+
forge script script/Deploy.s.sol --rpc-url http://localhost:${port} \\
|
|
4228
|
+
--broadcast --unlocked --sender 0xYourWallet
|
|
4229
|
+
${!options.from ? `
|
|
4230
|
+
\x1B[33m\u26A0 Warning: No --from address specified, which may cause issues in Hardhat.\x1B[0m
|
|
4231
|
+
` : ""}
|
|
4186
4232
|
`);
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const e=o`<svg
|
|
2
2
|
width="14"
|
|
3
3
|
height="14"
|
|
4
4
|
viewBox="0 0 14 14"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const r=o`<svg fill="none" viewBox="0 0 24 24">
|
|
2
2
|
<path
|
|
3
3
|
style="fill: var(--wui-color-accent-100);"
|
|
4
4
|
d="M10.2 6.6a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM21 6.6a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM10.2 17.4a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM21 17.4a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0Z"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as t}from"./core-
|
|
1
|
+
import{w as t}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const e=t`
|
|
2
2
|
<svg width="36" height="36">
|
|
3
3
|
<path
|
|
4
4
|
d="M28.724 0H7.271A7.269 7.269 0 0 0 0 7.272v21.46A7.268 7.268 0 0 0 7.271 36H28.73A7.272 7.272 0 0 0 36 28.728V7.272A7.275 7.275 0 0 0 28.724 0Z"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as i}from"./core-
|
|
1
|
+
import{w as i}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const c=i`<svg fill="none" viewBox="0 0 40 40">
|
|
2
2
|
<g clip-path="url(#a)">
|
|
3
3
|
<g clip-path="url(#b)">
|
|
4
4
|
<circle cx="20" cy="19.89" r="20" fill="#000" />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const i=o`<svg fill="none" viewBox="0 0 14 15">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as C}from"./core-
|
|
1
|
+
import{w as C}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const i=C`<svg
|
|
2
2
|
fill="none"
|
|
3
3
|
viewBox="0 0 21 20"
|
|
4
4
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const t=o`<svg fill="none" viewBox="0 0 14 15">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const t=o`<svg fill="none" viewBox="0 0 14 15">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const p=o`<svg fill="none" viewBox="0 0 14 15">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const l=o`<svg
|
|
2
2
|
xmlns="http://www.w3.org/2000/svg"
|
|
3
3
|
width="12"
|
|
4
4
|
height="13"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as N,o as G,l as q,m as O,n as c,y as M,D as z,O as ee,G as j,E as te,R as U,P as Me,u as K,Q as k,U as ft,I as yi,W as pt,C as Xt,v as vn,T as Zt,B as Xe,M as ni,V as ii,w as Ne,L as yn,q as xi}from"./core-
|
|
1
|
+
import{k as N,o as G,l as q,m as O,n as c,y as M,D as z,O as ee,G as j,E as te,R as U,P as Me,u as K,Q as k,U as ft,I as yi,W as pt,C as Xt,v as vn,T as Zt,B as Xe,M as ni,V as ii,w as Ne,L as yn,q as xi}from"./core-D7szIsgf.js";import{n as u,c as T,o as W,r as I,U as he,e as Ci,f as Ri,a as $i}from"./index-Cg8hiVbn.js";import{r as Ii,h as Ei}from"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const Wi=N`
|
|
2
2
|
:host {
|
|
3
3
|
position: relative;
|
|
4
4
|
background-color: var(--wui-color-gray-glass-002);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as l}from"./core-
|
|
1
|
+
import{w as l}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const c=l`<svg fill="none" viewBox="0 0 20 20">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as C}from"./core-
|
|
1
|
+
import{w as C}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const i=C`<svg
|
|
2
2
|
xmlns="http://www.w3.org/2000/svg"
|
|
3
3
|
width="12"
|
|
4
4
|
height="13"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as p,g as y,s as w,d as k,i as b,l as L,a as O,c as R,b as E,e as x,H as m,f as M}from"./index-
|
|
1
|
+
import{B as p,g as y,s as w,d as k,i as b,l as L,a as O,c as R,b as E,e as x,H as m,f as M}from"./index-Ccy1t-C4.js";import"./index--LSQjR_2.js";class S extends p{constructor({callbackSelector:s,cause:e,data:o,extraData:n,sender:c,urls:t}){super(e.shortMessage||"An error occurred while fetching for an offchain result.",{cause:e,metaMessages:[...e.metaMessages||[],e.metaMessages?.length?"":[],"Offchain Gateway Call:",t&&[" Gateway URL(s):",...t.map(i=>` ${y(i)}`)],` Sender: ${c}`,` Data: ${o}`,` Callback selector: ${s}`,` Extra data: ${n}`].flat(),name:"OffchainLookupError"})}}class $ extends p{constructor({result:s,url:e}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${y(e)}`,`Response: ${w(s)}`],name:"OffchainLookupResponseMalformedError"})}}class q extends p{constructor({sender:s,to:e}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${e}`,`OffchainLookup sender address: ${s}`],name:"OffchainLookupSenderMismatchError"})}}const D="0x556f1830",T={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function B(d,{blockNumber:s,blockTag:e,data:o,to:n}){const{args:c}=k({data:o,abi:[T]}),[t,i,l,a,r]=c,{ccipRead:f}=d,h=f&&typeof f?.request=="function"?f.request:C;try{if(!b(n,t))throw new q({sender:t,to:n});const u=i.includes(L)?await O({data:l,ccipRequest:h}):await h({data:l,sender:t,urls:i}),{data:g}=await R(d,{blockNumber:s,blockTag:e,data:E([a,x([{type:"bytes"},{type:"bytes"}],[u,r])]),to:n});return g}catch(u){throw new S({callbackSelector:a,cause:u,data:o,extraData:r,sender:t,urls:i})}}async function C({data:d,sender:s,urls:e}){let o=new Error("An unknown error occurred.");for(let n=0;n<e.length;n++){const c=e[n],t=c.includes("{data}")?"GET":"POST",i=t==="POST"?{data:d,sender:s}:void 0,l=t==="POST"?{"Content-Type":"application/json"}:{};try{const a=await fetch(c.replace("{sender}",s.toLowerCase()).replace("{data}",d),{body:JSON.stringify(i),headers:l,method:t});let r;if(a.headers.get("Content-Type")?.startsWith("application/json")?r=(await a.json()).data:r=await a.text(),!a.ok){o=new m({body:i,details:r?.error?w(r.error):a.statusText,headers:a.headers,status:a.status,url:c});continue}if(!M(r)){o=new $({result:r,url:c});continue}return r}catch(a){o=new m({body:i,details:a.message,url:c})}}throw o}export{C as ccipRequest,B as offchainLookup,T as offchainLookupAbiItem,D as offchainLookupSignature};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as p,g as m,s as w,d as k,i as b,l as L,a as O,c as R,b as E,e as x,H as y,f as M}from"./index
|
|
1
|
+
import{B as p,g as m,s as w,d as k,i as b,l as L,a as O,c as R,b as E,e as x,H as y,f as M}from"./index--LSQjR_2.js";class S extends p{constructor({callbackSelector:s,cause:e,data:o,extraData:n,sender:c,urls:t}){super(e.shortMessage||"An error occurred while fetching for an offchain result.",{cause:e,metaMessages:[...e.metaMessages||[],e.metaMessages?.length?"":[],"Offchain Gateway Call:",t&&[" Gateway URL(s):",...t.map(i=>` ${m(i)}`)],` Sender: ${c}`,` Data: ${o}`,` Callback selector: ${s}`,` Extra data: ${n}`].flat(),name:"OffchainLookupError"})}}class $ extends p{constructor({result:s,url:e}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${m(e)}`,`Response: ${w(s)}`],name:"OffchainLookupResponseMalformedError"})}}class q extends p{constructor({sender:s,to:e}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${e}`,`OffchainLookup sender address: ${s}`],name:"OffchainLookupSenderMismatchError"})}}const A="0x556f1830",T={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function D(d,{blockNumber:s,blockTag:e,data:o,to:n}){const{args:c}=k({data:o,abi:[T]}),[t,i,l,a,r]=c,{ccipRead:f}=d,h=f&&typeof f?.request=="function"?f.request:C;try{if(!b(n,t))throw new q({sender:t,to:n});const u=i.includes(L)?await O({data:l,ccipRequest:h}):await h({data:l,sender:t,urls:i}),{data:g}=await R(d,{blockNumber:s,blockTag:e,data:E([a,x([{type:"bytes"},{type:"bytes"}],[u,r])]),to:n});return g}catch(u){throw new S({callbackSelector:a,cause:u,data:o,extraData:r,sender:t,urls:i})}}async function C({data:d,sender:s,urls:e}){let o=new Error("An unknown error occurred.");for(let n=0;n<e.length;n++){const c=e[n],t=c.includes("{data}")?"GET":"POST",i=t==="POST"?{data:d,sender:s}:void 0,l=t==="POST"?{"Content-Type":"application/json"}:{};try{const a=await fetch(c.replace("{sender}",s.toLowerCase()).replace("{data}",d),{body:JSON.stringify(i),headers:l,method:t});let r;if(a.headers.get("Content-Type")?.startsWith("application/json")?r=(await a.json()).data:r=await a.text(),!a.ok){o=new y({body:i,details:r?.error?w(r.error):a.statusText,headers:a.headers,status:a.status,url:c});continue}if(!M(r)){o=new $({result:r,url:c});continue}return r}catch(a){o=new y({body:i,details:a.message,url:c})}}throw o}export{C as ccipRequest,D as offchainLookup,T as offchainLookupAbiItem,A as offchainLookupSignature};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const t=o`<svg fill="none" viewBox="0 0 14 14">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const l=o`<svg
|
|
2
2
|
width="28"
|
|
3
3
|
height="28"
|
|
4
4
|
viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const i=o`<svg fill="none" viewBox="0 0 16 16">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const t=o`<svg fill="none" viewBox="0 0 16 16">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const t=o`<svg fill="none" viewBox="0 0 16 16">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const p=o`<svg fill="none" viewBox="0 0 16 16">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as t}from"./core-
|
|
1
|
+
import{w as t}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const e=t`<svg width="36" height="36" fill="none">
|
|
2
2
|
<path
|
|
3
3
|
fill="#fff"
|
|
4
4
|
fill-opacity=".05"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const r=o`<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
2
2
|
<path
|
|
3
3
|
fill-rule="evenodd"
|
|
4
4
|
clip-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as l}from"./core-
|
|
1
|
+
import{w as l}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const t=l`<svg fill="none" viewBox="0 0 16 16">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const t=o`<svg fill="none" viewBox="0 0 20 20">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as o}from"./core-
|
|
1
|
+
import{w as o}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const a=o`<svg fill="none" viewBox="0 0 16 16">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as C}from"./core-
|
|
1
|
+
import{w as C}from"./core-D7szIsgf.js";import"./index--LSQjR_2.js";import"./index.es-C1H8G2CD.js";import"./events-DQ172AOg.js";const t=C`<svg
|
|
2
2
|
xmlns="http://www.w3.org/2000/svg"
|
|
3
3
|
width="16"
|
|
4
4
|
height="16"
|