dash-platform-sdk 1.6.0-dev.2 → 1.6.0-dev.3
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 +33 -15
- package/bundle.min.js +1 -1
- package/index.d.ts +3 -1
- package/index.js +2 -1
- package/package.json +2 -2
- package/proto/generated/platform.d.ts +128 -2
- package/proto/generated/platform.js +266 -8
- package/src/DashPlatformSDK.d.ts +19 -1
- package/src/DashPlatformSDK.js +28 -10
- package/src/QueryExecutor.d.ts +122 -0
- package/src/QueryExecutor.js +205 -0
- package/src/constants.d.ts +6 -0
- package/src/constants.js +6 -0
- package/src/contestedResources/getContestedResourceVoteState.d.ts +2 -1
- package/src/contestedResources/getContestedResourceVoteState.js +69 -49
- package/src/contestedResources/index.d.ts +4 -1
- package/src/contestedResources/index.js +5 -2
- package/src/dataContracts/getDataContractByIdentifier.d.ts +2 -1
- package/src/dataContracts/getDataContractByIdentifier.js +15 -27
- package/src/dataContracts/index.d.ts +4 -1
- package/src/dataContracts/index.js +5 -2
- package/src/documents/getActionFeeAgreement.d.ts +2 -1
- package/src/documents/getActionFeeAgreement.js +3 -3
- package/src/documents/index.d.ts +12 -8
- package/src/documents/index.js +16 -13
- package/src/documents/query.d.ts +2 -1
- package/src/documents/query.js +16 -8
- package/src/documents/queryAggregate.d.ts +8 -1
- package/src/documents/queryAggregate.js +49 -15
- package/src/documents/queryJoined.d.ts +3 -2
- package/src/documents/queryJoined.js +54 -13
- package/src/documents/queryRanked.d.ts +3 -2
- package/src/documents/queryRanked.js +49 -15
- package/src/documents/v1.d.ts +25 -8
- package/src/documents/v1.js +50 -14
- package/src/grpcConnectionPool.d.ts +24 -4
- package/src/grpcConnectionPool.js +153 -37
- package/src/identities/getIdentityBalance.d.ts +2 -1
- package/src/identities/getIdentityBalance.js +13 -27
- package/src/identities/getIdentityByIdentifier.d.ts +2 -1
- package/src/identities/getIdentityByIdentifier.js +14 -28
- package/src/identities/getIdentityByNonUniquePublicKeyHash.d.ts +2 -1
- package/src/identities/getIdentityByNonUniquePublicKeyHash.js +49 -28
- package/src/identities/getIdentityByPublicKeyHash.d.ts +2 -1
- package/src/identities/getIdentityByPublicKeyHash.js +14 -28
- package/src/identities/getIdentityContractNonce.d.ts +2 -1
- package/src/identities/getIdentityContractNonce.js +10 -27
- package/src/identities/getIdentityNonce.d.ts +2 -1
- package/src/identities/getIdentityNonce.js +10 -27
- package/src/identities/getIdentityPublicKeys.d.ts +2 -1
- package/src/identities/getIdentityPublicKeys.js +16 -29
- package/src/identities/index.d.ts +4 -1
- package/src/identities/index.js +11 -8
- package/src/names/index.d.ts +4 -1
- package/src/names/index.js +8 -5
- package/src/names/registerName.d.ts +2 -1
- package/src/names/registerName.js +4 -4
- package/src/names/searchByIdentity.d.ts +2 -1
- package/src/names/searchByIdentity.js +2 -2
- package/src/names/searchByName.d.ts +2 -1
- package/src/names/searchByName.js +2 -2
- package/src/node/epochInfos.d.ts +2 -1
- package/src/node/epochInfos.js +27 -31
- package/src/node/finalizedEpochInfos.d.ts +4 -3
- package/src/node/finalizedEpochInfos.js +45 -39
- package/src/node/index.d.ts +4 -1
- package/src/node/index.js +7 -4
- package/src/node/totalCredits.d.ts +2 -1
- package/src/node/totalCredits.js +10 -25
- package/src/platformAddresses/getAddressInfo.d.ts +2 -1
- package/src/platformAddresses/getAddressInfo.js +17 -31
- package/src/platformAddresses/getAddressesBranchState.d.ts +2 -1
- package/src/platformAddresses/getAddressesBranchState.js +22 -8
- package/src/platformAddresses/getAddressesInfos.d.ts +2 -1
- package/src/platformAddresses/getAddressesInfos.js +18 -29
- package/src/platformAddresses/getAddressesTrunkState.d.ts +2 -1
- package/src/platformAddresses/getAddressesTrunkState.js +25 -23
- package/src/platformAddresses/getRecentAddressBalanceChanges.d.ts +2 -1
- package/src/platformAddresses/getRecentAddressBalanceChanges.js +26 -26
- package/src/platformAddresses/getRecentCompactedAddressBalanceChanges.d.ts +2 -1
- package/src/platformAddresses/getRecentCompactedAddressBalanceChanges.js +30 -26
- package/src/platformAddresses/index.d.ts +4 -1
- package/src/platformAddresses/index.js +10 -7
- package/src/quorumKeyProvider.d.ts +23 -0
- package/src/quorumKeyProvider.js +28 -0
- package/src/shielded/getMostRecentShieldedAnchor.d.ts +2 -1
- package/src/shielded/getMostRecentShieldedAnchor.js +8 -25
- package/src/shielded/getShieldedAnchors.d.ts +2 -1
- package/src/shielded/getShieldedAnchors.js +8 -25
- package/src/shielded/getShieldedEncryptedNotes.d.ts +2 -1
- package/src/shielded/getShieldedEncryptedNotes.js +16 -30
- package/src/shielded/getShieldedNotesCount.d.ts +2 -1
- package/src/shielded/getShieldedNotesCount.js +8 -25
- package/src/shielded/getShieldedNullifiers.d.ts +2 -1
- package/src/shielded/getShieldedNullifiers.js +14 -28
- package/src/shielded/getShieldedPoolState.d.ts +2 -1
- package/src/shielded/getShieldedPoolState.js +8 -25
- package/src/shielded/index.d.ts +4 -1
- package/src/shielded/index.js +10 -7
- package/src/stateTransitions/index.d.ts +4 -1
- package/src/stateTransitions/index.js +5 -2
- package/src/stateTransitions/waitForStateTransitionResult.d.ts +2 -1
- package/src/stateTransitions/waitForStateTransitionResult.js +42 -44
- package/src/tokens/getIdentitiesTokenBalances.d.ts +2 -1
- package/src/tokens/getIdentitiesTokenBalances.js +17 -28
- package/src/tokens/getIdentityTokensBalances.d.ts +2 -1
- package/src/tokens/getIdentityTokensBalances.js +17 -28
- package/src/tokens/getTokenContractInfo.d.ts +2 -1
- package/src/tokens/getTokenContractInfo.js +16 -30
- package/src/tokens/getTokenDirectPurchasePrices.d.ts +2 -1
- package/src/tokens/getTokenDirectPurchasePrices.js +26 -28
- package/src/tokens/getTokenTotalSupply.d.ts +2 -1
- package/src/tokens/getTokenTotalSupply.js +16 -28
- package/src/tokens/index.d.ts +4 -1
- package/src/tokens/index.js +11 -8
- package/src/utils/ProofError.d.ts +9 -0
- package/src/utils/ProofError.js +10 -0
- package/src/utils/verifyTenderdashProof.js +2 -1
- package/test/unit/SDK.spec.js +42 -0
- package/src/utils/getQuorumPublicKey.d.ts +0 -1
- package/src/utils/getQuorumPublicKey.js +0 -19
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { verifyRecentAddressBalanceChanges } from 'pshenmic-dpp';
|
|
1
|
+
import { verifyRecentAddressBalanceChanges, PlatformAddressWASM } from 'pshenmic-dpp';
|
|
2
2
|
import { GetRecentAddressBalanceChangesRequest } from '../../proto/generated/platform.js';
|
|
3
|
-
import { LATEST_PLATFORM_VERSION } from '../constants.js';
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import verifyTenderdashProof from '../utils/verifyTenderdashProof.js';
|
|
7
|
-
export async function getRecentAddressBalanceChanges(grpcPool, startHeight, startHeightExclusive = false) {
|
|
3
|
+
import { LATEST_PLATFORM_VERSION, RECENT_ADDRESS_BALANCE_CHANGES_LIMIT } from '../constants.js';
|
|
4
|
+
import QueryExecutor from '../QueryExecutor.js';
|
|
5
|
+
export async function getRecentAddressBalanceChanges(grpcPool, quorumKeyProvider, startHeight, startHeightExclusive = false) {
|
|
8
6
|
const getRecentAddressBalanceChangesRequest = GetRecentAddressBalanceChangesRequest.create({
|
|
9
7
|
version: {
|
|
10
8
|
oneofKind: 'v0',
|
|
@@ -15,24 +13,26 @@ export async function getRecentAddressBalanceChanges(grpcPool, startHeight, star
|
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
16
|
+
return await QueryExecutor.build(grpcPool, quorumKeyProvider)
|
|
17
|
+
.setGrpcRequest('getRecentAddressBalanceChanges', getRecentAddressBalanceChangesRequest)
|
|
18
|
+
.setProofVerifier(verifyRecentAddressBalanceChanges, startHeight, startHeightExclusive, RECENT_ADDRESS_BALANCE_CHANGES_LIMIT, true, LATEST_PLATFORM_VERSION)
|
|
19
|
+
.mapResponse(data => {
|
|
20
|
+
if (data.proved) {
|
|
21
|
+
return data.verified.blocks;
|
|
22
|
+
}
|
|
23
|
+
return data.result.addressBalanceUpdateEntries.blockChanges.map(({ blockHeight, changes }) => ({
|
|
24
|
+
blockHeight: BigInt(blockHeight),
|
|
25
|
+
changes: changes.map(({ address, operation }) => {
|
|
26
|
+
if (operation.oneofKind == null) {
|
|
27
|
+
throw new Error('Unexpected address balance change operation');
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
address: PlatformAddressWASM.fromBytes(address),
|
|
31
|
+
operation: operation.oneofKind === 'setBalance' ? 'setCredits' : 'addToCredits',
|
|
32
|
+
credits: BigInt(operation.oneofKind === 'setBalance' ? operation.setBalance : operation.addToBalance)
|
|
33
|
+
};
|
|
34
|
+
})
|
|
35
|
+
}));
|
|
36
|
+
})
|
|
37
|
+
.execute();
|
|
38
38
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { GRPCPool } from '../grpcConnectionPool.js';
|
|
2
|
+
import { QuorumKeyProvider } from '../quorumKeyProvider.js';
|
|
2
3
|
import { CompactedBlockAddressBalanceChanges } from 'pshenmic-dpp';
|
|
3
|
-
export declare function getRecentCompactedAddressBalanceChanges(grpcPool: GRPCPool, startBlockHeight: bigint): Promise<CompactedBlockAddressBalanceChanges[]>;
|
|
4
|
+
export declare function getRecentCompactedAddressBalanceChanges(grpcPool: GRPCPool, quorumKeyProvider: QuorumKeyProvider, startBlockHeight: bigint): Promise<CompactedBlockAddressBalanceChanges[]>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { verifyRecentCompactedAddressBalanceChanges } from 'pshenmic-dpp';
|
|
1
|
+
import { verifyRecentCompactedAddressBalanceChanges, PlatformAddressWASM } from 'pshenmic-dpp';
|
|
2
2
|
import { GetRecentCompactedAddressBalanceChangesRequest } from '../../proto/generated/platform.js';
|
|
3
|
-
import { LATEST_PLATFORM_VERSION } from '../constants.js';
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import verifyTenderdashProof from '../utils/verifyTenderdashProof.js';
|
|
7
|
-
export async function getRecentCompactedAddressBalanceChanges(grpcPool, startBlockHeight) {
|
|
3
|
+
import { LATEST_PLATFORM_VERSION, RECENT_COMPACTED_ADDRESS_BALANCE_CHANGES_LIMIT } from '../constants.js';
|
|
4
|
+
import QueryExecutor from '../QueryExecutor.js';
|
|
5
|
+
export async function getRecentCompactedAddressBalanceChanges(grpcPool, quorumKeyProvider, startBlockHeight) {
|
|
8
6
|
const getRecentCompactedAddressBalanceChangesRequest = GetRecentCompactedAddressBalanceChangesRequest.create({
|
|
9
7
|
version: {
|
|
10
8
|
oneofKind: 'v0',
|
|
@@ -14,24 +12,30 @@ export async function getRecentCompactedAddressBalanceChanges(grpcPool, startBlo
|
|
|
14
12
|
}
|
|
15
13
|
}
|
|
16
14
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
15
|
+
return await QueryExecutor.build(grpcPool, quorumKeyProvider)
|
|
16
|
+
.setGrpcRequest('getRecentCompactedAddressBalanceChanges', getRecentCompactedAddressBalanceChangesRequest)
|
|
17
|
+
.setProofVerifier(verifyRecentCompactedAddressBalanceChanges, startBlockHeight, RECENT_COMPACTED_ADDRESS_BALANCE_CHANGES_LIMIT, LATEST_PLATFORM_VERSION)
|
|
18
|
+
.mapResponse(data => {
|
|
19
|
+
if (data.proved) {
|
|
20
|
+
return data.verified.ranges;
|
|
21
|
+
}
|
|
22
|
+
return data.result.compactedAddressBalanceUpdateEntries.compactedBlockChanges.map(({ startBlockHeight, endBlockHeight, changes }) => ({
|
|
23
|
+
startBlockHeight: BigInt(startBlockHeight),
|
|
24
|
+
endBlockHeight: BigInt(endBlockHeight),
|
|
25
|
+
changes: changes.map(({ address, operation }) => {
|
|
26
|
+
if (operation.oneofKind == null) {
|
|
27
|
+
throw new Error('Unexpected address balance change operation');
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
address: PlatformAddressWASM.fromBytes(address),
|
|
31
|
+
operation: operation.oneofKind,
|
|
32
|
+
setCredits: operation.oneofKind === 'setCredits' ? BigInt(operation.setCredits) : undefined,
|
|
33
|
+
addToCreditsOperations: operation.oneofKind === 'addToCreditsOperations'
|
|
34
|
+
? operation.addToCreditsOperations.entries.map(({ blockHeight, credits }) => ({ blockHeight: BigInt(blockHeight), credits: BigInt(credits) }))
|
|
35
|
+
: []
|
|
36
|
+
};
|
|
37
|
+
})
|
|
38
|
+
}));
|
|
39
|
+
})
|
|
40
|
+
.execute();
|
|
37
41
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { GRPCPool } from '../grpcConnectionPool.js';
|
|
2
|
+
import { QuorumKeyProvider } from '../quorumKeyProvider.js';
|
|
2
3
|
import { BlockAddressBalanceChanges, CompactedBlockAddressBalanceChanges, PlatformAddressLike, StateTransitionWASM, VerifiedAddressesBranchState } from 'pshenmic-dpp';
|
|
3
4
|
import { PlatformAddressesTrunkState, PlatformAddressInfo, PlatformAddressTransitionParamsMap, PlatformAddressTransitionType } from '../../types.js';
|
|
4
5
|
export declare class PlatformAddressesController {
|
|
5
6
|
/** @ignore **/
|
|
6
7
|
grpcPool: GRPCPool;
|
|
7
|
-
|
|
8
|
+
/** @ignore **/
|
|
9
|
+
quorumKeyProvider: QuorumKeyProvider;
|
|
10
|
+
constructor(grpcPool: GRPCPool, quorumKeyProvider: QuorumKeyProvider);
|
|
8
11
|
/**
|
|
9
12
|
* Makes a query for platform address info, returns an object with address, balance and nonce
|
|
10
13
|
*
|
|
@@ -8,8 +8,11 @@ import createStateTransition from './createStateTransition.js';
|
|
|
8
8
|
export class PlatformAddressesController {
|
|
9
9
|
/** @ignore **/
|
|
10
10
|
grpcPool;
|
|
11
|
-
|
|
11
|
+
/** @ignore **/
|
|
12
|
+
quorumKeyProvider;
|
|
13
|
+
constructor(grpcPool, quorumKeyProvider) {
|
|
12
14
|
this.grpcPool = grpcPool;
|
|
15
|
+
this.quorumKeyProvider = quorumKeyProvider;
|
|
13
16
|
}
|
|
14
17
|
/**
|
|
15
18
|
* Makes a query for platform address info, returns an object with address, balance and nonce
|
|
@@ -18,7 +21,7 @@ export class PlatformAddressesController {
|
|
|
18
21
|
* @return {Promise<PlatformAddressInfo>}
|
|
19
22
|
*/
|
|
20
23
|
async getAddressInfo(address) {
|
|
21
|
-
return await getAddressInfo(this.grpcPool, address);
|
|
24
|
+
return await getAddressInfo(this.grpcPool, this.quorumKeyProvider, address);
|
|
22
25
|
}
|
|
23
26
|
/**
|
|
24
27
|
* Makes a query for platform addresses infos, returns array with an object with address, balance and nonce
|
|
@@ -27,7 +30,7 @@ export class PlatformAddressesController {
|
|
|
27
30
|
* @return {Promise<PlatformAddressInfo[]>}
|
|
28
31
|
*/
|
|
29
32
|
async getAddressesInfos(addresses) {
|
|
30
|
-
return await getAddressesInfos(this.grpcPool, addresses);
|
|
33
|
+
return await getAddressesInfos(this.grpcPool, this.quorumKeyProvider, addresses);
|
|
31
34
|
}
|
|
32
35
|
/**
|
|
33
36
|
* Makes a query for the trunk chunk of the address funds tree, used as the entry point
|
|
@@ -40,7 +43,7 @@ export class PlatformAddressesController {
|
|
|
40
43
|
* @return {Promise<PlatformAddressesTrunkState>}
|
|
41
44
|
*/
|
|
42
45
|
async getAddressesTrunkState() {
|
|
43
|
-
return await getAddressesTrunkState(this.grpcPool);
|
|
46
|
+
return await getAddressesTrunkState(this.grpcPool, this.quorumKeyProvider);
|
|
44
47
|
}
|
|
45
48
|
/**
|
|
46
49
|
* Makes a query for a branch chunk of the address funds tree at the given key and depth,
|
|
@@ -57,7 +60,7 @@ export class PlatformAddressesController {
|
|
|
57
60
|
* @return {Promise<VerifiedAddressesBranchState>}
|
|
58
61
|
*/
|
|
59
62
|
async getAddressesBranchState(key, depth, checkpointHeight, expectedRootHash) {
|
|
60
|
-
return await getAddressesBranchState(this.grpcPool, key, depth, checkpointHeight, expectedRootHash);
|
|
63
|
+
return await getAddressesBranchState(this.grpcPool, this.quorumKeyProvider, key, depth, checkpointHeight, expectedRootHash);
|
|
61
64
|
}
|
|
62
65
|
/**
|
|
63
66
|
* Makes a query for recent address balance changes starting from the given block height,
|
|
@@ -68,7 +71,7 @@ export class PlatformAddressesController {
|
|
|
68
71
|
* @return {Promise<BlockAddressBalanceChanges[]>}
|
|
69
72
|
*/
|
|
70
73
|
async getRecentAddressBalanceChanges(startHeight, startHeightExclusive = false) {
|
|
71
|
-
return await getRecentAddressBalanceChanges(this.grpcPool, startHeight, startHeightExclusive);
|
|
74
|
+
return await getRecentAddressBalanceChanges(this.grpcPool, this.quorumKeyProvider, startHeight, startHeightExclusive);
|
|
72
75
|
}
|
|
73
76
|
/**
|
|
74
77
|
* Makes a query for recent compacted address balance changes starting from the given
|
|
@@ -78,7 +81,7 @@ export class PlatformAddressesController {
|
|
|
78
81
|
* @return {Promise<CompactedBlockAddressBalanceChanges[]>}
|
|
79
82
|
*/
|
|
80
83
|
async getRecentCompactedAddressBalanceChanges(startBlockHeight) {
|
|
81
|
-
return await getRecentCompactedAddressBalanceChanges(this.grpcPool, startBlockHeight);
|
|
84
|
+
return await getRecentCompactedAddressBalanceChanges(this.grpcPool, this.quorumKeyProvider, startBlockHeight);
|
|
82
85
|
}
|
|
83
86
|
/**
|
|
84
87
|
* Helper function for creating {StateTransitionWASM} for Platform Address transitions
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Network } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Source of quorum public keys used to verify proof signatures.
|
|
4
|
+
* Implement it to supply keys from your own source (SPV client, local Dash Core node, etc.)
|
|
5
|
+
*/
|
|
6
|
+
export interface QuorumKeyProvider {
|
|
7
|
+
/**
|
|
8
|
+
* @param quorumType {number} LLMQ type of the quorum
|
|
9
|
+
* @param quorumHash {string} hex of proof.quorumHash bytes, same as in Dash Core RPC (`quorum info`)
|
|
10
|
+
*
|
|
11
|
+
* @return {Promise<string>} BLS public key of the quorum in hex
|
|
12
|
+
*/
|
|
13
|
+
getQuorumPublicKey: (quorumType: number, quorumHash: string) => Promise<string>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Default quorum key provider, fetches quorum public keys from Platform Explorer API
|
|
17
|
+
*/
|
|
18
|
+
export declare class PlatformExplorerQuorumKeyProvider implements QuorumKeyProvider {
|
|
19
|
+
#private;
|
|
20
|
+
network: Network;
|
|
21
|
+
constructor(network: Network);
|
|
22
|
+
getQuorumPublicKey(quorumType: number, quorumHash: string): Promise<string>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { fetchWithDetails } from './utils/fetchWithDetails.js';
|
|
2
|
+
/**
|
|
3
|
+
* Default quorum key provider, fetches quorum public keys from Platform Explorer API
|
|
4
|
+
*/
|
|
5
|
+
export class PlatformExplorerQuorumKeyProvider {
|
|
6
|
+
network;
|
|
7
|
+
#cache = {};
|
|
8
|
+
constructor(network) {
|
|
9
|
+
this.network = network;
|
|
10
|
+
}
|
|
11
|
+
async getQuorumPublicKey(quorumType, quorumHash) {
|
|
12
|
+
const cached = this.#cache[`${quorumType}_${quorumHash}`];
|
|
13
|
+
if (cached != null) {
|
|
14
|
+
return cached;
|
|
15
|
+
}
|
|
16
|
+
const url = `https://${this.network === 'mainnet' ? '' : 'testnet.'}platform-explorer.pshenmic.dev/quorum/info?quorumType=${quorumType}&quorumHash=${quorumHash}`;
|
|
17
|
+
const resp = await fetchWithDetails(url, {
|
|
18
|
+
method: 'GET'
|
|
19
|
+
});
|
|
20
|
+
if (resp.status !== 200) {
|
|
21
|
+
throw new Error('Failed to query Platform Explorer for quorum public keys');
|
|
22
|
+
}
|
|
23
|
+
const data = await resp.json();
|
|
24
|
+
const { quorumPublicKey } = data;
|
|
25
|
+
this.#cache[`${quorumType}_${quorumHash}`] = quorumPublicKey;
|
|
26
|
+
return quorumPublicKey;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { GRPCPool } from '../grpcConnectionPool.js';
|
|
2
|
+
import { QuorumKeyProvider } from '../quorumKeyProvider.js';
|
|
2
3
|
import { IdentifierLike } from 'pshenmic-dpp';
|
|
3
|
-
export default function getMostRecentShieldedAnchor(grpcPool: GRPCPool, tokenIdentifier?: IdentifierLike): Promise<Uint8Array | undefined>;
|
|
4
|
+
export default function getMostRecentShieldedAnchor(grpcPool: GRPCPool, quorumKeyProvider: QuorumKeyProvider, tokenIdentifier?: IdentifierLike): Promise<Uint8Array | undefined>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { GetMostRecentShieldedAnchorRequest } from '../../proto/generated/platform.js';
|
|
2
2
|
import { IdentifierWASM, verifyMostRecentShieldedAnchorProof } from 'pshenmic-dpp';
|
|
3
|
-
import { LATEST_PLATFORM_VERSION } from
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import verifyTenderdashProof from "../utils/verifyTenderdashProof.js";
|
|
7
|
-
export default async function getMostRecentShieldedAnchor(grpcPool, tokenIdentifier) {
|
|
3
|
+
import { LATEST_PLATFORM_VERSION } from '../constants.js';
|
|
4
|
+
import QueryExecutor from '../QueryExecutor.js';
|
|
5
|
+
export default async function getMostRecentShieldedAnchor(grpcPool, quorumKeyProvider, tokenIdentifier) {
|
|
8
6
|
const tokenId = tokenIdentifier != null ? new IdentifierWASM(tokenIdentifier) : undefined;
|
|
9
7
|
const getMostRecentShieldedAnchorRequest = GetMostRecentShieldedAnchorRequest.create({
|
|
10
8
|
version: {
|
|
@@ -15,24 +13,9 @@ export default async function getMostRecentShieldedAnchor(grpcPool, tokenIdentif
|
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const { v0 } = version;
|
|
24
|
-
if (v0.result.oneofKind !== 'proof') {
|
|
25
|
-
throw new Error('Unexpected oneOf type returned from DAPI (must be proof)');
|
|
26
|
-
}
|
|
27
|
-
const { result: { proof }, metadata } = v0;
|
|
28
|
-
if (metadata == null) {
|
|
29
|
-
throw new Error('Metadata not found');
|
|
30
|
-
}
|
|
31
|
-
const { rootHash, anchor } = verifyMostRecentShieldedAnchorProof(proof.grovedbProof, true, LATEST_PLATFORM_VERSION, tokenId);
|
|
32
|
-
const quorumPublicKey = await getQuorumPublicKey(grpcPool.network, proof.quorumType, bytesToHex(proof.quorumHash));
|
|
33
|
-
const verify = await verifyTenderdashProof(proof, metadata, rootHash, quorumPublicKey);
|
|
34
|
-
if (!verify) {
|
|
35
|
-
throw new Error('Failed to verify query');
|
|
36
|
-
}
|
|
37
|
-
return anchor;
|
|
16
|
+
return await QueryExecutor.build(grpcPool, quorumKeyProvider)
|
|
17
|
+
.setGrpcRequest('getMostRecentShieldedAnchor', getMostRecentShieldedAnchorRequest)
|
|
18
|
+
.setProofVerifier(verifyMostRecentShieldedAnchorProof, true, LATEST_PLATFORM_VERSION, tokenId)
|
|
19
|
+
.mapResponse(data => data.proved ? data.verified.anchor : data.result.anchor)
|
|
20
|
+
.execute();
|
|
38
21
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { GRPCPool } from '../grpcConnectionPool.js';
|
|
2
|
+
import { QuorumKeyProvider } from '../quorumKeyProvider.js';
|
|
2
3
|
import { IdentifierLike } from 'pshenmic-dpp';
|
|
3
|
-
export default function getShieldedAnchors(grpcPool: GRPCPool, tokenIdentifier?: IdentifierLike): Promise<Uint8Array[]>;
|
|
4
|
+
export default function getShieldedAnchors(grpcPool: GRPCPool, quorumKeyProvider: QuorumKeyProvider, tokenIdentifier?: IdentifierLike): Promise<Uint8Array[]>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { GetShieldedAnchorsRequest } from '../../proto/generated/platform.js';
|
|
2
2
|
import { IdentifierWASM, verifyShieldedAnchorsProof } from 'pshenmic-dpp';
|
|
3
|
-
import { LATEST_PLATFORM_VERSION } from
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import verifyTenderdashProof from "../utils/verifyTenderdashProof.js";
|
|
7
|
-
export default async function getShieldedAnchors(grpcPool, tokenIdentifier) {
|
|
3
|
+
import { LATEST_PLATFORM_VERSION } from '../constants.js';
|
|
4
|
+
import QueryExecutor from '../QueryExecutor.js';
|
|
5
|
+
export default async function getShieldedAnchors(grpcPool, quorumKeyProvider, tokenIdentifier) {
|
|
8
6
|
const tokenId = tokenIdentifier != null ? new IdentifierWASM(tokenIdentifier) : undefined;
|
|
9
7
|
const getShieldedAnchorsRequest = GetShieldedAnchorsRequest.create({
|
|
10
8
|
version: {
|
|
@@ -15,24 +13,9 @@ export default async function getShieldedAnchors(grpcPool, tokenIdentifier) {
|
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const { v0 } = version;
|
|
24
|
-
if (v0.result.oneofKind !== 'proof') {
|
|
25
|
-
throw new Error('Unexpected oneOf type returned from DAPI (must be proof)');
|
|
26
|
-
}
|
|
27
|
-
const { result: { proof }, metadata } = v0;
|
|
28
|
-
if (metadata == null) {
|
|
29
|
-
throw new Error('Metadata not found');
|
|
30
|
-
}
|
|
31
|
-
const { rootHash, anchors } = verifyShieldedAnchorsProof(proof.grovedbProof, true, LATEST_PLATFORM_VERSION, tokenId);
|
|
32
|
-
const quorumPublicKey = await getQuorumPublicKey(grpcPool.network, proof.quorumType, bytesToHex(proof.quorumHash));
|
|
33
|
-
const verify = await verifyTenderdashProof(proof, metadata, rootHash, quorumPublicKey);
|
|
34
|
-
if (!verify) {
|
|
35
|
-
throw new Error('Failed to verify query');
|
|
36
|
-
}
|
|
37
|
-
return anchors;
|
|
16
|
+
return await QueryExecutor.build(grpcPool, quorumKeyProvider)
|
|
17
|
+
.setGrpcRequest('getShieldedAnchors', getShieldedAnchorsRequest)
|
|
18
|
+
.setProofVerifier(verifyShieldedAnchorsProof, true, LATEST_PLATFORM_VERSION, tokenId)
|
|
19
|
+
.mapResponse(data => data.proved ? data.verified.anchors : data.result.anchors.anchors)
|
|
20
|
+
.execute();
|
|
38
21
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GRPCPool } from '../grpcConnectionPool.js';
|
|
2
|
+
import { QuorumKeyProvider } from '../quorumKeyProvider.js';
|
|
2
3
|
import { ShieldedEncryptedNote } from '../../types.js';
|
|
3
4
|
import { IdentifierLike } from 'pshenmic-dpp';
|
|
4
|
-
export default function getShieldedEncryptedNotes(grpcPool: GRPCPool, startIndex: bigint, count: number, tokenIdentifier?: IdentifierLike): Promise<ShieldedEncryptedNote[]>;
|
|
5
|
+
export default function getShieldedEncryptedNotes(grpcPool: GRPCPool, quorumKeyProvider: QuorumKeyProvider, startIndex: bigint, count: number, tokenIdentifier?: IdentifierLike): Promise<ShieldedEncryptedNote[]>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { GetShieldedEncryptedNotesRequest } from '../../proto/generated/platform.js';
|
|
2
2
|
import { IdentifierWASM, verifyShieldedEncryptedNotesProof } from 'pshenmic-dpp';
|
|
3
|
-
import { LATEST_PLATFORM_VERSION, SHIELDED_MAX_NOTES_PER_QUERY } from
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import verifyTenderdashProof from "../utils/verifyTenderdashProof.js";
|
|
7
|
-
export default async function getShieldedEncryptedNotes(grpcPool, startIndex, count, tokenIdentifier) {
|
|
3
|
+
import { LATEST_PLATFORM_VERSION, SHIELDED_MAX_NOTES_PER_QUERY } from '../constants.js';
|
|
4
|
+
import QueryExecutor from '../QueryExecutor.js';
|
|
5
|
+
export default async function getShieldedEncryptedNotes(grpcPool, quorumKeyProvider, startIndex, count, tokenIdentifier) {
|
|
8
6
|
const tokenId = tokenIdentifier != null ? new IdentifierWASM(tokenIdentifier) : undefined;
|
|
9
7
|
const getShieldedEncryptedNotesRequest = GetShieldedEncryptedNotesRequest.create({
|
|
10
8
|
version: {
|
|
@@ -17,29 +15,17 @@ export default async function getShieldedEncryptedNotes(grpcPool, startIndex, co
|
|
|
17
15
|
}
|
|
18
16
|
}
|
|
19
17
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const { rootHash, notes } = verifyShieldedEncryptedNotesProof(proof.grovedbProof, startIndex, count, SHIELDED_MAX_NOTES_PER_QUERY, true, LATEST_PLATFORM_VERSION, tokenId);
|
|
34
|
-
const quorumPublicKey = await getQuorumPublicKey(grpcPool.network, proof.quorumType, bytesToHex(proof.quorumHash));
|
|
35
|
-
const verify = await verifyTenderdashProof(proof, metadata, rootHash, quorumPublicKey);
|
|
36
|
-
if (!verify) {
|
|
37
|
-
throw new Error('Failed to verify query');
|
|
38
|
-
}
|
|
39
|
-
return notes.map(note => ({
|
|
40
|
-
nullifier: note.nullifier,
|
|
41
|
-
cmx: note.cmx,
|
|
42
|
-
encryptedNote: note.encryptedNote,
|
|
43
|
-
cvNet: note.cvNet
|
|
44
|
-
}));
|
|
18
|
+
return await QueryExecutor.build(grpcPool, quorumKeyProvider)
|
|
19
|
+
.setGrpcRequest('getShieldedEncryptedNotes', getShieldedEncryptedNotesRequest)
|
|
20
|
+
.setProofVerifier(verifyShieldedEncryptedNotesProof, startIndex, count, SHIELDED_MAX_NOTES_PER_QUERY, true, LATEST_PLATFORM_VERSION, tokenId)
|
|
21
|
+
.mapResponse(data => {
|
|
22
|
+
const notes = data.proved ? data.verified.notes : data.result.encryptedNotes.entries;
|
|
23
|
+
return notes.map(note => ({
|
|
24
|
+
nullifier: note.nullifier,
|
|
25
|
+
cmx: note.cmx,
|
|
26
|
+
encryptedNote: note.encryptedNote,
|
|
27
|
+
cvNet: note.cvNet
|
|
28
|
+
}));
|
|
29
|
+
})
|
|
30
|
+
.execute();
|
|
45
31
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { GRPCPool } from '../grpcConnectionPool.js';
|
|
2
|
+
import { QuorumKeyProvider } from '../quorumKeyProvider.js';
|
|
2
3
|
import { IdentifierLike } from 'pshenmic-dpp';
|
|
3
|
-
export default function getShieldedNotesCount(grpcPool: GRPCPool, tokenIdentifier?: IdentifierLike): Promise<bigint | undefined>;
|
|
4
|
+
export default function getShieldedNotesCount(grpcPool: GRPCPool, quorumKeyProvider: QuorumKeyProvider, tokenIdentifier?: IdentifierLike): Promise<bigint | undefined>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { GetShieldedNotesCountRequest } from '../../proto/generated/platform.js';
|
|
2
2
|
import { IdentifierWASM, verifyShieldedNotesCountProof } from 'pshenmic-dpp';
|
|
3
|
-
import { LATEST_PLATFORM_VERSION } from
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import verifyTenderdashProof from "../utils/verifyTenderdashProof.js";
|
|
7
|
-
export default async function getShieldedNotesCount(grpcPool, tokenIdentifier) {
|
|
3
|
+
import { LATEST_PLATFORM_VERSION } from '../constants.js';
|
|
4
|
+
import QueryExecutor from '../QueryExecutor.js';
|
|
5
|
+
export default async function getShieldedNotesCount(grpcPool, quorumKeyProvider, tokenIdentifier) {
|
|
8
6
|
const tokenId = tokenIdentifier != null ? new IdentifierWASM(tokenIdentifier) : undefined;
|
|
9
7
|
const getShieldedNotesCountRequest = GetShieldedNotesCountRequest.create({
|
|
10
8
|
version: {
|
|
@@ -15,24 +13,9 @@ export default async function getShieldedNotesCount(grpcPool, tokenIdentifier) {
|
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const { v0 } = version;
|
|
24
|
-
if (v0.result.oneofKind !== 'proof') {
|
|
25
|
-
throw new Error('Unexpected oneOf type returned from DAPI (must be proof)');
|
|
26
|
-
}
|
|
27
|
-
const { result: { proof }, metadata } = v0;
|
|
28
|
-
if (metadata == null) {
|
|
29
|
-
throw new Error('Metadata not found');
|
|
30
|
-
}
|
|
31
|
-
const { rootHash, count } = verifyShieldedNotesCountProof(proof.grovedbProof, true, LATEST_PLATFORM_VERSION, tokenId);
|
|
32
|
-
const quorumPublicKey = await getQuorumPublicKey(grpcPool.network, proof.quorumType, bytesToHex(proof.quorumHash));
|
|
33
|
-
const verify = await verifyTenderdashProof(proof, metadata, rootHash, quorumPublicKey);
|
|
34
|
-
if (!verify) {
|
|
35
|
-
throw new Error('Failed to verify query');
|
|
36
|
-
}
|
|
37
|
-
return count;
|
|
16
|
+
return await QueryExecutor.build(grpcPool, quorumKeyProvider)
|
|
17
|
+
.setGrpcRequest('getShieldedNotesCount', getShieldedNotesCountRequest)
|
|
18
|
+
.setProofVerifier(verifyShieldedNotesCountProof, true, LATEST_PLATFORM_VERSION, tokenId)
|
|
19
|
+
.mapResponse(data => data.proved ? data.verified.count : BigInt(data.result.totalNotesCount))
|
|
20
|
+
.execute();
|
|
38
21
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GRPCPool } from '../grpcConnectionPool.js';
|
|
2
|
+
import { QuorumKeyProvider } from '../quorumKeyProvider.js';
|
|
2
3
|
import { ShieldedNullifierStatus } from '../../types.js';
|
|
3
4
|
import { IdentifierLike } from 'pshenmic-dpp';
|
|
4
|
-
export default function getShieldedNullifiers(grpcPool: GRPCPool, nullifiers: Uint8Array[], tokenIdentifier?: IdentifierLike): Promise<ShieldedNullifierStatus[]>;
|
|
5
|
+
export default function getShieldedNullifiers(grpcPool: GRPCPool, quorumKeyProvider: QuorumKeyProvider, nullifiers: Uint8Array[], tokenIdentifier?: IdentifierLike): Promise<ShieldedNullifierStatus[]>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { GetShieldedNullifiersRequest } from '../../proto/generated/platform.js';
|
|
2
2
|
import { IdentifierWASM, verifyShieldedNullifiersProof } from 'pshenmic-dpp';
|
|
3
|
-
import { LATEST_PLATFORM_VERSION } from
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import verifyTenderdashProof from "../utils/verifyTenderdashProof.js";
|
|
7
|
-
export default async function getShieldedNullifiers(grpcPool, nullifiers, tokenIdentifier) {
|
|
3
|
+
import { LATEST_PLATFORM_VERSION } from '../constants.js';
|
|
4
|
+
import QueryExecutor from '../QueryExecutor.js';
|
|
5
|
+
export default async function getShieldedNullifiers(grpcPool, quorumKeyProvider, nullifiers, tokenIdentifier) {
|
|
8
6
|
const tokenId = tokenIdentifier != null ? new IdentifierWASM(tokenIdentifier) : undefined;
|
|
9
7
|
const getShieldedNullifiersRequest = GetShieldedNullifiersRequest.create({
|
|
10
8
|
version: {
|
|
@@ -16,27 +14,15 @@ export default async function getShieldedNullifiers(grpcPool, nullifiers, tokenI
|
|
|
16
14
|
}
|
|
17
15
|
}
|
|
18
16
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
throw new Error('Metadata not found');
|
|
31
|
-
}
|
|
32
|
-
const { rootHash, nullifiers: nullifiersStatuses } = verifyShieldedNullifiersProof(proof.grovedbProof, nullifiers, true, LATEST_PLATFORM_VERSION, tokenId);
|
|
33
|
-
const quorumPublicKey = await getQuorumPublicKey(grpcPool.network, proof.quorumType, bytesToHex(proof.quorumHash));
|
|
34
|
-
const verify = await verifyTenderdashProof(proof, metadata, rootHash, quorumPublicKey);
|
|
35
|
-
if (!verify) {
|
|
36
|
-
throw new Error('Failed to verify query');
|
|
37
|
-
}
|
|
38
|
-
return nullifiersStatuses.map(entry => ({
|
|
39
|
-
nullifier: entry.nullifier,
|
|
40
|
-
isSpent: entry.isSpent
|
|
41
|
-
}));
|
|
17
|
+
return await QueryExecutor.build(grpcPool, quorumKeyProvider)
|
|
18
|
+
.setGrpcRequest('getShieldedNullifiers', getShieldedNullifiersRequest)
|
|
19
|
+
.setProofVerifier(verifyShieldedNullifiersProof, nullifiers, true, LATEST_PLATFORM_VERSION, tokenId)
|
|
20
|
+
.mapResponse(data => {
|
|
21
|
+
const nullifiersStatuses = data.proved ? data.verified.nullifiers : data.result.nullifierStatuses.entries;
|
|
22
|
+
return nullifiersStatuses.map(entry => ({
|
|
23
|
+
nullifier: entry.nullifier,
|
|
24
|
+
isSpent: entry.isSpent
|
|
25
|
+
}));
|
|
26
|
+
})
|
|
27
|
+
.execute();
|
|
42
28
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { GRPCPool } from '../grpcConnectionPool.js';
|
|
2
|
+
import { QuorumKeyProvider } from '../quorumKeyProvider.js';
|
|
2
3
|
import { IdentifierLike } from 'pshenmic-dpp';
|
|
3
|
-
export default function getShieldedPoolState(grpcPool: GRPCPool, tokenIdentifier?: IdentifierLike): Promise<bigint | undefined>;
|
|
4
|
+
export default function getShieldedPoolState(grpcPool: GRPCPool, quorumKeyProvider: QuorumKeyProvider, tokenIdentifier?: IdentifierLike): Promise<bigint | undefined>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { GetShieldedPoolStateRequest } from '../../proto/generated/platform.js';
|
|
2
|
-
import
|
|
3
|
-
import bytesToHex from "../utils/bytesToHex.js";
|
|
4
|
-
import verifyTenderdashProof from "../utils/verifyTenderdashProof.js";
|
|
2
|
+
import QueryExecutor from '../QueryExecutor.js';
|
|
5
3
|
import { IdentifierWASM, verifyShieldedPoolStateProof } from 'pshenmic-dpp';
|
|
6
|
-
import { LATEST_PLATFORM_VERSION } from
|
|
7
|
-
export default async function getShieldedPoolState(grpcPool, tokenIdentifier) {
|
|
4
|
+
import { LATEST_PLATFORM_VERSION } from '../constants.js';
|
|
5
|
+
export default async function getShieldedPoolState(grpcPool, quorumKeyProvider, tokenIdentifier) {
|
|
8
6
|
const tokenId = tokenIdentifier != null ? new IdentifierWASM(tokenIdentifier) : undefined;
|
|
9
7
|
const getShieldedPoolStateRequest = GetShieldedPoolStateRequest.create({
|
|
10
8
|
version: {
|
|
@@ -15,24 +13,9 @@ export default async function getShieldedPoolState(grpcPool, tokenIdentifier) {
|
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const { v0 } = version;
|
|
24
|
-
if (v0.result.oneofKind !== 'proof') {
|
|
25
|
-
throw new Error('Unexpected oneOf type returned from DAPI (must be proof)');
|
|
26
|
-
}
|
|
27
|
-
const { result: { proof }, metadata } = v0;
|
|
28
|
-
if (metadata == null) {
|
|
29
|
-
throw new Error('Metadata not found');
|
|
30
|
-
}
|
|
31
|
-
const { rootHash, totalBalance } = verifyShieldedPoolStateProof(proof.grovedbProof, true, LATEST_PLATFORM_VERSION, tokenId);
|
|
32
|
-
const quorumPublicKey = await getQuorumPublicKey(grpcPool.network, proof.quorumType, bytesToHex(proof.quorumHash));
|
|
33
|
-
const verify = await verifyTenderdashProof(proof, metadata, rootHash, quorumPublicKey);
|
|
34
|
-
if (!verify) {
|
|
35
|
-
throw new Error('Failed to verify query');
|
|
36
|
-
}
|
|
37
|
-
return totalBalance;
|
|
16
|
+
return await QueryExecutor.build(grpcPool, quorumKeyProvider)
|
|
17
|
+
.setGrpcRequest('getShieldedPoolState', getShieldedPoolStateRequest)
|
|
18
|
+
.setProofVerifier(verifyShieldedPoolStateProof, true, LATEST_PLATFORM_VERSION, tokenId)
|
|
19
|
+
.mapResponse(data => data.proved ? data.verified.totalBalance : BigInt(data.result.totalBalance))
|
|
20
|
+
.execute();
|
|
38
21
|
}
|