@dashevo/evo-sdk 2.1.3 → 3.0.0-dev.10
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/dist/addresses/facade.d.ts +210 -0
- package/dist/addresses/facade.js +239 -0
- package/dist/contracts/facade.d.ts +9 -17
- package/dist/contracts/facade.js +4 -6
- package/dist/documents/facade.d.ts +23 -38
- package/dist/documents/facade.js +4 -10
- package/dist/dpns/facade.d.ts +10 -13
- package/dist/dpns/facade.js +4 -6
- package/dist/epoch/facade.d.ts +12 -34
- package/dist/epoch/facade.js +16 -19
- package/dist/evo-sdk.module.js +1 -1
- package/dist/evo-sdk.module.js.map +1 -1
- package/dist/group/facade.d.ts +19 -72
- package/dist/group/facade.js +28 -38
- package/dist/identities/facade.d.ts +28 -53
- package/dist/identities/facade.js +12 -21
- package/dist/protocol/facade.d.ts +5 -10
- package/dist/protocol/facade.js +10 -6
- package/dist/sdk.d.ts +7 -2
- package/dist/sdk.js +13 -0
- package/dist/system/facade.d.ts +10 -9
- package/dist/system/facade.js +36 -9
- package/dist/tokens/facade.d.ts +46 -48
- package/dist/tokens/facade.js +2 -2
- package/dist/voting/facade.d.ts +8 -46
- package/dist/voting/facade.js +12 -20
- package/dist/wallet/functions.d.ts +16 -15
- package/dist/wallet/functions.js +10 -10
- package/dist/wasm.d.ts +0 -1
- package/package.json +4 -5
package/dist/group/facade.d.ts
CHANGED
|
@@ -1,77 +1,24 @@
|
|
|
1
|
+
import * as wasm from '../wasm.js';
|
|
1
2
|
import type { EvoSDK } from '../sdk.js';
|
|
2
3
|
export declare class GroupFacade {
|
|
3
4
|
private sdk;
|
|
4
5
|
constructor(sdk: EvoSDK);
|
|
5
|
-
info(contractId:
|
|
6
|
-
infoWithProof(contractId:
|
|
7
|
-
infos(
|
|
8
|
-
infosWithProof(
|
|
9
|
-
members(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}): Promise<any>;
|
|
24
|
-
identityGroupsWithProof(identityId: string, opts?: {
|
|
25
|
-
memberDataContracts?: string[];
|
|
26
|
-
ownerDataContracts?: string[];
|
|
27
|
-
moderatorDataContracts?: string[];
|
|
28
|
-
}): Promise<any>;
|
|
29
|
-
actions(contractId: string, groupContractPosition: number, status: string, opts?: {
|
|
30
|
-
startAtInfo?: unknown;
|
|
31
|
-
count?: number;
|
|
32
|
-
}): Promise<any>;
|
|
33
|
-
actionsWithProof(contractId: string, groupContractPosition: number, status: string, opts?: {
|
|
34
|
-
startAtInfo?: unknown;
|
|
35
|
-
count?: number;
|
|
36
|
-
}): Promise<any>;
|
|
37
|
-
actionSigners(contractId: string, groupContractPosition: number, status: string, actionId: string): Promise<any>;
|
|
38
|
-
actionSignersWithProof(contractId: string, groupContractPosition: number, status: string, actionId: string): Promise<any>;
|
|
39
|
-
groupsDataContracts(dataContractIds: string[]): Promise<any>;
|
|
40
|
-
groupsDataContractsWithProof(dataContractIds: string[]): Promise<any>;
|
|
41
|
-
contestedResources(params: {
|
|
42
|
-
documentTypeName: string;
|
|
43
|
-
contractId: string;
|
|
44
|
-
indexName: string;
|
|
45
|
-
startAtValue?: Uint8Array;
|
|
46
|
-
limit?: number;
|
|
47
|
-
orderAscending?: boolean;
|
|
48
|
-
}): Promise<any>;
|
|
49
|
-
contestedResourcesWithProof(params: {
|
|
50
|
-
documentTypeName: string;
|
|
51
|
-
contractId: string;
|
|
52
|
-
indexName: string;
|
|
53
|
-
startAtValue?: Uint8Array;
|
|
54
|
-
limit?: number;
|
|
55
|
-
orderAscending?: boolean;
|
|
56
|
-
}): Promise<any>;
|
|
57
|
-
contestedResourceVotersForIdentity(params: {
|
|
58
|
-
contractId: string;
|
|
59
|
-
documentTypeName: string;
|
|
60
|
-
indexName: string;
|
|
61
|
-
indexValues: any[];
|
|
62
|
-
contestantId: string;
|
|
63
|
-
startAtVoterInfo?: string;
|
|
64
|
-
limit?: number;
|
|
65
|
-
orderAscending?: boolean;
|
|
66
|
-
}): Promise<any>;
|
|
67
|
-
contestedResourceVotersForIdentityWithProof(params: {
|
|
68
|
-
contractId: string;
|
|
69
|
-
documentTypeName: string;
|
|
70
|
-
indexName: string;
|
|
71
|
-
indexValues: any[];
|
|
72
|
-
contestantId: string;
|
|
73
|
-
startAtIdentifierInfo?: string;
|
|
74
|
-
count?: number;
|
|
75
|
-
orderAscending?: boolean;
|
|
76
|
-
}): Promise<any>;
|
|
6
|
+
info(contractId: wasm.IdentifierLike, groupContractPosition: number): Promise<wasm.Group | undefined>;
|
|
7
|
+
infoWithProof(contractId: wasm.IdentifierLike, groupContractPosition: number): Promise<wasm.ProofMetadataResponseTyped<wasm.Group | undefined>>;
|
|
8
|
+
infos(query: wasm.GroupInfosQuery): Promise<Map<number, wasm.Group | undefined>>;
|
|
9
|
+
infosWithProof(query: wasm.GroupInfosQuery): Promise<wasm.ProofMetadataResponseTyped<Map<number, wasm.Group | undefined>>>;
|
|
10
|
+
members(query: wasm.GroupMembersQuery): Promise<Map<wasm.Identifier, bigint>>;
|
|
11
|
+
membersWithProof(query: wasm.GroupMembersQuery): Promise<wasm.ProofMetadataResponseTyped<Map<wasm.Identifier, bigint>>>;
|
|
12
|
+
identityGroups(query: wasm.IdentityGroupsQuery): Promise<wasm.IdentityGroupInfo[]>;
|
|
13
|
+
identityGroupsWithProof(query: wasm.IdentityGroupsQuery): Promise<wasm.ProofMetadataResponseTyped<wasm.IdentityGroupInfo[]>>;
|
|
14
|
+
actions(query: wasm.GroupActionsQuery): Promise<Map<wasm.Identifier, wasm.GroupAction | undefined>>;
|
|
15
|
+
actionsWithProof(query: wasm.GroupActionsQuery): Promise<wasm.ProofMetadataResponseTyped<Map<wasm.Identifier, wasm.GroupAction | undefined>>>;
|
|
16
|
+
actionSigners(query: wasm.GroupActionSignersQuery): Promise<Map<wasm.Identifier, bigint>>;
|
|
17
|
+
actionSignersWithProof(query: wasm.GroupActionSignersQuery): Promise<wasm.ProofMetadataResponseTyped<Map<wasm.Identifier, bigint>>>;
|
|
18
|
+
groupsDataContracts(dataContractIds: wasm.IdentifierLike[]): Promise<Map<wasm.Identifier, Map<number, wasm.Group | undefined>>>;
|
|
19
|
+
groupsDataContractsWithProof(dataContractIds: wasm.IdentifierLike[]): Promise<wasm.ProofMetadataResponseTyped<Map<wasm.Identifier, Map<number, wasm.Group | undefined>>>>;
|
|
20
|
+
contestedResources(query: wasm.VotePollsByDocumentTypeQuery): Promise<any[]>;
|
|
21
|
+
contestedResourcesWithProof(query: wasm.VotePollsByDocumentTypeQuery): Promise<wasm.ProofMetadataResponseTyped<Array<any>>>;
|
|
22
|
+
contestedResourceVotersForIdentity(query: wasm.ContestedResourceVotersForIdentityQuery): Promise<wasm.Identifier[]>;
|
|
23
|
+
contestedResourceVotersForIdentityWithProof(query: wasm.ContestedResourceVotersForIdentityQuery): Promise<wasm.ProofMetadataResponseTyped<wasm.Identifier[]>>;
|
|
77
24
|
}
|
package/dist/group/facade.js
CHANGED
|
@@ -8,51 +8,45 @@ export class GroupFacade {
|
|
|
8
8
|
const w = await this.sdk.getWasmSdkConnected();
|
|
9
9
|
return w.getGroupInfoWithProofInfo(contractId, groupContractPosition);
|
|
10
10
|
}
|
|
11
|
-
async infos(
|
|
11
|
+
async infos(query) {
|
|
12
12
|
const w = await this.sdk.getWasmSdkConnected();
|
|
13
|
-
return w.getGroupInfos(
|
|
13
|
+
return w.getGroupInfos(query);
|
|
14
14
|
}
|
|
15
|
-
async infosWithProof(
|
|
15
|
+
async infosWithProof(query) {
|
|
16
16
|
const w = await this.sdk.getWasmSdkConnected();
|
|
17
|
-
return w.getGroupInfosWithProofInfo(
|
|
17
|
+
return w.getGroupInfosWithProofInfo(query);
|
|
18
18
|
}
|
|
19
|
-
async members(
|
|
20
|
-
const { memberIds, startAt, limit } = opts;
|
|
19
|
+
async members(query) {
|
|
21
20
|
const w = await this.sdk.getWasmSdkConnected();
|
|
22
|
-
return w.getGroupMembers(
|
|
21
|
+
return w.getGroupMembers(query);
|
|
23
22
|
}
|
|
24
|
-
async membersWithProof(
|
|
25
|
-
const { memberIds, startAt, limit } = opts;
|
|
23
|
+
async membersWithProof(query) {
|
|
26
24
|
const w = await this.sdk.getWasmSdkConnected();
|
|
27
|
-
return w.getGroupMembersWithProofInfo(
|
|
25
|
+
return w.getGroupMembersWithProofInfo(query);
|
|
28
26
|
}
|
|
29
|
-
async identityGroups(
|
|
30
|
-
const { memberDataContracts, ownerDataContracts, moderatorDataContracts } = opts;
|
|
27
|
+
async identityGroups(query) {
|
|
31
28
|
const w = await this.sdk.getWasmSdkConnected();
|
|
32
|
-
return w.getIdentityGroups(
|
|
29
|
+
return w.getIdentityGroups(query);
|
|
33
30
|
}
|
|
34
|
-
async identityGroupsWithProof(
|
|
35
|
-
const { memberDataContracts, ownerDataContracts, moderatorDataContracts } = opts;
|
|
31
|
+
async identityGroupsWithProof(query) {
|
|
36
32
|
const w = await this.sdk.getWasmSdkConnected();
|
|
37
|
-
return w.getIdentityGroupsWithProofInfo(
|
|
33
|
+
return w.getIdentityGroupsWithProofInfo(query);
|
|
38
34
|
}
|
|
39
|
-
async actions(
|
|
40
|
-
const { startAtInfo, count } = opts;
|
|
35
|
+
async actions(query) {
|
|
41
36
|
const w = await this.sdk.getWasmSdkConnected();
|
|
42
|
-
return w.getGroupActions(
|
|
37
|
+
return w.getGroupActions(query);
|
|
43
38
|
}
|
|
44
|
-
async actionsWithProof(
|
|
45
|
-
const { startAtInfo, count } = opts;
|
|
39
|
+
async actionsWithProof(query) {
|
|
46
40
|
const w = await this.sdk.getWasmSdkConnected();
|
|
47
|
-
return w.getGroupActionsWithProofInfo(
|
|
41
|
+
return w.getGroupActionsWithProofInfo(query);
|
|
48
42
|
}
|
|
49
|
-
async actionSigners(
|
|
43
|
+
async actionSigners(query) {
|
|
50
44
|
const w = await this.sdk.getWasmSdkConnected();
|
|
51
|
-
return w.getGroupActionSigners(
|
|
45
|
+
return w.getGroupActionSigners(query);
|
|
52
46
|
}
|
|
53
|
-
async actionSignersWithProof(
|
|
47
|
+
async actionSignersWithProof(query) {
|
|
54
48
|
const w = await this.sdk.getWasmSdkConnected();
|
|
55
|
-
return w.getGroupActionSignersWithProofInfo(
|
|
49
|
+
return w.getGroupActionSignersWithProofInfo(query);
|
|
56
50
|
}
|
|
57
51
|
async groupsDataContracts(dataContractIds) {
|
|
58
52
|
const w = await this.sdk.getWasmSdkConnected();
|
|
@@ -62,24 +56,20 @@ export class GroupFacade {
|
|
|
62
56
|
const w = await this.sdk.getWasmSdkConnected();
|
|
63
57
|
return w.getGroupsDataContractsWithProofInfo(dataContractIds);
|
|
64
58
|
}
|
|
65
|
-
async contestedResources(
|
|
66
|
-
const { documentTypeName, contractId, indexName, startAtValue, limit, orderAscending } = params;
|
|
59
|
+
async contestedResources(query) {
|
|
67
60
|
const w = await this.sdk.getWasmSdkConnected();
|
|
68
|
-
return w.getContestedResources(
|
|
61
|
+
return w.getContestedResources(query);
|
|
69
62
|
}
|
|
70
|
-
async contestedResourcesWithProof(
|
|
71
|
-
const { documentTypeName, contractId, indexName, startAtValue, limit, orderAscending } = params;
|
|
63
|
+
async contestedResourcesWithProof(query) {
|
|
72
64
|
const w = await this.sdk.getWasmSdkConnected();
|
|
73
|
-
return w.getContestedResourcesWithProofInfo(
|
|
65
|
+
return w.getContestedResourcesWithProofInfo(query);
|
|
74
66
|
}
|
|
75
|
-
async contestedResourceVotersForIdentity(
|
|
76
|
-
const { contractId, documentTypeName, indexName, indexValues, contestantId, startAtVoterInfo, limit, orderAscending } = params;
|
|
67
|
+
async contestedResourceVotersForIdentity(query) {
|
|
77
68
|
const w = await this.sdk.getWasmSdkConnected();
|
|
78
|
-
return w.getContestedResourceVotersForIdentity(
|
|
69
|
+
return w.getContestedResourceVotersForIdentity(query);
|
|
79
70
|
}
|
|
80
|
-
async contestedResourceVotersForIdentityWithProof(
|
|
81
|
-
const { contractId, documentTypeName, indexName, indexValues, contestantId, startAtIdentifierInfo, count, orderAscending } = params;
|
|
71
|
+
async contestedResourceVotersForIdentityWithProof(query) {
|
|
82
72
|
const w = await this.sdk.getWasmSdkConnected();
|
|
83
|
-
return w.getContestedResourceVotersForIdentityWithProofInfo(
|
|
73
|
+
return w.getContestedResourceVotersForIdentityWithProofInfo(query);
|
|
84
74
|
}
|
|
85
75
|
}
|
|
@@ -3,73 +3,48 @@ import type { EvoSDK } from '../sdk.js';
|
|
|
3
3
|
export declare class IdentitiesFacade {
|
|
4
4
|
private sdk;
|
|
5
5
|
constructor(sdk: EvoSDK);
|
|
6
|
-
fetch(identityId:
|
|
7
|
-
fetchWithProof(identityId:
|
|
8
|
-
fetchUnproved(identityId:
|
|
9
|
-
getKeys(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
balanceWithProof(identityId: string): Promise<any>;
|
|
30
|
-
balances(identityIds: string[]): Promise<any>;
|
|
31
|
-
balancesWithProof(identityIds: string[]): Promise<any>;
|
|
32
|
-
balanceAndRevision(identityId: string): Promise<any>;
|
|
33
|
-
balanceAndRevisionWithProof(identityId: string): Promise<any>;
|
|
34
|
-
byPublicKeyHash(publicKeyHash: string): Promise<wasm.IdentityWasm>;
|
|
35
|
-
byPublicKeyHashWithProof(publicKeyHash: string): Promise<any>;
|
|
36
|
-
byNonUniquePublicKeyHash(publicKeyHash: string, opts?: {
|
|
37
|
-
startAfter?: string;
|
|
38
|
-
}): Promise<any>;
|
|
39
|
-
byNonUniquePublicKeyHashWithProof(publicKeyHash: string, opts?: {
|
|
40
|
-
startAfter?: string;
|
|
41
|
-
}): Promise<any>;
|
|
42
|
-
contractKeys(args: {
|
|
43
|
-
identityIds: string[];
|
|
44
|
-
contractId: string;
|
|
45
|
-
purposes?: number[];
|
|
46
|
-
}): Promise<any>;
|
|
47
|
-
contractKeysWithProof(args: {
|
|
48
|
-
identityIds: string[];
|
|
49
|
-
contractId: string;
|
|
50
|
-
purposes?: number[];
|
|
51
|
-
}): Promise<any>;
|
|
52
|
-
tokenBalances(identityId: string, tokenIds: string[]): Promise<any>;
|
|
53
|
-
tokenBalancesWithProof(identityId: string, tokenIds: string[]): Promise<any>;
|
|
6
|
+
fetch(identityId: wasm.IdentifierLike): Promise<wasm.Identity | undefined>;
|
|
7
|
+
fetchWithProof(identityId: wasm.IdentifierLike): Promise<wasm.ProofMetadataResponseTyped<wasm.Identity>>;
|
|
8
|
+
fetchUnproved(identityId: wasm.IdentifierLike): Promise<wasm.Identity>;
|
|
9
|
+
getKeys(query: wasm.IdentityKeysQuery): Promise<wasm.IdentityKeyInfo[]>;
|
|
10
|
+
getKeysWithProof(query: wasm.IdentityKeysQuery): Promise<wasm.ProofMetadataResponseTyped<wasm.IdentityKeyInfo[]>>;
|
|
11
|
+
nonce(identityId: wasm.IdentifierLike): Promise<bigint | null>;
|
|
12
|
+
nonceWithProof(identityId: wasm.IdentifierLike): Promise<wasm.ProofMetadataResponseTyped<bigint | null>>;
|
|
13
|
+
contractNonce(identityId: wasm.IdentifierLike, contractId: wasm.IdentifierLike): Promise<bigint | null>;
|
|
14
|
+
contractNonceWithProof(identityId: wasm.IdentifierLike, contractId: wasm.IdentifierLike): Promise<wasm.ProofMetadataResponseTyped<bigint | null>>;
|
|
15
|
+
balance(identityId: wasm.IdentifierLike): Promise<bigint | null>;
|
|
16
|
+
balanceWithProof(identityId: wasm.IdentifierLike): Promise<wasm.ProofMetadataResponseTyped<bigint | null>>;
|
|
17
|
+
balances(identityIds: wasm.IdentifierLike[]): Promise<Map<wasm.Identifier, bigint | null>>;
|
|
18
|
+
balancesWithProof(identityIds: wasm.IdentifierLike[]): Promise<wasm.ProofMetadataResponseTyped<Map<wasm.Identifier, bigint | null>>>;
|
|
19
|
+
balanceAndRevision(identityId: wasm.IdentifierLike): Promise<wasm.IdentityBalanceAndRevision | null>;
|
|
20
|
+
balanceAndRevisionWithProof(identityId: wasm.IdentifierLike): Promise<wasm.ProofMetadataResponseTyped<wasm.IdentityBalanceAndRevision | null>>;
|
|
21
|
+
byPublicKeyHash(publicKeyHash: string | Uint8Array): Promise<wasm.Identity | null>;
|
|
22
|
+
byPublicKeyHashWithProof(publicKeyHash: string | Uint8Array): Promise<wasm.ProofMetadataResponseTyped<wasm.Identity | null>>;
|
|
23
|
+
byNonUniquePublicKeyHash(publicKeyHash: string | Uint8Array, startAfter?: wasm.IdentifierLike): Promise<wasm.Identity[]>;
|
|
24
|
+
byNonUniquePublicKeyHashWithProof(publicKeyHash: string | Uint8Array, startAfter?: wasm.IdentifierLike): Promise<wasm.ProofMetadataResponseTyped<wasm.Identity[]>>;
|
|
25
|
+
contractKeys(query: wasm.IdentitiesContractKeysQuery): Promise<wasm.IdentityContractKeys[]>;
|
|
26
|
+
contractKeysWithProof(query: wasm.IdentitiesContractKeysQuery): Promise<wasm.ProofMetadataResponseTyped<wasm.IdentityContractKeys[]>>;
|
|
27
|
+
tokenBalances(identityId: wasm.IdentifierLike, tokenIds: wasm.IdentifierLike[]): Promise<Map<wasm.Identifier, bigint>>;
|
|
28
|
+
tokenBalancesWithProof(identityId: wasm.IdentifierLike, tokenIds: wasm.IdentifierLike[]): Promise<wasm.ProofMetadataResponseTyped<Map<wasm.Identifier, bigint>>>;
|
|
54
29
|
create(args: {
|
|
55
30
|
assetLockProof: unknown;
|
|
56
31
|
assetLockPrivateKeyWif: string;
|
|
57
32
|
publicKeys: unknown[];
|
|
58
33
|
}): Promise<any>;
|
|
59
34
|
topUp(args: {
|
|
60
|
-
identityId:
|
|
35
|
+
identityId: wasm.IdentifierLike;
|
|
61
36
|
assetLockProof: unknown;
|
|
62
37
|
assetLockPrivateKeyWif: string;
|
|
63
38
|
}): Promise<any>;
|
|
64
39
|
creditTransfer(args: {
|
|
65
|
-
senderId:
|
|
66
|
-
recipientId:
|
|
40
|
+
senderId: wasm.IdentifierLike;
|
|
41
|
+
recipientId: wasm.IdentifierLike;
|
|
67
42
|
amount: number | bigint | string;
|
|
68
43
|
privateKeyWif: string;
|
|
69
44
|
keyId?: number;
|
|
70
45
|
}): Promise<any>;
|
|
71
46
|
creditWithdrawal(args: {
|
|
72
|
-
identityId:
|
|
47
|
+
identityId: wasm.IdentifierLike;
|
|
73
48
|
toAddress: string;
|
|
74
49
|
amount: number | bigint | string;
|
|
75
50
|
coreFeePerByte?: number;
|
|
@@ -77,7 +52,7 @@ export declare class IdentitiesFacade {
|
|
|
77
52
|
keyId?: number;
|
|
78
53
|
}): Promise<any>;
|
|
79
54
|
update(args: {
|
|
80
|
-
identityId:
|
|
55
|
+
identityId: wasm.IdentifierLike;
|
|
81
56
|
addPublicKeys?: unknown[];
|
|
82
57
|
disablePublicKeyIds?: number[];
|
|
83
58
|
privateKeyWif: string;
|
|
@@ -15,16 +15,13 @@ export class IdentitiesFacade {
|
|
|
15
15
|
const w = await this.sdk.getWasmSdkConnected();
|
|
16
16
|
return w.getIdentityUnproved(identityId);
|
|
17
17
|
}
|
|
18
|
-
async getKeys(
|
|
19
|
-
const { identityId, keyRequestType, specificKeyIds, searchPurposeMap, limit, offset } = args;
|
|
20
|
-
const mapJson = asJsonString(searchPurposeMap);
|
|
18
|
+
async getKeys(query) {
|
|
21
19
|
const w = await this.sdk.getWasmSdkConnected();
|
|
22
|
-
return w.getIdentityKeys(
|
|
20
|
+
return w.getIdentityKeys(query);
|
|
23
21
|
}
|
|
24
|
-
async getKeysWithProof(
|
|
25
|
-
const { identityId, keyRequestType, specificKeyIds, limit, offset } = args;
|
|
22
|
+
async getKeysWithProof(query) {
|
|
26
23
|
const w = await this.sdk.getWasmSdkConnected();
|
|
27
|
-
return w.getIdentityKeysWithProofInfo(
|
|
24
|
+
return w.getIdentityKeysWithProofInfo(query);
|
|
28
25
|
}
|
|
29
26
|
async nonce(identityId) {
|
|
30
27
|
const w = await this.sdk.getWasmSdkConnected();
|
|
@@ -74,27 +71,21 @@ export class IdentitiesFacade {
|
|
|
74
71
|
const w = await this.sdk.getWasmSdkConnected();
|
|
75
72
|
return w.getIdentityByPublicKeyHashWithProofInfo(publicKeyHash);
|
|
76
73
|
}
|
|
77
|
-
async byNonUniquePublicKeyHash(publicKeyHash,
|
|
78
|
-
const { startAfter } = opts;
|
|
74
|
+
async byNonUniquePublicKeyHash(publicKeyHash, startAfter) {
|
|
79
75
|
const w = await this.sdk.getWasmSdkConnected();
|
|
80
|
-
return w.getIdentityByNonUniquePublicKeyHash(publicKeyHash, startAfter
|
|
76
|
+
return w.getIdentityByNonUniquePublicKeyHash(publicKeyHash, startAfter);
|
|
81
77
|
}
|
|
82
|
-
async byNonUniquePublicKeyHashWithProof(publicKeyHash,
|
|
83
|
-
const { startAfter } = opts;
|
|
78
|
+
async byNonUniquePublicKeyHashWithProof(publicKeyHash, startAfter) {
|
|
84
79
|
const w = await this.sdk.getWasmSdkConnected();
|
|
85
|
-
return w.getIdentityByNonUniquePublicKeyHashWithProofInfo(publicKeyHash, startAfter
|
|
80
|
+
return w.getIdentityByNonUniquePublicKeyHashWithProofInfo(publicKeyHash, startAfter || undefined);
|
|
86
81
|
}
|
|
87
|
-
async contractKeys(
|
|
88
|
-
const { identityIds, contractId, purposes } = args;
|
|
89
|
-
const purposesArray = purposes && purposes.length > 0 ? Uint32Array.from(purposes) : null;
|
|
82
|
+
async contractKeys(query) {
|
|
90
83
|
const w = await this.sdk.getWasmSdkConnected();
|
|
91
|
-
return w.getIdentitiesContractKeys(
|
|
84
|
+
return w.getIdentitiesContractKeys(query);
|
|
92
85
|
}
|
|
93
|
-
async contractKeysWithProof(
|
|
94
|
-
const { identityIds, contractId, purposes } = args;
|
|
95
|
-
const purposesArray = purposes && purposes.length > 0 ? Uint32Array.from(purposes) : null;
|
|
86
|
+
async contractKeysWithProof(query) {
|
|
96
87
|
const w = await this.sdk.getWasmSdkConnected();
|
|
97
|
-
return w.getIdentitiesContractKeysWithProofInfo(
|
|
88
|
+
return w.getIdentitiesContractKeysWithProofInfo(query);
|
|
98
89
|
}
|
|
99
90
|
async tokenBalances(identityId, tokenIds) {
|
|
100
91
|
const w = await this.sdk.getWasmSdkConnected();
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import type { EvoSDK } from '../sdk.js';
|
|
2
|
+
import * as wasm from '../wasm.js';
|
|
2
3
|
export declare class ProtocolFacade {
|
|
3
4
|
private sdk;
|
|
4
5
|
constructor(sdk: EvoSDK);
|
|
5
|
-
versionUpgradeState(): Promise<
|
|
6
|
-
versionUpgradeStateWithProof(): Promise<
|
|
7
|
-
versionUpgradeVoteStatus(
|
|
8
|
-
|
|
9
|
-
count: number;
|
|
10
|
-
}): Promise<any>;
|
|
11
|
-
versionUpgradeVoteStatusWithProof(params: {
|
|
12
|
-
startProTxHash: string;
|
|
13
|
-
count: number;
|
|
14
|
-
}): Promise<any>;
|
|
6
|
+
versionUpgradeState(): Promise<wasm.ProtocolVersionUpgradeState>;
|
|
7
|
+
versionUpgradeStateWithProof(): Promise<wasm.ProofMetadataResponseTyped<wasm.ProtocolVersionUpgradeState>>;
|
|
8
|
+
versionUpgradeVoteStatus(startProTxHash: string | Uint8Array, count: number): Promise<Map<string, wasm.ProtocolVersionUpgradeVoteStatus>>;
|
|
9
|
+
versionUpgradeVoteStatusWithProof(startProTxHash: string | Uint8Array, count: number): Promise<wasm.ProofMetadataResponseTyped<unknown>>;
|
|
15
10
|
}
|
package/dist/protocol/facade.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
export class ProtocolFacade {
|
|
2
2
|
constructor(sdk) { this.sdk = sdk; }
|
|
3
|
-
async versionUpgradeState() {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
async versionUpgradeState() {
|
|
4
|
+
const w = await this.sdk.getWasmSdkConnected();
|
|
5
|
+
return w.getProtocolVersionUpgradeState();
|
|
6
|
+
}
|
|
7
|
+
async versionUpgradeStateWithProof() {
|
|
8
|
+
const w = await this.sdk.getWasmSdkConnected();
|
|
9
|
+
return w.getProtocolVersionUpgradeStateWithProofInfo();
|
|
10
|
+
}
|
|
11
|
+
async versionUpgradeVoteStatus(startProTxHash, count) {
|
|
7
12
|
const w = await this.sdk.getWasmSdkConnected();
|
|
8
13
|
return w.getProtocolVersionUpgradeVoteStatus(startProTxHash, count);
|
|
9
14
|
}
|
|
10
|
-
async versionUpgradeVoteStatusWithProof(
|
|
11
|
-
const { startProTxHash, count } = params;
|
|
15
|
+
async versionUpgradeVoteStatusWithProof(startProTxHash, count) {
|
|
12
16
|
const w = await this.sdk.getWasmSdkConnected();
|
|
13
17
|
return w.getProtocolVersionUpgradeVoteStatusWithProofInfo(startProTxHash, count);
|
|
14
18
|
}
|
package/dist/sdk.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as wasm from './wasm.js';
|
|
2
|
+
import { AddressesFacade } from './addresses/facade.js';
|
|
2
3
|
import { DocumentsFacade } from './documents/facade.js';
|
|
3
4
|
import { IdentitiesFacade } from './identities/facade.js';
|
|
4
5
|
import { ContractsFacade } from './contracts/facade.js';
|
|
@@ -21,13 +22,14 @@ export interface ConnectionOptions {
|
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
export interface EvoSDKOptions extends ConnectionOptions {
|
|
24
|
-
network?: 'testnet' | 'mainnet';
|
|
25
|
+
network?: 'testnet' | 'mainnet' | 'local';
|
|
25
26
|
trusted?: boolean;
|
|
26
27
|
addresses?: string[];
|
|
27
28
|
}
|
|
28
29
|
export declare class EvoSDK {
|
|
29
30
|
private wasmSdk?;
|
|
30
31
|
private options;
|
|
32
|
+
addresses: AddressesFacade;
|
|
31
33
|
documents: DocumentsFacade;
|
|
32
34
|
identities: IdentitiesFacade;
|
|
33
35
|
contracts: ContractsFacade;
|
|
@@ -51,6 +53,8 @@ export declare class EvoSDK {
|
|
|
51
53
|
static mainnet(options?: ConnectionOptions): EvoSDK;
|
|
52
54
|
static testnetTrusted(options?: ConnectionOptions): EvoSDK;
|
|
53
55
|
static mainnetTrusted(options?: ConnectionOptions): EvoSDK;
|
|
56
|
+
static local(options?: ConnectionOptions): EvoSDK;
|
|
57
|
+
static localTrusted(options?: ConnectionOptions): EvoSDK;
|
|
54
58
|
/**
|
|
55
59
|
* Create an EvoSDK instance configured with specific masternode addresses.
|
|
56
60
|
*
|
|
@@ -65,8 +69,9 @@ export declare class EvoSDK {
|
|
|
65
69
|
* await sdk.connect();
|
|
66
70
|
* ```
|
|
67
71
|
*/
|
|
68
|
-
static withAddresses(addresses: string[], network?: 'mainnet' | 'testnet', options?: ConnectionOptions): EvoSDK;
|
|
72
|
+
static withAddresses(addresses: string[], network?: 'mainnet' | 'testnet' | 'local', options?: ConnectionOptions): EvoSDK;
|
|
69
73
|
}
|
|
74
|
+
export { AddressesFacade } from './addresses/facade.js';
|
|
70
75
|
export { DocumentsFacade } from './documents/facade.js';
|
|
71
76
|
export { IdentitiesFacade } from './identities/facade.js';
|
|
72
77
|
export { ContractsFacade } from './contracts/facade.js';
|
package/dist/sdk.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as wasm from './wasm.js';
|
|
2
2
|
import { ensureInitialized as initWasm } from './wasm.js';
|
|
3
|
+
import { AddressesFacade } from './addresses/facade.js';
|
|
3
4
|
import { DocumentsFacade } from './documents/facade.js';
|
|
4
5
|
import { IdentitiesFacade } from './identities/facade.js';
|
|
5
6
|
import { ContractsFacade } from './contracts/facade.js';
|
|
@@ -15,6 +16,7 @@ export class EvoSDK {
|
|
|
15
16
|
// Apply defaults while preserving any future connection options
|
|
16
17
|
const { network = 'testnet', trusted = false, addresses, ...connection } = options;
|
|
17
18
|
this.options = { network, trusted, addresses, ...connection };
|
|
19
|
+
this.addresses = new AddressesFacade(this);
|
|
18
20
|
this.documents = new DocumentsFacade(this);
|
|
19
21
|
this.identities = new IdentitiesFacade(this);
|
|
20
22
|
this.contracts = new ContractsFacade(this);
|
|
@@ -53,6 +55,9 @@ export class EvoSDK {
|
|
|
53
55
|
else if (network === 'testnet') {
|
|
54
56
|
await wasm.WasmSdk.prefetchTrustedQuorumsTestnet();
|
|
55
57
|
}
|
|
58
|
+
else if (network === 'local') {
|
|
59
|
+
await wasm.WasmSdk.prefetchTrustedQuorumsLocal();
|
|
60
|
+
}
|
|
56
61
|
builder = wasm.WasmSdkBuilder.withAddresses(addresses, network);
|
|
57
62
|
}
|
|
58
63
|
else if (network === 'mainnet') {
|
|
@@ -63,6 +68,11 @@ export class EvoSDK {
|
|
|
63
68
|
await wasm.WasmSdk.prefetchTrustedQuorumsTestnet();
|
|
64
69
|
builder = trusted ? wasm.WasmSdkBuilder.testnetTrusted() : wasm.WasmSdkBuilder.testnet();
|
|
65
70
|
}
|
|
71
|
+
else if (network === 'local') {
|
|
72
|
+
// Default local dashmate gateway and quorum list sidecar
|
|
73
|
+
await wasm.WasmSdk.prefetchTrustedQuorumsLocal();
|
|
74
|
+
builder = trusted ? wasm.WasmSdkBuilder.localTrusted() : wasm.WasmSdkBuilder.local();
|
|
75
|
+
}
|
|
66
76
|
else {
|
|
67
77
|
throw new Error(`Unknown network: ${network}`);
|
|
68
78
|
}
|
|
@@ -99,6 +109,8 @@ export class EvoSDK {
|
|
|
99
109
|
static mainnet(options = {}) { return new EvoSDK({ network: 'mainnet', ...options }); }
|
|
100
110
|
static testnetTrusted(options = {}) { return new EvoSDK({ network: 'testnet', trusted: true, ...options }); }
|
|
101
111
|
static mainnetTrusted(options = {}) { return new EvoSDK({ network: 'mainnet', trusted: true, ...options }); }
|
|
112
|
+
static local(options = {}) { return new EvoSDK({ network: 'local', ...options }); }
|
|
113
|
+
static localTrusted(options = {}) { return new EvoSDK({ network: 'local', trusted: true, ...options }); }
|
|
102
114
|
/**
|
|
103
115
|
* Create an EvoSDK instance configured with specific masternode addresses.
|
|
104
116
|
*
|
|
@@ -117,6 +129,7 @@ export class EvoSDK {
|
|
|
117
129
|
return new EvoSDK({ addresses, network, ...options });
|
|
118
130
|
}
|
|
119
131
|
}
|
|
132
|
+
export { AddressesFacade } from './addresses/facade.js';
|
|
120
133
|
export { DocumentsFacade } from './documents/facade.js';
|
|
121
134
|
export { IdentitiesFacade } from './identities/facade.js';
|
|
122
135
|
export { ContractsFacade } from './contracts/facade.js';
|
package/dist/system/facade.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import * as wasm from '../wasm.js';
|
|
1
2
|
import type { EvoSDK } from '../sdk.js';
|
|
2
3
|
export declare class SystemFacade {
|
|
3
4
|
private sdk;
|
|
4
5
|
constructor(sdk: EvoSDK);
|
|
5
|
-
status(): Promise<
|
|
6
|
-
currentQuorumsInfo(): Promise<
|
|
7
|
-
totalCreditsInPlatform(): Promise<
|
|
8
|
-
totalCreditsInPlatformWithProof(): Promise<
|
|
9
|
-
prefundedSpecializedBalance(identityId:
|
|
10
|
-
prefundedSpecializedBalanceWithProof(identityId:
|
|
11
|
-
waitForStateTransitionResult(stateTransitionHash: string): Promise<
|
|
12
|
-
pathElements(path: string[], keys: string[]): Promise<
|
|
13
|
-
pathElementsWithProof(path: string[], keys: string[]): Promise<
|
|
6
|
+
status(): Promise<wasm.StatusResponse>;
|
|
7
|
+
currentQuorumsInfo(): Promise<wasm.CurrentQuorumsInfo>;
|
|
8
|
+
totalCreditsInPlatform(): Promise<bigint | undefined>;
|
|
9
|
+
totalCreditsInPlatformWithProof(): Promise<wasm.ProofMetadataResponseTyped<bigint | undefined>>;
|
|
10
|
+
prefundedSpecializedBalance(identityId: wasm.IdentifierLike): Promise<wasm.PrefundedSpecializedBalance | undefined>;
|
|
11
|
+
prefundedSpecializedBalanceWithProof(identityId: wasm.IdentifierLike): Promise<wasm.ProofMetadataResponseTyped<wasm.PrefundedSpecializedBalance | undefined>>;
|
|
12
|
+
waitForStateTransitionResult(stateTransitionHash: string): Promise<wasm.StateTransitionResult>;
|
|
13
|
+
pathElements(path: string[], keys: string[]): Promise<wasm.PathElement[]>;
|
|
14
|
+
pathElementsWithProof(path: string[], keys: string[]): Promise<wasm.ProofMetadataResponseTyped<wasm.PathElement[]>>;
|
|
14
15
|
}
|
package/dist/system/facade.js
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
export class SystemFacade {
|
|
2
2
|
constructor(sdk) { this.sdk = sdk; }
|
|
3
|
-
async status() {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
async
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
async
|
|
3
|
+
async status() {
|
|
4
|
+
const w = await this.sdk.getWasmSdkConnected();
|
|
5
|
+
return w.getStatus();
|
|
6
|
+
}
|
|
7
|
+
async currentQuorumsInfo() {
|
|
8
|
+
const w = await this.sdk.getWasmSdkConnected();
|
|
9
|
+
return w.getCurrentQuorumsInfo();
|
|
10
|
+
}
|
|
11
|
+
async totalCreditsInPlatform() {
|
|
12
|
+
const w = await this.sdk.getWasmSdkConnected();
|
|
13
|
+
return w.getTotalCreditsInPlatform();
|
|
14
|
+
}
|
|
15
|
+
async totalCreditsInPlatformWithProof() {
|
|
16
|
+
const w = await this.sdk.getWasmSdkConnected();
|
|
17
|
+
return w.getTotalCreditsInPlatformWithProofInfo();
|
|
18
|
+
}
|
|
19
|
+
async prefundedSpecializedBalance(identityId) {
|
|
20
|
+
const w = await this.sdk.getWasmSdkConnected();
|
|
21
|
+
return w.getPrefundedSpecializedBalance(identityId);
|
|
22
|
+
}
|
|
23
|
+
async prefundedSpecializedBalanceWithProof(identityId) {
|
|
24
|
+
const w = await this.sdk.getWasmSdkConnected();
|
|
25
|
+
return w.getPrefundedSpecializedBalanceWithProofInfo(identityId);
|
|
26
|
+
}
|
|
27
|
+
async waitForStateTransitionResult(stateTransitionHash) {
|
|
28
|
+
const w = await this.sdk.getWasmSdkConnected();
|
|
29
|
+
return w.waitForStateTransitionResult(stateTransitionHash);
|
|
30
|
+
}
|
|
31
|
+
async pathElements(path, keys) {
|
|
32
|
+
const w = await this.sdk.getWasmSdkConnected();
|
|
33
|
+
return w.getPathElements(path, keys);
|
|
34
|
+
}
|
|
35
|
+
async pathElementsWithProof(path, keys) {
|
|
36
|
+
const w = await this.sdk.getWasmSdkConnected();
|
|
37
|
+
return w.getPathElementsWithProofInfo(path, keys);
|
|
38
|
+
}
|
|
12
39
|
}
|