@burnt-labs/abstraxion 1.0.0-alpha.77 → 1.0.0-alpha.78
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/.turbo/turbo-build.log +16 -16
- package/CHANGELOG.md +71 -0
- package/dist/index.d.ts +390 -562
- package/dist/index.js +472 -301
- package/dist/index.mjs +473 -301
- package/package.json +8 -5
- package/src/controllers/IframeController.ts +59 -0
- package/src/controllers/PopupController.ts +188 -120
- package/src/controllers/RedirectController.ts +214 -114
- package/src/controllers/RequireSigningClient.ts +92 -0
- package/src/controllers/__tests__/PopupController.connect.test.ts +96 -0
- package/src/controllers/__tests__/RedirectController.callback.test.ts +115 -12
- package/src/controllers/__tests__/SigningClients.test.ts +81 -97
- package/src/controllers/index.ts +4 -0
- package/src/controllers/types.ts +23 -0
- package/src/controllers/utils.ts +44 -0
- package/src/hooks/__tests__/useManageAuthenticators.test.ts +241 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useAbstraxionSigningClient.ts +45 -52
- package/src/hooks/useManageAuthenticators.ts +88 -0
- package/src/index.ts +5 -8
- package/src/types.ts +20 -12
- package/tests/integration/fixtures.ts +2 -3
- package/tests/integration/grant-management/treasury-decoding.integration.test.ts +640 -0
- package/tests/integration/message-contract.integration.test.ts +970 -267
- package/tests/integration/response-shapes.integration.test.ts +4 -4
- package/tests/integration/treasury_address_list.txt +86 -0
- package/tsup.config.ts +1 -1
- package/vitest.config.contract.ts +34 -0
- package/vitest.config.integration.ts +8 -1
- package/src/controllers/IframeSigningClient.ts +0 -57
- package/src/controllers/PopupSigningClient.ts +0 -50
- package/src/controllers/RedirectSigningClient.ts +0 -51
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
|
|
2
|
-
> @burnt-labs/abstraxion@1.0.0-alpha.
|
|
2
|
+
> @burnt-labs/abstraxion@1.0.0-alpha.78 build /home/runner/work/xion.js/xion.js/packages/abstraxion
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v6.7.0
|
|
8
|
+
[34mCLI[39m Using tsup config: /home/runner/work/xion.js/xion.js/packages/abstraxion/tsup.config.ts
|
|
9
|
+
[34mCLI[39m Target: esnext
|
|
10
|
+
[34mCLI[39m Cleaning output folder
|
|
11
|
+
[34mESM[39m Build start
|
|
12
|
+
[34mCJS[39m Build start
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m85.87 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 340ms
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m84.43 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 340ms
|
|
17
|
+
[34mDTS[39m Build start
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 2672ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m36.27 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
# @burnt-labs/abstraxion
|
|
2
2
|
|
|
3
|
+
## 1.0.0-alpha.78
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#355](https://github.com/burnt-labs/xion.js/pull/355) [`e466751`](https://github.com/burnt-labs/xion.js/commit/e46675174d71aabd6ff24cc59016713938168ea2) Thanks [@ertemann](https://github.com/ertemann)! - Adopt `@burnt-labs/xion-types` as the source of truth for protobuf and contract types, consolidate the popup/redirect/iframe signing clients into a single `RequireSigningClient`, expose the manage-authenticators flow through the SDK, and tighten the SDK ↔ Dashboard message contract.
|
|
8
|
+
|
|
9
|
+
## Breaking changes (`@burnt-labs/abstraxion-core`)
|
|
10
|
+
- **`IframeMessageType.ADD_AUTHENTICATORS`** and the `DashboardMessageType.ADD_AUTHENTICATORS_*` enum values have been **renamed** to `MANAGE_AUTHENTICATORS` / `MANAGE_AUTHENTICATORS_*` with no backward-compat aliases. These enums are the wire contract between the SDK and the Abstraxion Dashboard; the dashboard bundle on testnet/mainnet must be redeployed before this SDK version is published. The contract probe in `packages/abstraxion/tests/integration/message-contract.integration.test.ts` is the canonical pre-release gate.
|
|
11
|
+
- **`PopupSigningClient`, `RedirectSigningClient`, and `IframeSigningClient` have been removed** and replaced by a single `RequireSigningClient` that handles all three transports behind one interface, including proper transaction simulation. Consumers that imported the per-mode clients directly must switch to `RequireSigningClient`.
|
|
12
|
+
- **Protobuf types are no longer vendored.** All manually generated/kept protobuf and contract types have been removed in favor of `@burnt-labs/xion-types`. Consumers importing protobuf message types from `abstraxion-core` internals must import from `@burnt-labs/xion-types` instead.
|
|
13
|
+
|
|
14
|
+
## Migration to `@burnt-labs/xion-types`
|
|
15
|
+
- `@burnt-labs/xion-types` is pinned to `29.0.0-rc1` across all packages (pnpm override + per-package `dependencies`).
|
|
16
|
+
- `@burnt-labs/signers`: imports `AbstractAccount` and `MsgRegisterAccount` from `xion-types` subpaths; `uint64FromProto` widened to accept `Long | bigint` for cross-boundary compat.
|
|
17
|
+
- `@burnt-labs/account-management`: `GrantConfigByTypeUrl` now extends `GrantConfig` from `xion-types`; the local `Any` interface has been removed and `TreasuryAny` from `xion-types` is used instead. `Params` is re-exported as `TreasuryParamsV2` for forward-compat with the upcoming chain upgrade.
|
|
18
|
+
- `@burnt-labs/abstraxion-core`: adds a `ChainGrant` interface and uses `import type` for authz types from `xion-types`.
|
|
19
|
+
|
|
20
|
+
## New public API — Manage Authenticators flow (`@burnt-labs/abstraxion`)
|
|
21
|
+
- **`useManageAuthenticators()`** — new hook that opens the dashboard manage-authenticators flow (add or remove) in popup, iframe (embedded), and redirect modes. Returns `{ manageAuthenticators, isSupported, manageAuthResult, clearManageAuthResult }`.
|
|
22
|
+
- **`ManageAuthResult`** — exported type for the redirect-mode result (`{ success: true } | { success: false; error: string }`).
|
|
23
|
+
- **`UseManageAuthenticatorsReturn`** — type export for the hook's return shape.
|
|
24
|
+
|
|
25
|
+
## SDK internals (`@burnt-labs/abstraxion-core`)
|
|
26
|
+
- `PopupController.promptManageAuthenticators(signerAddress)` — opens a popup to the dashboard `manage-authenticators` view; resolves on `MANAGE_AUTHENTICATORS_SUCCESS`, rejects on cancel/error. Timeout: 10 min.
|
|
27
|
+
- `IframeController.promptManageAuthenticators(signerAddress)` — sends `MANAGE_AUTHENTICATORS` via `MessageChannelManager` to the embedded iframe; resolves when the user completes the flow.
|
|
28
|
+
- `RedirectController.promptManageAuthenticators(signerAddress)` — navigates to the dashboard manage-auth page; result available via `manageAuthResult` store after return.
|
|
29
|
+
- `RedirectController.manageAuthResult` — new `ResultStore<ManageAuthResult>` (parallel to `signResult`). Subscribe, snapshot, and clear follow the same `useSyncExternalStore`-compatible pattern.
|
|
30
|
+
- `waitForPopupMessage<T>` — shared private helper in `PopupController` that eliminates duplicated popup-message-waiting boilerplate across sign and manage-auth flows.
|
|
31
|
+
- `DashboardMessageType` — three new enum values: `MANAGE_AUTHENTICATORS_SUCCESS`, `MANAGE_AUTHENTICATORS_REJECTED`, `MANAGE_AUTHENTICATORS_ERROR`.
|
|
32
|
+
|
|
33
|
+
## Direct grant decoding pipeline (`@burnt-labs/abstraxion-core`)
|
|
34
|
+
- `fetchChainGrantsDecoded()` decodes chain grants directly from protobuf, eliminating the REST intermediate step that caused multiple session-invalidation bugs (#290, #336).
|
|
35
|
+
- `compareChainGrantsToTreasuryGrants` now returns a typed `GrantComparisonResult` with reasons (`grant_missing`, `grant_mismatch`, `decode_error`); `decode_error` is non-fatal — session is preserved and a warning is logged.
|
|
36
|
+
- Unknown limit/filter type URLs preserve raw bytes and fall back to byte-level comparison instead of returning `false`.
|
|
37
|
+
- `decodeAuthorization` is wrapped in try/catch — corrupted bytes return `Unsupported` instead of throwing, preventing malformed treasury data from crashing session restore.
|
|
38
|
+
|
|
39
|
+
## TX payload utilities (`@burnt-labs/signers`)
|
|
40
|
+
- **`validateTxPayload(payload, context)`** — pre-flight validation for transaction payloads before encoding/transport; logs issues without throwing so dev mistakes surface early.
|
|
41
|
+
- **`normalizeMessages(messages)`** — dashboard-side normalization that converts post-JSON-transport CosmWasm `msg` fields from plain objects back to `Uint8Array` for protobuf encoding.
|
|
42
|
+
- **`TxTransportPayload`** — shared type for the wire format used by popup, redirect, and iframe signing flows.
|
|
43
|
+
- **`getTreasuryParamsMetadata(params)`** — backward-compat helper that returns `metadata` with fallback to `display_url` for pre-upgrade indexer responses.
|
|
44
|
+
- Coins are sorted in grant encoding for deterministic comparison.
|
|
45
|
+
- `NilPubKey` protobuf encoding fixed.
|
|
46
|
+
- `AAClient` upgraded from `Tendermint37Client` to `Comet38Client` for consistency with `GranteeSignerClient`/`rpcClient` and proper CometBFT 0.38+ support.
|
|
47
|
+
- `MsgInstantiateContract2` validation fixed.
|
|
48
|
+
|
|
49
|
+
## DaoDAO indexer typing (`@burnt-labs/signers`)
|
|
50
|
+
- Generated typed API paths from the DaoDAO indexer OpenAPI spec.
|
|
51
|
+
- Manually maintained response types with runtime type guards.
|
|
52
|
+
- `xion-types` compatibility test for bigint boundary validation.
|
|
53
|
+
- New scripts: `generate:daodao-indexer-types`, `generate:daodao-indexer-types:local`.
|
|
54
|
+
|
|
55
|
+
## Treasury strategy improvements (`@burnt-labs/account-management`)
|
|
56
|
+
- `CompositeTreasuryStrategy` gains a racing mode (`Promise.any()` parallel execution) that resolves on first success, eliminating waits for slow DAODAO indexer timeouts. Constructor signature changed to `(strategies[], options)`.
|
|
57
|
+
- DAODAO indexer treasury strategy is end-to-end typed against the generated indexer schema.
|
|
58
|
+
|
|
59
|
+
## Refactors
|
|
60
|
+
- `resolveAuthAppUrl` and `buildDashboardUrl` extracted to `controllers/utils.ts`; used by both `PopupController` and `RedirectController`, removing duplicated `fetchConfig` call sites.
|
|
61
|
+
- `ResultStore<T>` in `RedirectController` replaces the bespoke `signResult_` / `signResultSubscribers_` pattern, making both sign and manage-auth results consistent.
|
|
62
|
+
|
|
63
|
+
## Constants (`@burnt-labs/constants`)
|
|
64
|
+
- Mainnet dashboard / iframe URL changed from `https://settings.mainnet.burnt.com` to `https://settings.burnt.com`.
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- Updated dependencies [[`e466751`](https://github.com/burnt-labs/xion.js/commit/e46675174d71aabd6ff24cc59016713938168ea2)]:
|
|
69
|
+
- @burnt-labs/abstraxion-core@1.0.0-alpha.69
|
|
70
|
+
- @burnt-labs/signers@1.0.0-alpha.8
|
|
71
|
+
- @burnt-labs/account-management@1.0.0-alpha.10
|
|
72
|
+
- @burnt-labs/constants@0.1.0-alpha.24
|
|
73
|
+
|
|
3
74
|
## 1.0.0-alpha.77
|
|
4
75
|
|
|
5
76
|
### Minor Changes
|