@flapsdk/vault-runtime 0.1.36-next.0 → 0.1.36
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/{chunk-FWYBGHBX.js → chunk-22KTLOYH.js} +4 -17
- package/chunk-22KTLOYH.js.map +1 -0
- package/chunk-AGLB72HK.js +61 -0
- package/chunk-AGLB72HK.js.map +1 -0
- package/{chunk-MLAOJT5Q.js → chunk-IN34R3DY.js} +494 -361
- package/chunk-IN34R3DY.js.map +1 -0
- package/{chunk-V7U4QTMT.js → chunk-QLVWFL4T.js} +164 -106
- package/chunk-QLVWFL4T.js.map +1 -0
- package/host-client.d.mts +2 -9
- package/host-client.js +3 -3
- package/host.d.mts +5 -5
- package/host.js +4 -4
- package/{hostRuntimeConfig-DibvcxHE.d.mts → hostRuntimeConfig-DAz-f577.d.mts} +1 -1
- package/{mpegts-J2J6JTD7.js → mpegts-536UQHCG.js} +6 -6
- package/{mpegts-J2J6JTD7.js.map → mpegts-536UQHCG.js.map} +1 -1
- package/package.json +3 -4
- package/runtime-contract.json +1 -2
- package/sdk.d.mts +4 -40
- package/sdk.js +6 -37
- package/sdk.js.map +1 -1
- package/server.d.mts +3 -3
- package/{txError-OBuRV8xN.d.mts → txError-DmiNOh9R.d.mts} +2 -15
- package/{types-DUZWZ3mC.d.mts → types-BbjEsfiD.d.mts} +4 -98
- package/ui.d.mts +1 -1
- package/ui.js +1 -1
- package/chunk-A3ER7XYN.js +0 -408
- package/chunk-A3ER7XYN.js.map +0 -1
- package/chunk-FWYBGHBX.js.map +0 -1
- package/chunk-MLAOJT5Q.js.map +0 -1
- package/chunk-V7U4QTMT.js.map +0 -1
|
@@ -1,78 +1,144 @@
|
|
|
1
|
-
import { createVaultRuntimeContext, chainLabelForChain
|
|
2
|
-
import {
|
|
1
|
+
import { createVaultRuntimeContext, chainLabelForChain } from './chunk-AGLB72HK.js';
|
|
2
|
+
import { createLocalNftMetadataReader, createLocalMediaUploader, vaultV2NftAbi, nftTokenUriAbi } from './chunk-PU7VEZWA.js';
|
|
3
3
|
import { fetchOracleJson } from './chunk-JLI25XFB.js';
|
|
4
|
-
import { RuntimeContext, Alert } from './chunk-
|
|
4
|
+
import { RuntimeContext, Alert } from './chunk-IN34R3DY.js';
|
|
5
5
|
import { isValidAddress, ZERO_ADDRESS } from './chunk-B4WKI3EW.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { useState, useRef, useCallback, useEffect, useMemo } from 'react';
|
|
7
|
+
import { useAccount, useChainId, useConnect, useDisconnect, useSwitchChain, usePublicClient, useWalletClient, useBalance } from 'wagmi';
|
|
8
|
+
import { toFunctionSelector, parseAbi, encodeFunctionData, formatUnits, decodeFunctionResult, decodeAbiParameters, decodeEventLog, getContractAddress, concatHex, encodeAbiParameters, keccak256 } from 'viem';
|
|
9
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
11
|
+
// src/sdk/fsiPolicy.mjs
|
|
12
|
+
var FSI_QUERY_PREFIX = "https://bsc-debug.butterfly.army/fsi/v1";
|
|
13
|
+
var FSI_ORIGIN = "https://bsc-debug.butterfly.army";
|
|
14
|
+
var FSI_PATH = "/fsi/v1";
|
|
15
|
+
var encodedPathSyntax = /%(?:2e|2f|5c|25)/i;
|
|
16
|
+
var hasDotSegment = (path) => path.split("/").some((part) => part === "." || part === "..");
|
|
17
|
+
function isFsiQueryUrl(value) {
|
|
18
|
+
try {
|
|
19
|
+
if (typeof value !== "string" || /[\\#\u0000-\u0020\u007f]/.test(value)) return false;
|
|
20
|
+
const rawPath = value.match(/^[a-z][a-z\d+.-]*:\/\/[^/?#]*([^?#]*)/i)?.[1];
|
|
21
|
+
if (rawPath === void 0 || encodedPathSyntax.test(rawPath) || hasDotSegment(rawPath)) return false;
|
|
22
|
+
const url = new URL(value);
|
|
23
|
+
return url.origin === FSI_ORIGIN && !url.username && !url.password && !url.hash && (url.pathname === FSI_PATH || url.pathname.startsWith(`${FSI_PATH}/`)) && !encodedPathSyntax.test(url.pathname);
|
|
24
|
+
} catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function hasFsiQueryDeclaration(endpoints) {
|
|
29
|
+
const urls = typeof endpoints === "string" ? [endpoints] : endpoints;
|
|
30
|
+
return Array.isArray(urls) && urls.some((value) => {
|
|
31
|
+
if (!isFsiQueryUrl(value)) return false;
|
|
32
|
+
const url = new URL(value);
|
|
33
|
+
return !url.search && (url.pathname === FSI_PATH || url.pathname === `${FSI_PATH}/`);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function buildFsiQueryUrl(path, params = {}) {
|
|
37
|
+
if (typeof path !== "string" || path.startsWith("/") || /[\\?#\s\u0000-\u001f\u007f]/.test(path)) {
|
|
38
|
+
throw new Error("FSI path must be relative to /fsi/v1 without query or fragment; pass query parameters separately.");
|
|
39
|
+
}
|
|
40
|
+
if (encodedPathSyntax.test(path) || hasDotSegment(path)) {
|
|
41
|
+
throw new Error("FSI path traversal and encoded path separators/dots are not allowed.");
|
|
42
|
+
}
|
|
43
|
+
const url = new URL(`${FSI_QUERY_PREFIX}/${path}`);
|
|
44
|
+
if (!isFsiQueryUrl(url.href)) throw new Error("FSI URL is outside the platform query allowlist.");
|
|
45
|
+
for (const [key, value] of Object.entries(params)) {
|
|
46
|
+
if (typeof value !== "string") throw new Error("FSI query parameter values must be strings.");
|
|
47
|
+
url.searchParams.set(key, value);
|
|
48
|
+
}
|
|
49
|
+
return url.href;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// src/sdk/fsi.ts
|
|
53
|
+
async function readFsiJson(endpoints, path, params, fetchImpl = fetch) {
|
|
54
|
+
if (!hasFsiQueryDeclaration(endpoints)) {
|
|
55
|
+
throw new Error("FSI requires https://bsc-debug.butterfly.army/fsi/v1 in manifest.endpoints for review.");
|
|
56
|
+
}
|
|
57
|
+
const url = buildFsiQueryUrl(path, params);
|
|
58
|
+
const response = await fetchImpl(url, {
|
|
59
|
+
method: "GET",
|
|
60
|
+
credentials: "omit",
|
|
61
|
+
redirect: "error",
|
|
62
|
+
referrerPolicy: "no-referrer",
|
|
63
|
+
cache: "no-store"
|
|
64
|
+
});
|
|
65
|
+
if (!response.ok) throw new Error(`FSI request returned ${response.status}.`);
|
|
66
|
+
return await response.json();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// src/sdk/contractWriteFees.ts
|
|
70
|
+
var MAX_CONTRACT_WRITE_GAS = 5000000n;
|
|
71
|
+
var MAX_GAS_PRICE_MULTIPLIER = 2n;
|
|
72
|
+
async function resolveSafeContractWriteFeeOverrides(request, getNetworkGasPrice) {
|
|
73
|
+
if (request.gas !== void 0) {
|
|
74
|
+
if (request.gas <= 0n) throw new Error("Contract write gas must be greater than zero.");
|
|
75
|
+
if (request.gas > MAX_CONTRACT_WRITE_GAS) {
|
|
76
|
+
throw new Error(`Contract write gas must not exceed ${MAX_CONTRACT_WRITE_GAS.toString()}.`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (request.gasPrice !== void 0) {
|
|
80
|
+
if (request.gasPrice <= 0n) throw new Error("Contract write gasPrice must be greater than zero.");
|
|
81
|
+
const networkGasPrice = await getNetworkGasPrice();
|
|
82
|
+
if (networkGasPrice <= 0n) throw new Error("The runtime returned an invalid network gas price.");
|
|
83
|
+
const maximumGasPrice = networkGasPrice * MAX_GAS_PRICE_MULTIPLIER;
|
|
84
|
+
if (request.gasPrice > maximumGasPrice) {
|
|
85
|
+
throw new Error(
|
|
86
|
+
`Contract write gasPrice ${request.gasPrice.toString()} exceeds the runtime safety limit ${maximumGasPrice.toString()}.`
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
...request.gas === void 0 ? {} : { gas: request.gas },
|
|
92
|
+
...request.gasPrice === void 0 ? {} : { gasPrice: request.gasPrice }
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// src/sdk/contractEvents.ts
|
|
97
|
+
var MAX_CONTRACT_EVENT_BLOCK_SPAN = 1000n;
|
|
98
|
+
var MAX_CONTRACT_EVENT_BLOCK_LOOKBACK = 20000n;
|
|
99
|
+
var CONTRACT_EVENT_QUERY_CONCURRENCY = 4;
|
|
100
|
+
function splitContractEventBlockRanges(fromBlock, toBlock, maxBlockSpan = MAX_CONTRACT_EVENT_BLOCK_SPAN, maxLookback = MAX_CONTRACT_EVENT_BLOCK_LOOKBACK) {
|
|
101
|
+
if (fromBlock < 0n || toBlock < 0n) {
|
|
102
|
+
throw new RangeError("Contract event block numbers must not be negative.");
|
|
103
|
+
}
|
|
104
|
+
if (maxBlockSpan <= 0n) {
|
|
105
|
+
throw new RangeError("Contract event block span must be greater than zero.");
|
|
106
|
+
}
|
|
107
|
+
if (maxLookback < 0n) {
|
|
108
|
+
throw new RangeError("Contract event block lookback must not be negative.");
|
|
109
|
+
}
|
|
110
|
+
if (toBlock < fromBlock) return [];
|
|
111
|
+
if (toBlock - fromBlock > maxLookback) {
|
|
112
|
+
throw new RangeError(`Contract event block range must not exceed ${maxLookback.toString()} blocks.`);
|
|
113
|
+
}
|
|
114
|
+
const ranges = [];
|
|
115
|
+
let cursor = fromBlock;
|
|
116
|
+
while (cursor <= toBlock) {
|
|
117
|
+
const candidateEnd = cursor + maxBlockSpan;
|
|
118
|
+
const chunkEnd = candidateEnd < toBlock ? candidateEnd : toBlock;
|
|
119
|
+
ranges.push({ fromBlock: cursor, toBlock: chunkEnd });
|
|
120
|
+
cursor = chunkEnd + 1n;
|
|
121
|
+
}
|
|
122
|
+
return ranges;
|
|
123
|
+
}
|
|
124
|
+
async function readContractEventsInBlockRanges(input) {
|
|
125
|
+
const concurrency = input.concurrency ?? CONTRACT_EVENT_QUERY_CONCURRENCY;
|
|
126
|
+
if (!Number.isInteger(concurrency) || concurrency < 1 || concurrency > CONTRACT_EVENT_QUERY_CONCURRENCY) {
|
|
127
|
+
throw new RangeError(`Contract event query concurrency must be between 1 and ${CONTRACT_EVENT_QUERY_CONCURRENCY}.`);
|
|
128
|
+
}
|
|
129
|
+
const ranges = splitContractEventBlockRanges(input.fromBlock, input.toBlock);
|
|
130
|
+
const events = [];
|
|
131
|
+
for (let index2 = 0; index2 < ranges.length; index2 += concurrency) {
|
|
132
|
+
const batch = ranges.slice(index2, index2 + concurrency);
|
|
133
|
+
const batchEvents = await Promise.all(batch.map((range) => input.readRange(range)));
|
|
134
|
+
for (const items of batchEvents) events.push(...items);
|
|
135
|
+
}
|
|
136
|
+
return events;
|
|
72
137
|
}
|
|
73
138
|
var forbiddenName = /^(?:execute(?:Call|Batch)?|multicall|delegatecall|approve|increaseAllowance|decreaseAllowance|setApprovalForAll|transferOwnership|acceptOwnership|upgradeTo.*|setConfig|setSwapPath|setSplit)$/i;
|
|
74
|
-
var forbiddenSignatures = ["
|
|
139
|
+
var forbiddenSignatures = ["executeCall(address,uint256,bytes)", "approve(address,uint256)", "setApprovalForAll(address,bool)", "transferOwnership(address)", "upgradeTo(address)", "upgradeToAndCall(address,bytes)"];
|
|
75
140
|
var forbiddenSelectors = new Set(forbiddenSignatures.map(toFunctionSelector));
|
|
141
|
+
var executeSelectors = new Set(["execute(address,uint256,bytes,uint8)", "execute(address,uint256,bytes)"].map(toFunctionSelector));
|
|
76
142
|
var hash = /^0x[0-9a-fA-F]{64}$/;
|
|
77
143
|
var index = (x) => Number.isInteger(x) && x >= 0 && x < 32;
|
|
78
144
|
function requireRule(ok, reason) {
|
|
@@ -99,7 +165,8 @@ function parseResolvedContract(input) {
|
|
|
99
165
|
const seen = /* @__PURE__ */ new Set();
|
|
100
166
|
for (const f of writes) {
|
|
101
167
|
const selector = toFunctionSelector(f);
|
|
102
|
-
|
|
168
|
+
const reviewedExecute = f.name === "execute";
|
|
169
|
+
requireRule(!["view", "pure"].includes(f.stateMutability) && (reviewedExecute || !forbiddenName.test(f.name)) && !forbiddenSelectors.has(selector) && (reviewedExecute || !executeSelectors.has(selector) && !f.inputs.some(hasDynamicBytes)), "forbidden-write");
|
|
103
170
|
requireRule(!seen.has(selector), "duplicate-selector");
|
|
104
171
|
seen.add(selector);
|
|
105
172
|
}
|
|
@@ -453,8 +520,6 @@ async function withdrawNftAccount(env, request) {
|
|
|
453
520
|
}
|
|
454
521
|
return { hash: hash2, status, accountAddress, recipient, amount: input.amount, balanceAfter };
|
|
455
522
|
}
|
|
456
|
-
|
|
457
|
-
// src/sdk/runtime.tsx
|
|
458
523
|
var EMPTY_NFT_ACCOUNT_POLICIES = Object.freeze([]);
|
|
459
524
|
var defaultNftMetadataReader = createLocalNftMetadataReader();
|
|
460
525
|
var defaultMediaUploader = createLocalMediaUploader();
|
|
@@ -492,7 +557,7 @@ function VaultRuntimeProvider({ children, manifest, i18n, runtimeContext: runtim
|
|
|
492
557
|
const { address: accountAddress, isConnected } = useAccount();
|
|
493
558
|
const connectedChainId = useChainId();
|
|
494
559
|
const { connect, connectors } = useConnect();
|
|
495
|
-
const { disconnect
|
|
560
|
+
const { disconnect } = useDisconnect();
|
|
496
561
|
const { switchChainAsync, isPending: isSwitchingChain } = useSwitchChain();
|
|
497
562
|
const effectiveChainId = runtimeOverrides?.chainId ?? hostRuntimeResult?.addresses.chainId ?? connectedChainId ?? manifest.match.bindings[0]?.chainId ?? 56;
|
|
498
563
|
const publicClient = usePublicClient({ chainId: effectiveChainId });
|
|
@@ -581,7 +646,7 @@ function VaultRuntimeProvider({ children, manifest, i18n, runtimeContext: runtim
|
|
|
581
646
|
const connector = connectors[0];
|
|
582
647
|
if (connector) connect({ connector });
|
|
583
648
|
},
|
|
584
|
-
disconnect: () =>
|
|
649
|
+
disconnect: () => disconnect(),
|
|
585
650
|
switchChain: async () => {
|
|
586
651
|
if (previewWallet) {
|
|
587
652
|
throw new Error(`Switch wallet to ${chainLabelForChain(runtimeContext.chainId)} before continuing.`);
|
|
@@ -593,7 +658,7 @@ function VaultRuntimeProvider({ children, manifest, i18n, runtimeContext: runtim
|
|
|
593
658
|
}
|
|
594
659
|
};
|
|
595
660
|
},
|
|
596
|
-
[accountAddress, connect, connectedChainId, connectors,
|
|
661
|
+
[accountAddress, connect, connectedChainId, connectors, disconnect, isConnected, isSwitchingChain, nativeBalance, runtimeContext.chainId, runtimeOverrides?.previewWallet, switchChainAsync]
|
|
597
662
|
);
|
|
598
663
|
const assertWalletWriteReady = useCallback(
|
|
599
664
|
(actionLabel) => {
|
|
@@ -710,7 +775,7 @@ function VaultRuntimeProvider({ children, manifest, i18n, runtimeContext: runtim
|
|
|
710
775
|
if (!publicClient || !contractRuntime) throw new Error("resolved-contract/client-unavailable");
|
|
711
776
|
const contract = input.contract;
|
|
712
777
|
const prepared = contractRuntime.snapshot(input);
|
|
713
|
-
prepared.request = snapshotGenericContractWrite(prepared.request);
|
|
778
|
+
if (!prepared.record) prepared.request = snapshotGenericContractWrite(prepared.request);
|
|
714
779
|
const feeOverrides = await resolveSafeContractWriteFeeOverrides(prepared.request, getGasPrice);
|
|
715
780
|
const checked = await contractRuntime.validate(prepared, true);
|
|
716
781
|
const request = checked.request;
|
|
@@ -734,7 +799,7 @@ function VaultRuntimeProvider({ children, manifest, i18n, runtimeContext: runtim
|
|
|
734
799
|
assertWalletWriteReady(`writing ${input.functionName}`);
|
|
735
800
|
if (!walletClient || !publicClient || !contractRuntime) throw new Error("resolved-contract/client-unavailable");
|
|
736
801
|
const prepared = contractRuntime.snapshot(input);
|
|
737
|
-
prepared.request = snapshotGenericContractWrite(prepared.request);
|
|
802
|
+
if (!prepared.record) prepared.request = snapshotGenericContractWrite(prepared.request);
|
|
738
803
|
const feeOverrides = await resolveSafeContractWriteFeeOverrides(prepared.request, getGasPrice);
|
|
739
804
|
let checked = await contractRuntime.validate(prepared, true);
|
|
740
805
|
if (prepared.record) {
|
|
@@ -792,6 +857,12 @@ function VaultRuntimeProvider({ children, manifest, i18n, runtimeContext: runtim
|
|
|
792
857
|
},
|
|
793
858
|
[oracleReader, runtimeContext]
|
|
794
859
|
);
|
|
860
|
+
const fsiEndpointsRef = useRef(runtimeContext.manifest.endpoints);
|
|
861
|
+
fsiEndpointsRef.current = runtimeContext.manifest.endpoints;
|
|
862
|
+
const readFsi = useCallback(
|
|
863
|
+
(path, params) => readFsiJson(fsiEndpointsRef.current, path, params),
|
|
864
|
+
[]
|
|
865
|
+
);
|
|
795
866
|
const readNftMetadata = useCallback(
|
|
796
867
|
async (request) => {
|
|
797
868
|
if (request.tokenId < 0n) throw new Error("NFT tokenId must not be negative.");
|
|
@@ -902,25 +973,8 @@ function VaultRuntimeProvider({ children, manifest, i18n, runtimeContext: runtim
|
|
|
902
973
|
}
|
|
903
974
|
}, [assertWalletWriteReady, nftWithdrawalEnvironment, publicClient, refetch, runtimeContext, walletClient]);
|
|
904
975
|
const componentContext = useMemo(() => structuredClone(runtimeContext), [runtimeContext]);
|
|
905
|
-
const chainRuntime = useFlapWalletRuntime({ connect: wallet.connect, mediaUploader: mediaUploader ?? defaultMediaUploader });
|
|
906
|
-
const forChain = useCallback((chainId) => createFlapChainSdk({
|
|
907
|
-
...chainRuntime,
|
|
908
|
-
// Reuse the Vault's strict target and resolver policies for scoped access too.
|
|
909
|
-
simulateContract: async (_chainId, request) => {
|
|
910
|
-
if (_chainId !== runtimeContext.chainId) throw new Error("Vault writes require the bound network.");
|
|
911
|
-
return (await simulateContract(request)).result;
|
|
912
|
-
},
|
|
913
|
-
writeContract: async (_chainId, request) => {
|
|
914
|
-
if (_chainId !== runtimeContext.chainId) throw new Error("Vault writes require the bound network.");
|
|
915
|
-
return writeContract(request);
|
|
916
|
-
},
|
|
917
|
-
sendTransaction: async () => {
|
|
918
|
-
throw new Error("Raw transactions require a reviewed standalone App.");
|
|
919
|
-
}
|
|
920
|
-
}, { chainId, manifest, writableChains: [runtimeContext.chainId], i18n: i18nApi, notify }), [chainRuntime, manifest, runtimeContext.chainId, i18nApi, notify, simulateContract, writeContract]);
|
|
921
976
|
const sdk = useMemo(
|
|
922
977
|
() => ({
|
|
923
|
-
forChain,
|
|
924
978
|
context: componentContext,
|
|
925
979
|
i18n: i18nApi,
|
|
926
980
|
notify,
|
|
@@ -935,6 +989,7 @@ function VaultRuntimeProvider({ children, manifest, i18n, runtimeContext: runtim
|
|
|
935
989
|
waitForTx,
|
|
936
990
|
withdrawNftAccount: withdrawNftAccount2,
|
|
937
991
|
readOracle,
|
|
992
|
+
readFsi,
|
|
938
993
|
readNftMetadata,
|
|
939
994
|
uploadImage,
|
|
940
995
|
uploadText,
|
|
@@ -942,18 +997,21 @@ function VaultRuntimeProvider({ children, manifest, i18n, runtimeContext: runtim
|
|
|
942
997
|
refetchNonce: version,
|
|
943
998
|
openExplorerTx
|
|
944
999
|
}),
|
|
945
|
-
[
|
|
1000
|
+
[getBlockNumber, getContractEvents, getGasPrice, i18nApi, notify, openExplorerTx, resolveContract, readContract, readNftMetadata, readOracle, readFsi, refetch, componentContext, simulateContract, uploadImage, uploadText, version, waitForTx, wallet, withdrawNftAccount2, writeContract]
|
|
946
1001
|
);
|
|
947
|
-
return /* @__PURE__ */
|
|
948
|
-
|
|
949
|
-
{
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
1002
|
+
return /* @__PURE__ */ jsxs(RuntimeContext.Provider, { value: sdk, children: [
|
|
1003
|
+
children,
|
|
1004
|
+
/* @__PURE__ */ jsx("div", { className: "pointer-events-none fixed bottom-4 right-4 z-50 flex w-[min(360px,calc(100vw-2rem))] flex-col gap-2", children: messages.map((message) => /* @__PURE__ */ jsx("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx(
|
|
1005
|
+
Alert,
|
|
1006
|
+
{
|
|
1007
|
+
tone: message.level === "error" ? "danger" : message.level,
|
|
1008
|
+
className: "cursor-pointer shadow-panel backdrop-blur-sm transition hover:translate-y-[-1px]",
|
|
1009
|
+
children: /* @__PURE__ */ jsx("button", { type: "button", className: "w-full text-left", onClick: () => dismissMessage(message.id), children: message.message })
|
|
1010
|
+
}
|
|
1011
|
+
) }, message.id)) })
|
|
1012
|
+
] });
|
|
955
1013
|
}
|
|
956
1014
|
|
|
957
|
-
export { VaultRuntimeProvider
|
|
958
|
-
//# sourceMappingURL=chunk-
|
|
959
|
-
//# sourceMappingURL=chunk-
|
|
1015
|
+
export { VaultRuntimeProvider };
|
|
1016
|
+
//# sourceMappingURL=chunk-QLVWFL4T.js.map
|
|
1017
|
+
//# sourceMappingURL=chunk-QLVWFL4T.js.map
|