@ocap/tx-protocols 1.31.5 → 1.31.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.
Files changed (41) hide show
  1. package/esm/bridge-release-crypto.mjs +1 -1
  2. package/esm/execute.mjs +24 -5
  3. package/esm/gas-security-guard.d.mts +2 -8
  4. package/esm/gas-security-guard.mjs +16 -1
  5. package/esm/index.d.mts +16 -3
  6. package/esm/index.mjs +0 -2
  7. package/esm/pipes/ensure-cost.mjs +3 -0
  8. package/esm/pipes/ensure-gas.d.mts +2 -1
  9. package/esm/pipes/write-ledger.mjs +2 -1
  10. package/esm/protocols/bridge/release-checks.d.mts +69 -0
  11. package/esm/protocols/bridge/{release.mjs → release-checks.mjs} +101 -100
  12. package/esm/protocols/rollup/bridge-create.mjs +2 -2
  13. package/esm/protocols/rollup/bridge-membership.mjs +10 -12
  14. package/esm/protocols/rollup/bridge-v2.d.mts +15 -5
  15. package/esm/protocols/rollup/bridge-v2.mjs +33 -8
  16. package/esm/protocols/token/deposit-v2.mjs +126 -25
  17. package/esm/protocols/token/withdraw-v2.d.mts +13 -1
  18. package/esm/protocols/token/withdraw-v2.mjs +158 -25
  19. package/esm/protocols/trade/transfer-v2.mjs +3 -8
  20. package/lib/bridge-release-crypto.cjs +1 -1
  21. package/lib/execute.cjs +24 -5
  22. package/lib/gas-security-guard.cjs +16 -1
  23. package/lib/gas-security-guard.d.cts +2 -8
  24. package/lib/index.cjs +0 -2
  25. package/lib/index.d.cts +16 -3
  26. package/lib/pipes/ensure-cost.cjs +3 -0
  27. package/lib/pipes/ensure-gas.d.cts +2 -1
  28. package/lib/pipes/write-ledger.cjs +2 -1
  29. package/lib/protocols/bridge/{release.cjs → release-checks.cjs} +115 -101
  30. package/lib/protocols/bridge/release-checks.d.cts +69 -0
  31. package/lib/protocols/rollup/bridge-create.cjs +1 -1
  32. package/lib/protocols/rollup/bridge-membership.cjs +9 -10
  33. package/lib/protocols/rollup/bridge-v2.cjs +32 -5
  34. package/lib/protocols/rollup/bridge-v2.d.cts +15 -5
  35. package/lib/protocols/token/deposit-v2.cjs +125 -24
  36. package/lib/protocols/token/withdraw-v2.cjs +155 -22
  37. package/lib/protocols/token/withdraw-v2.d.cts +13 -1
  38. package/lib/protocols/trade/transfer-v2.cjs +2 -7
  39. package/package.json +16 -16
  40. package/esm/protocols/bridge/release.d.mts +0 -34
  41. package/lib/protocols/bridge/release.d.cts +0 -34
@@ -1,34 +0,0 @@
1
- import { ReleaseResolution, Runner } from "@ocap/tx-pipeline";
2
-
3
- //#region src/protocols/bridge/release.d.ts
4
- declare const RELEASE_KIND: {
5
- readonly DEPOSIT: 1;
6
- readonly REFUND: 2;
7
- readonly DEPOSIT_B: 3;
8
- };
9
- /** `resolveMigrated` follows at most this many `migratedTo` links of an ACCOUNT (check 6) */
10
- declare const MAX_MIGRATION_HOPS = 8;
11
- interface ReleaseItx {
12
- kind: number;
13
- bridge: string;
14
- evidence: string;
15
- ordinal: number;
16
- to: string;
17
- amount: string;
18
- ethChainId: string;
19
- epoch: number;
20
- ethSender: string;
21
- claimSignature: string;
22
- signaturesList: string[];
23
- }
24
- type Context = Record<string, any> & {
25
- itx: ReleaseItx;
26
- /** what `resolveBridgeForRelease` found: the bridge, its reserve and the reserves a refund may draw on */
27
- release?: ReleaseResolution;
28
- releaseAmount?: bigint;
29
- releaseTimeMs?: number;
30
- };
31
- declare const runner: Runner<Context>;
32
- declare function resolveMigrated(context: Context, address: string): Promise<string | null>;
33
- //#endregion
34
- export { Context, MAX_MIGRATION_HOPS, RELEASE_KIND, ReleaseItx, runner as default, resolveMigrated };
@@ -1,34 +0,0 @@
1
- import { ReleaseResolution, Runner } from "@ocap/tx-pipeline";
2
-
3
- //#region src/protocols/bridge/release.d.ts
4
- declare const RELEASE_KIND: {
5
- readonly DEPOSIT: 1;
6
- readonly REFUND: 2;
7
- readonly DEPOSIT_B: 3;
8
- };
9
- /** `resolveMigrated` follows at most this many `migratedTo` links of an ACCOUNT (check 6) */
10
- declare const MAX_MIGRATION_HOPS = 8;
11
- interface ReleaseItx {
12
- kind: number;
13
- bridge: string;
14
- evidence: string;
15
- ordinal: number;
16
- to: string;
17
- amount: string;
18
- ethChainId: string;
19
- epoch: number;
20
- ethSender: string;
21
- claimSignature: string;
22
- signaturesList: string[];
23
- }
24
- type Context = Record<string, any> & {
25
- itx: ReleaseItx;
26
- /** what `resolveBridgeForRelease` found: the bridge, its reserve and the reserves a refund may draw on */
27
- release?: ReleaseResolution;
28
- releaseAmount?: bigint;
29
- releaseTimeMs?: number;
30
- };
31
- declare const runner: Runner<Context>;
32
- declare function resolveMigrated(context: Context, address: string): Promise<string | null>;
33
- //#endregion
34
- export { Context, MAX_MIGRATION_HOPS, RELEASE_KIND, ReleaseItx, runner as default, resolveMigrated };