@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 CHANGED
@@ -4,11 +4,9 @@ Generated from `flap-vault-ui-template`.
4
4
 
5
5
 
6
6
 
7
-
8
-
9
7
  This package is the shared runtime surface that local preview, Artifact Workbench, and `flap.sh` should agree on.
10
8
 
11
- Package version: `0.1.43`. Source commit: `e5bdfb9abc934a02c3a89a287966d074be232e5c`.
9
+ Package version: `0.1.44-next.0`. Source commit: `73389f0d53c53433cfb5ac6cf6c1ec0022e21dde`.
12
10
 
13
11
  ## Exports
14
12
 
@@ -19,6 +17,13 @@ Package version: `0.1.43`. Source commit: `e5bdfb9abc934a02c3a89a287966d074be232
19
17
 
20
18
  See `runtime-contract.json` for the machine-readable subpath contract.
21
19
 
20
+ ## Presale quote approvals
21
+
22
+ Standalone Mini Apps can use `sdk.approveQuote({ pool, amount })` with a genuine
23
+ Launcher handle under a reviewed `walletContracts[].presaleApproval` policy.
24
+ The host must provision the policy to resolve and authorize the pool's ERC20 quote
25
+ token. This feature is advertised by `sdkFeatures.presaleApproval = 1`.
26
+
22
27
  ## Mini App subroutes
23
28
 
24
29
  Standalone Mini Apps use `useMiniAppRouter()` from `./sdk`. It returns
@@ -33,55 +38,48 @@ identify the feature. Hosts inject a `router` into `MiniAppRuntimeProvider`;
33
38
  explicitly if the host has not enabled routing. Deploy supporting hosts before
34
39
  accepting new route-dependent artifacts; source-package provenance is unchanged.
35
40
 
41
+ ## Street maps
42
+
43
+ The `./ui` export `FlapStreetMap` requires `mapCapabilities: ["street-map-v1"]` and `uiFeatures.streetMap = 1`. Enhanced map artifacts also require the immutable `STREET_MAP_PRESENTATION_V1 = 1` UI export and `uiFeatures.streetMapPresentation = 1`; Workbench records this requirement so older hosts stop before importing an unsupported artifact. Existing basic map artifacts remain compatible. Hosts copy the packaged `runtime-map/maplibre-6.15.0-worker.mjs` to the exact same-origin path `/runtime-map/maplibre-6.15.0-worker.mjs`. The fixed MapLibre 6.15.0 engine is lazy bundled; there is no CDN loader, arbitrary style/URL/Worker/HTML API or automatic GPS request. The component supports four rarity colors (optional bounded hex palette), gray cooldown/expiry states, city bubbles through zoom 7.2, store labels above zoom 10.5, separate event points/countdowns, selection, a React details slot, a pulsing user marker and a range circle in meters. Navigation/metric scale are opt-in. Pass existing GPS coordinates, localized control labels and a list fallback. Timestamps are epoch milliseconds; client distance/range/time are display estimates, never claim authorization. Points are capped at 2000, zoom at 3..18, radius at 100000 meters. Fixed OpenFreeMap dark resources are requested without credentials; the provider sees the client IP and viewport. This direct-resource policy does not isolate redirects or guarantee upstream availability. WebGL2/Worker failure and a 15-second startup timeout show the fallback. Map-owned canvas/listeners/observers/clock are released on unmount; MapLibre retains its page-wide shared pool, capped at two Workers, for reuse. Preserve the package Worker license and fixed attribution links. Old UI remains compatible; deployed 0.1.39 hosts do not gain this testing feature. See template docs/street-map.md and docs/street-map.zh-CN.md.
44
+
45
+ ## Location and motion sensors
46
+
47
+ This release adds `useGeolocation()`, `useDeviceMotion()` and
48
+ `useDeviceOrientation()` to `./sdk`, with `DEVICE_SENSORS_VERSION = 1`
49
+ and `sdkFeatures.deviceSensors = 1`. Declare only the channels used in
50
+ `manifest.deviceCapabilities`: `location`, `motion`, `orientation`.
51
+ Vault UI can also use `useFlapSdk().device`; standalone Mini Apps can use
52
+ `useMiniAppSdk().device`. Each channel provides `getSnapshot()`,
53
+ `subscribe(listener)`, `request(options?)` and `stop()`.
54
+
55
+ Call `request()` directly from a user click. Mounting or subscribing never
56
+ requests permission or starts collection. Permission and actual data are
57
+ separate: use readings only after `status === "active"` and non-null data.
58
+ Handle refusal, unsupported/insecure environments, policy restrictions,
59
+ timeout, missing data and background pauses with usable click/touch/manual
60
+ fallbacks. Location is a system estimate; inspect accuracy and timestamp.
61
+
62
+ The `./host` entry exports `createBrowserDeviceSensors` and
63
+ `createMockDeviceSensors`; providers accept a host-owned `deviceSensors`
64
+ adapter and scope it to the declaration. Mock values are explicitly marked.
65
+ Components cannot create adapters or call raw browser permission APIs.
66
+ Old manifests without device declarations retain their behavior and do not
67
+ request permissions. Phone and wallet support still requires real-device tests.
68
+
69
+ This package is an explicit next-channel testing release. Install its exact version; stable latest and deployed hosts are not upgraded by this publication.
70
+
71
+
36
72
  ## FSI queries
37
73
 
38
- Declare the intended FSI root in `manifest.endpoints` to use
39
- `sdk.readFsi(relativePath, params)`. Supported roots, in selection order, are
40
- `https://fsi.taxed.fun/fsi/v1`, `https://bsc-debug.butterfly.army/fsi/v1`
41
- and BSC Testnet `https://bsc-testnet-debug.butterfly.army/fsi/v1`.
42
- When multiple roots are declared, this order applies regardless of array order
43
- or `chainId`. Testnet packages should declare only the testnet FSI root.
44
- Failed requests never fall back to another host. Exact reviewed root declarations,
45
- HTTPS origin/path boundaries, GET, credential and redirect restrictions remain.
46
- Hosts and Workbench must deploy a release containing the selected endpoint policy
47
- and synchronize the Workbench source checker before accepting those packages.
48
-
49
- ## Transaction confirmation
50
-
51
- `waitForTx(hash)` polls the original transaction hash through the public client selected for that operation. It queries immediately, then every 2 seconds after a pending or transient-error response, with an 8-second deadline per query and a 180-second total deadline. It returns the original success/reverted status; applications must check `status === "success"` before showing success or refreshing as successful. A timeout means the result is unknown: retain the hash and reconcile it before offering another transaction. Polling does not follow sped-up or cancelled replacement transactions; the original hash can time out. The public API and receipt fields remain compatible.
52
-
53
- ## Standalone resolved write constraints
54
-
55
- Standalone Mini Apps can use `walletContracts[].resolvedContracts[].writeConstraints`
56
- to declare exact lengths for top-level ABI `bytes` inputs. Each rule identifies
57
- an allowed function selector and lists its constrained input positions and lengths.
58
- Pin the resolver root and resolved target code hashes. A payable rule can require
59
- an exact `valueWei` within the existing cap. The SDK checks the declared constraints
60
- before simulation and wallet submission.
61
-
62
- The supporting runtime advertises `sdkFeatures.resolvedWriteConstraints = 1`.
63
- Deploy the matching Workbench checker and host runtime before accepting manifests
64
- that use the field. See the [Mini App wallet guide](https://github.com/flap-sh/flap-vault-component-template/blob/main/docs/mini-app-wallet.md#fixed-length-inputs-declared-as-bytes).
65
-
66
- ## BNB Chain gas overrides
67
-
68
- Explicit contract-write gas overrides can be up to 15,000,000 on BNB Chain
69
- mainnet and testnet. Other chains retain the existing 5,000,000 limit.
70
-
71
- ## taxed.fun source-checker compatibility
72
-
73
- The official template source for stable `0.1.40` adds reviewed native-fetch
74
- queries on every valid strict `taxed.fun` subdomain, including multi-level
75
- subdomains. Hosts and paths must stay literal, query values must use the global
76
- `encodeURIComponent`, and manifest endpoint declarations and safe GET options
77
- remain required. The apex domain, dynamic hosts/paths and unsafe options do not
78
- gain permission. Existing `sdk.readFsi` routing and the SDK exports are unchanged.
79
-
80
- The source checker is not shipped in this npm package. Deploy the matching
81
- template and Workbench checker policies separately; upgrading this package alone
82
- does not enable the new native-fetch policy or approve an endpoint.
83
- See the [0.1.40 release guide](https://github.com/flap-sh/flap-vault-component-template/blob/main/docs/releases/0.1.40.md)
84
- and [request policy](https://github.com/flap-sh/flap-vault-component-template/blob/main/docs/taxed-endpoints.md).
74
+ Declare `https://fsi.taxed.fun/fsi/v1` in `manifest.endpoints` to use
75
+ `sdk.readFsi(relativePath, params)` with the current FSI host. The legacy
76
+ `https://bsc-debug.butterfly.army/fsi/v1` prefix remains supported. Only
77
+ declaring the legacy prefix preserves legacy routing; declaring both selects
78
+ the current host regardless of array order. Failed requests never fall back
79
+ to the other host. Both require an exact reviewed root declaration and retain
80
+ the HTTPS origin, path, GET, credential and redirect restrictions.
81
+ Hosts and Workbench must deploy matching runtime and checker policies before
82
+ accepting source packages that declare the new endpoint.
85
83
 
86
84
  ## Shared Vault UI and Mini App v2
87
85