dash 3.22.11 → 3.22.14
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 +57 -14
- package/build/src/SDK/Client/Platform/Platform.js +12 -0
- package/build/src/SDK/Client/Platform/Platform.js.map +1 -1
- package/build/src/SDK/Client/Platform/createAssetLockTransaction.js +8 -4
- package/build/src/SDK/Client/Platform/createAssetLockTransaction.js.map +1 -1
- package/build/src/SDK/Client/Platform/methods/identities/internal/createAssetLockProof.js +8 -4
- package/build/src/SDK/Client/Platform/methods/identities/internal/createAssetLockProof.js.map +1 -1
- package/build/src/SDK/Client/Platform/methods/identities/internal/createIdentityCreateTransition.js +8 -4
- package/build/src/SDK/Client/Platform/methods/identities/internal/createIdentityCreateTransition.js.map +1 -1
- package/build/src/SDK/Client/Platform/methods/identities/internal/createIdnetityTopUpTransition.js +8 -4
- package/build/src/SDK/Client/Platform/methods/identities/internal/createIdnetityTopUpTransition.js.map +1 -1
- package/build/src/SDK/Client/Platform/methods/identities/internal/waitForCoreChainLockedHeight.js +7 -3
- package/build/src/SDK/Client/Platform/methods/identities/internal/waitForCoreChainLockedHeight.js.map +1 -1
- package/build/src/SDK/Client/Platform/methods/identities/register.js +5 -6
- package/build/src/SDK/Client/Platform/methods/identities/register.js.map +1 -1
- package/build/src/SDK/Client/Platform/methods/identities/topUp.js +5 -7
- package/build/src/SDK/Client/Platform/methods/identities/topUp.js.map +1 -1
- package/build/src/SDK/SDK.js +10 -0
- package/build/src/SDK/SDK.js.map +1 -1
- package/build-utils/ws.js +15 -0
- package/dist/dash.min.js +9 -0
- package/dist/dash.min.js.LICENSE.txt +80 -0
- package/dist/dash.min.js.map +1 -0
- package/dist/src/SDK/Client/Platform/Platform.d.ts +7 -0
- package/dist/src/SDK/Client/Platform/createAssetLockTransaction.d.ts +3 -2
- package/dist/src/SDK/Client/Platform/methods/identities/internal/createAssetLockProof.d.ts +3 -2
- package/dist/src/SDK/Client/Platform/methods/identities/internal/createIdentityCreateTransition.d.ts +3 -2
- package/dist/src/SDK/Client/Platform/methods/identities/internal/createIdnetityTopUpTransition.d.ts +3 -2
- package/dist/src/SDK/Client/Platform/methods/identities/internal/waitForCoreChainLockedHeight.d.ts +2 -1
- package/dist/src/SDK/SDK.d.ts +9 -0
- package/docs/README.md +11 -52
- package/docs/_sidebar.md +0 -17
- package/docs/examples/fetch-an-identity-from-its-name.md +5 -9
- package/docs/examples/generate-a-new-mnemonic.md +1 -1
- package/docs/examples/pay-to-another-address.md +16 -13
- package/docs/examples/receive-money-and-check-balance.md +55 -39
- package/docs/examples/sign-and-verify-messages.md +19 -9
- package/docs/examples/use-different-account.md +5 -17
- package/docs/getting-started/core-concepts.md +6 -5
- package/docs/getting-started/dash-platform-applications.md +1 -1
- package/docs/getting-started/quickstart.md +7 -24
- package/docs/getting-started/with-typescript.md +5 -2
- package/docs/index.html +2 -2
- package/docs/platform/about-platform.md +5 -5
- package/docs/platform/contracts/about-contracts.md +2 -2
- package/docs/platform/contracts/create.md +5 -5
- package/docs/platform/contracts/get.md +1 -1
- package/docs/platform/contracts/publish.md +3 -3
- package/docs/platform/contracts/update.md +1 -4
- package/docs/platform/documents/broadcast.md +15 -15
- package/docs/platform/documents/create.md +5 -5
- package/docs/platform/documents/get.md +6 -5
- package/docs/platform/identities/about-identity.md +1 -1
- package/docs/platform/identities/get.md +1 -1
- package/docs/platform/identities/register.md +1 -1
- package/docs/platform/identities/topUp.md +2 -2
- package/docs/platform/names/about-dpns.md +1 -1
- package/docs/platform/names/register.md +9 -9
- package/docs/platform/names/resolve.md +1 -1
- package/docs/platform/names/resolveByRecord.md +9 -8
- package/docs/platform/names/search.md +1 -1
- package/docs/usage/dashcorelib-primitives.md +48 -37
- package/docs/wallet/about-wallet-lib.md +3 -3
- package/docs/wallet/accounts.md +11 -7
- package/docs/wallet/signing-encrypt.md +12 -6
- package/package.json +16 -12
- package/src/SDK/Client/Platform/Platform.ts +21 -0
- package/src/SDK/Client/Platform/createAssetLockTransaction.ts +5 -2
- package/src/SDK/Client/Platform/methods/identities/internal/createAssetLockProof.ts +5 -2
- package/src/SDK/Client/Platform/methods/identities/internal/createIdentityCreateTransition.ts +5 -2
- package/src/SDK/Client/Platform/methods/identities/internal/createIdnetityTopUpTransition.ts +5 -2
- package/src/SDK/Client/Platform/methods/identities/internal/waitForCoreChainLockedHeight.ts +4 -3
- package/src/SDK/Client/Platform/methods/identities/register.ts +7 -8
- package/src/SDK/Client/Platform/methods/identities/topUp.ts +5 -8
- package/src/SDK/SDK.ts +34 -21
- package/webpack.base.config.js +14 -0
- package/webpack.config.js +6 -2
- package/docs/examples/publishing-a-new-contract.md +0 -68
- package/docs/examples/updating-a-contract.md +0 -55
- package/docs/examples/use-local-evonet.md +0 -19
- package/examples/node/create-and-fund-wallet.js +0 -28
- package/examples/node/register-contract.js +0 -34
- package/examples/node/register-identity.js +0 -23
- package/examples/node/register-name.js +0 -19
- package/examples/node/retrieve-contract.js +0 -20
- package/examples/node/retrieve-documents.js +0 -22
- package/examples/node/retrieve-identity.js +0 -20
- package/examples/node/retrieve-name.js +0 -14
- package/examples/node/sign-and-verify-messages.js +0 -29
- package/examples/schema.json +0 -58
- package/examples/web/usage.web.html +0 -12
- package/examples/web/usage.web.js +0 -28
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const Dash = require('dash');
|
|
2
|
-
const clientOpts = {
|
|
3
|
-
network: 'testnet',
|
|
4
|
-
wallet: {
|
|
5
|
-
mnemonic: 'your mnemonic here',
|
|
6
|
-
},
|
|
7
|
-
};
|
|
8
|
-
const identityId = 'your identity id';
|
|
9
|
-
const client = new Dash.Client(clientOpts);
|
|
10
|
-
|
|
11
|
-
const registerName = async function () {
|
|
12
|
-
let platform = client.platform;
|
|
13
|
-
await client.isReady();
|
|
14
|
-
|
|
15
|
-
const identity = await platform.identities.get(identityId);
|
|
16
|
-
const nameRegistration = await platform.names.register('alice', identity);
|
|
17
|
-
console.log({nameRegistration});
|
|
18
|
-
};
|
|
19
|
-
registerName();
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const Dash = require('dash');
|
|
2
|
-
|
|
3
|
-
const clientOpts = {
|
|
4
|
-
network: 'testnet'
|
|
5
|
-
};
|
|
6
|
-
const client = new Dash.Client(clientOpts);
|
|
7
|
-
|
|
8
|
-
const getContract = async function () {
|
|
9
|
-
let platform = client.platform;
|
|
10
|
-
await client.isReady();
|
|
11
|
-
|
|
12
|
-
platform
|
|
13
|
-
.contracts
|
|
14
|
-
.get('77w8Xqn25HwJhjodrHW133aXhjuTsTv9ozQaYpSHACE3')
|
|
15
|
-
.then((contract) => {
|
|
16
|
-
console.dir({contract},{depth:5});
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
getContract();
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const Dash = require('dash');
|
|
2
|
-
|
|
3
|
-
const clientOpts = {
|
|
4
|
-
network: 'testnet'
|
|
5
|
-
};
|
|
6
|
-
const client = new Dash.Client(clientOpts);
|
|
7
|
-
|
|
8
|
-
const getDocuments = async function () {
|
|
9
|
-
let platform = client.platform;
|
|
10
|
-
await client.isReady();
|
|
11
|
-
|
|
12
|
-
const queryOpts = {
|
|
13
|
-
where: [
|
|
14
|
-
['normalizedLabel', 'startsWith', 'd'],
|
|
15
|
-
['normalizedParentDomainName', '==', 'dash'],
|
|
16
|
-
],
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const documents = await platform.documents.get('dpns.domain', queryOpts);
|
|
20
|
-
console.dir({documents},{depth:5});
|
|
21
|
-
};
|
|
22
|
-
getDocuments();
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const Dash = require('dash');
|
|
2
|
-
|
|
3
|
-
const clientOpts = {
|
|
4
|
-
network: 'testnet'
|
|
5
|
-
};
|
|
6
|
-
const client = new Dash.Client(clientOpts);
|
|
7
|
-
|
|
8
|
-
const getIdentity = async function () {
|
|
9
|
-
let platform = client.platform;
|
|
10
|
-
await client.isReady();
|
|
11
|
-
|
|
12
|
-
platform
|
|
13
|
-
.identities
|
|
14
|
-
.get('3GegupTgRfdN9JMS8R6QXF3B2VbZtiw63eyudh1oMJAk')
|
|
15
|
-
.then((identity) => {
|
|
16
|
-
console.log({identity});
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
getIdentity();
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const Dash = require('dash');
|
|
2
|
-
|
|
3
|
-
const clientOpts = {
|
|
4
|
-
network: 'testnet'
|
|
5
|
-
};
|
|
6
|
-
const client = new Dash.Client(clientOpts);
|
|
7
|
-
|
|
8
|
-
const platform = client.platform;
|
|
9
|
-
|
|
10
|
-
async function retrieveName(){
|
|
11
|
-
const user = await platform.names.get('alice');
|
|
12
|
-
console.dir({user}, {depth:5});
|
|
13
|
-
}
|
|
14
|
-
retrieveName();
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const Dash = require('dash');
|
|
2
|
-
|
|
3
|
-
const clientOpts = {
|
|
4
|
-
network: 'testnet',
|
|
5
|
-
wallet: {
|
|
6
|
-
mnemonic: null,
|
|
7
|
-
},
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const client = new Dash.Client(clientOpts);
|
|
11
|
-
|
|
12
|
-
const message = new Dash.Core.Message('hello, world');
|
|
13
|
-
|
|
14
|
-
const signAndVerify = async function () {
|
|
15
|
-
const {account, wallet} = client;
|
|
16
|
-
|
|
17
|
-
const mnemonic = wallet.exportWallet();
|
|
18
|
-
console.log('Mnemonic:', mnemonic);
|
|
19
|
-
|
|
20
|
-
const idKey = account.getIdentityHDKey()
|
|
21
|
-
const idPrivateKey = idKey.privateKey;
|
|
22
|
-
const idAddress = idPrivateKey.toAddress().toString()
|
|
23
|
-
|
|
24
|
-
const signed = account.sign(message, idPrivateKey);
|
|
25
|
-
const verify = message.verify(idAddress, signed.toString());
|
|
26
|
-
console.log(verify);
|
|
27
|
-
};
|
|
28
|
-
client.isReady().then(signAndVerify);
|
|
29
|
-
|
package/examples/schema.json
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contact": {
|
|
3
|
-
"indices": [
|
|
4
|
-
{
|
|
5
|
-
"name": "userIdToUserId",
|
|
6
|
-
"unique": true,
|
|
7
|
-
"properties": [
|
|
8
|
-
{
|
|
9
|
-
"$userId": "asc"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"toUserId": "asc"
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"required": [
|
|
18
|
-
"toUserId",
|
|
19
|
-
"publicKey"
|
|
20
|
-
],
|
|
21
|
-
"properties": {
|
|
22
|
-
"toUserId": {
|
|
23
|
-
"type": "string"
|
|
24
|
-
},
|
|
25
|
-
"publicKey": {
|
|
26
|
-
"type": "string"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"additionalProperties": false
|
|
30
|
-
},
|
|
31
|
-
"profile": {
|
|
32
|
-
"indices": [
|
|
33
|
-
{
|
|
34
|
-
"name": "userId",
|
|
35
|
-
"unique": true,
|
|
36
|
-
"properties": [
|
|
37
|
-
{
|
|
38
|
-
"$userId": "asc"
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
"required": [
|
|
44
|
-
"avatarUrl",
|
|
45
|
-
"about"
|
|
46
|
-
],
|
|
47
|
-
"properties": {
|
|
48
|
-
"about": {
|
|
49
|
-
"type": "string"
|
|
50
|
-
},
|
|
51
|
-
"avatarUrl": {
|
|
52
|
-
"type": "string",
|
|
53
|
-
"format": "url"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"additionalProperties": false
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const network = "testnet";
|
|
2
|
-
const opts = {
|
|
3
|
-
network,
|
|
4
|
-
wallet: {
|
|
5
|
-
mnemonic: "arena light cheap control apple buffalo indicate rare motor valid accident isolate",
|
|
6
|
-
},
|
|
7
|
-
apps: {
|
|
8
|
-
dashpay: {
|
|
9
|
-
contractId: ''// Provide the dashpay contract id here
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
const clientInstance = new Dash.Client(opts);
|
|
14
|
-
|
|
15
|
-
(async ()=>{
|
|
16
|
-
const { platform } = clientInstance;
|
|
17
|
-
account = await clientInstance.getWalletAccount();
|
|
18
|
-
|
|
19
|
-
async function sendPayment() {
|
|
20
|
-
const tx = await account.createTransaction({recipient: 'yNPbcFfabtNmmxKdGwhHomdYfVs6gikbPf', satoshis: 12000});
|
|
21
|
-
console.log(await account.broadcastTransaction(tx));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
async function readDocument() {
|
|
25
|
-
const profile = await platform.documents.fetch('dashpay.profile', {});
|
|
26
|
-
console.log(profile);
|
|
27
|
-
}
|
|
28
|
-
})()
|