dash 3.22.2 → 3.22.5

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.
@@ -78,7 +78,7 @@ describe('Dash - Client', function suite() {
78
78
  switch (_b.label) {
79
79
  case 0:
80
80
  testMnemonic = 'agree country attract master mimic ball load beauty join gentle turtle hover';
81
- testHDKey = "xprv9s21ZrQH143K4PgfRZPuYjYUWRZkGfEPuWTEUESMoEZLC274ntC4G49qxgZJEPgmujsmY52eVggtwZgJPrWTMXmbYgqDVySWg46XzbGXrSZ";
81
+ testHDKey = "tprv8ZgxMBicQKsPeGi4CikhacVPz6UmErenu1PoD3S4XcEDSPP8auRaS8hG3DQtsQ2i9HACgohHwF5sgMVJNksoKqYoZbis8o75Pp1koCme2Yo";
82
82
  client = new index_1.Client({
83
83
  wallet: {
84
84
  HDPrivateKey: testHDKey,
@@ -204,7 +204,7 @@ describe('Dash - Client', function suite() {
204
204
  importedIdentityIds = account.identities.getIdentityIds();
205
205
  // Check that we've imported identities properly
206
206
  chai_1.expect(importedIdentityIds.length).to.be.equal(accountIdentitiesCountBeforeTest + 1);
207
- chai_1.expect(importedIdentityIds[0]).to.be.equal(interceptedIdentityStateTransition.getIdentityId().toString());
207
+ chai_1.expect(importedIdentityIds[1]).to.be.equal(interceptedIdentityStateTransition.getIdentityId().toString());
208
208
  return [2 /*return*/];
209
209
  }
210
210
  });
@@ -52,7 +52,7 @@ var broadcastStateTransition_1 = __importDefault(require("../../broadcastStateTr
52
52
  function register(fundingAmount) {
53
53
  if (fundingAmount === void 0) { fundingAmount = 10000; }
54
54
  return __awaiter(this, void 0, void 0, function () {
55
- var client, account, _a, assetLockTransaction, assetLockPrivateKey, assetLockOutputIndex, assetLockProof, _b, identity, identityCreateTransition, identityIndex;
55
+ var client, account, _a, assetLockTransaction, assetLockPrivateKey, assetLockOutputIndex, assetLockProof, _b, identity, identityCreateTransition, identityIndex, registeredIdentity;
56
56
  return __generator(this, function (_c) {
57
57
  switch (_c.label) {
58
58
  case 0: return [4 /*yield*/, this.initialize()];
@@ -80,7 +80,16 @@ function register(fundingAmount) {
80
80
  case 7:
81
81
  _c.sent();
82
82
  // If state transition was broadcast without any errors, import identity to the account
83
- account.storage.insertIdentityIdAtIndex(account.walletId, identity.getId().toString(), identityIndex);
83
+ account.storage
84
+ .getWalletStore(account.walletId)
85
+ .insertIdentityIdAtIndex(identity.getId().toString(), identityIndex);
86
+ return [4 /*yield*/, this.identities.get(identity.getId().toString())];
87
+ case 8:
88
+ registeredIdentity = _c.sent();
89
+ // We cannot just return registeredIdentity as we want to
90
+ // keep additional information (assetLockProof and transaction) instance
91
+ identity.setMetadata(registeredIdentity.metadata);
92
+ identity.setBalance(registeredIdentity.balance);
84
93
  return [2 /*return*/, identity];
85
94
  }
86
95
  });
@@ -1 +1 @@
1
- {"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../../../../src/SDK/Client/Platform/methods/identities/register.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gGAA0E;AAC1E,6GAAuF;AACvF,yFAAmE;AACnE,4FAAsE;AAEtE;;;;;GAKG;AACH,SAA8B,QAAQ,CAEpC,aAA8B;IAA9B,8BAAA,EAAA,qBAA8B;;;;;wBAE5B,qBAAM,IAAI,CAAC,UAAU,EAAE,EAAA;;oBAAvB,SAAuB,CAAC;oBAEhB,MAAM,GAAK,IAAI,OAAT,CAAU;oBAER,qBAAM,MAAM,CAAC,gBAAgB,EAAE,EAAA;;oBAAzC,OAAO,GAAG,SAA+B;oBAM3C,qBAAM,oCAA0B,CAAC,IAAI,EAAE,aAAa,CAAC,EAAA;;oBAJnD,KAIF,SAAqD,EAHxC,oBAAoB,iBAAA,EACrB,mBAAmB,gBAAA,EAClB,oBAAoB,iBAAA;oBAGrC,mCAAmC;oBACnC,qBAAM,OAAO,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,EAAA;;oBADxD,mCAAmC;oBACnC,SAAwD,CAAC;oBAClC,qBAAM,8BAAoB,CAAC,IAAI,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,EAAA;;oBAA7F,cAAc,GAAG,SAA4E;oBAErC,qBAAM,wCAA8B,CAC9F,IAAI,EAAE,cAAc,EAAE,mBAAmB,CAC5C,EAAA;;oBAFK,KAAwD,SAE7D,EAFO,QAAQ,cAAA,EAAE,wBAAwB,8BAAA,EAAE,aAAa,mBAAA;oBAGzD,qBAAM,kCAAwB,CAAC,IAAI,EAAE,wBAAwB,CAAC,EAAA;;oBAA9D,SAA8D,CAAC;oBAE/D,uFAAuF;oBACvF,OAAO,CAAC,OAAO,CAAC,uBAAuB,CACnC,OAAO,CAAC,QAAQ,EAChB,QAAQ,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,EAC3B,aAAa,CAChB,CAAC;oBAEF,sBAAO,QAAQ,EAAC;;;;CACnB;AAjCD,2BAiCC"}
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../../../../src/SDK/Client/Platform/methods/identities/register.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gGAA0E;AAC1E,6GAAuF;AACvF,yFAAmE;AACnE,4FAAsE;AAEtE;;;;;GAKG;AACH,SAA8B,QAAQ,CAEpC,aAA8B;IAA9B,8BAAA,EAAA,qBAA8B;;;;;wBAE5B,qBAAM,IAAI,CAAC,UAAU,EAAE,EAAA;;oBAAvB,SAAuB,CAAC;oBAEhB,MAAM,GAAK,IAAI,OAAT,CAAU;oBAER,qBAAM,MAAM,CAAC,gBAAgB,EAAE,EAAA;;oBAAzC,OAAO,GAAG,SAA+B;oBAM3C,qBAAM,oCAA0B,CAAC,IAAI,EAAE,aAAa,CAAC,EAAA;;oBAJnD,KAIF,SAAqD,EAHxC,oBAAoB,iBAAA,EACrB,mBAAmB,gBAAA,EAClB,oBAAoB,iBAAA;oBAGrC,mCAAmC;oBACnC,qBAAM,OAAO,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,EAAA;;oBADxD,mCAAmC;oBACnC,SAAwD,CAAC;oBAClC,qBAAM,8BAAoB,CAAC,IAAI,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,EAAA;;oBAA7F,cAAc,GAAG,SAA4E;oBAErC,qBAAM,wCAA8B,CAC9F,IAAI,EAAE,cAAc,EAAE,mBAAmB,CAC5C,EAAA;;oBAFK,KAAwD,SAE7D,EAFO,QAAQ,cAAA,EAAE,wBAAwB,8BAAA,EAAE,aAAa,mBAAA;oBAGzD,qBAAM,kCAAwB,CAAC,IAAI,EAAE,wBAAwB,CAAC,EAAA;;oBAA9D,SAA8D,CAAC;oBAE/D,uFAAuF;oBACxF,OAAO,CAAC,OAAO;yBACb,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC;yBAChC,uBAAuB,CACtB,QAAQ,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,EAC3B,aAAa,CACd,CAAC;oBAGyB,qBAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAA;;oBAA3E,kBAAkB,GAAG,SAAsD;oBAEjF,yDAAyD;oBACzD,wEAAwE;oBACxE,QAAQ,CAAC,WAAW,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;oBAClD,QAAQ,CAAC,UAAU,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;oBAEhD,sBAAO,QAAQ,EAAC;;;;CACnB;AA1CD,2BA0CC"}
@@ -18,7 +18,7 @@ var SDK;
18
18
  // Wallet-lib primitives
19
19
  SDK.Wallet = wallet_lib_1.Wallet;
20
20
  SDK.Account = wallet_lib_1.Account;
21
- SDK.KeyChain = wallet_lib_1.KeyChain;
21
+ SDK.KeyChain = wallet_lib_1.DerivableKeyChain;
22
22
  SDK.WalletLib = {
23
23
  CONSTANTS: wallet_lib_1.CONSTANTS,
24
24
  EVENTS: wallet_lib_1.EVENTS,
@@ -1 +1 @@
1
- {"version":3,"file":"SDK.js","sourceRoot":"","sources":["../../../src/SDK/SDK.ts"],"names":[],"mappings":";;;;;;AAAA,mCAA6C;AAC7C,+BAAuC;AACvC,uCAAmD;AACnD,qEAA8D;AAE9D,kDAQ6B;AAE7B,IAAiB,GAAG,CAmBnB;AAnBD,WAAiB,GAAG;IACL,cAAU,GAAG,qBAAW,CAAC;IACzB,UAAM,GAAG,eAAO,CAAC;IAEjB,QAAI,GAAG,WAAK,CAAC;IACb,YAAQ,GAAG,mBAAS,CAAC;IAEhC,wBAAwB;IACb,UAAM,GAAG,mBAAO,CAAC;IACjB,WAAO,GAAG,oBAAQ,CAAC;IACnB,YAAQ,GAAG,qBAAS,CAAC;IAErB,aAAS,GAAG;QACnB,SAAS,EAAE,sBAAmB;QAC9B,MAAM,EAAE,mBAAgB;QACxB,OAAO,EAAE,oBAAiB;QAC1B,KAAK,EAAE,kBAAe;KACzB,CAAA;AAEL,CAAC,EAnBgB,GAAG,GAAH,WAAG,KAAH,WAAG,QAmBnB;AACe,sBAAO"}
1
+ {"version":3,"file":"SDK.js","sourceRoot":"","sources":["../../../src/SDK/SDK.ts"],"names":[],"mappings":";;;;;;AAAA,mCAA6C;AAC7C,+BAAuC;AACvC,uCAAmD;AACnD,qEAA8D;AAE9D,kDAQ6B;AAE7B,IAAiB,GAAG,CAmBnB;AAnBD,WAAiB,GAAG;IACL,cAAU,GAAG,qBAAW,CAAC;IACzB,UAAM,GAAG,eAAO,CAAC;IAEjB,QAAI,GAAG,WAAK,CAAC;IACb,YAAQ,GAAG,mBAAS,CAAC;IAEhC,wBAAwB;IACb,UAAM,GAAG,mBAAO,CAAC;IACjB,WAAO,GAAG,oBAAQ,CAAC;IACnB,YAAQ,GAAG,8BAAS,CAAC;IAErB,aAAS,GAAG;QACnB,SAAS,EAAE,sBAAmB;QAC9B,MAAM,EAAE,mBAAgB;QACxB,OAAO,EAAE,oBAAiB;QAC1B,KAAK,EAAE,kBAAe;KACzB,CAAA;AAEL,CAAC,EAnBgB,GAAG,GAAH,WAAG,KAAH,WAAG,QAmBnB;AACe,sBAAO"}
@@ -9,7 +9,7 @@ var IdentityPublicKey_1 = __importDefault(require("@dashevo/dpp/lib/identity/Ide
9
9
  var getIdentityFixture = require('@dashevo/dpp/lib/test/fixtures/getIdentityFixture');
10
10
  function createIdentityFixtureInAccount(account) {
11
11
  var identityFixture = getIdentityFixture();
12
- var identityFixtureIndex = 10000;
12
+ var identityFixtureIndex = 0;
13
13
  var identityPrivateKey = account.identities.getIdentityHDKeyByIndex(identityFixtureIndex, 0).privateKey;
14
14
  identityFixture.publicKeys[0] = new IdentityPublicKey_1.default({
15
15
  id: 0,
@@ -18,7 +18,9 @@ function createIdentityFixtureInAccount(account) {
18
18
  purpose: IdentityPublicKey_1.default.PURPOSES.AUTHENTICATION,
19
19
  securityLevel: IdentityPublicKey_1.default.SECURITY_LEVELS.MASTER
20
20
  });
21
- account.storage.insertIdentityIdAtIndex(account.walletId, identityFixture.getId().toString(), identityFixtureIndex);
21
+ account.storage
22
+ .getWalletStore(account.walletId)
23
+ .insertIdentityIdAtIndex(identityFixture.getId().toString(), identityFixtureIndex);
22
24
  return identityFixture;
23
25
  }
24
26
  exports.createIdentityFixtureInAccount = createIdentityFixtureInAccount;
@@ -1 +1 @@
1
- {"version":3,"file":"createIdentityFixtureInAccount.js","sourceRoot":"","sources":["../../../../src/test/fixtures/createIdentityFixtureInAccount.ts"],"names":[],"mappings":";;;;;;AAAA,kGAA4E;AAC5E,aAAa;AACb,IAAM,kBAAkB,GAAG,OAAO,CAAC,mDAAmD,CAAC,CAAC;AAExF,SAAgB,8BAA8B,CAAC,OAAO;IAClD,IAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;IAC7C,IAAM,oBAAoB,GAAG,KAAK,CAAC;IAC3B,IAAY,kBAAkB,GAAK,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC,oBAAoB,EAAE,CAAC,CAAC,WAAxE,CAAyE;IAE/G,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,2BAAiB,CAAC;QAClD,EAAE,EAAE,CAAC;QACL,IAAI,EAAE,2BAAiB,CAAC,KAAK,CAAC,eAAe;QAC7C,IAAI,EAAE,kBAAkB,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;QACjD,OAAO,EAAE,2BAAiB,CAAC,QAAQ,CAAC,cAAc;QAClD,aAAa,EAAE,2BAAiB,CAAC,eAAe,CAAC,MAAM;KAC1D,CAAC,CAAC;IAEH,OAAO,CAAC,OAAO,CAAC,uBAAuB,CACnC,OAAO,CAAC,QAAQ,EAChB,eAAe,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,EAClC,oBAAoB,CACvB,CAAC;IAEF,OAAO,eAAe,CAAC;AAC3B,CAAC;AApBD,wEAoBC"}
1
+ {"version":3,"file":"createIdentityFixtureInAccount.js","sourceRoot":"","sources":["../../../../src/test/fixtures/createIdentityFixtureInAccount.ts"],"names":[],"mappings":";;;;;;AAAA,kGAA4E;AAC5E,aAAa;AACb,IAAM,kBAAkB,GAAG,OAAO,CAAC,mDAAmD,CAAC,CAAC;AAExF,SAAgB,8BAA8B,CAAC,OAAO;IAClD,IAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;IAC7C,IAAM,oBAAoB,GAAG,CAAC,CAAC;IACvB,IAAY,kBAAkB,GAAK,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC,oBAAoB,EAAE,CAAC,CAAC,WAAxE,CAAyE;IAE/G,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,2BAAiB,CAAC;QAClD,EAAE,EAAE,CAAC;QACL,IAAI,EAAE,2BAAiB,CAAC,KAAK,CAAC,eAAe;QAC7C,IAAI,EAAE,kBAAkB,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;QACjD,OAAO,EAAE,2BAAiB,CAAC,QAAQ,CAAC,cAAc;QAClD,aAAa,EAAE,2BAAiB,CAAC,eAAe,CAAC,MAAM;KAC1D,CAAC,CAAC;IAEH,OAAO,CAAC,OAAO;SACZ,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC;SAChC,uBAAuB,CACtB,eAAe,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,EAClC,oBAAoB,CACvB,CAAC;IAEF,OAAO,eAAe,CAAC;AAC3B,CAAC;AArBD,wEAqBC"}
@@ -52,7 +52,7 @@ function createTransactionInAccount(account) {
52
52
  txid: new dashcore_lib_1.Transaction(undefined).hash,
53
53
  }])
54
54
  .to(account.getAddress(10).address, 100000);
55
- return [4 /*yield*/, account.importTransactions([walletTransaction.serialize(true)])];
55
+ return [4 /*yield*/, account.importTransactions([[walletTransaction.serialize(true)]])];
56
56
  case 1:
57
57
  _a.sent();
58
58
  return [2 /*return*/, walletTransaction];
@@ -1 +1 @@
1
- {"version":3,"file":"createTransactionFixtureInAccount.js","sourceRoot":"","sources":["../../../../src/test/fixtures/createTransactionFixtureInAccount.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAoD;AAEpD,SAAsB,0BAA0B,CAAC,OAAO;;;;;;oBAE9C,iBAAiB,GAAG,IAAI,0BAAW,CAAC,SAAS,CAAC;yBAC/C,IAAI,CAAC,CAAC;4BACH,MAAM,EAAE,MAAM;4BACd,MAAM,EAAE,oDAAoD;4BAC5D,WAAW,EAAE,CAAC;4BACd,IAAI,EAAE,IAAI,0BAAW,CAAC,SAAS,CAAC,CAAC,IAAI;yBACxC,CAAC,CAAC;yBACF,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;oBAEhD,qBAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC,iBAAiB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAA;;oBAArE,SAAqE,CAAC;oBAEtE,sBAAO,iBAAiB,EAAC;;;;CAC5B;AAdD,gEAcC"}
1
+ {"version":3,"file":"createTransactionFixtureInAccount.js","sourceRoot":"","sources":["../../../../src/test/fixtures/createTransactionFixtureInAccount.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAoD;AAEpD,SAAsB,0BAA0B,CAAC,OAAO;;;;;;oBAE9C,iBAAiB,GAAG,IAAI,0BAAW,CAAC,SAAS,CAAC;yBAC/C,IAAI,CAAC,CAAC;4BACH,MAAM,EAAE,MAAM;4BACd,MAAM,EAAE,oDAAoD;4BAC5D,WAAW,EAAE,CAAC;4BACd,IAAI,EAAE,IAAI,0BAAW,CAAC,SAAS,CAAC,CAAC,IAAI;yBACxC,CAAC,CAAC;yBACF,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;oBAEhD,qBAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,iBAAiB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAA;;oBAAvE,SAAuE,CAAC;oBAExE,sBAAO,iBAAiB,EAAC;;;;CAC5B;AAdD,gEAcC"}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { Client as _Client } from './Client';
3
3
  import { Platform as _Platform } from './Platform';
4
- import { Wallet as _Wallet, Account as _Account, KeyChain as _KeyChain } from '@dashevo/wallet-lib';
4
+ import { Wallet as _Wallet, Account as _Account, DerivableKeyChain as _KeyChain } from '@dashevo/wallet-lib';
5
5
  export declare namespace SDK {
6
6
  let DAPIClient: any;
7
7
  let Client: typeof _Client;
@@ -45,6 +45,7 @@ export declare namespace SDK {
45
45
  PRIVATEKEY: string;
46
46
  SINGLE_ADDRESS: string;
47
47
  HDWALLET: string;
48
+ HDPRIVATE: string;
48
49
  HDPUBLIC: string;
49
50
  };
50
51
  INJECTION_LISTS: {
@@ -109,6 +110,11 @@ export declare namespace SDK {
109
110
  calculateTransactionFees: typeof import("@dashevo/wallet-libsrc/utils/calculateTransactionFees");
110
111
  categorizeTransactions: typeof import("@dashevo/wallet-libsrc/utils/categorizeTransactions");
111
112
  mnemonicToHDPrivateKey: (mnemonic: any, network?: any, passphrase?: string) => any;
113
+ calculateDuffBalance: (addresses: any, chainStore: any, type?: {
114
+ confirmed: any;
115
+ unconfirmed: any;
116
+ total: any;
117
+ }) => number;
112
118
  generateNewMnemonic: () => any;
113
119
  seedToHDPrivateKey: (seed: any, network?: string) => any;
114
120
  mnemonicToWalletId: (mnemonic: any) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dash",
3
- "version": "3.22.2",
3
+ "version": "3.22.5",
4
4
  "description": "Dash library for JavaScript/TypeScript ecosystem (Wallet, DAPI, Primitives, BLS, ...)",
5
5
  "main": "build/src/index.js",
6
6
  "unpkg": "dist/dash.min.js",
@@ -34,14 +34,14 @@
34
34
  },
35
35
  "homepage": "https://github.com/dashevo/DashJS#readme",
36
36
  "dependencies": {
37
- "@dashevo/dapi-client": "~0.22.2",
38
- "@dashevo/dashcore-lib": "~0.19.31",
39
- "@dashevo/dashpay-contract": "~0.22.2",
40
- "@dashevo/dpns-contract": "~0.22.2",
41
- "@dashevo/dpp": "~0.22.2",
42
- "@dashevo/grpc-common": "~0.22.2",
43
- "@dashevo/masternode-reward-shares-contract": "~0.22.2",
44
- "@dashevo/wallet-lib": "~7.22.2",
37
+ "@dashevo/dapi-client": "~0.22.5",
38
+ "@dashevo/dashcore-lib": "~0.19.33",
39
+ "@dashevo/dashpay-contract": "~0.22.5",
40
+ "@dashevo/dpns-contract": "~0.22.5",
41
+ "@dashevo/dpp": "~0.22.5",
42
+ "@dashevo/grpc-common": "~0.22.5",
43
+ "@dashevo/masternode-reward-shares-contract": "~0.22.5",
44
+ "@dashevo/wallet-lib": "~7.22.5",
45
45
  "bs58": "^4.0.1",
46
46
  "node-inspect-extracted": "^1.0.8"
47
47
  },
@@ -37,7 +37,7 @@ describe('Dash - Client', function suite() {
37
37
 
38
38
  beforeEach(async function beforeEach() {
39
39
  testMnemonic = 'agree country attract master mimic ball load beauty join gentle turtle hover';
40
- testHDKey = "xprv9s21ZrQH143K4PgfRZPuYjYUWRZkGfEPuWTEUESMoEZLC274ntC4G49qxgZJEPgmujsmY52eVggtwZgJPrWTMXmbYgqDVySWg46XzbGXrSZ";
40
+ testHDKey = "tprv8ZgxMBicQKsPeGi4CikhacVPz6UmErenu1PoD3S4XcEDSPP8auRaS8hG3DQtsQ2i9HACgohHwF5sgMVJNksoKqYoZbis8o75Pp1koCme2Yo";
41
41
 
42
42
  client = new Client({
43
43
  wallet: {
@@ -145,7 +145,7 @@ describe('Dash - Client', function suite() {
145
145
  const importedIdentityIds = account.identities.getIdentityIds();
146
146
  // Check that we've imported identities properly
147
147
  expect(importedIdentityIds.length).to.be.equal(accountIdentitiesCountBeforeTest + 1);
148
- expect(importedIdentityIds[0]).to.be.equal(interceptedIdentityStateTransition.getIdentityId().toString());
148
+ expect(importedIdentityIds[1]).to.be.equal(interceptedIdentityStateTransition.getIdentityId().toString());
149
149
  });
150
150
 
151
151
  it('should throw TransitionBroadcastError when transport resolves error', async () => {
@@ -36,11 +36,20 @@ export default async function register(
36
36
  await broadcastStateTransition(this, identityCreateTransition);
37
37
 
38
38
  // If state transition was broadcast without any errors, import identity to the account
39
- account.storage.insertIdentityIdAtIndex(
40
- account.walletId,
41
- identity.getId().toString(),
42
- identityIndex,
39
+ account.storage
40
+ .getWalletStore(account.walletId)
41
+ .insertIdentityIdAtIndex(
42
+ identity.getId().toString(),
43
+ identityIndex,
43
44
  );
44
45
 
46
+ // Current identity object will not have metadata or balance information
47
+ const registeredIdentity = await this.identities.get(identity.getId().toString());
48
+
49
+ // We cannot just return registeredIdentity as we want to
50
+ // keep additional information (assetLockProof and transaction) instance
51
+ identity.setMetadata(registeredIdentity.metadata);
52
+ identity.setBalance(registeredIdentity.balance);
53
+
45
54
  return identity;
46
55
  }
package/src/SDK/SDK.ts CHANGED
@@ -6,7 +6,7 @@ import { default as _DAPIClient } from '@dashevo/dapi-client';
6
6
  import {
7
7
  Wallet as _Wallet,
8
8
  Account as _Account,
9
- KeyChain as _KeyChain,
9
+ DerivableKeyChain as _KeyChain,
10
10
  CONSTANTS as _WalletLibCONSTANTS,
11
11
  EVENTS as _WalletLibEVENTS,
12
12
  utils as _WalletLibUtils,
@@ -4,7 +4,7 @@ const getIdentityFixture = require('@dashevo/dpp/lib/test/fixtures/getIdentityFi
4
4
 
5
5
  export function createIdentityFixtureInAccount(account) {
6
6
  const identityFixture = getIdentityFixture();
7
- const identityFixtureIndex = 10000;
7
+ const identityFixtureIndex = 0;
8
8
  const { privateKey: identityPrivateKey } = account.identities.getIdentityHDKeyByIndex(identityFixtureIndex, 0);
9
9
 
10
10
  identityFixture.publicKeys[0] = new IdentityPublicKey({
@@ -15,8 +15,9 @@ export function createIdentityFixtureInAccount(account) {
15
15
  securityLevel: IdentityPublicKey.SECURITY_LEVELS.MASTER
16
16
  });
17
17
 
18
- account.storage.insertIdentityIdAtIndex(
19
- account.walletId,
18
+ account.storage
19
+ .getWalletStore(account.walletId)
20
+ .insertIdentityIdAtIndex(
20
21
  identityFixture.getId().toString(),
21
22
  identityFixtureIndex,
22
23
  );
@@ -11,7 +11,7 @@ export async function createTransactionInAccount(account) {
11
11
  }])
12
12
  .to(account.getAddress(10).address, 100000);
13
13
 
14
- await account.importTransactions([walletTransaction.serialize(true)]);
14
+ await account.importTransactions([[walletTransaction.serialize(true)]]);
15
15
 
16
16
  return walletTransaction;
17
- }
17
+ }