@flapsdk/vault-runtime 0.1.43 → 0.1.44-next.0
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 +48 -50
- package/{chunk-ZH7JPICS.js → chunk-5DU4W4CK.js} +563 -4
- package/chunk-5DU4W4CK.js.map +1 -0
- package/{chunk-56WOVXXG.js → chunk-BIRAO6LU.js} +436 -85
- package/chunk-BIRAO6LU.js.map +1 -0
- package/{chunk-HJZVFN57.js → chunk-ZLF6YGWQ.js} +45 -129
- package/chunk-ZLF6YGWQ.js.map +1 -0
- package/host-client.d.mts +6 -3
- package/host-client.js +3 -3
- package/host.d.mts +5 -5
- package/host.js +1 -1
- package/{hostRuntimeConfig-B-w3HrT1.d.mts → hostRuntimeConfig-5ZZT8uC7.d.mts} +1 -1
- package/maplibre-gl-KTPWJHIW.js +26453 -0
- package/maplibre-gl-KTPWJHIW.js.map +1 -0
- package/package.json +6 -4
- package/runtime-contract.json +14 -4
- package/runtime-map/LICENSE.maplibre.txt +116 -0
- package/runtime-map/maplibre-6.15.0-worker.mjs +10 -0
- package/sdk.d.mts +33 -6
- package/sdk.js +10 -8
- package/sdk.js.map +1 -1
- package/server.d.mts +3 -3
- package/{txError-B6PglmOO.d.mts → txError-CjQVWypm.d.mts} +1 -1
- package/{types-CUJv4dxm.d.mts → types-kDMLRchJ.d.mts} +150 -14
- package/ui.d.mts +74 -2
- package/ui.js +1 -1
- package/chunk-56WOVXXG.js.map +0 -1
- package/chunk-HJZVFN57.js.map +0 -1
- package/chunk-ZH7JPICS.js.map +0 -1
package/sdk.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as ActionAvailabilityStage, b as
|
|
3
|
-
import { d as MiniAppRouterAdapter, c as MiniAppRouter } from './txError-
|
|
4
|
-
export { M as MINI_APP_ROUTING_VERSION, a as MINI_APP_SLUG_PATTERN, b as MiniAppRouteSnapshot, O as OracleReadError, Z as ZERO_ADDRESS, g as buildLocalOracleUrl, h as createLocalOracleReader, j as fetchOracleJson, k as fetchProvisionedOracle, l as formatCountdown, m as formatPercentBps, n as formatTokenAmount, p as getTxErrorKind, q as handleTxError, r as isActionAvailableForPhase, s as isCustomVaultTaxToken, u as isMiniAppSlug, w as isStandaloneMiniApp, x as isValidAddress, F as parseTokenAmount, H as readTaxVaultHostContext, L as resolveTokenMarketPhase, P as shortenAddress, Q as standardErc20Abi } from './txError-
|
|
1
|
+
import { aH as VaultManifest, a as Address, x as FlapI18n, y as FlapNotify, N as FlapWalletRuntime, t as DeviceSensors, v as FlapChainSdk, aF as VaultLaunchSchema, aC as VaultLaunchConfigResult, _ as IpfsUploadResult, a5 as MediaUploader, a4 as MediaUploadRequest, ac as NftMetadataReader, aa as NftMetadataAttribute, K as FlapVaultSdk, aN as VaultRuntimeContext, L as FlapWallet, q as DeviceSensorRequestOptions, r as DeviceSensorState, k as DeviceMotionData, s as DeviceSensorStatus, p as DeviceSensorPermission, o as DeviceSensorMode, l as DeviceOrientationData, j as DeviceLocationRequestOptions, i as DeviceLocationData } from './types-kDMLRchJ.mjs';
|
|
2
|
+
export { A as ActionAvailabilityStage, b as AppPresaleApproval, c as AppResolvedContract, d as AppWalletContract, C as ContractEventRequest, e as ContractReadRequest, f as ContractWriteRequest, D as DEVICE_SENSORS_VERSION, h as DeviceCapability, m as DeviceSensor, F as FLAP_WALLET_RUNTIME_VERSION, u as FeeMode, w as FlapFeeVaultInfo, z as FlapSendTransactionRequest, G as FlapTaxInfo, H as FlapTokenInfo, I as FlapTransactionReceipt, J as FlapVaultPortalInfo, $ as ManifestBindingEntry, a1 as ManifestNftAccountWithdrawal, a2 as ManifestResolvedContract, a3 as MediaUploadOptions, a7 as NftAccountWithdrawalPolicy, a8 as NftAccountWithdrawalReceipt, a9 as NftAccountWithdrawalRequest, ab as NftMetadataReadRequest, ad as NftMetadataReaderRequest, ae as NftMetadataSnapshot, af as NftMetadataSource, ag as OracleProvision, ah as OracleReadRequest, ai as OracleReader, aj as PRESALE_APPROVAL_VERSION, al as PaymentToken, am as PresaleQuoteApprovalRequest, an as ResolvedContractCheck, ao as ResolvedContractHandle, ap as ReviewedBeaconPin, aq as ReviewedContractPin, ar as RuntimeOracleRegistry, as as SimulateResult, at as TokenMarketPhase, aw as TxReceipt, ax as VaultArtifactSurface, ay as VaultComponentProps, az as VaultHostContext, aA as VaultLaunchConfigComponentProps, aB as VaultLaunchConfigContext, aD as VaultLaunchConfigSummaryItem, aE as VaultLaunchConfigValues, aG as VaultLaunchSchemaField, aM as VaultRenderSurface, aO as VaultRuntimeContextOverrides, aP as VaultRuntimeExtraConfig } from './types-kDMLRchJ.mjs';
|
|
3
|
+
import { d as MiniAppRouterAdapter, c as MiniAppRouter } from './txError-CjQVWypm.mjs';
|
|
4
|
+
export { M as MINI_APP_ROUTING_VERSION, a as MINI_APP_SLUG_PATTERN, b as MiniAppRouteSnapshot, O as OracleReadError, Z as ZERO_ADDRESS, g as buildLocalOracleUrl, h as createLocalOracleReader, j as fetchOracleJson, k as fetchProvisionedOracle, l as formatCountdown, m as formatPercentBps, n as formatTokenAmount, p as getTxErrorKind, q as handleTxError, r as isActionAvailableForPhase, s as isCustomVaultTaxToken, u as isMiniAppSlug, w as isStandaloneMiniApp, x as isValidAddress, F as parseTokenAmount, H as readTaxVaultHostContext, L as resolveTokenMarketPhase, P as shortenAddress, Q as standardErc20Abi } from './txError-CjQVWypm.mjs';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { ReactNode } from 'react';
|
|
7
7
|
export { erc20Abi } from 'viem';
|
|
@@ -16,6 +16,7 @@ interface MiniAppSession {
|
|
|
16
16
|
signIn(): Promise<void>;
|
|
17
17
|
}
|
|
18
18
|
interface MiniAppSdk {
|
|
19
|
+
device: DeviceSensors;
|
|
19
20
|
context: {
|
|
20
21
|
appId: string;
|
|
21
22
|
slug: string;
|
|
@@ -27,13 +28,14 @@ interface MiniAppSdk {
|
|
|
27
28
|
readIpfsText(cid: string, path?: string): Promise<string>;
|
|
28
29
|
forChain(chainId: number): FlapChainSdk;
|
|
29
30
|
}
|
|
30
|
-
declare function MiniAppRuntimeProvider({ manifest, session, i18n, notify, runtime, router, children }: {
|
|
31
|
+
declare function MiniAppRuntimeProvider({ manifest, session, i18n, notify, runtime, deviceSensors, router, children }: {
|
|
31
32
|
manifest: VaultManifest;
|
|
32
33
|
session: MiniAppSession;
|
|
33
34
|
i18n: FlapI18n;
|
|
34
35
|
notify: FlapNotify;
|
|
35
36
|
children: ReactNode;
|
|
36
37
|
runtime?: FlapWalletRuntime;
|
|
38
|
+
deviceSensors?: DeviceSensors;
|
|
37
39
|
router?: MiniAppRouterAdapter;
|
|
38
40
|
}): React.JSX.Element;
|
|
39
41
|
declare function useMiniAppSdk(): MiniAppSdk;
|
|
@@ -189,6 +191,31 @@ declare function useFlapNotify(): FlapNotify;
|
|
|
189
191
|
|
|
190
192
|
declare function useFlapWallet(): FlapWallet;
|
|
191
193
|
|
|
194
|
+
declare function useGeolocation(options?: DeviceLocationRequestOptions): {
|
|
195
|
+
request: (overrides?: DeviceLocationRequestOptions | undefined) => Promise<DeviceSensorState<DeviceLocationData>>;
|
|
196
|
+
stop: () => void;
|
|
197
|
+
status: DeviceSensorStatus;
|
|
198
|
+
permission: DeviceSensorPermission;
|
|
199
|
+
data: DeviceLocationData | null;
|
|
200
|
+
mode: DeviceSensorMode;
|
|
201
|
+
};
|
|
202
|
+
declare function useDeviceMotion(options?: DeviceSensorRequestOptions): {
|
|
203
|
+
request: (overrides?: DeviceSensorRequestOptions | undefined) => Promise<DeviceSensorState<DeviceMotionData>>;
|
|
204
|
+
stop: () => void;
|
|
205
|
+
status: DeviceSensorStatus;
|
|
206
|
+
permission: DeviceSensorPermission;
|
|
207
|
+
data: DeviceMotionData | null;
|
|
208
|
+
mode: DeviceSensorMode;
|
|
209
|
+
};
|
|
210
|
+
declare function useDeviceOrientation(options?: DeviceSensorRequestOptions): {
|
|
211
|
+
request: (overrides?: DeviceSensorRequestOptions | undefined) => Promise<DeviceSensorState<DeviceOrientationData>>;
|
|
212
|
+
stop: () => void;
|
|
213
|
+
status: DeviceSensorStatus;
|
|
214
|
+
permission: DeviceSensorPermission;
|
|
215
|
+
data: DeviceOrientationData | null;
|
|
216
|
+
mode: DeviceSensorMode;
|
|
217
|
+
};
|
|
218
|
+
|
|
192
219
|
/** Host feature check; declarations must fail closed on older runtimes. */
|
|
193
220
|
declare const NFT_ACCOUNT_WITHDRAWAL_VERSION = 1;
|
|
194
221
|
|
|
@@ -197,4 +224,4 @@ declare const RESOLVED_CONTRACTS_VERSION = 1;
|
|
|
197
224
|
/** Controlled dynamic CID text reads and image rendering. */
|
|
198
225
|
declare const IPFS_CONTENT_VERSION = 1;
|
|
199
226
|
|
|
200
|
-
export { Address, type ConsumerVideoClip, type ConsumerVideoSessionReader, FlapChainSdk, FlapI18n, FlapNotify, FlapVaultSdk, FlapWallet, IMAGE_UPLOAD_MEDIA_TYPES, IPFS_CONTENT_VERSION, IpfsUploadResult, type LocalNftMetadataReaderOptions, MAX_IMAGE_UPLOAD_BYTES, MAX_TEXT_UPLOAD_BYTES, MediaUploadError, MediaUploadRequest, MediaUploader, type MiniApp3DDecoderUrls, MiniAppRouter, MiniAppRouterAdapter, MiniAppRuntimeProvider, type MiniAppSdk, type MiniAppSession, NFT_ACCOUNT_WITHDRAWAL_VERSION, NftMetadataAttribute, NftMetadataReader, RESOLVED_CONTRACTS_VERSION, RUNTIME_UPLOAD_ENDPOINT, VAULT_LAUNCH_SCHEMA_ABI, VaultLaunchConfigResult, VaultLaunchSchema, VaultManifest, 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, useMiniAppRouter, useMiniAppSdk, useVaultContext, validateMediaUpload, vaultV2NftAbi };
|
|
227
|
+
export { Address, type ConsumerVideoClip, type ConsumerVideoSessionReader, DeviceLocationData, DeviceLocationRequestOptions, DeviceMotionData, DeviceOrientationData, DeviceSensorMode, DeviceSensorPermission, DeviceSensorRequestOptions, DeviceSensorState, DeviceSensorStatus, DeviceSensors, FlapChainSdk, FlapI18n, FlapNotify, FlapVaultSdk, FlapWallet, IMAGE_UPLOAD_MEDIA_TYPES, IPFS_CONTENT_VERSION, IpfsUploadResult, type LocalNftMetadataReaderOptions, MAX_IMAGE_UPLOAD_BYTES, MAX_TEXT_UPLOAD_BYTES, MediaUploadError, MediaUploadRequest, MediaUploader, type MiniApp3DDecoderUrls, MiniAppRouter, MiniAppRouterAdapter, MiniAppRuntimeProvider, type MiniAppSdk, type MiniAppSession, NFT_ACCOUNT_WITHDRAWAL_VERSION, NftMetadataAttribute, NftMetadataReader, RESOLVED_CONTRACTS_VERSION, RUNTIME_UPLOAD_ENDPOINT, VAULT_LAUNCH_SCHEMA_ABI, VaultLaunchConfigResult, VaultLaunchSchema, VaultManifest, VaultRuntimeContext, VideoSessionReadError, createConsumerVideoSessionReader, createIpfsUploadResult, createLocalMediaUploader, createLocalNftMetadataReader, isIpfsImageCid, isVaultLaunchConfigResultForSchema, nftTokenUriAbi, normalizeInlineNftImage, normalizeIpfsImagePath, parseInlineNftMetadata, parseVaultLaunchSchema, readVideoSessionLength, readVideoSessionSlice, resolveIpfsImageUrl, resolveIpfsImageUrls, resolveMiniApp3DAssetUrl, resolveMiniApp3DDecoderUrls, sanitizeNftMetadataRecord, useDeviceMotion, useDeviceOrientation, useVaultContext as useFlapChain, useFlapI18n, useFlapNotify, useFlapSdk, useFlapWallet, useGeolocation, useMiniAppRouter, useMiniAppSdk, useVaultContext, validateMediaUpload, vaultV2NftAbi };
|
package/sdk.js
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { isStandaloneMiniApp } from './chunk-WQ7WM2BC.js';
|
|
3
3
|
export { MINI_APP_ROUTING_VERSION, MINI_APP_SLUG_PATTERN, erc20Abi, getTxErrorKind, handleTxError, isMiniAppSlug, isStandaloneMiniApp, standardErc20Abi } from './chunk-WQ7WM2BC.js';
|
|
4
|
-
import './chunk-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { useRuntimeDeviceSensors } from './chunk-ZLF6YGWQ.js';
|
|
5
|
+
export { useDeviceMotion, useDeviceOrientation, useGeolocation } from './chunk-ZLF6YGWQ.js';
|
|
6
|
+
import { createIpfsTextReader, createFlapChainSdk } from './chunk-BIRAO6LU.js';
|
|
7
|
+
export { DEVICE_SENSORS_VERSION, FLAP_WALLET_RUNTIME_VERSION, PRESALE_APPROVAL_VERSION } from './chunk-BIRAO6LU.js';
|
|
7
8
|
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-WN4MIMCY.js';
|
|
8
9
|
export { OracleReadError, buildLocalOracleUrl, createLocalOracleReader, fetchOracleJson, fetchProvisionedOracle } from './chunk-JLI25XFB.js';
|
|
9
|
-
import { MiniAppContext, MiniAppRoutingContext, useFlapSdk } from './chunk-
|
|
10
|
-
export { VideoSessionReadError, createConsumerVideoSessionReader, readVideoSessionLength, readVideoSessionSlice, useVaultContext as useFlapChain, useFlapI18n, useFlapNotify, useFlapSdk, useVaultContext } from './chunk-
|
|
10
|
+
import { MiniAppContext, MiniAppRoutingContext, useFlapSdk } from './chunk-5DU4W4CK.js';
|
|
11
|
+
export { VideoSessionReadError, createConsumerVideoSessionReader, readVideoSessionLength, readVideoSessionSlice, useVaultContext as useFlapChain, useFlapI18n, useFlapNotify, useFlapSdk, useVaultContext } from './chunk-5DU4W4CK.js';
|
|
11
12
|
export { ZERO_ADDRESS, formatCountdown, formatPercentBps, formatTokenAmount, isActionAvailableForPhase, isCustomVaultTaxToken, isValidAddress, parseTokenAmount, readTaxVaultHostContext, resolveTokenMarketPhase, shortenAddress } from './chunk-B4WKI3EW.js';
|
|
12
13
|
export { isIpfsImageCid, normalizeIpfsImagePath, resolveIpfsImageUrl, resolveIpfsImageUrls } from './chunk-GY7YY67I.js';
|
|
13
14
|
import './chunk-BUSYA2B4.js';
|
|
14
15
|
import { useRef, useMemo, useContext, useSyncExternalStore } from 'react';
|
|
15
16
|
import { jsx } from 'react/jsx-runtime';
|
|
16
17
|
|
|
17
|
-
function MiniAppRuntimeProvider({ manifest, session, i18n, notify, runtime, router, children }) {
|
|
18
|
+
function MiniAppRuntimeProvider({ manifest, session, i18n, notify, runtime, deviceSensors, router, children }) {
|
|
19
|
+
const device = useRuntimeDeviceSensors(manifest, deviceSensors);
|
|
18
20
|
const current = useRef({ manifest, runtime });
|
|
19
21
|
current.current = { manifest, runtime };
|
|
20
22
|
const sdk = useMemo(() => {
|
|
21
23
|
const writableChains = [...manifest.walletChains ?? []];
|
|
22
24
|
const chainSdks = /* @__PURE__ */ new Map();
|
|
23
25
|
const readIpfsText = createIpfsTextReader();
|
|
24
|
-
return { context: { appId: manifest.artifactId, slug: manifest.slug, manifest: structuredClone(manifest) }, session, i18n, notify, readIpfsText, forChain: (chainId) => {
|
|
26
|
+
return { device, context: { appId: manifest.artifactId, slug: manifest.slug, manifest: structuredClone(manifest) }, session, i18n, notify, readIpfsText, forChain: (chainId) => {
|
|
25
27
|
if (!runtime) throw new Error("This host has not enabled wallet operations for Apps.");
|
|
26
28
|
let chainSdk = chainSdks.get(chainId);
|
|
27
29
|
if (!chainSdk) {
|
|
@@ -33,7 +35,7 @@ function MiniAppRuntimeProvider({ manifest, session, i18n, notify, runtime, rout
|
|
|
33
35
|
}
|
|
34
36
|
return chainSdk;
|
|
35
37
|
} };
|
|
36
|
-
}, [manifest, runtime, session, i18n, notify]);
|
|
38
|
+
}, [manifest, runtime, session, i18n, notify, device]);
|
|
37
39
|
if (!isStandaloneMiniApp(manifest)) throw new Error("A standalone Mini App v2 manifest is required.");
|
|
38
40
|
return /* @__PURE__ */ jsx(MiniAppContext.Provider, { value: sdk, children: /* @__PURE__ */ jsx(MiniAppRoutingContext.Provider, { value: router ?? null, children }) });
|
|
39
41
|
}
|
package/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/sdk/miniAppRuntime.tsx","../../src/sdk/miniAppRoutingRuntime.tsx","../../src/sdk/launchConfig.ts","../../src/sdk/three.ts","../../src/sdk/useFlapWallet.ts","../../src/sdk/client.ts"],"names":["useContext"],"mappings":";;;;;;;;;;;;;;;AA0BO,SAAS,sBAAA,CAAuB,EAAE,QAAA,EAAU,OAAA,EAAS,MAAM,MAAA,EAAQ,OAAA,EAAS,MAAA,EAAQ,QAAA,EAAS,EAEjG;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,MAAM,eAAe,oBAAA,EAAqB;AAC1C,IAAA,OAAO,EAAE,SAAS,EAAE,KAAA,EAAO,SAAS,UAAA,EAAY,IAAA,EAAM,SAAS,IAAA,EAAO,QAAA,E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AO,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;;;ACuEO,IAAM,8BAAA,GAAiC;AAGvC,IAAM,0BAAA,GAA6B;AAOnC,IAAM,oBAAA,GAAuB","file":"sdk.js","sourcesContent":["\"use client\";\nimport { useContext, useMemo, useRef, type ReactNode } from \"react\";\nimport type { Address, FlapI18n, FlapNotify, VaultManifest } from \"./types\";\nimport { MiniAppContext, MiniAppRoutingContext } from \"./runtimeStore\";\nimport { createFlapChainSdk, type FlapChainSdk, type FlapWalletRuntime } from \"./flapChainRuntime\";\nimport { isStandaloneMiniApp } from \"./miniApp\";\nimport { createIpfsTextReader } from \"./ipfsText\";\nimport type { MiniAppRouterAdapter } from \"./miniAppRoutingTypes\";\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 readIpfsText(cid: string, path?: string): Promise<string>;\n forChain(chainId: number): FlapChainSdk;\n}\nexport function MiniAppRuntimeProvider({ manifest, session, i18n, notify, runtime, router, children }: {\n manifest: VaultManifest; session: MiniAppSession; i18n: FlapI18n; notify: FlapNotify; children: ReactNode; runtime?: FlapWalletRuntime; router?: MiniAppRouterAdapter;\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 const readIpfsText = createIpfsTextReader();\n return { context: { appId: manifest.artifactId, slug: manifest.slug!, manifest: structuredClone(manifest) }, session, i18n, notify, readIpfsText, 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, readIpfsText }); 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}><MiniAppRoutingContext.Provider value={router ?? null}>{children}</MiniAppRoutingContext.Provider></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","\"use client\";\nimport { useContext, useSyncExternalStore } from \"react\";\nimport { MiniAppRoutingContext } from \"./runtimeStore\";\nimport type { MiniAppRouter } from \"./miniAppRoutingTypes\";\n\n/** Routing is enabled by the host, independently from wallet permissions. */\nexport function useMiniAppRouter(): MiniAppRouter {\n const adapter = useContext(MiniAppRoutingContext);\n if (!adapter) throw new Error(\"runtime/mini-app-routing-unsupported: this host must enable Mini App routing.\");\n const snapshot = useSyncExternalStore(adapter.subscribe, adapter.getSnapshot, adapter.getSnapshot);\n return { ...snapshot, push: adapter.push, replace: adapter.replace, back: adapter.back };\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 \"./miniAppRoutingTypes\";\nexport { useMiniAppRouter } from \"./miniAppRoutingRuntime\";\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, AppResolvedWriteConstraint } from \"./appWalletPolicy.mjs\";\n/** Controlled dynamic CID text reads and image rendering. */\nexport const IPFS_CONTENT_VERSION = 1;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/sdk/miniAppRuntime.tsx","../../src/sdk/miniAppRoutingRuntime.tsx","../../src/sdk/launchConfig.ts","../../src/sdk/three.ts","../../src/sdk/useFlapWallet.ts","../../src/sdk/client.ts"],"names":["useContext"],"mappings":";;;;;;;;;;;;;;;;AA6BO,SAAS,sBAAA,CAAuB,EAAE,QAAA,EAAU,OAAA,EAAS,IAAA,EAAM,QAAQ,OAAA,EAAS,aAAA,EAAe,MAAA,EAAQ,QAAA,EAAS,EAEhH;AACD,EAAA,MAAM,MAAA,GAAS,uBAAA,CAAwB,QAAA,EAAU,aAAa,CAAA;AAC9D,EAAA,MAAM,OAAA,GAAU,MAAA,CAAO,EAAE,QAAA,EAAU,SAAS,CAAA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AAI,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;;;ACuEO,IAAM,8BAAA,GAAiC;AAGvC,IAAM,0BAAA,GAA6B;AAOnC,IAAM,oBAAA,GAAuB","file":"sdk.js","sourcesContent":["\"use client\";\nimport { useContext, useMemo, useRef, type ReactNode } from \"react\";\nimport type { Address, FlapI18n, FlapNotify, VaultManifest } from \"./types\";\nimport { MiniAppContext, MiniAppRoutingContext } from \"./runtimeStore\";\nimport { createFlapChainSdk, type FlapChainSdk, type FlapWalletRuntime } from \"./flapChainRuntime\";\nimport { isStandaloneMiniApp } from \"./miniApp\";\nimport { createIpfsTextReader } from \"./ipfsText\";\nimport { useRuntimeDeviceSensors } from \"./deviceSensorHooks\";\nimport type { DeviceSensors } from \"./deviceSensors\";\nimport type { MiniAppRouterAdapter } from \"./miniAppRoutingTypes\";\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 device: DeviceSensors;\n context: { appId: string; slug: string; manifest: VaultManifest };\n session: MiniAppSession;\n i18n: FlapI18n;\n notify: FlapNotify;\n readIpfsText(cid: string, path?: string): Promise<string>;\n forChain(chainId: number): FlapChainSdk;\n}\nexport function MiniAppRuntimeProvider({ manifest, session, i18n, notify, runtime, deviceSensors, router, children }: {\n manifest: VaultManifest; session: MiniAppSession; i18n: FlapI18n; notify: FlapNotify; children: ReactNode; runtime?: FlapWalletRuntime; deviceSensors?: DeviceSensors; router?: MiniAppRouterAdapter;\n}) {\n const device = useRuntimeDeviceSensors(manifest, deviceSensors);\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 const readIpfsText = createIpfsTextReader();\n return { device, context: { appId: manifest.artifactId, slug: manifest.slug!, manifest: structuredClone(manifest) }, session, i18n, notify, readIpfsText, 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, readIpfsText }); chainSdks.set(chainId, chainSdk); }\n return chainSdk;\n } };\n }, [manifest, runtime, session, i18n, notify, device]);\n if (!isStandaloneMiniApp(manifest)) throw new Error(\"A standalone Mini App v2 manifest is required.\");\n return <MiniAppContext.Provider value={sdk}><MiniAppRoutingContext.Provider value={router ?? null}>{children}</MiniAppRoutingContext.Provider></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","\"use client\";\nimport { useContext, useSyncExternalStore } from \"react\";\nimport { MiniAppRoutingContext } from \"./runtimeStore\";\nimport type { MiniAppRouter } from \"./miniAppRoutingTypes\";\n\n/** Routing is enabled by the host, independently from wallet permissions. */\nexport function useMiniAppRouter(): MiniAppRouter {\n const adapter = useContext(MiniAppRoutingContext);\n if (!adapter) throw new Error(\"runtime/mini-app-routing-unsupported: this host must enable Mini App routing.\");\n const snapshot = useSyncExternalStore(adapter.subscribe, adapter.getSnapshot, adapter.getSnapshot);\n return { ...snapshot, push: adapter.push, replace: adapter.replace, back: adapter.back };\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 \"./miniAppRoutingTypes\";\nexport { useMiniAppRouter } from \"./miniAppRoutingRuntime\";\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, PRESALE_APPROVAL_VERSION } from \"./flapChainRuntime\";\nexport type { FlapChainSdk, FlapSendTransactionRequest, FlapTransactionReceipt, PresaleQuoteApprovalRequest } from \"./flapChainRuntime\";\n\nexport type { AppWalletContract, AppPresaleApproval, AppResolvedContract } from \"./appWalletPolicy.mjs\";\n/** Controlled dynamic CID text reads and image rendering. */\nexport const IPFS_CONTENT_VERSION = 1;\nexport { DEVICE_SENSORS_VERSION } from \"./deviceSensors\";\nexport { useGeolocation, useDeviceMotion, useDeviceOrientation } from \"./deviceSensorHooks\";\nexport type { DeviceCapability, DeviceSensorMode, DeviceSensorPermission, DeviceSensorStatus, DeviceSensorState, DeviceSensorRequestOptions, DeviceLocationRequestOptions, DeviceLocationData, DeviceMotionData, DeviceOrientationData, DeviceSensor, DeviceSensors } from \"./deviceSensors\";\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, e as ContractReadRequest, f as ContractWriteRequest, g as CreateVaultRuntimeContextInput, E as EndpointPolicy,
|
|
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-5ZZT8uC7.mjs';
|
|
2
|
+
import { ar as RuntimeOracleRegistry, ag as OracleProvision, ae as NftMetadataSnapshot } from './types-kDMLRchJ.mjs';
|
|
3
|
+
export { A as ActionAvailabilityStage, a as Address, C as ContractEventRequest, e as ContractReadRequest, f as ContractWriteRequest, g as CreateVaultRuntimeContextInput, E as EndpointPolicy, u as FeeMode, w as FlapFeeVaultInfo, x as FlapI18n, y as FlapNotify, G as FlapTaxInfo, H as FlapTokenInfo, J as FlapVaultPortalInfo, K as FlapVaultSdk, L as FlapWallet, O as HostRuntimeAddresses, P as HostRuntimeDataSource, Q as HostRuntimeDegradeReason, R as HostRuntimeInput, S as HostRuntimePolicy, T as HostRuntimePresentationFetcher, U as HostRuntimePresentationRequest, V as HostRuntimeResult, W as HostRuntimeSources, X as HostRuntimeStatus, Y as HostRuntimeWarning, Z as HostTokenPresentation, _ as IpfsUploadResult, $ as ManifestBindingEntry, a0 as ManifestExternalContract, a3 as MediaUploadOptions, a4 as MediaUploadRequest, a5 as MediaUploader, aa as NftMetadataAttribute, ab as NftMetadataReadRequest, ac as NftMetadataReader, ad as NftMetadataReaderRequest, af as NftMetadataSource, ah as OracleReadRequest, ai as OracleReader, al as PaymentToken, as as SimulateResult, at as TokenMarketPhase, au as TokenMetadataSnapshot, av as TokenRuntimeSnapshot, aw as TxReceipt, ax as VaultArtifactSurface, ay as VaultComponentProps, az as VaultHostContext, aA as VaultLaunchConfigComponentProps, aB as VaultLaunchConfigContext, aC as VaultLaunchConfigResult, aD as VaultLaunchConfigSummaryItem, aE as VaultLaunchConfigValues, aF as VaultLaunchSchema, aG as VaultLaunchSchemaField, aH as VaultManifest, aI as VaultManifestCapability, aJ as VaultManifestDisplayTitle, aK as VaultManifestLayout, aL as VaultManifestMode, aM as VaultRenderSurface, aN as VaultRuntimeContext, aO as VaultRuntimeContextOverrides, aP as VaultRuntimeExtraConfig } from './types-kDMLRchJ.mjs';
|
|
4
4
|
import 'viem';
|
|
5
5
|
|
|
6
6
|
declare const FLAP_RUNTIME_ORACLE_REGISTRY_ENV = "FLAP_RUNTIME_ORACLE_REGISTRY";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ai as OracleReader, ag as OracleProvision, a as Address, A as ActionAvailabilityStage, at as TokenMarketPhase, H as FlapTokenInfo, az as VaultHostContext, G as FlapTaxInfo, J as FlapVaultPortalInfo, u as FeeMode, aM as VaultRenderSurface, aH as VaultManifest, w as FlapFeeVaultInfo, $ as ManifestBindingEntry } from './types-kDMLRchJ.mjs';
|
|
2
2
|
|
|
3
3
|
declare const MINI_APP_SLUG_PATTERN: RegExp;
|
|
4
4
|
declare function isMiniAppSlug(value: unknown): value is string;
|
|
@@ -47,6 +47,7 @@ interface ParsedResolvedContract {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
declare const FLAP_WALLET_RUNTIME_VERSION = 1;
|
|
50
|
+
declare const PRESALE_APPROVAL_VERSION = 1;
|
|
50
51
|
interface FlapSendTransactionRequest {
|
|
51
52
|
to: Address;
|
|
52
53
|
value?: bigint;
|
|
@@ -60,6 +61,10 @@ interface FlapTransactionReceipt {
|
|
|
60
61
|
blockNumber: bigint;
|
|
61
62
|
logs: TransactionReceipt["logs"];
|
|
62
63
|
}
|
|
64
|
+
interface PresaleQuoteApprovalRequest {
|
|
65
|
+
pool: ResolvedContractHandle;
|
|
66
|
+
amount: bigint;
|
|
67
|
+
}
|
|
63
68
|
interface FlapChainSdk {
|
|
64
69
|
context: {
|
|
65
70
|
chainId: number;
|
|
@@ -72,6 +77,7 @@ interface FlapChainSdk {
|
|
|
72
77
|
readContract<T = unknown>(request: ContractReadRequest): Promise<T>;
|
|
73
78
|
simulateContract(request: ContractWriteRequest): Promise<SimulateResult>;
|
|
74
79
|
writeContract(request: ContractWriteRequest): Promise<Address>;
|
|
80
|
+
approveQuote(request: PresaleQuoteApprovalRequest): Promise<Address>;
|
|
75
81
|
sendTransaction(request: FlapSendTransactionRequest): Promise<Address>;
|
|
76
82
|
waitForTx(hash: Address): Promise<FlapTransactionReceipt>;
|
|
77
83
|
getGasPrice(): Promise<bigint>;
|
|
@@ -99,6 +105,16 @@ interface FlapWalletRuntime {
|
|
|
99
105
|
readOnly?: boolean;
|
|
100
106
|
generation?: string;
|
|
101
107
|
assertActive?(): void;
|
|
108
|
+
/** Authorize the reviewed Launcher for this host context and resolve its ERC20 quote token and cap. */
|
|
109
|
+
resolvePresaleApproval?(input: {
|
|
110
|
+
chainId: number;
|
|
111
|
+
policyId: string;
|
|
112
|
+
factory: Address;
|
|
113
|
+
launcher: Address;
|
|
114
|
+
}): Promise<{
|
|
115
|
+
quoteToken: Address;
|
|
116
|
+
maxApprovalWei: bigint;
|
|
117
|
+
}>;
|
|
102
118
|
getAccount(): FlapWalletAccount;
|
|
103
119
|
connect(): void;
|
|
104
120
|
disconnect(): void;
|
|
@@ -132,19 +148,14 @@ declare function createFlapChainSdk(runtime: FlapWalletRuntime, input: {
|
|
|
132
148
|
}): FlapChainSdk;
|
|
133
149
|
|
|
134
150
|
interface AppWalletPermissions { id: string; allow?: string[]; read?: string[]; maxValueWei?: string; approvalSpenders?: Address[]; maxApprovalWei?: string; codeHash?: `0x${string}` }
|
|
135
|
-
interface
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
interface AppWalletContract extends AppWalletPermissions { chainId: number; address: Address; resolvedContracts?: AppResolvedContract[] }
|
|
142
|
-
interface ParsedAppWalletPermissions {
|
|
143
|
-
definition: AppWalletPermissions;
|
|
144
|
-
writes: AbiFunction[];
|
|
145
|
-
reads: AbiFunction[];
|
|
146
|
-
writeConstraints?: ReadonlyMap<string, { fixedBytes: ReadonlyMap<number, number>; valueWei?: bigint }>;
|
|
147
|
-
}
|
|
151
|
+
interface AppResolvedContract extends AppWalletPermissions { resolver: string }
|
|
152
|
+
interface AppPresaleApproval {
|
|
153
|
+
policyId: string;
|
|
154
|
+
launcherResolver: string;
|
|
155
|
+
maxApprovalWei: string;
|
|
156
|
+
}
|
|
157
|
+
interface AppWalletContract extends AppWalletPermissions { chainId: number; address: Address; resolvedContracts?: AppResolvedContract[]; presaleApproval?: AppPresaleApproval }
|
|
158
|
+
interface ParsedAppWalletPermissions { definition: AppWalletPermissions; writes: AbiFunction[]; reads: AbiFunction[] }
|
|
148
159
|
interface ParsedAppWalletContract extends ParsedAppWalletPermissions { definition: AppWalletContract; resolved: (ParsedAppWalletPermissions & { resolver: AbiFunction })[] }
|
|
149
160
|
declare function parseAppWalletContracts(value: unknown): ParsedAppWalletContract[];
|
|
150
161
|
|
|
@@ -191,6 +202,126 @@ interface NftAccountWithdrawalReceipt {
|
|
|
191
202
|
balanceAfter?: bigint;
|
|
192
203
|
}
|
|
193
204
|
|
|
205
|
+
/** Host-owned browser device access. Importing this module never touches hardware. */
|
|
206
|
+
declare const DEVICE_SENSORS_VERSION = 1;
|
|
207
|
+
type DeviceCapability = "location" | "motion" | "orientation";
|
|
208
|
+
type DeviceSensorMode = "real" | "mock";
|
|
209
|
+
type DeviceSensorPermission = "unknown" | "prompt" | "granted" | "denied";
|
|
210
|
+
type DeviceSensorStatus = "idle" | "requesting" | "active" | "paused" | "denied" | "unsupported" | "insecure" | "policy-blocked" | "timeout" | "unavailable" | "not-declared" | "cancelled";
|
|
211
|
+
interface DeviceLocationData {
|
|
212
|
+
latitude: number;
|
|
213
|
+
longitude: number;
|
|
214
|
+
accuracy: number;
|
|
215
|
+
altitude: number | null;
|
|
216
|
+
altitudeAccuracy: number | null;
|
|
217
|
+
heading: number | null;
|
|
218
|
+
speed: number | null;
|
|
219
|
+
timestamp: number;
|
|
220
|
+
}
|
|
221
|
+
interface DeviceVector {
|
|
222
|
+
x: number | null;
|
|
223
|
+
y: number | null;
|
|
224
|
+
z: number | null;
|
|
225
|
+
}
|
|
226
|
+
interface DeviceRotationRate {
|
|
227
|
+
alpha: number | null;
|
|
228
|
+
beta: number | null;
|
|
229
|
+
gamma: number | null;
|
|
230
|
+
}
|
|
231
|
+
interface DeviceMotionData {
|
|
232
|
+
acceleration: DeviceVector | null;
|
|
233
|
+
accelerationIncludingGravity: DeviceVector | null;
|
|
234
|
+
rotationRate: DeviceRotationRate | null;
|
|
235
|
+
interval: number | null;
|
|
236
|
+
timestamp: number;
|
|
237
|
+
}
|
|
238
|
+
interface DeviceOrientationData {
|
|
239
|
+
alpha: number | null;
|
|
240
|
+
beta: number | null;
|
|
241
|
+
gamma: number | null;
|
|
242
|
+
absolute: boolean;
|
|
243
|
+
timestamp: number;
|
|
244
|
+
}
|
|
245
|
+
interface DeviceSensorState<T> {
|
|
246
|
+
status: DeviceSensorStatus;
|
|
247
|
+
permission: DeviceSensorPermission;
|
|
248
|
+
data: T | null;
|
|
249
|
+
mode: DeviceSensorMode;
|
|
250
|
+
}
|
|
251
|
+
interface DeviceSensorRequestOptions {
|
|
252
|
+
timeoutMs?: number;
|
|
253
|
+
signal?: AbortSignal;
|
|
254
|
+
}
|
|
255
|
+
interface DeviceLocationRequestOptions extends DeviceSensorRequestOptions {
|
|
256
|
+
watch?: boolean;
|
|
257
|
+
enableHighAccuracy?: boolean;
|
|
258
|
+
maximumAge?: number;
|
|
259
|
+
}
|
|
260
|
+
interface DeviceSensor<T, O extends DeviceSensorRequestOptions = DeviceSensorRequestOptions> {
|
|
261
|
+
getSnapshot(): DeviceSensorState<T>;
|
|
262
|
+
subscribe(listener: () => void): () => void;
|
|
263
|
+
/** Call directly from a user action. Resolves after data or a normalized failure. */
|
|
264
|
+
request(options?: O): Promise<DeviceSensorState<T>>;
|
|
265
|
+
/** Stops this capability's shared session, including all of its subscribers. */
|
|
266
|
+
stop(): void;
|
|
267
|
+
}
|
|
268
|
+
interface DeviceSensors {
|
|
269
|
+
readonly version: typeof DEVICE_SENSORS_VERSION;
|
|
270
|
+
readonly mode: DeviceSensorMode;
|
|
271
|
+
location: DeviceSensor<DeviceLocationData, DeviceLocationRequestOptions>;
|
|
272
|
+
motion: DeviceSensor<DeviceMotionData>;
|
|
273
|
+
orientation: DeviceSensor<DeviceOrientationData>;
|
|
274
|
+
/** Stops work and invalidates callbacks; services may safely be restarted. */
|
|
275
|
+
dispose(): void;
|
|
276
|
+
}
|
|
277
|
+
interface DeviceEventTarget {
|
|
278
|
+
addEventListener(type: string, listener: (event: any) => void): void;
|
|
279
|
+
removeEventListener(type: string, listener: (event: any) => void): void;
|
|
280
|
+
}
|
|
281
|
+
/** Structural host adapter, also useful for deterministic tests without hardware. */
|
|
282
|
+
interface DeviceSensorEnvironment {
|
|
283
|
+
secure: boolean;
|
|
284
|
+
window: DeviceEventTarget & {
|
|
285
|
+
DeviceMotionEvent?: {
|
|
286
|
+
requestPermission?: () => Promise<string>;
|
|
287
|
+
};
|
|
288
|
+
DeviceOrientationEvent?: {
|
|
289
|
+
requestPermission?: () => Promise<string>;
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
document: DeviceEventTarget & {
|
|
293
|
+
visibilityState?: string;
|
|
294
|
+
permissionsPolicy?: {
|
|
295
|
+
allowsFeature(feature: string): boolean;
|
|
296
|
+
};
|
|
297
|
+
featurePolicy?: {
|
|
298
|
+
allowsFeature(feature: string): boolean;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
geolocation?: {
|
|
302
|
+
getCurrentPosition(success: (value: any) => void, failure: (error: any) => void, options: PositionOptions): void;
|
|
303
|
+
watchPosition(success: (value: any) => void, failure: (error: any) => void, options: PositionOptions): number;
|
|
304
|
+
clearWatch(id: number): void;
|
|
305
|
+
};
|
|
306
|
+
setTimeout(callback: () => void, milliseconds: number): unknown;
|
|
307
|
+
clearTimeout(id: unknown): void;
|
|
308
|
+
now(): number;
|
|
309
|
+
}
|
|
310
|
+
interface BrowserDeviceSensorsOptions {
|
|
311
|
+
capabilities?: readonly DeviceCapability[];
|
|
312
|
+
/** Hosts normally omit this. No navigator access occurs until request(). */
|
|
313
|
+
environment?: DeviceSensorEnvironment | (() => DeviceSensorEnvironment | undefined);
|
|
314
|
+
}
|
|
315
|
+
declare function createBrowserDeviceSensors(options?: BrowserDeviceSensorsOptions): DeviceSensors;
|
|
316
|
+
interface MockDeviceSensorsOptions {
|
|
317
|
+
capabilities?: readonly DeviceCapability[];
|
|
318
|
+
outcome?: "granted" | "denied" | "unsupported" | "unavailable" | "timeout";
|
|
319
|
+
location?: Partial<DeviceLocationData>;
|
|
320
|
+
motion?: Partial<DeviceMotionData>;
|
|
321
|
+
orientation?: Partial<DeviceOrientationData>;
|
|
322
|
+
}
|
|
323
|
+
declare function createMockDeviceSensors(options?: MockDeviceSensorsOptions): DeviceSensors;
|
|
324
|
+
|
|
194
325
|
type Address = `0x${string}`;
|
|
195
326
|
interface PaymentToken {
|
|
196
327
|
address: Address;
|
|
@@ -382,6 +513,10 @@ interface VaultManifest {
|
|
|
382
513
|
};
|
|
383
514
|
mode?: VaultManifestMode;
|
|
384
515
|
capabilities?: VaultManifestCapability[];
|
|
516
|
+
/** Reviewed device access intent. Omission preserves legacy no-device behavior. */
|
|
517
|
+
deviceCapabilities?: ("location" | "motion" | "orientation")[];
|
|
518
|
+
/** Fixed shared street map only; grants no raw network or worker access. */
|
|
519
|
+
mapCapabilities?: ("street-map-v1")[];
|
|
385
520
|
/** Omitted manifests keep the legacy vault-ui-only behavior. */
|
|
386
521
|
surfaces?: VaultArtifactSurface[];
|
|
387
522
|
layout?: VaultManifestLayout;
|
|
@@ -573,6 +708,7 @@ interface MediaUploadRequest extends MediaUploadOptions {
|
|
|
573
708
|
/** Optional host override for the controlled upload service. */
|
|
574
709
|
type MediaUploader = (request: MediaUploadRequest) => Promise<IpfsUploadResult>;
|
|
575
710
|
interface FlapVaultSdk {
|
|
711
|
+
device: DeviceSensors;
|
|
576
712
|
forChain(chainId: number): FlapChainSdk;
|
|
577
713
|
context: VaultRuntimeContext;
|
|
578
714
|
i18n: FlapI18n;
|
|
@@ -620,4 +756,4 @@ interface VaultComponentProps {
|
|
|
620
756
|
context?: VaultRuntimeContext;
|
|
621
757
|
}
|
|
622
758
|
|
|
623
|
-
export { type
|
|
759
|
+
export { type ManifestBindingEntry as $, type ActionAvailabilityStage as A, type BrowserDeviceSensorsOptions as B, type ContractEventRequest as C, DEVICE_SENSORS_VERSION as D, type EndpointPolicy as E, FLAP_WALLET_RUNTIME_VERSION as F, type FlapTaxInfo as G, type FlapTokenInfo as H, type FlapTransactionReceipt as I, type FlapVaultPortalInfo as J, type FlapVaultSdk as K, type FlapWallet as L, type FlapWalletAccount as M, type FlapWalletRuntime as N, type HostRuntimeAddresses as O, type HostRuntimeDataSource as P, type HostRuntimeDegradeReason as Q, type HostRuntimeInput as R, type HostRuntimePolicy as S, type HostRuntimePresentationFetcher as T, type HostRuntimePresentationRequest as U, type HostRuntimeResult as V, type HostRuntimeSources as W, type HostRuntimeStatus as X, type HostRuntimeWarning as Y, type HostTokenPresentation as Z, type IpfsUploadResult as _, type Address as a, type ManifestExternalContract as a0, type ManifestNftAccountWithdrawal as a1, type ManifestResolvedContract as a2, type MediaUploadOptions as a3, type MediaUploadRequest as a4, type MediaUploader as a5, type MockDeviceSensorsOptions as a6, type NftAccountWithdrawalPolicy as a7, type NftAccountWithdrawalReceipt as a8, type NftAccountWithdrawalRequest as a9, type VaultLaunchConfigComponentProps as aA, type VaultLaunchConfigContext as aB, type VaultLaunchConfigResult as aC, type VaultLaunchConfigSummaryItem as aD, type VaultLaunchConfigValues as aE, type VaultLaunchSchema as aF, type VaultLaunchSchemaField as aG, type VaultManifest as aH, type VaultManifestCapability as aI, type VaultManifestDisplayTitle as aJ, type VaultManifestLayout as aK, type VaultManifestMode as aL, type VaultRenderSurface as aM, type VaultRuntimeContext as aN, type VaultRuntimeContextOverrides as aO, type VaultRuntimeExtraConfig as aP, createBrowserDeviceSensors as aQ, createFlapChainSdk as aR, createMockDeviceSensors as aS, parseAppWalletContracts as aT, type NftMetadataAttribute as aa, type NftMetadataReadRequest as ab, type NftMetadataReader as ac, type NftMetadataReaderRequest as ad, type NftMetadataSnapshot as ae, type NftMetadataSource as af, type OracleProvision as ag, type OracleReadRequest as ah, type OracleReader as ai, PRESALE_APPROVAL_VERSION as aj, type ParsedResolvedContract as ak, type PaymentToken as al, type PresaleQuoteApprovalRequest as am, type ResolvedContractCheck as an, type ResolvedContractHandle as ao, type ReviewedBeaconPin as ap, type ReviewedContractPin as aq, type RuntimeOracleRegistry as ar, type SimulateResult as as, type TokenMarketPhase as at, type TokenMetadataSnapshot as au, type TokenRuntimeSnapshot as av, type TxReceipt as aw, type VaultArtifactSurface as ax, type VaultComponentProps as ay, type VaultHostContext as az, type AppPresaleApproval as b, type AppResolvedContract as c, type AppWalletContract as d, type ContractReadRequest as e, type ContractWriteRequest as f, type CreateVaultRuntimeContextInput as g, type DeviceCapability as h, type DeviceLocationData as i, type DeviceLocationRequestOptions as j, type DeviceMotionData as k, type DeviceOrientationData as l, type DeviceSensor as m, type DeviceSensorEnvironment as n, type DeviceSensorMode as o, type DeviceSensorPermission as p, type DeviceSensorRequestOptions as q, type DeviceSensorState as r, type DeviceSensorStatus as s, type DeviceSensors as t, type FeeMode as u, type FlapChainSdk as v, type FlapFeeVaultInfo as w, type FlapI18n as x, type FlapNotify as y, type FlapSendTransactionRequest 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-kDMLRchJ.mjs';
|
|
6
6
|
import 'viem';
|
|
7
7
|
|
|
8
8
|
interface AddressLinkProps {
|
|
@@ -222,4 +222,76 @@ type VideoSessionPlayerProps = VideoClipSessionPlayerProps | (ConsumerVideoSessi
|
|
|
222
222
|
});
|
|
223
223
|
declare function VideoSessionPlayer(props: VideoSessionPlayerProps): React.JSX.Element;
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
declare const STREET_MAP_RARITY_COLORS: Readonly<{
|
|
226
|
+
common: "#22c55e";
|
|
227
|
+
rare: "#3b82f6";
|
|
228
|
+
epic: "#a855f7";
|
|
229
|
+
legendary: "#fbbf24";
|
|
230
|
+
}>;
|
|
231
|
+
type FlapStreetMapRarity = keyof typeof STREET_MAP_RARITY_COLORS;
|
|
232
|
+
type FlapStreetMapPointKind = "store" | "event";
|
|
233
|
+
interface FlapStreetMapCoordinate {
|
|
234
|
+
lat: number;
|
|
235
|
+
lng: number;
|
|
236
|
+
}
|
|
237
|
+
interface FlapStreetMapPoint extends FlapStreetMapCoordinate {
|
|
238
|
+
id: string;
|
|
239
|
+
title: string;
|
|
240
|
+
rarity?: FlapStreetMapRarity;
|
|
241
|
+
symbol?: string;
|
|
242
|
+
place?: string;
|
|
243
|
+
city?: string;
|
|
244
|
+
/** Plain display data; monetary units and eligibility remain application-owned. */
|
|
245
|
+
amount?: string | number;
|
|
246
|
+
/** Optional expiry and cooldown deadlines, both in Unix epoch milliseconds. */
|
|
247
|
+
expiresAt?: number;
|
|
248
|
+
respawnAt?: number;
|
|
249
|
+
kind?: FlapStreetMapPointKind;
|
|
250
|
+
}
|
|
251
|
+
interface FlapStreetMapPointState {
|
|
252
|
+
coolingDown: boolean;
|
|
253
|
+
expired: boolean;
|
|
254
|
+
cooldownRemainingMs: number;
|
|
255
|
+
eventRemainingMs: number | null;
|
|
256
|
+
}
|
|
257
|
+
interface FlapStreetMapState {
|
|
258
|
+
status: "loading" | "ready" | "unavailable";
|
|
259
|
+
reason?: "not-declared" | "invalid-input" | "unsupported" | "load-failed" | "timeout" | "context-lost";
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/** Immutable required-export sentinel; future revisions use a new name. */
|
|
263
|
+
declare const STREET_MAP_PRESENTATION_V1 = 1;
|
|
264
|
+
interface FlapStreetMapDetailsContext extends FlapStreetMapPointState {
|
|
265
|
+
nowMs: number;
|
|
266
|
+
distanceMeters: number | null;
|
|
267
|
+
claimRadiusMeters: number | null;
|
|
268
|
+
/** Geometric estimate for display, never a claim authorization. */
|
|
269
|
+
withinDisplayRadius: boolean | null;
|
|
270
|
+
close(): void;
|
|
271
|
+
}
|
|
272
|
+
interface FlapStreetMapProps {
|
|
273
|
+
points?: readonly FlapStreetMapPoint[];
|
|
274
|
+
center?: FlapStreetMapCoordinate;
|
|
275
|
+
userLocation?: FlapStreetMapCoordinate | null;
|
|
276
|
+
zoom?: number;
|
|
277
|
+
selectedPointId?: string | null;
|
|
278
|
+
onSelectPoint?: (id: string) => void;
|
|
279
|
+
onSelectionChange?: (point: FlapStreetMapPoint | null) => void;
|
|
280
|
+
/** Project-owned, localized React content; never HTML strings or map popups. */
|
|
281
|
+
renderPointDetails?: (point: FlapStreetMapPoint, context: FlapStreetMapDetailsContext) => React.ReactNode;
|
|
282
|
+
claimRadiusMeters?: number;
|
|
283
|
+
cityClusters?: boolean;
|
|
284
|
+
showPointLabels?: boolean;
|
|
285
|
+
showEventCountdowns?: boolean;
|
|
286
|
+
showNavigation?: boolean;
|
|
287
|
+
showScale?: boolean;
|
|
288
|
+
rarityColors?: Partial<Record<FlapStreetMapRarity, string>>;
|
|
289
|
+
controlLabels?: Partial<Record<"zoomIn" | "zoomOut" | "resetBearing" | "closeDetails", string>>;
|
|
290
|
+
onStateChange?: (state: FlapStreetMapState) => void;
|
|
291
|
+
fallback?: React.ReactNode;
|
|
292
|
+
className?: string;
|
|
293
|
+
}
|
|
294
|
+
/** Fixed resource/rendering surface. Amounts, claim rules and details remain project-owned. */
|
|
295
|
+
declare function FlapStreetMap({ points, center, userLocation, zoom, selectedPointId, onSelectPoint, onSelectionChange, renderPointDetails, claimRadiusMeters, cityClusters, showPointLabels, showEventCountdowns, showNavigation, showScale, rarityColors, controlLabels, onStateChange, fallback, className, }: FlapStreetMapProps): React.JSX.Element;
|
|
296
|
+
|
|
297
|
+
export { AddressLink, Alert, BinanceImage, type BinanceImageProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardHeader, CardTitle, CopyButton, type CopyButtonProps, Countdown, DataRow, DetailTile, ExternalLink, type ExternalLinkProps, FlapStreetMap, type FlapStreetMapCoordinate, type FlapStreetMapDetailsContext, type FlapStreetMapPoint, type FlapStreetMapPointKind, type FlapStreetMapPointState, type FlapStreetMapProps, type FlapStreetMapRarity, type FlapStreetMapState, Input, type InputProps, IpfsBackground, type IpfsBackgroundProps, IpfsImage, type IpfsImageProps, IpfsText, type IpfsTextProps, Metric, NftMetadataImage, type NftMetadataImageProps, ReviewedFrame, type ReviewedFrameProps, type ReviewedFrameProvider, STREET_MAP_PRESENTATION_V1, StatusBadge, type StatusTone, TxButton, type TxButtonState, VaultBanner, type VideoClipSessionPlayerProps, type VideoSessionClip, VideoSessionPlayer, type VideoSessionPlayerProps, type VideoSessionState, buttonVariants };
|
package/ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { AddressLink, Alert, BinanceImage, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, CopyButton, Countdown, DataRow, DetailTile, ExternalLink, Input, IpfsBackground, IpfsImage, IpfsText, Metric, NftMetadataImage, ReviewedFrame, StatusBadge, TxButton, VaultBanner, VideoSessionPlayer, buttonVariants } from './chunk-
|
|
2
|
+
export { AddressLink, Alert, BinanceImage, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, CopyButton, Countdown, DataRow, DetailTile, ExternalLink, FlapStreetMap, Input, IpfsBackground, IpfsImage, IpfsText, Metric, NftMetadataImage, ReviewedFrame, STREET_MAP_PRESENTATION_V1, StatusBadge, TxButton, VaultBanner, VideoSessionPlayer, buttonVariants } from './chunk-5DU4W4CK.js';
|
|
3
3
|
import './chunk-B4WKI3EW.js';
|
|
4
4
|
import './chunk-GY7YY67I.js';
|
|
5
5
|
import './chunk-BUSYA2B4.js';
|