pshenmic-dpp 1.1.0-dev.2 → 1.1.0-dev.4
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 +26 -4
- package/dist/wasm/base122.js +2 -3
- package/dist/wasm/index.d.ts +4 -3
- package/dist/wasm/index.js +5 -4
- package/dist/wasm/initAsync.d.ts +6 -0
- package/dist/wasm/initAsync.js +20 -0
- package/dist/wasm/initInterface.d.ts +5 -0
- package/dist/wasm/initInterface.js +45 -0
- package/dist/wasm/initWASM.d.ts +2 -0
- package/dist/wasm/initWASM.js +28 -0
- package/dist/wasm/pshenmic_dpp.d.ts +21 -4
- package/dist/wasm/pshenmic_dpp.js +118 -0
- package/dist/wasm/pshenmic_dpp_bg.js +1 -1
- package/dist/wasm/pshenmic_dpp_bg.wasm.d.ts +10 -4
- package/dist/wasm/pshenmic_dpp_zipped.js +1 -0
- package/package.json +16 -10
- package/tests/AssetLockProof.spec.cjs +1 -1
- package/tests/AsyncImportTest.spec.cjs +930 -0
- package/tests/Identifier.spec.cjs +1 -1
package/README.md
CHANGED
|
@@ -18,18 +18,23 @@ ___
|
|
|
18
18
|
### Build JS
|
|
19
19
|
`yarn build:full`
|
|
20
20
|
|
|
21
|
-
**NOTE. If you want to use ES6 module without CJS, you need to run `yarn babel`**
|
|
22
|
-
|
|
23
21
|
### Build with binary instead base122
|
|
24
22
|
`yarn build:raw`
|
|
25
23
|
Now you can import `.js` with base122 buffer for WebAssembly module, or binary which smaller
|
|
26
24
|
___
|
|
27
25
|
## Why you need to use `pshenmic-dpp` instead `wasm-dpp`
|
|
28
26
|
|
|
29
|
-
- `pshenmic-dpp` weighs much less, currently taking up only
|
|
27
|
+
- `pshenmic-dpp` weighs much less, currently taking up only 1.4mb(\*) or 2.2mb(\*) in base122 format with GZIP
|
|
30
28
|
- You can build only necessary modules by removing imports from `lib.rs` before building
|
|
31
29
|
- More accurately replicates `rs-dpp`
|
|
32
30
|
- Some sugar, like enums, which you can pass in string with any case or just use numbers
|
|
31
|
+
|
|
32
|
+
**(\*)** \- This module contains 2 builds for wasm js layer:
|
|
33
|
+
- JS without bundling or GZIP (2.2mb)
|
|
34
|
+
- Bundled JS with GZIP (1.4mb)
|
|
35
|
+
|
|
36
|
+
These variations can be imported depending on requirements.
|
|
37
|
+
In both cases, the binary wasm data will be compressed using gzip.
|
|
33
38
|
___
|
|
34
39
|
|
|
35
40
|
## Current features
|
|
@@ -129,8 +134,9 @@ yarn tests
|
|
|
129
134
|
|
|
130
135
|
## Example
|
|
131
136
|
|
|
137
|
+
This example show how to synchronously import module with size 2.2mb
|
|
132
138
|
```js
|
|
133
|
-
import wasm from pshenmic_dpp';
|
|
139
|
+
import wasm from 'pshenmic_dpp';
|
|
134
140
|
|
|
135
141
|
const document = new wasm.DocumentWASM(
|
|
136
142
|
{
|
|
@@ -169,3 +175,19 @@ st.sign(privKey, pubKey)
|
|
|
169
175
|
console.log(st.toBytes())
|
|
170
176
|
console.log(st.hash(false))
|
|
171
177
|
```
|
|
178
|
+
|
|
179
|
+
This example show how to asynchronously import module with size 1.4mb
|
|
180
|
+
```js
|
|
181
|
+
const {default: initWASM} = require('pshenmic-dpp/initAsync')
|
|
182
|
+
|
|
183
|
+
async function main() {
|
|
184
|
+
let wasm = await initWASM()
|
|
185
|
+
|
|
186
|
+
const dataContractIdentifier = new wasm.IdentifierWASM('6QMfQTdKpC3Y9uWBcTwXeY3KdzRLDqASUsDnQ4MEc9XC')
|
|
187
|
+
const ownerIdentifier = new wasm.IdentifierWASM('B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH')
|
|
188
|
+
|
|
189
|
+
const documentInstance = new wasm.DocumentWASM(document, 'documentTypeName', BigInt(1), dataContractIdentifier, ownerIdentifier)
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
main().catch(console.error)
|
|
193
|
+
```
|
package/dist/wasm/base122.js
CHANGED
|
@@ -18,10 +18,9 @@ const kShortened = 0b111 // Uses the illegal index to signify the last two-byte
|
|
|
18
18
|
* with raw data bytes or a string of bytes (i.e. the type of argument to btoa())
|
|
19
19
|
* @returns {Uint8Array} The data in a regular array representing byte values.
|
|
20
20
|
*/
|
|
21
|
-
export function
|
|
21
|
+
export function decode (base122Data) {
|
|
22
22
|
const strData = typeof (base122Data) === 'string' ? base122Data : utf8DataToString(base122Data)
|
|
23
23
|
const decoded = []
|
|
24
|
-
const decodedIndex = 0
|
|
25
24
|
let curByte = 0
|
|
26
25
|
let bitOfByte = 0
|
|
27
26
|
|
|
@@ -47,7 +46,7 @@ export function decodeBase122 (base122Data) {
|
|
|
47
46
|
const illegalIndex = (c >>> 8) & 7 // 7 = 0b111.
|
|
48
47
|
// We have to first check if this is a shortened two-byte character, i.e. if it only
|
|
49
48
|
// encodes <= 7 bits.
|
|
50
|
-
if (illegalIndex
|
|
49
|
+
if (illegalIndex !== kShortened) push7(kIllegals[illegalIndex])
|
|
51
50
|
// Always push the rest.
|
|
52
51
|
push7(c & 127)
|
|
53
52
|
} else {
|
package/dist/wasm/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as DPP from './pshenmic_dpp';
|
|
1
|
+
import * as DPP from './pshenmic_dpp.js';
|
|
2
2
|
|
|
3
|
-
export * from './pshenmic_dpp'
|
|
3
|
+
export * from './pshenmic_dpp.js'
|
|
4
4
|
|
|
5
|
-
export * from './base122'
|
|
5
|
+
export * from './base122.js'
|
|
6
6
|
|
|
7
7
|
export default dpp;
|
|
8
8
|
|
|
@@ -122,4 +122,5 @@ export class DashPlatformProtocolWASM {
|
|
|
122
122
|
verifyTokenContractInfo: Function
|
|
123
123
|
verifyTokenTotalSupply: Function
|
|
124
124
|
verifyTokensBalancesForIdentity: Function
|
|
125
|
+
verifyTokenDirectPurchasePrices: Function
|
|
125
126
|
}
|
package/dist/wasm/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as DPP from './pshenmic_dpp.js'
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import wasmBytes from './pshenmic_dpp_bg.js'
|
|
3
|
+
import { decode } from './base122.js'
|
|
4
|
+
import { decompressSync } from 'fflate'
|
|
4
5
|
|
|
5
6
|
export * from './base122.js'
|
|
6
7
|
export * from './pshenmic_dpp.js'
|
|
7
8
|
|
|
8
|
-
const bytes = new Uint8Array(
|
|
9
|
+
const bytes = new Uint8Array(decode(wasmBytes))
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
DPP.initSync({ module: decompressSync(bytes) })
|
|
11
12
|
|
|
12
13
|
export default DPP
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import initWASM from './initWASM.js'
|
|
2
|
+
import initWASMInterface from './initInterface.js'
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line
|
|
5
|
+
let dpp
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Asynchronously initialization for compressed module (reduced size)
|
|
9
|
+
* @returns {Promise<*>}
|
|
10
|
+
*/
|
|
11
|
+
async function initModule () {
|
|
12
|
+
const wasm = await initWASM()
|
|
13
|
+
const wasmInterface = await initWASMInterface()
|
|
14
|
+
|
|
15
|
+
dpp = wasmInterface.initSync(wasm)
|
|
16
|
+
|
|
17
|
+
return wasmInterface
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default initModule
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import wasmInterfaceBytes from './pshenmic_dpp_zipped.js'
|
|
2
|
+
import { decode } from './base122.js'
|
|
3
|
+
|
|
4
|
+
export * from './base122.js'
|
|
5
|
+
|
|
6
|
+
const isNode = () =>
|
|
7
|
+
typeof process !== 'undefined' &&
|
|
8
|
+
!!process.versions &&
|
|
9
|
+
!!process.versions.node
|
|
10
|
+
|
|
11
|
+
const interfaceBytes = new Uint8Array(decode(wasmInterfaceBytes))
|
|
12
|
+
const interfaceBlob = new Blob([interfaceBytes])
|
|
13
|
+
|
|
14
|
+
async function initInterface () {
|
|
15
|
+
const decompressionStream = new DecompressionStream('gzip')
|
|
16
|
+
const decompressedStream = interfaceBlob.stream().pipeThrough(decompressionStream)
|
|
17
|
+
const decompressedResponse = new Response(decompressedStream)
|
|
18
|
+
const moduleText = await decompressedResponse.text()
|
|
19
|
+
|
|
20
|
+
let module
|
|
21
|
+
if (isNode()) {
|
|
22
|
+
const vm = await import('vm')
|
|
23
|
+
|
|
24
|
+
const context = vm.createContext({
|
|
25
|
+
crypto,
|
|
26
|
+
TextDecoder
|
|
27
|
+
})
|
|
28
|
+
const vmModule = new vm.Script(moduleText)
|
|
29
|
+
|
|
30
|
+
vmModule.runInContext(context)
|
|
31
|
+
|
|
32
|
+
module = context['pshenmic-dpp']
|
|
33
|
+
} else {
|
|
34
|
+
const blob = new Blob([moduleText], { type: 'application/javascript' })
|
|
35
|
+
const moduleUrl = URL.createObjectURL(blob)
|
|
36
|
+
|
|
37
|
+
module = await import(moduleUrl)
|
|
38
|
+
|
|
39
|
+
URL.revokeObjectURL(moduleUrl)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return module
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default initInterface
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import wasmBytes from './pshenmic_dpp_bg.js'
|
|
2
|
+
import { decode } from './base122.js'
|
|
3
|
+
|
|
4
|
+
export * from './base122.js'
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line
|
|
7
|
+
const isNode = () =>
|
|
8
|
+
typeof process !== 'undefined' &&
|
|
9
|
+
!!process.versions &&
|
|
10
|
+
!!process.versions.node
|
|
11
|
+
|
|
12
|
+
const interfaceBytes = new Uint8Array(decode(wasmBytes))
|
|
13
|
+
const interfaceBlob = new Blob([interfaceBytes])
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Convert wasm bin string to Uint8Array with decompression via DecompressionStream
|
|
17
|
+
* @returns {Promise<ArrayBuffer>}
|
|
18
|
+
*/
|
|
19
|
+
async function initWASM () {
|
|
20
|
+
const decompressionStream = new DecompressionStream('gzip')
|
|
21
|
+
const decompressedStream = interfaceBlob.stream().pipeThrough(decompressionStream)
|
|
22
|
+
const decompressedResponse = new Response(decompressedStream)
|
|
23
|
+
const module = await decompressedResponse.arrayBuffer()
|
|
24
|
+
|
|
25
|
+
return module
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default initWASM
|
|
@@ -15,6 +15,7 @@ export function verifyEpochsInfoProof(proof: Uint8Array, current_epoch: number,
|
|
|
15
15
|
export function verifyTotalCreditsProof(proof: Uint8Array, core_subsidy_halving_interval: number, activation_core_height: number, current_core_height: number, js_platform_version: any): VerifiedTotalCreditsWASM;
|
|
16
16
|
export function verifyTokenBalancesForIdentitiesProof(proof: Uint8Array, js_token_id: any, is_proof_subset: boolean, js_identities: any, js_platform_version: any): VerifiedTokenBalancesForIdentitiesWASM;
|
|
17
17
|
export function verifyTokenContractInfoProof(proof: Uint8Array, js_token_id: any, verify_subset_of_proof: boolean, js_platform_version: any): VerifiedTokenContractInfoWASM;
|
|
18
|
+
export function verifyTokenDirectPurchasePrices(proof: Uint8Array, js_token_ids: any, verify_subset_of_proof: boolean, js_platform_version: any): VerifiedTokenDirectPurchasePrices;
|
|
18
19
|
export function verifyTokenTotalSupplyProof(proof: Uint8Array, js_token_id: any, verify_subset_of_proof: boolean, js_platform_version: any): VerifiedTokenTotalSupplyWASM;
|
|
19
20
|
export function verifyTokensBalancesForIdentityProof(proof: Uint8Array, js_token_ids: any, js_identity_id: any, verify_subset_of_proof: boolean, js_platform_version: any): VerifiedTokensBalancesForIdentityWASM;
|
|
20
21
|
export enum ActionGoalWASM {
|
|
@@ -2976,6 +2977,16 @@ export class VerifiedTokenContractInfoWASM {
|
|
|
2976
2977
|
readonly rootHash: Uint8Array;
|
|
2977
2978
|
readonly contractInfo: TokenContractInfoWASM | undefined;
|
|
2978
2979
|
}
|
|
2980
|
+
export class VerifiedTokenDirectPurchasePrices {
|
|
2981
|
+
/** @returns {VerifiedTokenDirectPurchasePrices} */
|
|
2982
|
+
private constructor();
|
|
2983
|
+
/** @ignore */
|
|
2984
|
+
free(): void;
|
|
2985
|
+
readonly __type: string;
|
|
2986
|
+
static readonly __struct: string;
|
|
2987
|
+
readonly rootHash: Uint8Array;
|
|
2988
|
+
readonly prices: Array<any> | undefined;
|
|
2989
|
+
}
|
|
2979
2990
|
export class VerifiedTokenTotalSupplyWASM {
|
|
2980
2991
|
/** @returns {VerifiedTokenTotalSupplyWASM} */
|
|
2981
2992
|
private constructor();
|
|
@@ -3177,6 +3188,12 @@ export interface InitOutput {
|
|
|
3177
3188
|
readonly verifiedtokencontractinfowasm_root_hash: (a: number) => number;
|
|
3178
3189
|
readonly verifiedtokencontractinfowasm_get_contract_info: (a: number) => number;
|
|
3179
3190
|
readonly verifyTokenContractInfoProof: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
3191
|
+
readonly __wbg_verifiedtokendirectpurchaseprices_free: (a: number, b: number) => void;
|
|
3192
|
+
readonly verifiedtokendirectpurchaseprices_type_name: (a: number, b: number) => void;
|
|
3193
|
+
readonly verifiedtokendirectpurchaseprices_struct_name: (a: number) => void;
|
|
3194
|
+
readonly verifiedtokendirectpurchaseprices_root_hash: (a: number) => number;
|
|
3195
|
+
readonly verifiedtokendirectpurchaseprices_prices: (a: number, b: number) => void;
|
|
3196
|
+
readonly verifyTokenDirectPurchasePrices: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
3180
3197
|
readonly __wbg_totalsingletokenbalancewasm_free: (a: number, b: number) => void;
|
|
3181
3198
|
readonly totalsingletokenbalancewasm_type_name: (a: number, b: number) => void;
|
|
3182
3199
|
readonly totalsingletokenbalancewasm_struct_name: (a: number) => void;
|
|
@@ -3190,20 +3207,20 @@ export interface InitOutput {
|
|
|
3190
3207
|
readonly verifiedtokensbalancesforidentitywasm_type_name: (a: number, b: number) => void;
|
|
3191
3208
|
readonly verifiedtokensbalancesforidentitywasm_struct_name: (a: number) => void;
|
|
3192
3209
|
readonly verifyTokensBalancesForIdentityProof: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
3193
|
-
readonly __wbg_verifiedidentitynoncewasm_free: (a: number, b: number) => void;
|
|
3194
3210
|
readonly __wbg_verifiedtotalcreditswasm_free: (a: number, b: number) => void;
|
|
3195
|
-
readonly
|
|
3211
|
+
readonly __wbg_verifiedidentitynoncewasm_free: (a: number, b: number) => void;
|
|
3196
3212
|
readonly __wbg_verifiedtokentotalsupplywasm_free: (a: number, b: number) => void;
|
|
3213
|
+
readonly __wbg_verifiedidentitycontractnoncewasm_free: (a: number, b: number) => void;
|
|
3197
3214
|
readonly __wbg_verifiedtokensbalancesforidentitywasm_free: (a: number, b: number) => void;
|
|
3198
3215
|
readonly __wbg_verifiedidentitybyuniquekeyhashwasm_free: (a: number, b: number) => void;
|
|
3216
|
+
readonly verifiedtokensbalancesforidentitywasm_balances: (a: number) => number;
|
|
3217
|
+
readonly verifiedtokensbalancesforidentitywasm_root_hash: (a: number) => number;
|
|
3199
3218
|
readonly verifiedidentitynoncewasm_nonce: (a: number, b: number) => void;
|
|
3200
3219
|
readonly verifiedidentitynoncewasm_root_hash: (a: number) => number;
|
|
3201
3220
|
readonly verifiedidentitybyuniquekeyhashwasm_identity: (a: number) => number;
|
|
3202
3221
|
readonly verifiedidentitybyuniquekeyhashwasm_root_hash: (a: number) => number;
|
|
3203
3222
|
readonly verifiedidentitycontractnoncewasm_contract_nonce: (a: number, b: number) => void;
|
|
3204
3223
|
readonly verifiedidentitycontractnoncewasm_root_hash: (a: number) => number;
|
|
3205
|
-
readonly verifiedtokensbalancesforidentitywasm_balances: (a: number) => number;
|
|
3206
|
-
readonly verifiedtokensbalancesforidentitywasm_root_hash: (a: number) => number;
|
|
3207
3224
|
readonly __wbg_partialidentitywasm_free: (a: number, b: number) => void;
|
|
3208
3225
|
readonly partialidentitywasm_new: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: bigint, h: number) => void;
|
|
3209
3226
|
readonly partialidentitywasm_id: (a: number) => number;
|
|
@@ -677,6 +677,32 @@ export function verifyTokenContractInfoProof(proof, js_token_id, verify_subset_o
|
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
|
|
680
|
+
/**
|
|
681
|
+
* @param {Uint8Array} proof
|
|
682
|
+
* @param {any} js_token_ids
|
|
683
|
+
* @param {boolean} verify_subset_of_proof
|
|
684
|
+
* @param {any} js_platform_version
|
|
685
|
+
* @returns {VerifiedTokenDirectPurchasePrices}
|
|
686
|
+
*/
|
|
687
|
+
export function verifyTokenDirectPurchasePrices(proof, js_token_ids, verify_subset_of_proof, js_platform_version) {
|
|
688
|
+
try {
|
|
689
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
690
|
+
wasm.verifyTokenDirectPurchasePrices(retptr, addBorrowedObject(proof), addBorrowedObject(js_token_ids), verify_subset_of_proof, addBorrowedObject(js_platform_version));
|
|
691
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
692
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
693
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
694
|
+
if (r2) {
|
|
695
|
+
throw takeObject(r1);
|
|
696
|
+
}
|
|
697
|
+
return VerifiedTokenDirectPurchasePrices.__wrap(r0);
|
|
698
|
+
} finally {
|
|
699
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
700
|
+
heap[stack_pointer++] = undefined;
|
|
701
|
+
heap[stack_pointer++] = undefined;
|
|
702
|
+
heap[stack_pointer++] = undefined;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
|
|
680
706
|
/**
|
|
681
707
|
* @param {Uint8Array} proof
|
|
682
708
|
* @param {any} js_token_id
|
|
@@ -20771,6 +20797,98 @@ export class VerifiedTokenContractInfoWASM {
|
|
|
20771
20797
|
}
|
|
20772
20798
|
}
|
|
20773
20799
|
|
|
20800
|
+
const VerifiedTokenDirectPurchasePricesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
20801
|
+
? { register: () => {}, unregister: () => {} }
|
|
20802
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_verifiedtokendirectpurchaseprices_free(ptr >>> 0, 1));
|
|
20803
|
+
|
|
20804
|
+
export class VerifiedTokenDirectPurchasePrices {
|
|
20805
|
+
|
|
20806
|
+
static __wrap(ptr) {
|
|
20807
|
+
ptr = ptr >>> 0;
|
|
20808
|
+
const obj = Object.create(VerifiedTokenDirectPurchasePrices.prototype);
|
|
20809
|
+
obj.__wbg_ptr = ptr;
|
|
20810
|
+
VerifiedTokenDirectPurchasePricesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
20811
|
+
return obj;
|
|
20812
|
+
}
|
|
20813
|
+
|
|
20814
|
+
__destroy_into_raw() {
|
|
20815
|
+
const ptr = this.__wbg_ptr;
|
|
20816
|
+
this.__wbg_ptr = 0;
|
|
20817
|
+
VerifiedTokenDirectPurchasePricesFinalization.unregister(this);
|
|
20818
|
+
return ptr;
|
|
20819
|
+
}
|
|
20820
|
+
|
|
20821
|
+
/** @ignore */
|
|
20822
|
+
/** */
|
|
20823
|
+
free() {
|
|
20824
|
+
const ptr = this.__destroy_into_raw();
|
|
20825
|
+
wasm.__wbg_verifiedtokendirectpurchaseprices_free(ptr, 0);
|
|
20826
|
+
}
|
|
20827
|
+
/**
|
|
20828
|
+
* @returns {string}
|
|
20829
|
+
*/
|
|
20830
|
+
get __type() {
|
|
20831
|
+
let deferred1_0;
|
|
20832
|
+
let deferred1_1;
|
|
20833
|
+
try {
|
|
20834
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
20835
|
+
wasm.verifiedtokendirectpurchaseprices_type_name(retptr, this.__wbg_ptr);
|
|
20836
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
20837
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
20838
|
+
deferred1_0 = r0;
|
|
20839
|
+
deferred1_1 = r1;
|
|
20840
|
+
return getStringFromWasm0(r0, r1);
|
|
20841
|
+
} finally {
|
|
20842
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
20843
|
+
wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
|
|
20844
|
+
}
|
|
20845
|
+
}
|
|
20846
|
+
/**
|
|
20847
|
+
* @returns {string}
|
|
20848
|
+
*/
|
|
20849
|
+
static get __struct() {
|
|
20850
|
+
let deferred1_0;
|
|
20851
|
+
let deferred1_1;
|
|
20852
|
+
try {
|
|
20853
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
20854
|
+
wasm.verifiedtokendirectpurchaseprices_struct_name(retptr);
|
|
20855
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
20856
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
20857
|
+
deferred1_0 = r0;
|
|
20858
|
+
deferred1_1 = r1;
|
|
20859
|
+
return getStringFromWasm0(r0, r1);
|
|
20860
|
+
} finally {
|
|
20861
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
20862
|
+
wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
|
|
20863
|
+
}
|
|
20864
|
+
}
|
|
20865
|
+
/**
|
|
20866
|
+
* @returns {Uint8Array}
|
|
20867
|
+
*/
|
|
20868
|
+
get rootHash() {
|
|
20869
|
+
const ret = wasm.verifiedtokendirectpurchaseprices_root_hash(this.__wbg_ptr);
|
|
20870
|
+
return takeObject(ret);
|
|
20871
|
+
}
|
|
20872
|
+
/**
|
|
20873
|
+
* @returns {Array<any> | undefined}
|
|
20874
|
+
*/
|
|
20875
|
+
get prices() {
|
|
20876
|
+
try {
|
|
20877
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
20878
|
+
wasm.verifiedtokendirectpurchaseprices_prices(retptr, this.__wbg_ptr);
|
|
20879
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
20880
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
20881
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
20882
|
+
if (r2) {
|
|
20883
|
+
throw takeObject(r1);
|
|
20884
|
+
}
|
|
20885
|
+
return takeObject(r0);
|
|
20886
|
+
} finally {
|
|
20887
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
20888
|
+
}
|
|
20889
|
+
}
|
|
20890
|
+
}
|
|
20891
|
+
|
|
20774
20892
|
const VerifiedTokenTotalSupplyWASMFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
20775
20893
|
? { register: () => {}, unregister: () => {} }
|
|
20776
20894
|
: new FinalizationRegistry(ptr => wasm.__wbg_verifiedtokentotalsupplywasm_free(ptr >>> 0, 1));
|