dash-platform-sdk 1.3.0-dev.8 → 1.4.0-dev.1
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/bundle.min.js +17 -17
- package/package.json +2 -5
- package/proto/generated/platform.client.d.ts +10 -0
- package/proto/generated/platform.client.js +7 -0
- package/proto/generated/platform.d.ts +114 -0
- package/proto/generated/platform.js +224 -1
- package/src/DashPlatformSDK.d.ts +1 -5
- package/src/DashPlatformSDK.js +0 -5
- package/src/constants.d.ts +2 -0
- package/src/constants.js +1 -0
- package/src/contestedResources/getContestedResourceVoteState.d.ts +1 -1
- package/src/contestedResources/getContestedResourceVoteState.js +10 -5
- package/src/contestedResources/index.d.ts +1 -1
- package/src/dataContracts/create.d.ts +3 -3
- package/src/dataContracts/create.js +3 -2
- package/src/dataContracts/createStateTransition.js +0 -1
- package/src/dataContracts/getDataContractByIdentifier.d.ts +1 -1
- package/src/dataContracts/getDataContractByIdentifier.js +3 -3
- package/src/dataContracts/index.d.ts +3 -3
- package/src/documents/create.d.ts +1 -1
- package/src/documents/create.js +1 -1
- package/src/documents/createStateTransition.d.ts +1 -1
- package/src/documents/index.d.ts +3 -3
- package/src/documents/query.d.ts +3 -3
- package/src/documents/query.js +3 -3
- package/src/grpcConnectionPool.d.ts +1 -1
- package/src/identities/createStateTransition.d.ts +2 -2
- package/src/identities/createStateTransition.js +11 -1
- package/src/identities/getIdentityBalance.d.ts +1 -1
- package/src/identities/getIdentityBalance.js +3 -2
- package/src/identities/getIdentityByIdentifier.d.ts +1 -1
- package/src/identities/getIdentityByIdentifier.js +3 -2
- package/src/identities/getIdentityByNonUniquePublicKeyHash.js +3 -2
- package/src/identities/getIdentityByPublicKeyHash.js +3 -2
- package/src/identities/getIdentityContractNonce.d.ts +1 -1
- package/src/identities/getIdentityContractNonce.js +3 -2
- package/src/identities/getIdentityNonce.d.ts +1 -1
- package/src/identities/getIdentityNonce.js +3 -2
- package/src/identities/getIdentityPublicKeys.d.ts +2 -2
- package/src/identities/getIdentityPublicKeys.js +19 -9
- package/src/identities/index.d.ts +8 -5
- package/src/identities/index.js +17 -5
- package/src/keyPair/index.d.ts +1 -1
- package/src/names/index.d.ts +1 -1
- package/src/node/epochs.js +3 -2
- package/src/node/index.d.ts +1 -1
- package/src/node/status.d.ts +1 -1
- package/src/node/totalCredits.d.ts +1 -1
- package/src/node/totalCredits.js +3 -3
- package/src/stateTransitions/broadcast.js +1 -1
- package/src/stateTransitions/waitForStateTransitionResult.js +68 -5
- package/src/tokens/createStateTransition.d.ts +1 -1
- package/src/tokens/getIdentitiesTokenBalances.d.ts +2 -2
- package/src/tokens/getIdentitiesTokenBalances.js +6 -5
- package/src/tokens/getIdentityTokensBalances.d.ts +2 -2
- package/src/tokens/getIdentityTokensBalances.js +6 -5
- package/src/tokens/getTokenContractInfo.d.ts +1 -1
- package/src/tokens/getTokenContractInfo.js +3 -2
- package/src/tokens/getTokenDirectPurchasePrices.d.ts +1 -1
- package/src/tokens/getTokenDirectPurchasePrices.js +3 -2
- package/src/tokens/getTokenTotalSupply.d.ts +1 -1
- package/src/tokens/getTokenTotalSupply.js +3 -2
- package/src/tokens/index.d.ts +1 -1
- package/src/utils/getEvonodeList.d.ts +1 -1
- package/src/utils/index.d.ts +8 -0
- package/src/utils/index.js +17 -0
- package/src/voting/index.d.ts +1 -1
- package/test/unit/ContestedResources.spec.js +5 -3
- package/test/unit/DataContract.spec.js +4 -3
- package/test/unit/Document.spec.js +2 -2
- package/test/unit/Identity.spec.js +61 -27
- package/test/unit/Names.spec.js +2 -0
- package/test/unit/Tokens.spec.js +3 -3
- package/{src/types.d.ts → types.d.ts} +15 -8
- package/{src/types.js → types.js} +2 -2
- package/src/signer/AbstractSigner.d.ts +0 -12
- package/src/signer/AbstractSigner.js +0 -1
- package/src/signer/PrivateKeySigner.d.ts +0 -1
- package/src/signer/PrivateKeySigner.js +0 -65
- package/src/signer/setSigner.d.ts +0 -2
- package/src/signer/setSigner.js +0 -5
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { StateTransitionWASM } from 'pshenmic-dpp';
|
|
2
|
-
export interface WalletInfo {
|
|
3
|
-
identities: string[];
|
|
4
|
-
currentIdentity: string | null;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Abstract interface for custom signer implementation
|
|
8
|
-
*/
|
|
9
|
-
export interface AbstractSigner {
|
|
10
|
-
connect: () => Promise<WalletInfo>;
|
|
11
|
-
signAndBroadcast: (stateTransition: StateTransitionWASM) => Promise<StateTransitionWASM>;
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
// import { IdentityWASM, NetworkWASM, PrivateKeyWASM, StateTransitionWASM } from 'pshenmic-dpp'
|
|
3
|
-
// import { base64 } from '@scure/base'
|
|
4
|
-
// import { IdentitiesController } from '../identities'
|
|
5
|
-
// import {AbstractSigner} from "./AbstractSigner";
|
|
6
|
-
//
|
|
7
|
-
// export class PrivateKeySigner implements AbstractSigner {
|
|
8
|
-
// privateKey: PrivateKeyWASM
|
|
9
|
-
// identity: IdentityWASM
|
|
10
|
-
// identities: IdentitiesController
|
|
11
|
-
//
|
|
12
|
-
// constructor (identitiesController: IdentitiesController, privateKey: string | PrivateKeyWASM, network?: NetworkWASM | string) {
|
|
13
|
-
// this.identities = identitiesController
|
|
14
|
-
//
|
|
15
|
-
// if (typeof privateKey === 'string') {
|
|
16
|
-
// let privateKeyWASM
|
|
17
|
-
//
|
|
18
|
-
// try {
|
|
19
|
-
// privateKeyWASM = PrivateKeyWASM.fromWIF(privateKey)
|
|
20
|
-
// } catch (e) {
|
|
21
|
-
// }
|
|
22
|
-
//
|
|
23
|
-
// if (privateKey.length === 64 && !network) {
|
|
24
|
-
// throw new Error('Network must be specified if hex or base64 private key being used')
|
|
25
|
-
// }
|
|
26
|
-
//
|
|
27
|
-
// try {
|
|
28
|
-
// privateKeyWASM = PrivateKeyWASM.fromHex(privateKey, network)
|
|
29
|
-
// } catch (e) {
|
|
30
|
-
// }
|
|
31
|
-
//
|
|
32
|
-
// try {
|
|
33
|
-
// privateKeyWASM = PrivateKeyWASM.fromBytes(base64.decode(privateKey), network)
|
|
34
|
-
// } catch (e) {
|
|
35
|
-
// }
|
|
36
|
-
//
|
|
37
|
-
// if (privateKeyWASM == null) {
|
|
38
|
-
// throw new Error('Could not decode private key')
|
|
39
|
-
// }
|
|
40
|
-
// } else if (privateKey?.__type === 'PrivateKeyWASM') {
|
|
41
|
-
// this.privateKey = privateKey
|
|
42
|
-
// } else {
|
|
43
|
-
// throw new Error('Unrecognized private key type')
|
|
44
|
-
// }
|
|
45
|
-
// }
|
|
46
|
-
//
|
|
47
|
-
// async connect (): Promise<void> {
|
|
48
|
-
// this.identity = await this.identities.getIdentityByPublicKeyHash(this.privateKey.getPublicKeyHash())
|
|
49
|
-
// }
|
|
50
|
-
//
|
|
51
|
-
// getCurrentIdentity (): IdentityWASM {
|
|
52
|
-
// return this.identity
|
|
53
|
-
// }
|
|
54
|
-
//
|
|
55
|
-
// signStateTransition (stateTransition: StateTransitionWASM): void {
|
|
56
|
-
// const [identityPublicKey] = this.identity.getPublicKeys()
|
|
57
|
-
// .filter(identityPublicKey => identityPublicKey.getPublicKeyHash() === this.privateKey.getPublicKeyHash())
|
|
58
|
-
//
|
|
59
|
-
// if (identityPublicKey == null) {
|
|
60
|
-
// throw new Error('Could not find an identity public key of identity matching this private key')
|
|
61
|
-
// }
|
|
62
|
-
//
|
|
63
|
-
// stateTransition.sign(this.privateKey, identityPublicKey)
|
|
64
|
-
// }
|
|
65
|
-
// }
|