@gvnrdao/dh-sdk 0.0.346 → 0.0.348
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/browser/dist/browser.js +2 -0
- package/browser/dist/browser.js.LICENSE.txt +18 -0
- package/dist/contracts/typechain-contracts/factories/src/agent/AgentDelegationRegistry__factory.d.ts +80 -1
- package/dist/contracts/typechain-contracts/src/agent/AgentDelegationRegistry.d.ts +85 -8
- package/dist/deployments.js +20 -8
- package/dist/deployments.mjs +20 -8
- package/dist/index.d.ts +3 -1
- package/dist/index.js +935 -411
- package/dist/index.mjs +842 -329
- package/dist/interfaces/chunks/loan-operations.i.d.ts +0 -6
- package/dist/modules/diamond-hands-sdk.d.ts +8 -4
- package/dist/modules/withdrawal-address/withdrawal-address.module.d.ts +9 -1
- package/dist/safe-delegation.js +20 -8
- package/dist/safe-delegation.mjs +20 -8
- package/dist/sign-guard.js +737 -0
- package/dist/sign-guard.mjs +734 -0
- package/dist/utils/address-conversion.utils.d.ts +16 -3
- package/dist/utils/agent-delegation.utils.d.ts +19 -4
- package/dist/utils/btc-spend-request-712.d.ts +150 -0
- package/dist/utils/btc-withdrawal-message.d.ts +40 -27
- package/dist/utils/sign-guard/index.d.ts +1 -0
- package/dist/utils/sign-guard/typed-data-guard.d.ts +68 -0
- package/dist/utils/stale-spend-invalidate-message.d.ts +28 -15
- package/package.json +5 -4
|
@@ -205,12 +205,6 @@ export interface UCDMintRequest {
|
|
|
205
205
|
skipValidation?: boolean;
|
|
206
206
|
rpcUrl?: string;
|
|
207
207
|
testBtcPrice?: number;
|
|
208
|
-
debugOverrides?: {
|
|
209
|
-
useStubbedBtcData?: boolean;
|
|
210
|
-
stubbedBtcPriceUsd?: string;
|
|
211
|
-
stubbedAvailableBtcSats?: string;
|
|
212
|
-
stubbedAuthorizedSpendsHash?: string;
|
|
213
|
-
};
|
|
214
208
|
/**
|
|
215
209
|
* Supplies the borrower authorization envelope instead of the connected
|
|
216
210
|
* signer — the seam a delegated Safe uses so its agent signs instantly
|
|
@@ -158,17 +158,21 @@ export declare class DiamondHandsSDK {
|
|
|
158
158
|
* from live chain state so a half-done ceremony resumes.
|
|
159
159
|
*
|
|
160
160
|
* Service-mode only — the server holds the Chipotle account that mints the
|
|
161
|
-
* PKP and it gates the route to current Safe owners. `knownAgentAddress`
|
|
162
|
-
* the caller-persisted agent
|
|
163
|
-
*
|
|
164
|
-
* restart.
|
|
161
|
+
* PKP and it gates the route to current Safe owners. `knownAgentAddress` +
|
|
162
|
+
* `knownAgentConsent` are the caller-persisted agent and its binding consent
|
|
163
|
+
* from an earlier prepare whose ceremony has not landed yet; echoing them back
|
|
164
|
+
* prevents a duplicate mint after a server restart. The server reuses an
|
|
165
|
+
* address only with a consent that verifies for this Safe (issue #1197).
|
|
165
166
|
*/
|
|
166
167
|
prepareSafeAgentModule(request: {
|
|
167
168
|
safeAddress: string;
|
|
168
169
|
knownAgentAddress?: string;
|
|
170
|
+
knownAgentConsent?: string;
|
|
169
171
|
}): Promise<{
|
|
170
172
|
status: "ready" | "already-delegated";
|
|
171
173
|
agentAddress: string;
|
|
174
|
+
/** The agent's binding consent in the registration call; null when no registration is needed. */
|
|
175
|
+
agentConsent: string | null;
|
|
172
176
|
moduleAddress: string;
|
|
173
177
|
validUntil: number | null;
|
|
174
178
|
calls: {
|
|
@@ -56,8 +56,16 @@ export declare class WithdrawalAddressModule {
|
|
|
56
56
|
private getRegistry;
|
|
57
57
|
/** True iff the registry is wired for this network (enforcement is active). */
|
|
58
58
|
isConfigured(): boolean;
|
|
59
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* keccak256 of the canonicalized address — matches the on-chain key.
|
|
61
|
+
* @throws on mixed-case bech32, which has no canonical spelling (BIP-173).
|
|
62
|
+
*/
|
|
60
63
|
static addressHash(btcAddress: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* The canonical spelling the registry keys on, or a VALIDATION failure for mixed-case
|
|
66
|
+
* bech32 — reported as a value, like every other failure of this module, never thrown.
|
|
67
|
+
*/
|
|
68
|
+
private canonicalAddress;
|
|
61
69
|
/**
|
|
62
70
|
* Add a Bitcoin address to the caller's allowlist. It becomes usable only
|
|
63
71
|
* after the registry's delay elapses. Returns the submitted tx.
|
package/dist/safe-delegation.js
CHANGED
|
@@ -330,7 +330,7 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
330
330
|
BITCOIN_WITHDRAWAL_ADDRESS_REGISTRY: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
|
|
331
331
|
BITCOIN_WITHDRAWAL_ADDRESS_REGISTRY_IMPL: "0x76E0a2c9d89562fD7c50b5f554d7fa25957e39Db",
|
|
332
332
|
AGENT_DELEGATION_REGISTRY: "0x6AE7fc6bE0925126b9D25b1B7Ce5AD5d127ec025",
|
|
333
|
-
AGENT_DELEGATION_REGISTRY_IMPL: "
|
|
333
|
+
AGENT_DELEGATION_REGISTRY_IMPL: "0x56a5af2C1549EFf70feD1F3BB8E1997717A84973",
|
|
334
334
|
DH_AGENT_DELEGATE: "0xa5A14489ae883960df6E1463A41a47aBE9Ecc5AF"
|
|
335
335
|
}
|
|
336
336
|
};
|
|
@@ -483,14 +483,26 @@ var MAINNET_DEPLOYMENT = {
|
|
|
483
483
|
block: 25669024
|
|
484
484
|
},
|
|
485
485
|
PositionManagerViews: {
|
|
486
|
-
previousImplementation: "
|
|
487
|
-
newImplementation: "
|
|
486
|
+
previousImplementation: "0xE68DC096A65Ecddbc6A9b5c6e5f878e2CE143Bfe",
|
|
487
|
+
newImplementation: "0x8fe7aF14dB9Bef814c4c8fBc0ce206Cb17F25E8e",
|
|
488
488
|
proxy: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
|
|
489
|
-
upgradedAt: "2026-
|
|
490
|
-
upgradedBy: "
|
|
491
|
-
reason: "
|
|
492
|
-
executeTx: "
|
|
493
|
-
block:
|
|
489
|
+
upgradedAt: "2026-10-17T12:16:35.000Z",
|
|
490
|
+
upgradedBy: "AdminModule generic-op 0x60494d283c30afb95748d8c1bb95b800ab8f17d2a2a45fb04784ebde7b05393c upgradeToAndCall(0x8fe7aF14, initializeV2(AdminModule)) \u2014 3-of-3 signatures (0x3030C041, 0x52b67f31, 0xfb3B8cbe), 24h timelock; proposed by Safe 0x3030C0414B6d95aA9d5A57269E51a347fCBaB472 in tx 0xffe3dd376736d542a89f944290b876d8eb8e5c3df8fc8349bc34a963106dd0f2, executed from Safe 0x52b67f31Ca7A58Ef20322512EB359b7D4758C868 via onchain-auth/.safe-batches/mainnet-pmv-backing-view-execute.json",
|
|
491
|
+
reason: "PoR vault-address gaps (tasks/vault-address-por-gaps-plan-2026-10-02.md, runbook tasks/RUNBOOK-pmv-backing-view-mainnet-2026-10-02.md). VERSION 1.1.1 -> 1.1.2: adds getBackingVaults (paged backing set: positions with ucdDebt > 0 and their stored vault addresses), locks the implementation (_disableInitializers constructor), and the call data initializeV2(AdminModule) consumes the previously OPEN reinitializer(2) (Cloudflare audit finding) without changing adminModule. No storage layout change. Post-upgrade: scripts/audit/backing-vaults-verify.ts PASS @ block 26226360 (72 positions, 15 backing vaults, view == independent scan; Initializable version 2; impl locked). Pre-proposed rollback op 0x43f50eb30d360a779f24c8229dd2d3b56a5d9eb40f056d3cd13047e5f0f51e84 (1/3 sigs) is to be cancelled by the proposer Safe via mainnet-pmv-backing-view-cancel-REVERT.json.",
|
|
492
|
+
executeTx: "0xbb36e557141827a0de990b7124ef8615352a2eb8c197efb3ce3a63998994fef5",
|
|
493
|
+
block: 26212216,
|
|
494
|
+
history: [
|
|
495
|
+
{
|
|
496
|
+
previousImplementation: "0x9225647a30bbACA4Acc0491B786869036914242e",
|
|
497
|
+
newImplementation: "0xE68DC096A65Ecddbc6A9b5c6e5f878e2CE143Bfe",
|
|
498
|
+
proxy: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
|
|
499
|
+
upgradedAt: "2026-08-03T08:34:23.000Z",
|
|
500
|
+
upgradedBy: "REPLACED, not upgraded. Fresh ERC1967Proxy (atomically initialized) + AdminModule generic-op 0x848a97186f0d PositionManager.setViews(proxy) \u2014 3-of-3, 24h timelock, executed in onchain-auth/.safe-batches/mainnet-release-execute-B.json",
|
|
501
|
+
reason: "2026-08 agent-stack release. The mainnet PositionManagerViews at 0x9225647a was deployed as a BARE implementation (EIP-1967 slot 0x00), so upgradeToAndCall reverts UUPSUnauthorizedCallContext \u2014 it could never be upgraded. PositionManager.setViews (added in the same Execute B batch) removed the repoint blocker, so Views was replaced behind a new proxy rather than upgraded. This makes the Pashov F3 renewal debt-ceiling check REACHABLE for the first time: ExceedsMaxLoan (0x499e7985) is present in 0xE68DC096 and absent from 0x9225647a. Views holds no protocol state (8 wiring slots + roles + pause), which is what made replacement safe. The old contract is ABANDONED, not decommissioned \u2014 it stays live and callable as the rollback target for setViews. NOTE: VERSION reads 1.1.1 on both sides; verify by address.",
|
|
502
|
+
executeTx: "0xf1f8d5fc13f45d7a3f932bf1a2d6e29381fdd41cd31298ad785bf7688df07fe6",
|
|
503
|
+
block: 25673200
|
|
504
|
+
}
|
|
505
|
+
]
|
|
494
506
|
},
|
|
495
507
|
AgentDelegationRegistry: {
|
|
496
508
|
newImplementation: "0xa9fF405Edd4329fc3159a64F56B37EBD253e4928",
|
package/dist/safe-delegation.mjs
CHANGED
|
@@ -303,7 +303,7 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
303
303
|
BITCOIN_WITHDRAWAL_ADDRESS_REGISTRY: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
|
|
304
304
|
BITCOIN_WITHDRAWAL_ADDRESS_REGISTRY_IMPL: "0x76E0a2c9d89562fD7c50b5f554d7fa25957e39Db",
|
|
305
305
|
AGENT_DELEGATION_REGISTRY: "0x6AE7fc6bE0925126b9D25b1B7Ce5AD5d127ec025",
|
|
306
|
-
AGENT_DELEGATION_REGISTRY_IMPL: "
|
|
306
|
+
AGENT_DELEGATION_REGISTRY_IMPL: "0x56a5af2C1549EFf70feD1F3BB8E1997717A84973",
|
|
307
307
|
DH_AGENT_DELEGATE: "0xa5A14489ae883960df6E1463A41a47aBE9Ecc5AF"
|
|
308
308
|
}
|
|
309
309
|
};
|
|
@@ -456,14 +456,26 @@ var MAINNET_DEPLOYMENT = {
|
|
|
456
456
|
block: 25669024
|
|
457
457
|
},
|
|
458
458
|
PositionManagerViews: {
|
|
459
|
-
previousImplementation: "
|
|
460
|
-
newImplementation: "
|
|
459
|
+
previousImplementation: "0xE68DC096A65Ecddbc6A9b5c6e5f878e2CE143Bfe",
|
|
460
|
+
newImplementation: "0x8fe7aF14dB9Bef814c4c8fBc0ce206Cb17F25E8e",
|
|
461
461
|
proxy: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
|
|
462
|
-
upgradedAt: "2026-
|
|
463
|
-
upgradedBy: "
|
|
464
|
-
reason: "
|
|
465
|
-
executeTx: "
|
|
466
|
-
block:
|
|
462
|
+
upgradedAt: "2026-10-17T12:16:35.000Z",
|
|
463
|
+
upgradedBy: "AdminModule generic-op 0x60494d283c30afb95748d8c1bb95b800ab8f17d2a2a45fb04784ebde7b05393c upgradeToAndCall(0x8fe7aF14, initializeV2(AdminModule)) \u2014 3-of-3 signatures (0x3030C041, 0x52b67f31, 0xfb3B8cbe), 24h timelock; proposed by Safe 0x3030C0414B6d95aA9d5A57269E51a347fCBaB472 in tx 0xffe3dd376736d542a89f944290b876d8eb8e5c3df8fc8349bc34a963106dd0f2, executed from Safe 0x52b67f31Ca7A58Ef20322512EB359b7D4758C868 via onchain-auth/.safe-batches/mainnet-pmv-backing-view-execute.json",
|
|
464
|
+
reason: "PoR vault-address gaps (tasks/vault-address-por-gaps-plan-2026-10-02.md, runbook tasks/RUNBOOK-pmv-backing-view-mainnet-2026-10-02.md). VERSION 1.1.1 -> 1.1.2: adds getBackingVaults (paged backing set: positions with ucdDebt > 0 and their stored vault addresses), locks the implementation (_disableInitializers constructor), and the call data initializeV2(AdminModule) consumes the previously OPEN reinitializer(2) (Cloudflare audit finding) without changing adminModule. No storage layout change. Post-upgrade: scripts/audit/backing-vaults-verify.ts PASS @ block 26226360 (72 positions, 15 backing vaults, view == independent scan; Initializable version 2; impl locked). Pre-proposed rollback op 0x43f50eb30d360a779f24c8229dd2d3b56a5d9eb40f056d3cd13047e5f0f51e84 (1/3 sigs) is to be cancelled by the proposer Safe via mainnet-pmv-backing-view-cancel-REVERT.json.",
|
|
465
|
+
executeTx: "0xbb36e557141827a0de990b7124ef8615352a2eb8c197efb3ce3a63998994fef5",
|
|
466
|
+
block: 26212216,
|
|
467
|
+
history: [
|
|
468
|
+
{
|
|
469
|
+
previousImplementation: "0x9225647a30bbACA4Acc0491B786869036914242e",
|
|
470
|
+
newImplementation: "0xE68DC096A65Ecddbc6A9b5c6e5f878e2CE143Bfe",
|
|
471
|
+
proxy: "0x8B57954eA338c6A6bfF1457f71080e25baFF3937",
|
|
472
|
+
upgradedAt: "2026-08-03T08:34:23.000Z",
|
|
473
|
+
upgradedBy: "REPLACED, not upgraded. Fresh ERC1967Proxy (atomically initialized) + AdminModule generic-op 0x848a97186f0d PositionManager.setViews(proxy) \u2014 3-of-3, 24h timelock, executed in onchain-auth/.safe-batches/mainnet-release-execute-B.json",
|
|
474
|
+
reason: "2026-08 agent-stack release. The mainnet PositionManagerViews at 0x9225647a was deployed as a BARE implementation (EIP-1967 slot 0x00), so upgradeToAndCall reverts UUPSUnauthorizedCallContext \u2014 it could never be upgraded. PositionManager.setViews (added in the same Execute B batch) removed the repoint blocker, so Views was replaced behind a new proxy rather than upgraded. This makes the Pashov F3 renewal debt-ceiling check REACHABLE for the first time: ExceedsMaxLoan (0x499e7985) is present in 0xE68DC096 and absent from 0x9225647a. Views holds no protocol state (8 wiring slots + roles + pause), which is what made replacement safe. The old contract is ABANDONED, not decommissioned \u2014 it stays live and callable as the rollback target for setViews. NOTE: VERSION reads 1.1.1 on both sides; verify by address.",
|
|
475
|
+
executeTx: "0xf1f8d5fc13f45d7a3f932bf1a2d6e29381fdd41cd31298ad785bf7688df07fe6",
|
|
476
|
+
block: 25673200
|
|
477
|
+
}
|
|
478
|
+
]
|
|
467
479
|
},
|
|
468
480
|
AgentDelegationRegistry: {
|
|
469
481
|
newImplementation: "0xa9fF405Edd4329fc3159a64F56B37EBD253e4928",
|