@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
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flapsdk/vault-runtime",
|
|
3
|
-
"version": "0.1.36
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "0.1.36",
|
|
4
|
+
"gitHead": "0c506f00cf77a5c8dde0d51034e98d4144ef01da",
|
|
5
5
|
"description": "Shared runtime surface for Flap Vault UI hosts, Workbench preview, and custom Vault components.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"@rainbow-me/rainbowkit": "^2.1.7"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
48
|
-
"access": "public"
|
|
49
|
-
"tag": "next"
|
|
48
|
+
"access": "public"
|
|
50
49
|
}
|
|
51
50
|
}
|
package/runtime-contract.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"runtimeContractVersion": 1,
|
|
3
3
|
"sdkFeatures": {
|
|
4
|
-
"flapWallet": 1,
|
|
5
4
|
"nftAccountWithdrawal": 1,
|
|
6
5
|
"resolvedContracts": 1,
|
|
7
6
|
"strictContractTargets": 1,
|
|
8
7
|
"hostOnlyProvider": 1
|
|
9
8
|
},
|
|
10
9
|
"packageName": "@flapsdk/vault-runtime",
|
|
11
|
-
"packageVersion": "0.1.36
|
|
10
|
+
"packageVersion": "0.1.36",
|
|
12
11
|
"stableAuthoringAliases": [
|
|
13
12
|
"@/src/sdk",
|
|
14
13
|
"@/src/ui"
|
package/sdk.d.mts
CHANGED
|
@@ -1,40 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as ActionAvailabilityStage,
|
|
3
|
-
export {
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ae as VaultLaunchSchema, ab as VaultLaunchConfigResult, I as IpfsUploadResult, G as MediaUploader, D as MediaUploadRequest, P as NftMetadataReader, L as NftMetadataAttribute, k as FlapVaultSdk, a as Address, am as VaultRuntimeContext, f as FlapI18n, g as FlapNotify, l as FlapWallet } from './types-BbjEsfiD.mjs';
|
|
2
|
+
export { A as ActionAvailabilityStage, C as ContractEventRequest, b as ContractReadRequest, c as ContractWriteRequest, F as FeeMode, e as FlapFeeVaultInfo, h as FlapTaxInfo, i as FlapTokenInfo, j as FlapVaultPortalInfo, M as ManifestBindingEntry, y as ManifestNftAccountWithdrawal, z as ManifestResolvedContract, B as MediaUploadOptions, N as NftAccountWithdrawalPolicy, J as NftAccountWithdrawalReceipt, K as NftAccountWithdrawalRequest, O as NftMetadataReadRequest, Q as NftMetadataReaderRequest, R as NftMetadataSnapshot, S as NftMetadataSource, T as OracleProvision, U as OracleReadRequest, V as OracleReader, X as PaymentToken, Y as ResolvedContractCheck, Z as ResolvedContractHandle, _ as ReviewedBeaconPin, $ as ReviewedContractPin, a0 as RuntimeOracleRegistry, a1 as SimulateResult, a2 as TokenMarketPhase, a5 as TxReceipt, a6 as VaultArtifactSurface, a7 as VaultComponentProps, a8 as VaultHostContext, a9 as VaultLaunchConfigComponentProps, aa as VaultLaunchConfigContext, ac as VaultLaunchConfigSummaryItem, ad as VaultLaunchConfigValues, af as VaultLaunchSchemaField, ag as VaultManifest, al as VaultRenderSurface, an as VaultRuntimeContextOverrides, ao as VaultRuntimeExtraConfig } from './types-BbjEsfiD.mjs';
|
|
3
|
+
export { O as OracleReadError, Z as ZERO_ADDRESS, c as buildLocalOracleUrl, d as createLocalOracleReader, f as fetchOracleJson, g as fetchProvisionedOracle, h as formatCountdown, i as formatPercentBps, j as formatTokenAmount, l as getTxErrorKind, m as handleTxError, n as isActionAvailableForPhase, o as isCustomVaultTaxToken, r as isValidAddress, y as parseTokenAmount, A as readTaxVaultHostContext, F as resolveTokenMarketPhase, H as shortenAddress, I as standardErc20Abi } from './txError-DmiNOh9R.mjs';
|
|
6
4
|
export { erc20Abi } from 'viem';
|
|
7
5
|
|
|
8
|
-
interface MiniAppSession {
|
|
9
|
-
address?: Address;
|
|
10
|
-
isConnected: boolean;
|
|
11
|
-
isAuthenticated: boolean;
|
|
12
|
-
isLoading: boolean;
|
|
13
|
-
connect(): void;
|
|
14
|
-
/** Uses the host's existing session; only prompts for a signature when needed. */
|
|
15
|
-
signIn(): Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
interface MiniAppSdk {
|
|
18
|
-
context: {
|
|
19
|
-
appId: string;
|
|
20
|
-
slug: string;
|
|
21
|
-
manifest: VaultManifest;
|
|
22
|
-
};
|
|
23
|
-
session: MiniAppSession;
|
|
24
|
-
i18n: FlapI18n;
|
|
25
|
-
notify: FlapNotify;
|
|
26
|
-
forChain(chainId: number): FlapChainSdk;
|
|
27
|
-
}
|
|
28
|
-
declare function MiniAppRuntimeProvider({ manifest, session, i18n, notify, runtime, children }: {
|
|
29
|
-
manifest: VaultManifest;
|
|
30
|
-
session: MiniAppSession;
|
|
31
|
-
i18n: FlapI18n;
|
|
32
|
-
notify: FlapNotify;
|
|
33
|
-
children: ReactNode;
|
|
34
|
-
runtime?: FlapWalletRuntime;
|
|
35
|
-
}): React.JSX.Element;
|
|
36
|
-
declare function useMiniAppSdk(): MiniAppSdk;
|
|
37
|
-
|
|
38
6
|
declare function isIpfsImageCid(value: string): boolean;
|
|
39
7
|
declare function normalizeIpfsImagePath(value: string | undefined): string | undefined;
|
|
40
8
|
declare function resolveIpfsImageUrl(cid: string, chainId?: number, path?: string): string | undefined;
|
|
@@ -172,11 +140,7 @@ declare function readVideoSessionSlice(sdk: VideoSdk, consumer: Address, start:
|
|
|
172
140
|
/** Uses the host's shared chain client; callers cannot supply a provider or RPC. */
|
|
173
141
|
declare function createConsumerVideoSessionReader(sdk: VideoSdk, consumer: Address): ConsumerVideoSessionReader;
|
|
174
142
|
|
|
175
|
-
/** Existing Vault calls keep their token context. Independent Apps select a chain. */
|
|
176
143
|
declare function useFlapSdk(): FlapVaultSdk;
|
|
177
|
-
declare function useFlapSdk(options: {
|
|
178
|
-
chainId: number;
|
|
179
|
-
}): FlapChainSdk;
|
|
180
144
|
declare function useVaultContext(): VaultRuntimeContext;
|
|
181
145
|
declare function useFlapI18n(): FlapI18n;
|
|
182
146
|
declare function useFlapNotify(): FlapNotify;
|
|
@@ -188,4 +152,4 @@ declare const NFT_ACCOUNT_WITHDRAWAL_VERSION = 1;
|
|
|
188
152
|
|
|
189
153
|
declare const RESOLVED_CONTRACTS_VERSION = 1;
|
|
190
154
|
|
|
191
|
-
export { Address, type ConsumerVideoClip, type ConsumerVideoSessionReader,
|
|
155
|
+
export { Address, type ConsumerVideoClip, type ConsumerVideoSessionReader, FlapI18n, FlapNotify, FlapVaultSdk, FlapWallet, IMAGE_UPLOAD_MEDIA_TYPES, IpfsUploadResult, type LocalNftMetadataReaderOptions, MAX_IMAGE_UPLOAD_BYTES, MAX_TEXT_UPLOAD_BYTES, MediaUploadError, MediaUploadRequest, MediaUploader, type MiniApp3DDecoderUrls, NFT_ACCOUNT_WITHDRAWAL_VERSION, NftMetadataAttribute, NftMetadataReader, RESOLVED_CONTRACTS_VERSION, RUNTIME_UPLOAD_ENDPOINT, VAULT_LAUNCH_SCHEMA_ABI, VaultLaunchConfigResult, VaultLaunchSchema, VaultRuntimeContext, VideoSessionReadError, createConsumerVideoSessionReader, createIpfsUploadResult, createLocalMediaUploader, createLocalNftMetadataReader, isIpfsImageCid, isVaultLaunchConfigResultForSchema, nftTokenUriAbi, normalizeInlineNftImage, normalizeIpfsImagePath, parseInlineNftMetadata, parseVaultLaunchSchema, readVideoSessionLength, readVideoSessionSlice, resolveIpfsImageUrl, resolveIpfsImageUrls, resolveMiniApp3DAssetUrl, resolveMiniApp3DDecoderUrls, sanitizeNftMetadataRecord, useVaultContext as useFlapChain, useFlapI18n, useFlapNotify, useFlapSdk, useFlapWallet, useVaultContext, validateMediaUpload, vaultV2NftAbi };
|
package/sdk.js
CHANGED
|
@@ -1,46 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import { createFlapChainSdk } from './chunk-A3ER7XYN.js';
|
|
6
|
-
export { FLAP_WALLET_RUNTIME_VERSION } from './chunk-A3ER7XYN.js';
|
|
2
|
+
export { erc20Abi, getTxErrorKind, handleTxError, standardErc20Abi } from './chunk-22KTLOYH.js';
|
|
3
|
+
import './chunk-QLVWFL4T.js';
|
|
4
|
+
import './chunk-AGLB72HK.js';
|
|
7
5
|
export { IMAGE_UPLOAD_MEDIA_TYPES, MAX_IMAGE_UPLOAD_BYTES, MAX_TEXT_UPLOAD_BYTES, MediaUploadError, RUNTIME_UPLOAD_ENDPOINT, createIpfsUploadResult, createLocalMediaUploader, createLocalNftMetadataReader, nftTokenUriAbi, normalizeInlineNftImage, parseInlineNftMetadata, sanitizeNftMetadataRecord, validateMediaUpload, vaultV2NftAbi } from './chunk-PU7VEZWA.js';
|
|
8
6
|
export { OracleReadError, buildLocalOracleUrl, createLocalOracleReader, fetchOracleJson, fetchProvisionedOracle } from './chunk-JLI25XFB.js';
|
|
9
|
-
import {
|
|
10
|
-
export { VideoSessionReadError, createConsumerVideoSessionReader, readVideoSessionLength, readVideoSessionSlice, useVaultContext as useFlapChain, useFlapI18n, useFlapNotify, useFlapSdk, useVaultContext } from './chunk-
|
|
7
|
+
import { useFlapSdk } from './chunk-IN34R3DY.js';
|
|
8
|
+
export { VideoSessionReadError, createConsumerVideoSessionReader, readVideoSessionLength, readVideoSessionSlice, useVaultContext as useFlapChain, useFlapI18n, useFlapNotify, useFlapSdk, useVaultContext } from './chunk-IN34R3DY.js';
|
|
11
9
|
export { ZERO_ADDRESS, formatCountdown, formatPercentBps, formatTokenAmount, isActionAvailableForPhase, isCustomVaultTaxToken, isValidAddress, parseTokenAmount, readTaxVaultHostContext, resolveTokenMarketPhase, shortenAddress } from './chunk-B4WKI3EW.js';
|
|
12
10
|
export { isIpfsImageCid, normalizeIpfsImagePath, resolveIpfsImageUrl, resolveIpfsImageUrls } from './chunk-SAG36LUR.js';
|
|
13
11
|
import './chunk-FUOBTZMQ.js';
|
|
14
12
|
import './chunk-BUSYA2B4.js';
|
|
15
|
-
import { useRef, useMemo, useContext } from 'react';
|
|
16
|
-
|
|
17
|
-
function MiniAppRuntimeProvider({ manifest, session, i18n, notify, runtime, children }) {
|
|
18
|
-
const current = useRef({ manifest, runtime });
|
|
19
|
-
current.current = { manifest, runtime };
|
|
20
|
-
const sdk = useMemo(() => {
|
|
21
|
-
const writableChains = [...manifest.walletChains ?? []];
|
|
22
|
-
const chainSdks = /* @__PURE__ */ new Map();
|
|
23
|
-
return { context: { appId: manifest.artifactId, slug: manifest.slug, manifest: structuredClone(manifest) }, session, i18n, notify, forChain: (chainId) => {
|
|
24
|
-
if (!runtime) throw new Error("This host has not enabled wallet operations for Apps.");
|
|
25
|
-
let chainSdk = chainSdks.get(chainId);
|
|
26
|
-
if (!chainSdk) {
|
|
27
|
-
chainSdk = createFlapChainSdk({ ...runtime, assertActive: () => {
|
|
28
|
-
if (current.current.manifest !== manifest || current.current.runtime !== runtime) throw new Error("The host wallet or App context changed. Review the transaction again.");
|
|
29
|
-
runtime.assertActive?.();
|
|
30
|
-
} }, { chainId, manifest, writableChains, i18n, notify });
|
|
31
|
-
chainSdks.set(chainId, chainSdk);
|
|
32
|
-
}
|
|
33
|
-
return chainSdk;
|
|
34
|
-
} };
|
|
35
|
-
}, [manifest, runtime, session, i18n, notify]);
|
|
36
|
-
if (!isStandaloneMiniApp(manifest)) throw new Error("A standalone Mini App v2 manifest is required.");
|
|
37
|
-
return /* @__PURE__ */ React.createElement(MiniAppContext.Provider, { value: sdk }, children);
|
|
38
|
-
}
|
|
39
|
-
function useMiniAppSdk() {
|
|
40
|
-
const sdk = useContext(MiniAppContext);
|
|
41
|
-
if (!sdk) throw new Error("useMiniAppSdk requires MiniAppRuntimeProvider.");
|
|
42
|
-
return sdk;
|
|
43
|
-
}
|
|
44
13
|
|
|
45
14
|
// src/sdk/launchConfig.ts
|
|
46
15
|
var VAULT_LAUNCH_SCHEMA_ABI = [{
|
|
@@ -121,6 +90,6 @@ function useFlapWallet() {
|
|
|
121
90
|
var NFT_ACCOUNT_WITHDRAWAL_VERSION = 1;
|
|
122
91
|
var RESOLVED_CONTRACTS_VERSION = 1;
|
|
123
92
|
|
|
124
|
-
export {
|
|
93
|
+
export { NFT_ACCOUNT_WITHDRAWAL_VERSION, RESOLVED_CONTRACTS_VERSION, VAULT_LAUNCH_SCHEMA_ABI, isVaultLaunchConfigResultForSchema, parseVaultLaunchSchema, resolveMiniApp3DAssetUrl, resolveMiniApp3DDecoderUrls, useFlapWallet };
|
|
125
94
|
//# sourceMappingURL=sdk.js.map
|
|
126
95
|
//# sourceMappingURL=sdk.js.map
|
package/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/sdk/miniAppRuntime.tsx","../../src/sdk/launchConfig.ts","../../src/sdk/three.ts","../../src/sdk/useFlapWallet.ts","../../src/sdk/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAuBO,SAAS,sBAAA,CAAuB,EAAE,QAAA,EAAU,OAAA,EAAS,MAAM,MAAA,EAAQ,OAAA,EAAS,UAAS,EAEzF;AACD,EAAA,MAAM,OAAA,GAAU,MAAA,CAAO,EAAE,QAAA,EAAU,SAAS,CAAA;AAAG,EAAA,OAAA,CAAQ,OAAA,GAAU,EAAE,QAAA,EAAU,OAAA,EAAQ;AACrF,EAAA,MAAM,GAAA,GAAM,QAAoB,MAAM;AACpC,IAAA,MAAM,iBAAiB,CAAC,GAAI,QAAA,CAAS,YAAA,IAAgB,EAAG,CAAA;AACxD,IAAA,MAAM,SAAA,uBAAgB,GAAA,EAA0B;AAChD,IAAA,OAAO,EAAE,OAAA,EAAS,EAAE,OAAO,QAAA,CAAS,UAAA,EAAY,MAAM,QAAA,CAAS,IAAA,EAAO,UAAU,eAAA,CAAgB,QAAQ,GAAE,EAAG,OAAA,EAAS,MAAM,MAAA,EAAQ,QAAA,EAAU,CAAC,OAAA,KAAY;AACzJ,MAAA,IAAI,CAAC,OAAA,EAAS,MAAM,IAAI,MAAM,uDAAuD,CAAA;AACrF,MAAA,IAAI,QAAA,GAAW,SAAA,CAAU,GAAA,CAAI,OAAO,CAAA;AACpC,MAAA,IAAI,CAAC,Q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AAQ,IAAI,GAAA,CAAI,QAAA,EAAU,cAAc,CAAA;AAC9C,EAAA,MAAM,eAAA,GAAkB,cAAA,CAAe,QAAA,CAAS,KAAA,CAAM,CAAA,EAAG,eAAe,QAAA,CAAS,WAAA,CAAY,GAAG,CAAA,GAAI,CAAC,CAAA;AACrG,EAAA,IAAI,KAAA,CAAM,MAAA,KAAW,cAAA,CAAe,MAAA,IAAU,CAAC,KAAA,CAAM,QAAA,CAAS,UAAA,CAAW,CAAA,EAAG,eAAe,CAAA,OAAA,CAAS,CAAA,EAAG;AACrG,IAAA,MAAM,IAAI,MAAM,6EAA6E,CAAA;AAAA,EAC/F;AACA,EAAA,OAAO,KAAA,CAAM,IAAA;AACf;AAGO,SAAS,wBAAA,CAAyB,UAAkB,SAAA,EAAmB;AAC5E,EAAA,OAAO,sBAAA,CAAuB,UAAU,SAAS,CAAA;AACnD;AAGO,SAAS,2BAAA,CAA4B,MAA4B,SAAA,EAAyC;AAC/G,EAAA,OAAO;AAAA,IACL,GAAI,IAAA,CAAK,KAAA,GAAQ,EAAE,KAAA,EAAO,sBAAA,CAAuB,IAAA,CAAK,KAAA,EAAO,SAAS,CAAA,EAAE,GAAI,EAAC;AAAA,IAC7E,GAAI,IAAA,CAAK,IAAA,GAAO,EAAE,IAAA,EAAM,sBAAA,CAAuB,IAAA,CAAK,IAAA,EAAM,SAAS,CAAA,EAAE,GAAI;AAAC,GAC5E;AACF;;;ACxBO,SAAS,aAAA,GAAgB;AAC9B,EAAA,OAAO,YAAW,CAAE,MAAA;AACtB;;;ACqEO,IAAM,8BAAA,GAAiC;AAGvC,IAAM,0BAAA,GAA6B","file":"sdk.js","sourcesContent":["\"use client\";\nimport { useContext, useMemo, useRef, type ReactNode } from \"react\";\nimport type { Address, FlapI18n, FlapNotify, VaultManifest } from \"./types\";\nimport { MiniAppContext } from \"./runtimeStore\";\nimport { createFlapChainSdk, type FlapChainSdk, type FlapWalletRuntime } from \"./flapChainRuntime\";\nimport { isStandaloneMiniApp } from \"./miniApp\";\n\nexport interface MiniAppSession {\n address?: Address;\n isConnected: boolean;\n isAuthenticated: boolean;\n isLoading: boolean;\n connect(): void;\n /** Uses the host's existing session; only prompts for a signature when needed. */\n signIn(): Promise<void>;\n}\nexport interface MiniAppSdk {\n context: { appId: string; slug: string; manifest: VaultManifest };\n session: MiniAppSession;\n i18n: FlapI18n;\n notify: FlapNotify;\n forChain(chainId: number): FlapChainSdk;\n}\nexport function MiniAppRuntimeProvider({ manifest, session, i18n, notify, runtime, children }: {\n manifest: VaultManifest; session: MiniAppSession; i18n: FlapI18n; notify: FlapNotify; children: ReactNode; runtime?: FlapWalletRuntime;\n}) {\n const current = useRef({ manifest, runtime }); current.current = { manifest, runtime };\n const sdk = useMemo<MiniAppSdk>(() => {\n const writableChains = [...(manifest.walletChains ?? [])];\n const chainSdks = new Map<number, FlapChainSdk>();\n return { context: { appId: manifest.artifactId, slug: manifest.slug!, manifest: structuredClone(manifest) }, session, i18n, notify, forChain: (chainId) => {\n if (!runtime) throw new Error(\"This host has not enabled wallet operations for Apps.\");\n let chainSdk = chainSdks.get(chainId);\n if (!chainSdk) { chainSdk = createFlapChainSdk({ ...runtime, assertActive: () => { if (current.current.manifest !== manifest || current.current.runtime !== runtime) throw new Error(\"The host wallet or App context changed. Review the transaction again.\"); runtime.assertActive?.(); } }, { chainId, manifest, writableChains, i18n, notify }); chainSdks.set(chainId, chainSdk); }\n return chainSdk;\n } };\n }, [manifest, runtime, session, i18n, notify]);\n if (!isStandaloneMiniApp(manifest)) throw new Error(\"A standalone Mini App v2 manifest is required.\");\n return <MiniAppContext.Provider value={sdk}>{children}</MiniAppContext.Provider>;\n}\nexport function useMiniAppSdk(): MiniAppSdk {\n const sdk = useContext(MiniAppContext);\n if (!sdk) throw new Error(\"useMiniAppSdk requires MiniAppRuntimeProvider.\");\n return sdk;\n}\n","import type { VaultLaunchConfigResult, VaultLaunchSchema } from \"./types\";\n\n/** Public IVaultSchemasV1 interface. Reading and encoding belong to the host, not the form. */\nexport const VAULT_LAUNCH_SCHEMA_ABI = [{\n type: \"function\",\n name: \"vaultDataSchema\",\n stateMutability: \"view\",\n inputs: [],\n outputs: [{\n name: \"schema\",\n type: \"tuple\",\n components: [\n { name: \"description\", type: \"string\" },\n { name: \"fields\", type: \"tuple[]\", components: [\n { name: \"name\", type: \"string\" },\n { name: \"fieldType\", type: \"string\" },\n { name: \"description\", type: \"string\" },\n { name: \"decimals\", type: \"uint8\" },\n ] },\n { name: \"isArray\", type: \"bool\" },\n ],\n }],\n}] as const;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\n/** Normalize decoded chain data and fail closed on malformed/ambiguous field definitions. */\nexport function parseVaultLaunchSchema(value: unknown): VaultLaunchSchema {\n if (!isRecord(value) || typeof value.isArray !== \"boolean\" || typeof value.description !== \"string\"\n || !Array.isArray(value.fields) || value.fields.length > 100) {\n throw new Error(\"Invalid vault launch schema.\");\n }\n const names = new Set<string>();\n const fields = value.fields.map((field: unknown) => {\n if (!isRecord(field) || typeof field.name !== \"string\" || !/^[A-Za-z_][A-Za-z0-9_]{0,63}$/.test(field.name)\n || names.has(field.name) || [\"__proto__\", \"constructor\", \"prototype\"].includes(field.name)\n || typeof field.fieldType !== \"string\" || !field.fieldType.trim() || field.fieldType.length > 100\n || typeof field.description !== \"string\" || !Number.isInteger(field.decimals)\n || (field.decimals as number) < 0 || (field.decimals as number) > 255) {\n throw new Error(\"Invalid vault launch schema field.\");\n }\n names.add(field.name);\n return { name: field.name, fieldType: field.fieldType, description: field.description, decimals: field.decimals as number };\n });\n return { description: value.description, isArray: value.isArray, fields };\n}\n\n/** Shape gate shared by preview hosts. Hosts must still validate field types/policies and ABI-encode. */\nexport function isVaultLaunchConfigResultForSchema(value: unknown, schema: VaultLaunchSchema): value is VaultLaunchConfigResult {\n if (!isRecord(value)) return false;\n if (value.status === \"invalid\") return value.errors === undefined\n || (Array.isArray(value.errors) && value.errors.length <= 100 && value.errors.every((error) => typeof error === \"string\"));\n if (value.status !== \"valid\") return false;\n if (value.summary !== undefined && (!Array.isArray(value.summary) || value.summary.length > 12\n || !value.summary.every((item) => isRecord(item) && typeof item.label === \"string\" && item.label.length <= 160\n && typeof item.value === \"string\" && item.value.length <= 160))) return false;\n if (schema.isArray !== Array.isArray(value.values)) return false;\n const rows = schema.isArray ? value.values as unknown[] : [value.values];\n if (rows.length === 0 || rows.length > 100) return false;\n const names = schema.fields.map((field) => field.name);\n return rows.every((row) => isRecord(row) && Object.keys(row).length === names.length\n && names.every((name) => Object.hasOwn(row, name) && row[name] !== undefined));\n}\n","export interface MiniApp3DDecoderUrls {\n draco?: string;\n ktx2?: string;\n}\n\nfunction assertArtifactAssetUrl(assetUrl: string, moduleUrl: string) {\n const moduleLocation = new URL(moduleUrl);\n const asset = new URL(assetUrl, moduleLocation);\n const moduleDirectory = moduleLocation.pathname.slice(0, moduleLocation.pathname.lastIndexOf(\"/\") + 1);\n if (asset.origin !== moduleLocation.origin || !asset.pathname.startsWith(`${moduleDirectory}assets/`)) {\n throw new Error(\"Mini App 3D assets must resolve from the current artifact assets/ manifest.\");\n }\n return asset.href;\n}\n\n/** Resolve a statically imported 3D asset without permitting remote/CDN fallback. */\nexport function resolveMiniApp3DAssetUrl(assetUrl: string, moduleUrl: string) {\n return assertArtifactAssetUrl(assetUrl, moduleUrl);\n}\n\n/** Return artifact-relative decoder URLs for DRACO/KTX2 loader configuration. */\nexport function resolveMiniApp3DDecoderUrls(urls: MiniApp3DDecoderUrls, moduleUrl: string): MiniApp3DDecoderUrls {\n return {\n ...(urls.draco ? { draco: assertArtifactAssetUrl(urls.draco, moduleUrl) } : {}),\n ...(urls.ktx2 ? { ktx2: assertArtifactAssetUrl(urls.ktx2, moduleUrl) } : {}),\n };\n}\n","import { useFlapSdk } from \"./runtime\";\n\nexport function useFlapWallet() {\n return useFlapSdk().wallet;\n}\n","\"use client\";\n\nexport * from \"./contract\";\nexport * from \"./miniApp\";\nexport * from \"./miniAppRuntime\";\nexport * from \"./erc20\";\nexport * from \"./format\";\nexport * from \"./ipfsImage\";\nexport * from \"./launchConfig\";\nexport * from \"./mediaUpload\";\nexport * from \"./nftMetadata\";\nexport * from \"./oracle\";\nexport * from \"./three\";\nexport * from \"./videoSession\";\nexport { useFlapI18n, useFlapNotify, useFlapSdk, useVaultContext } from \"./runtimeStore\";\nexport { ZERO_ADDRESS, isActionAvailableForPhase, isCustomVaultTaxToken, isValidAddress, readTaxVaultHostContext, resolveTokenMarketPhase } from \"./taxInfo\";\nexport { getTxErrorKind, handleTxError } from \"./txError\";\nexport { useFlapChain } from \"./useFlapChain\";\nexport { useFlapWallet } from \"./useFlapWallet\";\nexport type {\n ActionAvailabilityStage,\n Address,\n ContractEventRequest,\n ContractReadRequest,\n ContractWriteRequest,\n FeeMode,\n FlapFeeVaultInfo,\n FlapI18n,\n FlapNotify,\n FlapTaxInfo,\n FlapTokenInfo,\n FlapVaultPortalInfo,\n FlapVaultSdk,\n FlapWallet,\n ManifestBindingEntry,\n IpfsUploadResult,\n MediaUploader,\n MediaUploadOptions,\n MediaUploadRequest,\n NftMetadataAttribute,\n NftMetadataReader,\n NftMetadataReaderRequest,\n NftMetadataReadRequest,\n NftMetadataSnapshot,\n NftMetadataSource,\n OracleProvision,\n OracleReadRequest,\n OracleReader,\n PaymentToken,\n RuntimeOracleRegistry,\n SimulateResult,\n TokenMarketPhase,\n TxReceipt,\n VaultComponentProps,\n VaultHostContext,\n VaultArtifactSurface,\n VaultLaunchConfigComponentProps,\n VaultLaunchConfigContext,\n VaultLaunchConfigResult,\n VaultLaunchConfigSummaryItem,\n VaultLaunchConfigValues,\n VaultLaunchSchema,\n VaultLaunchSchemaField,\n VaultManifest,\n VaultRenderSurface,\n VaultRuntimeContext,\n VaultRuntimeContextOverrides,\n VaultRuntimeExtraConfig,\n} from \"./types\";\n\nexport type { ManifestNftAccountWithdrawal, NftAccountWithdrawalPolicy, NftAccountWithdrawalRequest, NftAccountWithdrawalReceipt, ReviewedContractPin, ReviewedBeaconPin } from \"./nftAccountTypes\";\n\n/** Host feature check; declarations must fail closed on older runtimes. */\nexport const NFT_ACCOUNT_WITHDRAWAL_VERSION = 1;\n\nexport type { ManifestResolvedContract, ResolvedContractCheck, ResolvedContractHandle } from \"./resolvedContractTypes\";\nexport const RESOLVED_CONTRACTS_VERSION = 1;\n\nexport { FLAP_WALLET_RUNTIME_VERSION } from \"./flapChainRuntime\";\nexport type { FlapChainSdk, FlapSendTransactionRequest, FlapTransactionReceipt } from \"./flapChainRuntime\";\n\nexport type { AppWalletContract, AppResolvedContract } from \"./appWalletPolicy.mjs\";\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/sdk/launchConfig.ts","../../src/sdk/three.ts","../../src/sdk/useFlapWallet.ts","../../src/sdk/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAGO,IAAM,0BAA0B,CAAC;AAAA,EACtC,IAAA,EAAM,UAAA;AAAA,EACN,IAAA,EAAM,iBAAA;AAAA,EACN,eAAA,EAAiB,MAAA;AAAA,EACjB,QAAQ,EAAC;AAAA,EACT,SAAS,CAAC;AAAA,IACR,IAAA,EAAM,QAAA;AAAA,IACN,IAAA,EAAM,OAAA;AAAA,IACN,UAAA,EAAY;AAAA,MACV,EAAE,IAAA,EAAM,aAAA,EAAe,IAAA,EAAM,QAAA,EAAS;AAAA,MACtC,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,WAAW,UAAA,EAAY;AAAA,QAC7C,EAAE,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,QAAA,EAAS;AAAA,QAC/B,EAAE,IAAA,EAAM,WAAA,EAAa,IAAA,EAAM,QAAA,EAAS;AAAA,QACpC,EAAE,IAAA,EAAM,aAAA,EAAe,IAAA,EAAM,QAAA,EAAS;AAAA,QACtC,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,OAAA;AAAQ,OACpC,EAAE;AAAA,MACF,EAAE,IAAA,EAA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M,6EAA6E,CAAA;AAAA,EAC/F;AACA,EAAA,OAAO,KAAA,CAAM,IAAA;AACf;AAGO,SAAS,wBAAA,CAAyB,UAAkB,SAAA,EAAmB;AAC5E,EAAA,OAAO,sBAAA,CAAuB,UAAU,SAAS,CAAA;AACnD;AAGO,SAAS,2BAAA,CAA4B,MAA4B,SAAA,EAAyC;AAC/G,EAAA,OAAO;AAAA,IACL,GAAI,IAAA,CAAK,KAAA,GAAQ,EAAE,KAAA,EAAO,sBAAA,CAAuB,IAAA,CAAK,KAAA,EAAO,SAAS,CAAA,EAAE,GAAI,EAAC;AAAA,IAC7E,GAAI,IAAA,CAAK,IAAA,GAAO,EAAE,IAAA,EAAM,sBAAA,CAAuB,IAAA,CAAK,IAAA,EAAM,SAAS,CAAA,EAAE,GAAI;AAAC,GAC5E;AACF;;;ACxBO,SAAS,aAAA,GAAgB;AAC9B,EAAA,OAAO,YAAW,CAAE,MAAA;AACtB;;;ACmEO,IAAM,8BAAA,GAAiC;AAGvC,IAAM,0BAAA,GAA6B","file":"sdk.js","sourcesContent":["import type { VaultLaunchConfigResult, VaultLaunchSchema } from \"./types\";\n\n/** Public IVaultSchemasV1 interface. Reading and encoding belong to the host, not the form. */\nexport const VAULT_LAUNCH_SCHEMA_ABI = [{\n type: \"function\",\n name: \"vaultDataSchema\",\n stateMutability: \"view\",\n inputs: [],\n outputs: [{\n name: \"schema\",\n type: \"tuple\",\n components: [\n { name: \"description\", type: \"string\" },\n { name: \"fields\", type: \"tuple[]\", components: [\n { name: \"name\", type: \"string\" },\n { name: \"fieldType\", type: \"string\" },\n { name: \"description\", type: \"string\" },\n { name: \"decimals\", type: \"uint8\" },\n ] },\n { name: \"isArray\", type: \"bool\" },\n ],\n }],\n}] as const;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\n/** Normalize decoded chain data and fail closed on malformed/ambiguous field definitions. */\nexport function parseVaultLaunchSchema(value: unknown): VaultLaunchSchema {\n if (!isRecord(value) || typeof value.isArray !== \"boolean\" || typeof value.description !== \"string\"\n || !Array.isArray(value.fields) || value.fields.length > 100) {\n throw new Error(\"Invalid vault launch schema.\");\n }\n const names = new Set<string>();\n const fields = value.fields.map((field: unknown) => {\n if (!isRecord(field) || typeof field.name !== \"string\" || !/^[A-Za-z_][A-Za-z0-9_]{0,63}$/.test(field.name)\n || names.has(field.name) || [\"__proto__\", \"constructor\", \"prototype\"].includes(field.name)\n || typeof field.fieldType !== \"string\" || !field.fieldType.trim() || field.fieldType.length > 100\n || typeof field.description !== \"string\" || !Number.isInteger(field.decimals)\n || (field.decimals as number) < 0 || (field.decimals as number) > 255) {\n throw new Error(\"Invalid vault launch schema field.\");\n }\n names.add(field.name);\n return { name: field.name, fieldType: field.fieldType, description: field.description, decimals: field.decimals as number };\n });\n return { description: value.description, isArray: value.isArray, fields };\n}\n\n/** Shape gate shared by preview hosts. Hosts must still validate field types/policies and ABI-encode. */\nexport function isVaultLaunchConfigResultForSchema(value: unknown, schema: VaultLaunchSchema): value is VaultLaunchConfigResult {\n if (!isRecord(value)) return false;\n if (value.status === \"invalid\") return value.errors === undefined\n || (Array.isArray(value.errors) && value.errors.length <= 100 && value.errors.every((error) => typeof error === \"string\"));\n if (value.status !== \"valid\") return false;\n if (value.summary !== undefined && (!Array.isArray(value.summary) || value.summary.length > 12\n || !value.summary.every((item) => isRecord(item) && typeof item.label === \"string\" && item.label.length <= 160\n && typeof item.value === \"string\" && item.value.length <= 160))) return false;\n if (schema.isArray !== Array.isArray(value.values)) return false;\n const rows = schema.isArray ? value.values as unknown[] : [value.values];\n if (rows.length === 0 || rows.length > 100) return false;\n const names = schema.fields.map((field) => field.name);\n return rows.every((row) => isRecord(row) && Object.keys(row).length === names.length\n && names.every((name) => Object.hasOwn(row, name) && row[name] !== undefined));\n}\n","export interface MiniApp3DDecoderUrls {\n draco?: string;\n ktx2?: string;\n}\n\nfunction assertArtifactAssetUrl(assetUrl: string, moduleUrl: string) {\n const moduleLocation = new URL(moduleUrl);\n const asset = new URL(assetUrl, moduleLocation);\n const moduleDirectory = moduleLocation.pathname.slice(0, moduleLocation.pathname.lastIndexOf(\"/\") + 1);\n if (asset.origin !== moduleLocation.origin || !asset.pathname.startsWith(`${moduleDirectory}assets/`)) {\n throw new Error(\"Mini App 3D assets must resolve from the current artifact assets/ manifest.\");\n }\n return asset.href;\n}\n\n/** Resolve a statically imported 3D asset without permitting remote/CDN fallback. */\nexport function resolveMiniApp3DAssetUrl(assetUrl: string, moduleUrl: string) {\n return assertArtifactAssetUrl(assetUrl, moduleUrl);\n}\n\n/** Return artifact-relative decoder URLs for DRACO/KTX2 loader configuration. */\nexport function resolveMiniApp3DDecoderUrls(urls: MiniApp3DDecoderUrls, moduleUrl: string): MiniApp3DDecoderUrls {\n return {\n ...(urls.draco ? { draco: assertArtifactAssetUrl(urls.draco, moduleUrl) } : {}),\n ...(urls.ktx2 ? { ktx2: assertArtifactAssetUrl(urls.ktx2, moduleUrl) } : {}),\n };\n}\n","import { useFlapSdk } from \"./runtime\";\n\nexport function useFlapWallet() {\n return useFlapSdk().wallet;\n}\n","\"use client\";\n\nexport * from \"./contract\";\nexport * from \"./erc20\";\nexport * from \"./format\";\nexport * from \"./ipfsImage\";\nexport * from \"./launchConfig\";\nexport * from \"./mediaUpload\";\nexport * from \"./nftMetadata\";\nexport * from \"./oracle\";\nexport * from \"./three\";\nexport * from \"./videoSession\";\nexport { useFlapI18n, useFlapNotify, useFlapSdk, useVaultContext } from \"./runtimeStore\";\nexport { ZERO_ADDRESS, isActionAvailableForPhase, isCustomVaultTaxToken, isValidAddress, readTaxVaultHostContext, resolveTokenMarketPhase } from \"./taxInfo\";\nexport { getTxErrorKind, handleTxError } from \"./txError\";\nexport { useFlapChain } from \"./useFlapChain\";\nexport { useFlapWallet } from \"./useFlapWallet\";\nexport type {\n ActionAvailabilityStage,\n Address,\n ContractEventRequest,\n ContractReadRequest,\n ContractWriteRequest,\n FeeMode,\n FlapFeeVaultInfo,\n FlapI18n,\n FlapNotify,\n FlapTaxInfo,\n FlapTokenInfo,\n FlapVaultPortalInfo,\n FlapVaultSdk,\n FlapWallet,\n ManifestBindingEntry,\n IpfsUploadResult,\n MediaUploader,\n MediaUploadOptions,\n MediaUploadRequest,\n NftMetadataAttribute,\n NftMetadataReader,\n NftMetadataReaderRequest,\n NftMetadataReadRequest,\n NftMetadataSnapshot,\n NftMetadataSource,\n OracleProvision,\n OracleReadRequest,\n OracleReader,\n PaymentToken,\n RuntimeOracleRegistry,\n SimulateResult,\n TokenMarketPhase,\n TxReceipt,\n VaultComponentProps,\n VaultHostContext,\n VaultArtifactSurface,\n VaultLaunchConfigComponentProps,\n VaultLaunchConfigContext,\n VaultLaunchConfigResult,\n VaultLaunchConfigSummaryItem,\n VaultLaunchConfigValues,\n VaultLaunchSchema,\n VaultLaunchSchemaField,\n VaultManifest,\n VaultRenderSurface,\n VaultRuntimeContext,\n VaultRuntimeContextOverrides,\n VaultRuntimeExtraConfig,\n} from \"./types\";\n\nexport type { ManifestNftAccountWithdrawal, NftAccountWithdrawalPolicy, NftAccountWithdrawalRequest, NftAccountWithdrawalReceipt, ReviewedContractPin, ReviewedBeaconPin } from \"./nftAccountTypes\";\n\n/** Host feature check; declarations must fail closed on older runtimes. */\nexport const NFT_ACCOUNT_WITHDRAWAL_VERSION = 1;\n\nexport type { ManifestResolvedContract, ResolvedContractCheck, ResolvedContractHandle } from \"./resolvedContractTypes\";\nexport const RESOLVED_CONTRACTS_VERSION = 1;\n"]}
|
package/server.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { L as LocalHostPresentationFetcherOptions, R as ResolveHostPresentationBatchInput, a as ResolveHostPresentationInput, T as TaxVaultHostChainConfig, c as createLocalHostPresentationFetcher, g as getTaxVaultHostChainConfig, l as loadFlapHostTokenPresentation, b as loadFlapHostTokenPresentationBatch } from './hostRuntimeConfig-
|
|
2
|
-
import {
|
|
3
|
-
export { A as ActionAvailabilityStage, a as Address, C as ContractEventRequest,
|
|
1
|
+
export { L as LocalHostPresentationFetcherOptions, R as ResolveHostPresentationBatchInput, a as ResolveHostPresentationInput, T as TaxVaultHostChainConfig, c as createLocalHostPresentationFetcher, g as getTaxVaultHostChainConfig, l as loadFlapHostTokenPresentation, b as loadFlapHostTokenPresentationBatch } from './hostRuntimeConfig-DAz-f577.mjs';
|
|
2
|
+
import { a0 as RuntimeOracleRegistry, T as OracleProvision, R as NftMetadataSnapshot } from './types-BbjEsfiD.mjs';
|
|
3
|
+
export { A as ActionAvailabilityStage, a as Address, C as ContractEventRequest, b as ContractReadRequest, c as ContractWriteRequest, d as CreateVaultRuntimeContextInput, E as EndpointPolicy, F as FeeMode, e as FlapFeeVaultInfo, f as FlapI18n, g as FlapNotify, h as FlapTaxInfo, i as FlapTokenInfo, j as FlapVaultPortalInfo, k as FlapVaultSdk, l as FlapWallet, H as HostRuntimeAddresses, m as HostRuntimeDataSource, n as HostRuntimeDegradeReason, o as HostRuntimeInput, p as HostRuntimePolicy, q as HostRuntimePresentationFetcher, r as HostRuntimePresentationRequest, s as HostRuntimeResult, t as HostRuntimeSources, u as HostRuntimeStatus, v as HostRuntimeWarning, w as HostTokenPresentation, I as IpfsUploadResult, M as ManifestBindingEntry, x as ManifestExternalContract, B as MediaUploadOptions, D as MediaUploadRequest, G as MediaUploader, L as NftMetadataAttribute, O as NftMetadataReadRequest, P as NftMetadataReader, Q as NftMetadataReaderRequest, S as NftMetadataSource, U as OracleReadRequest, V as OracleReader, X as PaymentToken, a1 as SimulateResult, a2 as TokenMarketPhase, a3 as TokenMetadataSnapshot, a4 as TokenRuntimeSnapshot, a5 as TxReceipt, a6 as VaultArtifactSurface, a7 as VaultComponentProps, a8 as VaultHostContext, a9 as VaultLaunchConfigComponentProps, aa as VaultLaunchConfigContext, ab as VaultLaunchConfigResult, ac as VaultLaunchConfigSummaryItem, ad as VaultLaunchConfigValues, ae as VaultLaunchSchema, af as VaultLaunchSchemaField, ag as VaultManifest, ah as VaultManifestCapability, ai as VaultManifestDisplayTitle, aj as VaultManifestLayout, ak as VaultManifestMode, al as VaultRenderSurface, am as VaultRuntimeContext, an as VaultRuntimeContextOverrides, ao as VaultRuntimeExtraConfig } from './types-BbjEsfiD.mjs';
|
|
4
4
|
import 'viem';
|
|
5
5
|
|
|
6
6
|
declare const FLAP_RUNTIME_ORACLE_REGISTRY_ENV = "FLAP_RUNTIME_ORACLE_REGISTRY";
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
declare const MINI_APP_SLUG_PATTERN: RegExp;
|
|
4
|
-
declare function isMiniAppSlug(value: unknown): value is string;
|
|
5
|
-
declare function isStandaloneMiniApp(manifest: unknown): manifest is {
|
|
6
|
-
schemaVersion: 2;
|
|
7
|
-
mode: "mini-app";
|
|
8
|
-
appModel: "standalone";
|
|
9
|
-
slug: string;
|
|
10
|
-
artifactId: string;
|
|
11
|
-
match: {
|
|
12
|
-
bindings: [];
|
|
13
|
-
};
|
|
14
|
-
};
|
|
1
|
+
import { V as OracleReader, T as OracleProvision, a as Address, A as ActionAvailabilityStage, a2 as TokenMarketPhase, i as FlapTokenInfo, a8 as VaultHostContext, h as FlapTaxInfo, j as FlapVaultPortalInfo, F as FeeMode, al as VaultRenderSurface, ag as VaultManifest, e as FlapFeeVaultInfo, M as ManifestBindingEntry } from './types-BbjEsfiD.mjs';
|
|
15
2
|
|
|
16
3
|
declare const standardErc20Abi: readonly [{
|
|
17
4
|
readonly type: "event";
|
|
@@ -250,4 +237,4 @@ type TxErrorMessageMap = Partial<Record<TxErrorKind, string>>;
|
|
|
250
237
|
declare function getTxErrorKind(error: unknown): TxErrorKind;
|
|
251
238
|
declare function handleTxError(error: unknown, messages?: TxErrorMessageMap): string;
|
|
252
239
|
|
|
253
|
-
export {
|
|
240
|
+
export { readTaxVaultHostContext as A, resolveFeeMode as B, type CreateTaxInfoHostContextInput as C, resolveManifestBinding as D, resolveTaxInfoRenderSurface as E, resolveTokenMarketPhase as F, resolveVaultBinding as G, shortenAddress as H, standardErc20Abi as I, OracleReadError as O, type ResolveRenderSurfaceInput as R, type TaxVaultHostSnapshot as T, type VaultBindingPolicy as V, ZERO_ADDRESS as Z, type RuntimeMatchInput as a, type TxErrorKind as b, buildLocalOracleUrl as c, createLocalOracleReader as d, createTaxInfoHostContext as e, fetchOracleJson as f, fetchProvisionedOracle as g, formatCountdown as h, formatPercentBps as i, formatTokenAmount as j, getTupleField as k, getTxErrorKind as l, handleTxError as m, isActionAvailableForPhase as n, isCustomVaultTaxToken as o, isManifestRuntimeMatch as p, isSameAddress as q, isValidAddress as r, isVaultBindingMatch as s, normalizeAddress as t, normalizeOnchainPortalTokenVersion as u, parseFeeVaultInfo as v, parsePortalTokenInfo as w, parseTaxTokenInfo as x, parseTokenAmount as y, parseVaultPortalInfo as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AbiFunction,
|
|
1
|
+
import { AbiFunction, Abi, PublicClient } from 'viem';
|
|
2
2
|
|
|
3
3
|
type ResolvedContractCheck = {
|
|
4
4
|
kind: "owner";
|
|
@@ -46,95 +46,6 @@ interface ParsedResolvedContract {
|
|
|
46
46
|
reads: "any" | AbiFunction[];
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
declare const FLAP_WALLET_RUNTIME_VERSION = 1;
|
|
50
|
-
interface FlapSendTransactionRequest {
|
|
51
|
-
to: Address;
|
|
52
|
-
value?: bigint;
|
|
53
|
-
data?: `0x${string}`;
|
|
54
|
-
gas?: bigint;
|
|
55
|
-
gasPrice?: bigint;
|
|
56
|
-
}
|
|
57
|
-
interface FlapTransactionReceipt {
|
|
58
|
-
hash: Address;
|
|
59
|
-
status: "success" | "reverted";
|
|
60
|
-
blockNumber: bigint;
|
|
61
|
-
logs: TransactionReceipt["logs"];
|
|
62
|
-
}
|
|
63
|
-
interface FlapChainSdk {
|
|
64
|
-
context: {
|
|
65
|
-
chainId: number;
|
|
66
|
-
manifest: VaultManifest;
|
|
67
|
-
};
|
|
68
|
-
i18n: FlapI18n;
|
|
69
|
-
notify: FlapNotify;
|
|
70
|
-
wallet: Omit<FlapWallet, "balance">;
|
|
71
|
-
resolveContract(id: string, args: readonly unknown[]): Promise<ResolvedContractHandle>;
|
|
72
|
-
readContract<T = unknown>(request: ContractReadRequest): Promise<T>;
|
|
73
|
-
simulateContract(request: ContractWriteRequest): Promise<SimulateResult>;
|
|
74
|
-
writeContract(request: ContractWriteRequest): Promise<Address>;
|
|
75
|
-
sendTransaction(request: FlapSendTransactionRequest): Promise<Address>;
|
|
76
|
-
waitForTx(hash: Address): Promise<FlapTransactionReceipt>;
|
|
77
|
-
getGasPrice(): Promise<bigint>;
|
|
78
|
-
getBlockNumber(): Promise<bigint>;
|
|
79
|
-
getBalance(address?: Address): Promise<bigint>;
|
|
80
|
-
getContractEvents<T = unknown>(request: ContractEventRequest): Promise<T[]>;
|
|
81
|
-
uploadImage(file: Blob, options?: MediaUploadOptions): ReturnType<MediaUploader>;
|
|
82
|
-
uploadText(text: string, options?: MediaUploadOptions): ReturnType<MediaUploader>;
|
|
83
|
-
openExplorerTx(hash: Address): void;
|
|
84
|
-
}
|
|
85
|
-
interface FlapWalletAccount {
|
|
86
|
-
address?: Address;
|
|
87
|
-
chainId?: number;
|
|
88
|
-
isConnected: boolean;
|
|
89
|
-
}
|
|
90
|
-
/** Host-only transport: never supplied by uploaded components. */
|
|
91
|
-
interface FlapWalletRuntime {
|
|
92
|
-
chains: readonly {
|
|
93
|
-
id: number;
|
|
94
|
-
name: string;
|
|
95
|
-
explorerBaseUrl?: string;
|
|
96
|
-
}[];
|
|
97
|
-
readOnly?: boolean;
|
|
98
|
-
generation?: string;
|
|
99
|
-
assertActive?(): void;
|
|
100
|
-
getAccount(): FlapWalletAccount;
|
|
101
|
-
connect(): void;
|
|
102
|
-
disconnect(): void;
|
|
103
|
-
switchChain(chainId: number): Promise<void>;
|
|
104
|
-
readContract(chainId: number, request: ContractReadRequest): Promise<unknown>;
|
|
105
|
-
simulateContract(chainId: number, request: ContractWriteRequest & {
|
|
106
|
-
account: Address;
|
|
107
|
-
}): Promise<unknown>;
|
|
108
|
-
writeContract(chainId: number, request: ContractWriteRequest & {
|
|
109
|
-
account: Address;
|
|
110
|
-
}): Promise<Address>;
|
|
111
|
-
sendTransaction(chainId: number, request: FlapSendTransactionRequest & {
|
|
112
|
-
account: Address;
|
|
113
|
-
}): Promise<Address>;
|
|
114
|
-
waitForTx(chainId: number, hash: Address): Promise<FlapTransactionReceipt>;
|
|
115
|
-
getCode(chainId: number, address: Address): Promise<`0x${string}` | undefined>;
|
|
116
|
-
getGasPrice(chainId: number): Promise<bigint>;
|
|
117
|
-
getBlockNumber(chainId: number): Promise<bigint>;
|
|
118
|
-
getBalance(chainId: number, address: Address): Promise<bigint>;
|
|
119
|
-
getContractEvents(chainId: number, request: ContractEventRequest): Promise<unknown[]>;
|
|
120
|
-
upload: MediaUploader;
|
|
121
|
-
openUrl(url: string): void;
|
|
122
|
-
}
|
|
123
|
-
declare function createFlapChainSdk(runtime: FlapWalletRuntime, input: {
|
|
124
|
-
chainId: number;
|
|
125
|
-
manifest: VaultManifest;
|
|
126
|
-
writableChains: readonly number[];
|
|
127
|
-
i18n: FlapI18n;
|
|
128
|
-
notify: FlapNotify;
|
|
129
|
-
}): FlapChainSdk;
|
|
130
|
-
|
|
131
|
-
interface AppWalletPermissions { id: string; allow?: string[]; read?: string[]; maxValueWei?: string; approvalSpenders?: Address[]; maxApprovalWei?: string; codeHash?: `0x${string}` }
|
|
132
|
-
interface AppResolvedContract extends AppWalletPermissions { resolver: string }
|
|
133
|
-
interface AppWalletContract extends AppWalletPermissions { chainId: number; address: Address; resolvedContracts?: AppResolvedContract[] }
|
|
134
|
-
interface ParsedAppWalletPermissions { definition: AppWalletPermissions; writes: AbiFunction[]; reads: AbiFunction[] }
|
|
135
|
-
interface ParsedAppWalletContract extends ParsedAppWalletPermissions { definition: AppWalletContract; resolved: (ParsedAppWalletPermissions & { resolver: AbiFunction })[] }
|
|
136
|
-
declare function parseAppWalletContracts(value: unknown): ParsedAppWalletContract[];
|
|
137
|
-
|
|
138
49
|
/** A request for review, never an authorization. No caller-supplied addresses. */
|
|
139
50
|
interface ManifestNftAccountWithdrawal {
|
|
140
51
|
policyId: string;
|
|
@@ -355,12 +266,6 @@ interface VaultManifestDisplayTitle {
|
|
|
355
266
|
en: string;
|
|
356
267
|
}
|
|
357
268
|
interface VaultManifest {
|
|
358
|
-
schemaVersion?: 2;
|
|
359
|
-
appModel?: "standalone";
|
|
360
|
-
slug?: string;
|
|
361
|
-
/** Standalone App networks that may request wallet writes. Omitted means read-only. */
|
|
362
|
-
walletChains?: number[];
|
|
363
|
-
walletContracts?: AppWalletContract[];
|
|
364
269
|
artifactId: string;
|
|
365
270
|
name: string;
|
|
366
271
|
displayTitle?: VaultManifestDisplayTitle;
|
|
@@ -560,7 +465,6 @@ interface MediaUploadRequest extends MediaUploadOptions {
|
|
|
560
465
|
/** Optional host override for the controlled upload service. */
|
|
561
466
|
type MediaUploader = (request: MediaUploadRequest) => Promise<IpfsUploadResult>;
|
|
562
467
|
interface FlapVaultSdk {
|
|
563
|
-
forChain(chainId: number): FlapChainSdk;
|
|
564
468
|
context: VaultRuntimeContext;
|
|
565
469
|
i18n: FlapI18n;
|
|
566
470
|
notify: FlapNotify;
|
|
@@ -579,6 +483,8 @@ interface FlapVaultSdk {
|
|
|
579
483
|
/** Reviewed NULL profile only; returns after receipt and balance refresh. */
|
|
580
484
|
withdrawNftAccount(request: NftAccountWithdrawalRequest): Promise<NftAccountWithdrawalReceipt>;
|
|
581
485
|
readOracle<T = unknown>(oracleId: string, params?: Record<string, string>): Promise<T>;
|
|
486
|
+
/** GET JSON under the reviewed FSI /fsi/v1 prefix; path is relative, query values are strings. */
|
|
487
|
+
readFsi<T = unknown>(path: string, params?: Record<string, string>): Promise<T>;
|
|
582
488
|
readNftMetadata(request: NftMetadataReadRequest): Promise<NftMetadataSnapshot>;
|
|
583
489
|
/** Uploads PNG/JPEG/GIF/WebP (up to 3 MiB) and returns the file CID. */
|
|
584
490
|
uploadImage(file: Blob, options?: MediaUploadOptions): Promise<IpfsUploadResult>;
|
|
@@ -603,4 +509,4 @@ interface VaultComponentProps {
|
|
|
603
509
|
context?: VaultRuntimeContext;
|
|
604
510
|
}
|
|
605
511
|
|
|
606
|
-
export {
|
|
512
|
+
export type { ReviewedContractPin as $, ActionAvailabilityStage as A, MediaUploadOptions as B, ContractEventRequest as C, MediaUploadRequest as D, EndpointPolicy as E, FeeMode as F, MediaUploader as G, HostRuntimeAddresses as H, IpfsUploadResult as I, NftAccountWithdrawalReceipt as J, NftAccountWithdrawalRequest as K, NftMetadataAttribute as L, ManifestBindingEntry as M, NftAccountWithdrawalPolicy as N, NftMetadataReadRequest as O, NftMetadataReader as P, NftMetadataReaderRequest as Q, NftMetadataSnapshot as R, NftMetadataSource as S, OracleProvision as T, OracleReadRequest as U, OracleReader as V, ParsedResolvedContract as W, PaymentToken as X, ResolvedContractCheck as Y, ResolvedContractHandle as Z, ReviewedBeaconPin as _, Address as a, RuntimeOracleRegistry as a0, SimulateResult as a1, TokenMarketPhase as a2, TokenMetadataSnapshot as a3, TokenRuntimeSnapshot as a4, TxReceipt as a5, VaultArtifactSurface as a6, VaultComponentProps as a7, VaultHostContext as a8, VaultLaunchConfigComponentProps as a9, VaultLaunchConfigContext as aa, VaultLaunchConfigResult as ab, VaultLaunchConfigSummaryItem as ac, VaultLaunchConfigValues as ad, VaultLaunchSchema as ae, VaultLaunchSchemaField as af, VaultManifest as ag, VaultManifestCapability as ah, VaultManifestDisplayTitle as ai, VaultManifestLayout as aj, VaultManifestMode as ak, VaultRenderSurface as al, VaultRuntimeContext as am, VaultRuntimeContextOverrides as an, VaultRuntimeExtraConfig as ao, ContractReadRequest as b, ContractWriteRequest as c, CreateVaultRuntimeContextInput as d, FlapFeeVaultInfo as e, FlapI18n as f, FlapNotify as g, FlapTaxInfo as h, FlapTokenInfo as i, FlapVaultPortalInfo as j, FlapVaultSdk as k, FlapWallet as l, HostRuntimeDataSource as m, HostRuntimeDegradeReason as n, HostRuntimeInput as o, HostRuntimePolicy as p, HostRuntimePresentationFetcher as q, HostRuntimePresentationRequest as r, HostRuntimeResult as s, HostRuntimeSources as t, HostRuntimeStatus as u, HostRuntimeWarning as v, HostTokenPresentation as w, ManifestExternalContract as x, ManifestNftAccountWithdrawal as y, ManifestResolvedContract as z };
|
package/ui.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
|
-
import { a as Address } from './types-
|
|
5
|
+
import { a as Address } from './types-BbjEsfiD.mjs';
|
|
6
6
|
import 'viem';
|
|
7
7
|
|
|
8
8
|
interface AddressLinkProps {
|
package/ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { AddressLink, Alert, BinanceImage, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Countdown, DataRow, DetailTile, ExternalLink, Input, IpfsBackground, IpfsImage, Metric, NftMetadataImage, ReviewedFrame, StatusBadge, TxButton, VaultBanner, VideoSessionPlayer, buttonVariants } from './chunk-
|
|
2
|
+
export { AddressLink, Alert, BinanceImage, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Countdown, DataRow, DetailTile, ExternalLink, Input, IpfsBackground, IpfsImage, Metric, NftMetadataImage, ReviewedFrame, StatusBadge, TxButton, VaultBanner, VideoSessionPlayer, buttonVariants } from './chunk-IN34R3DY.js';
|
|
3
3
|
import './chunk-B4WKI3EW.js';
|
|
4
4
|
import './chunk-SAG36LUR.js';
|
|
5
5
|
import './chunk-FUOBTZMQ.js';
|