@dignetwork/chip35-dl-coin-wasm 0.5.0 → 0.6.0
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/chip35_dl_coin_wasm.d.ts
CHANGED
|
@@ -9,6 +9,13 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export function addFee(spender_synthetic_key: Uint8Array, selected_coins: any, assert_coin_ids: any, fee: bigint): any;
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Build the **Admin** delegated puzzle for a 48-byte synthetic public key (a hub Teams admin).
|
|
14
|
+
* An admin may update the store AND change delegation (add/remove writers — i.e. revoke a deploy
|
|
15
|
+
* token), but cannot transfer ownership. Returns a `DelegatedPuzzle` (`{ adminInnerPuzzleHash }`).
|
|
16
|
+
*/
|
|
17
|
+
export function adminDelegatedPuzzleFromKey(synthetic_key: Uint8Array): any;
|
|
18
|
+
|
|
12
19
|
/**
|
|
13
20
|
* Build a CHIP-0007 metadata document from a JS object and return its canonical JSON + the
|
|
14
21
|
* `metadata_hash` (sha256 of that JSON). De-dupes the hand-computed badge metadata: callers stop
|
|
@@ -99,6 +106,13 @@ export function mintNft(minter_synthetic_key: Uint8Array, selected_coins: any, p
|
|
|
99
106
|
*/
|
|
100
107
|
export function mintStore(minter_synthetic_key: Uint8Array, selected_coins: any, root_hash: Uint8Array, label: string | null | undefined, description: string | null | undefined, bytes: bigint | null | undefined, program_hash: Uint8Array | null | undefined, owner_puzzle_hash: Uint8Array, delegated_puzzles: any, fee: bigint): any;
|
|
101
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Build the **Oracle** delegated puzzle: anyone may spend the store for the fixed `oracle_fee`
|
|
111
|
+
* (mojos) paid to the 32-byte `oracle_puzzle_hash`. Returns a `DelegatedPuzzle`
|
|
112
|
+
* (`{ oraclePaymentPuzzleHash, oracleFee }`).
|
|
113
|
+
*/
|
|
114
|
+
export function oracleDelegatedPuzzle(oracle_puzzle_hash: Uint8Array, oracle_fee: bigint): any;
|
|
115
|
+
|
|
102
116
|
/**
|
|
103
117
|
* Exercise a store's oracle delegated puzzle (see [`chip35_dl_coin::oracle_spend`]). The spender
|
|
104
118
|
* pays the oracle fee plus `fee` from `selected_coins`. Returns a `SuccessResponse`.
|
|
@@ -139,3 +153,12 @@ export function updateStoreOwnership(store: any, new_owner_puzzle_hash: Uint8Arr
|
|
|
139
153
|
* `Uint8Array`). Returns `{ ok: bool, errors: string[] }`.
|
|
140
154
|
*/
|
|
141
155
|
export function validateChip0007(metadata: any, assets: any): any;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Build the **Writer** delegated puzzle for a 48-byte synthetic public key — a revocable deploy
|
|
159
|
+
* token (#17) or a hub Teams writer (#43). A writer may advance the root (deploy a new capsule)
|
|
160
|
+
* WITHOUT the owner seed, but may NOT change delegation or transfer ownership. Add it to a store
|
|
161
|
+
* to issue the token; replace the store's delegated set to revoke it. Returns a `DelegatedPuzzle`
|
|
162
|
+
* (`{ writerInnerPuzzleHash }`).
|
|
163
|
+
*/
|
|
164
|
+
export function writerDelegatedPuzzleFromKey(synthetic_key: Uint8Array): any;
|
package/chip35_dl_coin_wasm.js
CHANGED
|
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./chip35_dl_coin_wasm_bg.js";
|
|
|
5
5
|
__wbg_set_wasm(wasm);
|
|
6
6
|
|
|
7
7
|
export {
|
|
8
|
-
addFee, buildChip0007Metadata, bulkMint, createDid, dataStoreFromSpend, decodeOffer, digstoreOwnerHint, encodeOffer, generateItemMetadata, hexSpendBundleToCoinSpends, init, issueCat, meltStore, mintNft, mintStore, oracleSpend, sha256, spendBundleToHex, updateStoreMetadata, updateStoreOwnership, validateChip0007
|
|
8
|
+
addFee, adminDelegatedPuzzleFromKey, buildChip0007Metadata, bulkMint, createDid, dataStoreFromSpend, decodeOffer, digstoreOwnerHint, encodeOffer, generateItemMetadata, hexSpendBundleToCoinSpends, init, issueCat, meltStore, mintNft, mintStore, oracleDelegatedPuzzle, oracleSpend, sha256, spendBundleToHex, updateStoreMetadata, updateStoreOwnership, validateChip0007, writerDelegatedPuzzleFromKey
|
|
9
9
|
} from "./chip35_dl_coin_wasm_bg.js";
|
|
@@ -27,6 +27,31 @@ export function addFee(spender_synthetic_key, selected_coins, assert_coin_ids, f
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Build the **Admin** delegated puzzle for a 48-byte synthetic public key (a hub Teams admin).
|
|
32
|
+
* An admin may update the store AND change delegation (add/remove writers — i.e. revoke a deploy
|
|
33
|
+
* token), but cannot transfer ownership. Returns a `DelegatedPuzzle` (`{ adminInnerPuzzleHash }`).
|
|
34
|
+
* @param {Uint8Array} synthetic_key
|
|
35
|
+
* @returns {any}
|
|
36
|
+
*/
|
|
37
|
+
export function adminDelegatedPuzzleFromKey(synthetic_key) {
|
|
38
|
+
try {
|
|
39
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
40
|
+
const ptr0 = passArray8ToWasm0(synthetic_key, wasm.__wbindgen_export);
|
|
41
|
+
const len0 = WASM_VECTOR_LEN;
|
|
42
|
+
wasm.adminDelegatedPuzzleFromKey(retptr, ptr0, len0);
|
|
43
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
44
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
45
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
46
|
+
if (r2) {
|
|
47
|
+
throw takeObject(r1);
|
|
48
|
+
}
|
|
49
|
+
return takeObject(r0);
|
|
50
|
+
} finally {
|
|
51
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
30
55
|
/**
|
|
31
56
|
* Build a CHIP-0007 metadata document from a JS object and return its canonical JSON + the
|
|
32
57
|
* `metadata_hash` (sha256 of that JSON). De-dupes the hand-computed badge metadata: callers stop
|
|
@@ -393,6 +418,32 @@ export function mintStore(minter_synthetic_key, selected_coins, root_hash, label
|
|
|
393
418
|
}
|
|
394
419
|
}
|
|
395
420
|
|
|
421
|
+
/**
|
|
422
|
+
* Build the **Oracle** delegated puzzle: anyone may spend the store for the fixed `oracle_fee`
|
|
423
|
+
* (mojos) paid to the 32-byte `oracle_puzzle_hash`. Returns a `DelegatedPuzzle`
|
|
424
|
+
* (`{ oraclePaymentPuzzleHash, oracleFee }`).
|
|
425
|
+
* @param {Uint8Array} oracle_puzzle_hash
|
|
426
|
+
* @param {bigint} oracle_fee
|
|
427
|
+
* @returns {any}
|
|
428
|
+
*/
|
|
429
|
+
export function oracleDelegatedPuzzle(oracle_puzzle_hash, oracle_fee) {
|
|
430
|
+
try {
|
|
431
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
432
|
+
const ptr0 = passArray8ToWasm0(oracle_puzzle_hash, wasm.__wbindgen_export);
|
|
433
|
+
const len0 = WASM_VECTOR_LEN;
|
|
434
|
+
wasm.oracleDelegatedPuzzle(retptr, ptr0, len0, oracle_fee);
|
|
435
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
436
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
437
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
438
|
+
if (r2) {
|
|
439
|
+
throw takeObject(r1);
|
|
440
|
+
}
|
|
441
|
+
return takeObject(r0);
|
|
442
|
+
} finally {
|
|
443
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
396
447
|
/**
|
|
397
448
|
* Exercise a store's oracle delegated puzzle (see [`chip35_dl_coin::oracle_spend`]). The spender
|
|
398
449
|
* pays the oracle fee plus `fee` from `selected_coins`. Returns a `SuccessResponse`.
|
|
@@ -576,6 +627,33 @@ export function validateChip0007(metadata, assets) {
|
|
|
576
627
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
577
628
|
}
|
|
578
629
|
}
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Build the **Writer** delegated puzzle for a 48-byte synthetic public key — a revocable deploy
|
|
633
|
+
* token (#17) or a hub Teams writer (#43). A writer may advance the root (deploy a new capsule)
|
|
634
|
+
* WITHOUT the owner seed, but may NOT change delegation or transfer ownership. Add it to a store
|
|
635
|
+
* to issue the token; replace the store's delegated set to revoke it. Returns a `DelegatedPuzzle`
|
|
636
|
+
* (`{ writerInnerPuzzleHash }`).
|
|
637
|
+
* @param {Uint8Array} synthetic_key
|
|
638
|
+
* @returns {any}
|
|
639
|
+
*/
|
|
640
|
+
export function writerDelegatedPuzzleFromKey(synthetic_key) {
|
|
641
|
+
try {
|
|
642
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
643
|
+
const ptr0 = passArray8ToWasm0(synthetic_key, wasm.__wbindgen_export);
|
|
644
|
+
const len0 = WASM_VECTOR_LEN;
|
|
645
|
+
wasm.writerDelegatedPuzzleFromKey(retptr, ptr0, len0);
|
|
646
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
647
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
648
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
649
|
+
if (r2) {
|
|
650
|
+
throw takeObject(r1);
|
|
651
|
+
}
|
|
652
|
+
return takeObject(r0);
|
|
653
|
+
} finally {
|
|
654
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
579
657
|
export function __wbg_Error_ef53bc310eb298a0(arg0, arg1) {
|
|
580
658
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
581
659
|
return addHeapObject(ret);
|
|
Binary file
|
package/package.json
CHANGED