@dashevo/evo-sdk 3.0.0-dev.5 → 3.0.0-dev.7
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/dpns/facade.d.ts +2 -2
- package/dist/evo-sdk.module.js +1 -1
- package/dist/evo-sdk.module.js.map +1 -1
- package/dist/group/facade.d.ts +2 -2
- package/dist/identities/facade.d.ts +12 -12
- package/dist/sdk.d.ts +7 -2
- package/dist/sdk.js +13 -0
- package/dist/tokens/facade.d.ts +2 -2
- package/dist/voting/facade.d.ts +2 -4
- package/dist/wasm.d.ts +0 -1
- package/package.json +4 -5
package/dist/group/facade.d.ts
CHANGED
|
@@ -19,6 +19,6 @@ export declare class GroupFacade {
|
|
|
19
19
|
groupsDataContractsWithProof(dataContractIds: wasm.IdentifierLike[]): Promise<wasm.ProofMetadataResponseTyped<Map<wasm.Identifier, Map<number, wasm.Group | undefined>>>>;
|
|
20
20
|
contestedResources(query: wasm.VotePollsByDocumentTypeQuery): Promise<any[]>;
|
|
21
21
|
contestedResourcesWithProof(query: wasm.VotePollsByDocumentTypeQuery): Promise<wasm.ProofMetadataResponseTyped<Array<any>>>;
|
|
22
|
-
contestedResourceVotersForIdentity(query: wasm.ContestedResourceVotersForIdentityQuery): Promise<
|
|
23
|
-
contestedResourceVotersForIdentityWithProof(query: wasm.ContestedResourceVotersForIdentityQuery): Promise<wasm.ProofMetadataResponseTyped<
|
|
22
|
+
contestedResourceVotersForIdentity(query: wasm.ContestedResourceVotersForIdentityQuery): Promise<wasm.Identifier[]>;
|
|
23
|
+
contestedResourceVotersForIdentityWithProof(query: wasm.ContestedResourceVotersForIdentityQuery): Promise<wasm.ProofMetadataResponseTyped<wasm.Identifier[]>>;
|
|
24
24
|
}
|
|
@@ -8,18 +8,18 @@ export declare class IdentitiesFacade {
|
|
|
8
8
|
fetchUnproved(identityId: wasm.IdentifierLike): Promise<wasm.Identity>;
|
|
9
9
|
getKeys(query: wasm.IdentityKeysQuery): Promise<wasm.IdentityKeyInfo[]>;
|
|
10
10
|
getKeysWithProof(query: wasm.IdentityKeysQuery): Promise<wasm.ProofMetadataResponseTyped<wasm.IdentityKeyInfo[]>>;
|
|
11
|
-
nonce(identityId: wasm.IdentifierLike): Promise<
|
|
12
|
-
nonceWithProof(identityId: wasm.IdentifierLike): Promise<wasm.ProofMetadataResponseTyped<
|
|
13
|
-
contractNonce(identityId: wasm.IdentifierLike, contractId: wasm.IdentifierLike): Promise<
|
|
14
|
-
contractNonceWithProof(identityId: wasm.IdentifierLike, contractId: wasm.IdentifierLike): Promise<wasm.ProofMetadataResponseTyped<
|
|
15
|
-
balance(identityId: wasm.IdentifierLike): Promise<
|
|
16
|
-
balanceWithProof(identityId: wasm.IdentifierLike): Promise<wasm.ProofMetadataResponseTyped<
|
|
17
|
-
balances(identityIds: wasm.IdentifierLike[]): Promise<wasm.
|
|
18
|
-
balancesWithProof(identityIds: wasm.IdentifierLike[]): Promise<wasm.ProofMetadataResponseTyped<wasm.
|
|
19
|
-
balanceAndRevision(identityId: wasm.IdentifierLike): Promise<wasm.IdentityBalanceAndRevision>;
|
|
20
|
-
balanceAndRevisionWithProof(identityId: wasm.IdentifierLike): Promise<wasm.ProofMetadataResponseTyped<wasm.IdentityBalanceAndRevision>>;
|
|
21
|
-
byPublicKeyHash(publicKeyHash: string | Uint8Array): Promise<wasm.Identity>;
|
|
22
|
-
byPublicKeyHashWithProof(publicKeyHash: string | Uint8Array): Promise<wasm.ProofMetadataResponseTyped<wasm.Identity>>;
|
|
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
23
|
byNonUniquePublicKeyHash(publicKeyHash: string | Uint8Array, startAfter?: wasm.IdentifierLike): Promise<wasm.Identity[]>;
|
|
24
24
|
byNonUniquePublicKeyHashWithProof(publicKeyHash: string | Uint8Array, startAfter?: wasm.IdentifierLike): Promise<wasm.ProofMetadataResponseTyped<wasm.Identity[]>>;
|
|
25
25
|
contractKeys(query: wasm.IdentitiesContractKeysQuery): Promise<wasm.IdentityContractKeys[]>;
|
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/tokens/facade.d.ts
CHANGED
|
@@ -21,8 +21,8 @@ export declare class TokensFacade {
|
|
|
21
21
|
directPurchasePricesWithProof(tokenIds: wasm.IdentifierLike[]): Promise<wasm.ProofMetadataResponseTyped<Map<wasm.Identifier, wasm.TokenPriceInfo>>>;
|
|
22
22
|
contractInfo(contractId: wasm.IdentifierLike): Promise<wasm.TokenContractInfo | undefined>;
|
|
23
23
|
contractInfoWithProof(contractId: wasm.IdentifierLike): Promise<wasm.ProofMetadataResponseTyped<wasm.TokenContractInfo | undefined>>;
|
|
24
|
-
perpetualDistributionLastClaim(identityId: wasm.IdentifierLike, tokenId: wasm.IdentifierLike): Promise<wasm.
|
|
25
|
-
perpetualDistributionLastClaimWithProof(identityId: wasm.IdentifierLike, tokenId: wasm.IdentifierLike): Promise<wasm.ProofMetadataResponseTyped<wasm.
|
|
24
|
+
perpetualDistributionLastClaim(identityId: wasm.IdentifierLike, tokenId: wasm.IdentifierLike): Promise<wasm.RewardDistributionMoment | undefined>;
|
|
25
|
+
perpetualDistributionLastClaimWithProof(identityId: wasm.IdentifierLike, tokenId: wasm.IdentifierLike): Promise<wasm.ProofMetadataResponseTyped<wasm.RewardDistributionMoment | undefined>>;
|
|
26
26
|
mint(args: {
|
|
27
27
|
contractId: wasm.IdentifierLike;
|
|
28
28
|
tokenPosition: number;
|
package/dist/voting/facade.d.ts
CHANGED
|
@@ -5,10 +5,8 @@ export declare class VotingFacade {
|
|
|
5
5
|
constructor(sdk: EvoSDK);
|
|
6
6
|
contestedResourceVoteState(query: wasm.ContestedResourceVoteStateQuery): Promise<wasm.ContestedResourceVoteState>;
|
|
7
7
|
contestedResourceVoteStateWithProof(query: wasm.ContestedResourceVoteStateQuery): Promise<wasm.ProofMetadataResponseTyped<wasm.ContestedResourceVoteState>>;
|
|
8
|
-
contestedResourceIdentityVotes(query: wasm.ContestedResourceIdentityVotesQuery): Promise<
|
|
9
|
-
contestedResourceIdentityVotesWithProof(query: wasm.ContestedResourceIdentityVotesQuery): Promise<wasm.ProofMetadataResponseTyped<
|
|
10
|
-
votes: Array<any>;
|
|
11
|
-
}>>;
|
|
8
|
+
contestedResourceIdentityVotes(query: wasm.ContestedResourceIdentityVotesQuery): Promise<Map<wasm.Identifier, wasm.ResourceVote>>;
|
|
9
|
+
contestedResourceIdentityVotesWithProof(query: wasm.ContestedResourceIdentityVotesQuery): Promise<wasm.ProofMetadataResponseTyped<Map<wasm.Identifier, wasm.ResourceVote>>>;
|
|
12
10
|
votePollsByEndDate(query?: wasm.VotePollsByEndDateQuery): Promise<wasm.VotePollsByEndDateEntry[]>;
|
|
13
11
|
votePollsByEndDateWithProof(query?: wasm.VotePollsByEndDateQuery): Promise<wasm.ProofMetadataResponseTyped<wasm.VotePollsByEndDateEntry[]>>;
|
|
14
12
|
masternodeVote(args: {
|
package/dist/wasm.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashevo/evo-sdk",
|
|
3
|
-
"version": "3.0.0-dev.
|
|
3
|
+
"version": "3.0.0-dev.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/evo-sdk.module.js",
|
|
6
6
|
"types": "./dist/sdk.d.ts",
|
|
@@ -22,14 +22,13 @@
|
|
|
22
22
|
"README.md"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@dashevo/wasm-sdk": "3.0.0-dev.
|
|
25
|
+
"@dashevo/wasm-sdk": "3.0.0-dev.7"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "rm -rf dist && tsc -p tsconfig.json && webpack --config webpack.config.cjs",
|
|
29
29
|
"lint": "eslint \"src/**/*.ts\" \"tests/**/*.*js\"",
|
|
30
|
-
"test": "yarn run test:unit
|
|
31
|
-
"test:unit": "mocha tests/unit/**/*.spec.mjs && karma start ./tests/karma/karma.conf.cjs --single-run"
|
|
32
|
-
"test:functional": "mocha tests/functional/**/*.spec.mjs --exit --timeout 90000 && karma start ./tests/karma/karma.functional.conf.cjs --single-run"
|
|
30
|
+
"test": "yarn run test:unit",
|
|
31
|
+
"test:unit": "mocha tests/unit/**/*.spec.mjs && karma start ./tests/karma/karma.conf.cjs --single-run"
|
|
33
32
|
},
|
|
34
33
|
"devDependencies": {
|
|
35
34
|
"@typescript-eslint/eslint-plugin": "^5.55.0",
|