@gvnrdao/dh-sdk 0.0.334 → 0.0.335
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 +13 -1
- package/browser/dist/browser.js +1 -1
- package/dist/constants/chunks/protocol-license.d.ts +48 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +38 -0
- package/dist/index.mjs +35 -0
- package/dist/modules/diamond-hands-sdk.d.ts +18 -0
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Protocol license data for Diamond Hands.
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth: the repository `LICENSE` file (byte-identical in
|
|
5
|
+
* `sdk/LICENSE` and `contracts/LICENSE`). `ContractVersionRegistry` publishes
|
|
6
|
+
* the SPDX identifier and a CIDv1 (raw/sha2-256) URI of that same file:
|
|
7
|
+
*
|
|
8
|
+
* LICENSE = "UNLICENSED"
|
|
9
|
+
* LICENSE_URI = "ipfs://bafkreigunb4phugonefe66by524nhnrgrpol4233ytg7e7eg7qomhy3s3a"
|
|
10
|
+
*
|
|
11
|
+
* `getLicense()` returns the bundled text so callers do not depend on an IPFS
|
|
12
|
+
* gateway. Fetching the CID at runtime would be a second copy of these bytes
|
|
13
|
+
* plus a network failure mode. A unit test locks the file, the CID, and the
|
|
14
|
+
* on-chain constants together.
|
|
15
|
+
*/
|
|
16
|
+
export declare const PROTOCOL_LICENSE_IDENTIFIER: "UNLICENSED";
|
|
17
|
+
export declare const PROTOCOL_LICENSE_URI: "ipfs://bafkreigunb4phugonefe66by524nhnrgrpol4233ytg7e7eg7qomhy3s3a";
|
|
18
|
+
export type ProtocolLicense = {
|
|
19
|
+
/** SPDX identifier published on-chain as `ContractVersionRegistry.LICENSE`. */
|
|
20
|
+
identifier: typeof PROTOCOL_LICENSE_IDENTIFIER;
|
|
21
|
+
/**
|
|
22
|
+
* Content-addressed IPFS URI published on-chain as
|
|
23
|
+
* `ContractVersionRegistry.LICENSE_URI`. The CID is CIDv1 / raw / sha2-256
|
|
24
|
+
* of `text`.
|
|
25
|
+
*/
|
|
26
|
+
uri: typeof PROTOCOL_LICENSE_URI;
|
|
27
|
+
/** Full proprietary license text (byte-identical to the CID payload). */
|
|
28
|
+
text: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Return the Diamond Hands protocol license.
|
|
32
|
+
*
|
|
33
|
+
* This is the package `LICENSE` file — the same bytes pinned at
|
|
34
|
+
* {@link PROTOCOL_LICENSE_URI} and advertised by `ContractVersionRegistry`.
|
|
35
|
+
*
|
|
36
|
+
* @returns Identifier (`UNLICENSED`), IPFS URI, and full license text.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* import { getLicense } from "@gvnrdao/dh-sdk";
|
|
41
|
+
*
|
|
42
|
+
* const license = getLicense();
|
|
43
|
+
* console.log(license.identifier); // "UNLICENSED"
|
|
44
|
+
* console.log(license.uri); // "ipfs://bafkrei…"
|
|
45
|
+
* console.log(license.text); // full GVNR DAO LLC reservation
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare function getLicense(): ProtocolLicense;
|
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ export { LoanStatus } from './types/loanStatus';
|
|
|
49
49
|
export type { LoanEvents, LoanEventsFilter, PositionCreatedEvent, PaymentEvent, StatusUpdateEvent, LiquidationEvent, UCDMintEvent, WithdrawalEvent, RenewalEvent, OperationFailureEvent, MintRequestEvent, BurnRequestEvent, CollateralContractEvent, } from './types/event-types';
|
|
50
50
|
export { PaymentType, PositionStatus, isValidPositionStatus, isValidPaymentType, numericToPositionStatus, EventHelpers, } from './types/event-types';
|
|
51
51
|
export type { ProtocolEvent, ProtocolEventsFilter, ProtocolEventsResult, } from './types/protocol-event-types';
|
|
52
|
+
export { getLicense, PROTOCOL_LICENSE_IDENTIFIER, PROTOCOL_LICENSE_URI, } from './constants/chunks/protocol-license';
|
|
53
|
+
export type { ProtocolLicense } from './constants/chunks/protocol-license';
|
|
52
54
|
export { fetchProtocolPauseStatus, assertProtocolNotPaused, } from './protocol/protocol-pause';
|
|
53
55
|
export type { ProtocolPauseStatus, ProtocolPauseKey, } from './protocol/protocol-pause';
|
|
54
56
|
export { SDKError, ErrorCategory, ErrorSeverity } from './utils/error-handler';
|
package/dist/index.js
CHANGED
|
@@ -5771,6 +5771,8 @@ __export(src_exports, {
|
|
|
5771
5771
|
LoanQuery: () => LoanQuery,
|
|
5772
5772
|
LoanStatus: () => LoanStatus,
|
|
5773
5773
|
PKPManager: () => PKPManager,
|
|
5774
|
+
PROTOCOL_LICENSE_IDENTIFIER: () => PROTOCOL_LICENSE_IDENTIFIER,
|
|
5775
|
+
PROTOCOL_LICENSE_URI: () => PROTOCOL_LICENSE_URI,
|
|
5774
5776
|
PaymentType: () => PaymentType,
|
|
5775
5777
|
PositionStatus: () => PositionStatus,
|
|
5776
5778
|
RECOVERY_INVALIDATE_ACTION: () => RECOVERY_INVALIDATE_ACTION,
|
|
@@ -5809,6 +5811,7 @@ __export(src_exports, {
|
|
|
5809
5811
|
getContractsByNetwork: () => getContractsByNetwork,
|
|
5810
5812
|
getDelegateStatus: () => getDelegateStatus,
|
|
5811
5813
|
getDeploymentByNetwork: () => getDeploymentByNetwork,
|
|
5814
|
+
getLicense: () => getLicense,
|
|
5812
5815
|
getPositionDelegate: () => getPositionDelegate,
|
|
5813
5816
|
getSafeAgentDelegation: () => getSafeAgentDelegation,
|
|
5814
5817
|
isClosePositionAuth: () => isClosePositionAuth,
|
|
@@ -6335,6 +6338,19 @@ var SDK_DEFAULTS = {
|
|
|
6335
6338
|
DEBUG: false
|
|
6336
6339
|
};
|
|
6337
6340
|
|
|
6341
|
+
// src/constants/chunks/protocol-license.ts
|
|
6342
|
+
var PROTOCOL_LICENSE_IDENTIFIER = "UNLICENSED";
|
|
6343
|
+
var PROTOCOL_LICENSE_URI = "ipfs://bafkreigunb4phugonefe66by524nhnrgrpol4233ytg7e7eg7qomhy3s3a";
|
|
6344
|
+
var PROTOCOL_LICENSE_TEXT = '(c) GVNR DAO LLC, 2026\n\nExcept as otherwise provided in the header of a specific source code\nfile in this repository: (a) all intellectual property (including all\nsource code, designs and protocols) contained in this repository has been\npublished for informational purposes only; (b) no license, right of\nreproduction or distribution or other right with respect thereto is\ngranted or implied; and (c) all moral, intellectual property and other\nrights are hereby reserved by the copyright holder.\n\nTHE SOFTWARE AND INTELLECTUAL PROPERTY INCLUDED IN THIS REPOSITORY\nIS PROVIDED BY THE COPYRIGHT HOLDERS "AS IS," AND ANY EXPRESS\nOR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE OR\nINTELLECTUAL PROPERTY (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\nOF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\nBUSINESS INTERRUPTION), HOWEVER CAUSED OR CLAIMED (WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)), EVEN IF\nSUCH DAMAGES WERE REASONABLY FORESEEABLE OR THE COPYRIGHT HOLDERS WERE\nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.';
|
|
6345
|
+
var PROTOCOL_LICENSE = Object.freeze({
|
|
6346
|
+
identifier: PROTOCOL_LICENSE_IDENTIFIER,
|
|
6347
|
+
uri: PROTOCOL_LICENSE_URI,
|
|
6348
|
+
text: PROTOCOL_LICENSE_TEXT
|
|
6349
|
+
});
|
|
6350
|
+
function getLicense() {
|
|
6351
|
+
return PROTOCOL_LICENSE;
|
|
6352
|
+
}
|
|
6353
|
+
|
|
6338
6354
|
// src/utils/service-endpoint-policy.ts
|
|
6339
6355
|
function assertSafeServiceEndpoint(endpoint) {
|
|
6340
6356
|
let url;
|
|
@@ -26655,6 +26671,25 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
|
|
|
26655
26671
|
getConfig() {
|
|
26656
26672
|
return this.config;
|
|
26657
26673
|
}
|
|
26674
|
+
/**
|
|
26675
|
+
* Return the Diamond Hands protocol license.
|
|
26676
|
+
*
|
|
26677
|
+
* Same data as the standalone `getLicense()` export: the package `LICENSE`
|
|
26678
|
+
* file, which is the CIDv1 payload of `ContractVersionRegistry.LICENSE_URI`.
|
|
26679
|
+
* Does not fetch IPFS.
|
|
26680
|
+
*
|
|
26681
|
+
* @returns Identifier (`UNLICENSED`), IPFS URI, and full license text.
|
|
26682
|
+
*
|
|
26683
|
+
* @example
|
|
26684
|
+
* ```ts
|
|
26685
|
+
* const license = sdk.getLicense();
|
|
26686
|
+
* console.log(license.identifier); // "UNLICENSED"
|
|
26687
|
+
* console.log(license.uri); // "ipfs://bafkrei…"
|
|
26688
|
+
* ```
|
|
26689
|
+
*/
|
|
26690
|
+
getLicense() {
|
|
26691
|
+
return getLicense();
|
|
26692
|
+
}
|
|
26658
26693
|
/**
|
|
26659
26694
|
* Clear all caches
|
|
26660
26695
|
*/
|
|
@@ -27621,6 +27656,8 @@ async function getSafeAgentDelegation(params) {
|
|
|
27621
27656
|
LoanQuery,
|
|
27622
27657
|
LoanStatus,
|
|
27623
27658
|
PKPManager,
|
|
27659
|
+
PROTOCOL_LICENSE_IDENTIFIER,
|
|
27660
|
+
PROTOCOL_LICENSE_URI,
|
|
27624
27661
|
PaymentType,
|
|
27625
27662
|
PositionStatus,
|
|
27626
27663
|
RECOVERY_INVALIDATE_ACTION,
|
|
@@ -27658,6 +27695,7 @@ async function getSafeAgentDelegation(params) {
|
|
|
27658
27695
|
getContractsByNetwork,
|
|
27659
27696
|
getDelegateStatus,
|
|
27660
27697
|
getDeploymentByNetwork,
|
|
27698
|
+
getLicense,
|
|
27661
27699
|
getPositionDelegate,
|
|
27662
27700
|
getSafeAgentDelegation,
|
|
27663
27701
|
isClosePositionAuth,
|
package/dist/index.mjs
CHANGED
|
@@ -6250,6 +6250,19 @@ var SDK_DEFAULTS = {
|
|
|
6250
6250
|
DEBUG: false
|
|
6251
6251
|
};
|
|
6252
6252
|
|
|
6253
|
+
// src/constants/chunks/protocol-license.ts
|
|
6254
|
+
var PROTOCOL_LICENSE_IDENTIFIER = "UNLICENSED";
|
|
6255
|
+
var PROTOCOL_LICENSE_URI = "ipfs://bafkreigunb4phugonefe66by524nhnrgrpol4233ytg7e7eg7qomhy3s3a";
|
|
6256
|
+
var PROTOCOL_LICENSE_TEXT = '(c) GVNR DAO LLC, 2026\n\nExcept as otherwise provided in the header of a specific source code\nfile in this repository: (a) all intellectual property (including all\nsource code, designs and protocols) contained in this repository has been\npublished for informational purposes only; (b) no license, right of\nreproduction or distribution or other right with respect thereto is\ngranted or implied; and (c) all moral, intellectual property and other\nrights are hereby reserved by the copyright holder.\n\nTHE SOFTWARE AND INTELLECTUAL PROPERTY INCLUDED IN THIS REPOSITORY\nIS PROVIDED BY THE COPYRIGHT HOLDERS "AS IS," AND ANY EXPRESS\nOR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE OR\nINTELLECTUAL PROPERTY (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\nOF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\nBUSINESS INTERRUPTION), HOWEVER CAUSED OR CLAIMED (WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)), EVEN IF\nSUCH DAMAGES WERE REASONABLY FORESEEABLE OR THE COPYRIGHT HOLDERS WERE\nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.';
|
|
6257
|
+
var PROTOCOL_LICENSE = Object.freeze({
|
|
6258
|
+
identifier: PROTOCOL_LICENSE_IDENTIFIER,
|
|
6259
|
+
uri: PROTOCOL_LICENSE_URI,
|
|
6260
|
+
text: PROTOCOL_LICENSE_TEXT
|
|
6261
|
+
});
|
|
6262
|
+
function getLicense() {
|
|
6263
|
+
return PROTOCOL_LICENSE;
|
|
6264
|
+
}
|
|
6265
|
+
|
|
6253
6266
|
// src/utils/service-endpoint-policy.ts
|
|
6254
6267
|
function assertSafeServiceEndpoint(endpoint) {
|
|
6255
6268
|
let url;
|
|
@@ -26584,6 +26597,25 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
|
|
|
26584
26597
|
getConfig() {
|
|
26585
26598
|
return this.config;
|
|
26586
26599
|
}
|
|
26600
|
+
/**
|
|
26601
|
+
* Return the Diamond Hands protocol license.
|
|
26602
|
+
*
|
|
26603
|
+
* Same data as the standalone `getLicense()` export: the package `LICENSE`
|
|
26604
|
+
* file, which is the CIDv1 payload of `ContractVersionRegistry.LICENSE_URI`.
|
|
26605
|
+
* Does not fetch IPFS.
|
|
26606
|
+
*
|
|
26607
|
+
* @returns Identifier (`UNLICENSED`), IPFS URI, and full license text.
|
|
26608
|
+
*
|
|
26609
|
+
* @example
|
|
26610
|
+
* ```ts
|
|
26611
|
+
* const license = sdk.getLicense();
|
|
26612
|
+
* console.log(license.identifier); // "UNLICENSED"
|
|
26613
|
+
* console.log(license.uri); // "ipfs://bafkrei…"
|
|
26614
|
+
* ```
|
|
26615
|
+
*/
|
|
26616
|
+
getLicense() {
|
|
26617
|
+
return getLicense();
|
|
26618
|
+
}
|
|
26587
26619
|
/**
|
|
26588
26620
|
* Clear all caches
|
|
26589
26621
|
*/
|
|
@@ -27549,6 +27581,8 @@ export {
|
|
|
27549
27581
|
LoanQuery,
|
|
27550
27582
|
LoanStatus,
|
|
27551
27583
|
PKPManager,
|
|
27584
|
+
PROTOCOL_LICENSE_IDENTIFIER,
|
|
27585
|
+
PROTOCOL_LICENSE_URI,
|
|
27552
27586
|
PaymentType,
|
|
27553
27587
|
PositionStatus,
|
|
27554
27588
|
RECOVERY_INVALIDATE_ACTION,
|
|
@@ -27587,6 +27621,7 @@ export {
|
|
|
27587
27621
|
getContractsByNetwork,
|
|
27588
27622
|
getDelegateStatus,
|
|
27589
27623
|
getDeploymentByNetwork,
|
|
27624
|
+
getLicense,
|
|
27590
27625
|
getPositionDelegate,
|
|
27591
27626
|
getSafeAgentDelegation,
|
|
27592
27627
|
isClosePositionAuth,
|
|
@@ -17,6 +17,7 @@ import { Satoshis } from "../types/branded/domain-values";
|
|
|
17
17
|
import { SDKError } from "../utils/error-handler";
|
|
18
18
|
import type { CreateLoanRequest, CreateLoanResult, LoanDataDetail, UCDMintRequest, UCDMintResult, PartialPaymentRequest, PartialPaymentResult, BTCWithdrawalResult, RenewPositionRequest, RenewPositionResult, LiquidationRequest, LiquidationResult, ConfirmBalanceRequest, ConfirmBalanceResult, TermsWithFeesResult } from "../interfaces/chunks/loan-operations.i";
|
|
19
19
|
import type { DiamondHandsSDKConfig } from "../interfaces/chunks/config.i";
|
|
20
|
+
import { type ProtocolLicense } from "../constants/chunks/protocol-license";
|
|
20
21
|
import type { PKPData } from "../interfaces/chunks/pkp-integration.i";
|
|
21
22
|
import { type AuthorizationProvider } from "../utils/authorization-provider.utils";
|
|
22
23
|
import type { DhServerLoginPayload } from "../utils/eip712-login";
|
|
@@ -1375,6 +1376,23 @@ export declare class DiamondHandsSDK {
|
|
|
1375
1376
|
* Get SDK configuration
|
|
1376
1377
|
*/
|
|
1377
1378
|
getConfig(): DiamondHandsSDKConfig;
|
|
1379
|
+
/**
|
|
1380
|
+
* Return the Diamond Hands protocol license.
|
|
1381
|
+
*
|
|
1382
|
+
* Same data as the standalone `getLicense()` export: the package `LICENSE`
|
|
1383
|
+
* file, which is the CIDv1 payload of `ContractVersionRegistry.LICENSE_URI`.
|
|
1384
|
+
* Does not fetch IPFS.
|
|
1385
|
+
*
|
|
1386
|
+
* @returns Identifier (`UNLICENSED`), IPFS URI, and full license text.
|
|
1387
|
+
*
|
|
1388
|
+
* @example
|
|
1389
|
+
* ```ts
|
|
1390
|
+
* const license = sdk.getLicense();
|
|
1391
|
+
* console.log(license.identifier); // "UNLICENSED"
|
|
1392
|
+
* console.log(license.uri); // "ipfs://bafkrei…"
|
|
1393
|
+
* ```
|
|
1394
|
+
*/
|
|
1395
|
+
getLicense(): ProtocolLicense;
|
|
1378
1396
|
/**
|
|
1379
1397
|
* Clear all caches
|
|
1380
1398
|
*/
|
package/package.json
CHANGED