@capxul/sdk 4.20.0-beta.4 → 4.20.0-beta.6
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 +57 -26
- package/dist/{OAuthBearerAuthClient-DWkofxdZ.mjs → OAuthBearerAuthClient-5ujCTtKE.mjs} +83 -101
- package/dist/{OAuthBearerAuthClient-C-ip-z8M.d.mts → OAuthBearerAuthClient-B7Nbepmu.d.mts} +23 -3
- package/dist/index.d.mts +63 -13
- package/dist/index.mjs +3 -151
- package/dist/node/index.d.mts +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/{production-BMfmzwHq.mjs → production-B4NzzuUb.mjs} +5325 -3943
- package/dist/{production-CJwxgI8u.d.mts → production-pLe7MsUo.d.mts} +367 -129
- package/dist/testing/index.d.mts +2 -2
- package/dist/testing/index.mjs +25 -16
- package/package.json +6 -5
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as CapxulResult } from "../OAuthBearerAuthClient-
|
|
2
|
-
import {
|
|
1
|
+
import { h as CapxulResult } from "../OAuthBearerAuthClient-B7Nbepmu.mjs";
|
|
2
|
+
import { Dr as IdentityTransition, g as CapxulClient, gr as TelemetryIdentifyInput, hr as TelemetryGroupInput, i as ObservationAdapter, mr as TelemetryEvent, n as ProductionSignerControls, t as CapxulClientInput } from "../production-pLe7MsUo.mjs";
|
|
3
3
|
import { Effect, Layer } from "effect";
|
|
4
4
|
//#region src/testing/production-client.d.ts
|
|
5
5
|
/** Create the one production client with per-client controls at its signing boundaries. */
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { K as toRaw, L as accountFromAccountPositions, N as redactTelemetryEvent, V as assetAmountFromRaw, a as smartAccountErrorFromCapxul, c as identityErrorFromCapxul, i as assembleCapxulClient, l as convexCallErrorFromCapxul, n as createCapxulClientWithSignerControls, o as accountReadErrorFromCapxul, s as wireChainId, u as bootstrapErrorFromCapxul } from "../production-B4NzzuUb.mjs";
|
|
2
|
+
import { $ as toJwtToken, B as toAllowedOrigin, G as toChainId, J as toDurationMs, K as toCountryCode, Q as toHandle, R as toAccountId, U as toAuthUserId, V as toAppId, X as toEpochMs, Y as toEmail, Z as toEpochSeconds, _t as CapxulError, b as CONFIGURED_MONEY_ASSETS, d as authClientPortFromPromiseAdapter, et as toKycTier, ft as toWeiAmount, lt as toSessionToken, n as readClockNow, pt as validateHandle, r as InMemoryAuthCacheAdapter, st as toPublishableKey, y as deriveCapxulSafeAddress, yt as Errors, z as toAddress } from "../OAuthBearerAuthClient-5ujCTtKE.mjs";
|
|
3
3
|
import { keccak256 } from "viem";
|
|
4
4
|
import { Effect, Result, Semaphore } from "effect";
|
|
5
5
|
import { getFunctionName } from "convex/server";
|
|
@@ -101,6 +101,11 @@ function armSignerFaults(plan = {}) {
|
|
|
101
101
|
}
|
|
102
102
|
//#endregion
|
|
103
103
|
//#region src/testing/account/InMemoryAccountReadAdapter.ts
|
|
104
|
+
function fixtureAsset(symbol) {
|
|
105
|
+
const asset = CONFIGURED_MONEY_ASSETS.find((row) => row.symbol === symbol);
|
|
106
|
+
if (asset === void 0) throw new Error(`no configured settlement asset ${symbol}`);
|
|
107
|
+
return asset;
|
|
108
|
+
}
|
|
104
109
|
var InMemoryAccountReadAdapter = class {
|
|
105
110
|
#deps;
|
|
106
111
|
#rawBalance;
|
|
@@ -108,26 +113,29 @@ var InMemoryAccountReadAdapter = class {
|
|
|
108
113
|
this.#deps = deps;
|
|
109
114
|
this.#rawBalance = deps.rawBalance ?? "0";
|
|
110
115
|
}
|
|
116
|
+
#asset() {
|
|
117
|
+
return fixtureAsset(this.#deps.assetSymbol ?? "USDC");
|
|
118
|
+
}
|
|
111
119
|
readBalance(_input) {
|
|
112
120
|
const scriptedFailure = this.#deps.failures?.readBalance;
|
|
113
121
|
if (scriptedFailure !== void 0) return Effect.fail(accountReadErrorFromCapxul("readBalance", scriptedFailure));
|
|
114
122
|
if (this.#deps.account !== void 0) return Effect.succeed(cloneAccount(this.#deps.account));
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
const asset = this.#asset();
|
|
124
|
+
const balance = assetAmountFromRaw(toWeiAmount(this.#rawBalance), asset).value;
|
|
125
|
+
return Effect.succeed(accountFromAccountPositions(toAccountId(this.#deps.accountId ?? "account_01TEST000000000000000000"), [{
|
|
126
|
+
asset: asset.assetId,
|
|
127
|
+
symbol: asset.symbol,
|
|
128
|
+
decimals: asset.decimals,
|
|
129
|
+
balance,
|
|
130
|
+
available: balance
|
|
131
|
+
}]));
|
|
123
132
|
}
|
|
124
133
|
fundFromFaucet(input) {
|
|
125
134
|
const scriptedFailure = this.#deps.failures?.fundFromFaucet;
|
|
126
135
|
if (scriptedFailure !== void 0) return Effect.fail(accountReadErrorFromCapxul("fundFromFaucet", scriptedFailure));
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const minted = BigInt(toWei(input.amount));
|
|
136
|
+
const asset = this.#asset();
|
|
137
|
+
if (input.amount.asset !== asset.assetId) return Effect.fail(accountReadErrorFromCapxul("fundFromFaucet", Errors.invalidInput("amount.asset", "must match adapter config")));
|
|
138
|
+
const minted = toRaw(input.amount, asset);
|
|
131
139
|
this.#rawBalance = (BigInt(this.#rawBalance) + minted).toString();
|
|
132
140
|
return Effect.succeed({ txHash: "0x" + "f".repeat(64) });
|
|
133
141
|
}
|
|
@@ -135,8 +143,9 @@ var InMemoryAccountReadAdapter = class {
|
|
|
135
143
|
function cloneAccount(account) {
|
|
136
144
|
return {
|
|
137
145
|
id: account.id,
|
|
138
|
-
|
|
139
|
-
|
|
146
|
+
balances: account.balances.map((position) => ({ ...position })),
|
|
147
|
+
balance: account.balance === null ? null : { ...account.balance },
|
|
148
|
+
available: account.available === null ? null : { ...account.available }
|
|
140
149
|
};
|
|
141
150
|
}
|
|
142
151
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capxul/sdk",
|
|
3
|
-
"version": "4.20.0-beta.
|
|
3
|
+
"version": "4.20.0-beta.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/Xelmar-tech/infrastructure.git",
|
|
@@ -43,17 +43,18 @@
|
|
|
43
43
|
"@vitest/coverage-v8": "4.1.11",
|
|
44
44
|
"fast-check": "^3.23.2",
|
|
45
45
|
"permissionless": "0.3.4",
|
|
46
|
+
"playwright": "1.59.1",
|
|
46
47
|
"posthog-js": "^1.418.10",
|
|
47
48
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
48
49
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.3.0",
|
|
49
50
|
"vite-plus": "0.3.0",
|
|
50
51
|
"vitest": "4.1.11",
|
|
51
|
-
"@capxul/config": "0.
|
|
52
|
+
"@capxul/config": "0.4.0-beta.0",
|
|
52
53
|
"@capxul/types": "0.3.0",
|
|
53
|
-
"@capxul/observability": "4.20.0-beta.
|
|
54
|
+
"@capxul/observability": "4.20.0-beta.6",
|
|
55
|
+
"@capxul/wire": "0.8.0-beta.1",
|
|
54
56
|
"@capxul/typescript-config": "0.0.0",
|
|
55
|
-
"@capxul/errors": "0.3.0"
|
|
56
|
-
"@capxul/wire": "0.8.0-beta.0"
|
|
57
|
+
"@capxul/errors": "0.3.0"
|
|
57
58
|
},
|
|
58
59
|
"_permissionlessPinReason": "permissionless.toSafeSmartAccount is pinned to 0.3.4 for live Safe deployment E2E. Counterfactual address fixtures captured 2026-05-17 in packages/backend/convex/_shared/__tests__/counterfactual.test.ts and packages/config/tests/safe.test.ts must be re-verified before upgrading.",
|
|
59
60
|
"scripts": {
|