dash-platform-sdk 1.3.0-dev.3 → 1.3.0-dev.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.
Files changed (139) hide show
  1. package/bundle.min.js +21 -2
  2. package/package.json +30 -31
  3. package/proto/generated/google/protobuf/wrappers.d.ts +260 -29
  4. package/proto/generated/platform.client.d.ts +251 -0
  5. package/proto/generated/platform.d.ts +3682 -1939
  6. package/src/DashPlatformSDK.d.ts +5 -4
  7. package/src/contestedResources/createStateTransition.d.ts +1 -2
  8. package/src/grpcConnectionPool.d.ts +30 -8
  9. package/src/keyPair/deriveChild.d.ts +2 -2
  10. package/src/keyPair/derivePath.d.ts +2 -2
  11. package/src/keyPair/index.d.ts +39 -114
  12. package/src/keyPair/mnemonicToSeed.d.ts +1 -1
  13. package/src/names/searchByIdentity.d.ts +1 -1
  14. package/src/node/index.d.ts +3 -3
  15. package/src/node/totalCredits.d.ts +2 -1
  16. package/src/tokens/getTokenDirectPurchasePrices.d.ts +3 -0
  17. package/src/tokens/index.d.ts +9 -1
  18. package/src/types.d.ts +10 -12
  19. package/src/utils/bytesToTypedArray.d.ts +1 -0
  20. package/src/utils/calculateMsgHash.d.ts +1 -1
  21. package/src/utils/calculateSignHash.d.ts +1 -1
  22. package/src/utils/calculateStateIdHash.d.ts +1 -1
  23. package/src/utils/createVoterIdentityId.d.ts +1 -1
  24. package/src/utils/getEvonodeList.d.ts +2 -2
  25. package/src/utils/sha256.d.ts +1 -1
  26. package/src/utils/signHash.d.ts +1 -1
  27. package/src/utils/signRequestId.d.ts +1 -1
  28. package/src/utils/verifyTenderdashProof.d.ts +1 -1
  29. package/src/voting/createStateTransition.d.ts +1 -2
  30. package/src/voting/index.d.ts +3 -4
  31. package/bundle.min.js.LICENSE.txt +0 -1
  32. package/index.js +0 -5
  33. package/proto/generated/google/protobuf/wrappers.js +0 -398
  34. package/proto/generated/platform.js +0 -18524
  35. package/src/DashPlatformSDK.js +0 -91
  36. package/src/constants.js +0 -13
  37. package/src/contestedResources/createStateTransition.js +0 -9
  38. package/src/contestedResources/getContestedResourceVoteState.js +0 -123
  39. package/src/contestedResources/index.js +0 -76
  40. package/src/dataContracts/create.js +0 -14
  41. package/src/dataContracts/createStateTransition.js +0 -23
  42. package/src/dataContracts/getDataContractByIdentifier.js +0 -87
  43. package/src/dataContracts/index.js +0 -103
  44. package/src/documents/create.js +0 -7
  45. package/src/documents/createStateTransition.js +0 -64
  46. package/src/documents/index.js +0 -130
  47. package/src/documents/query.js +0 -94
  48. package/src/grpcConnectionPool.js +0 -137
  49. package/src/identities/createStateTransition.js +0 -46
  50. package/src/identities/getIdentityBalance.js +0 -83
  51. package/src/identities/getIdentityByIdentifier.js +0 -83
  52. package/src/identities/getIdentityByNonUniquePublicKeyHash.js +0 -85
  53. package/src/identities/getIdentityByPublicKeyHash.js +0 -83
  54. package/src/identities/getIdentityContractNonce.js +0 -86
  55. package/src/identities/getIdentityNonce.js +0 -84
  56. package/src/identities/getIdentityPublicKeys.js +0 -85
  57. package/src/identities/index.js +0 -237
  58. package/src/keyPair/deriveChild.js +0 -50
  59. package/src/keyPair/derivePath.js +0 -50
  60. package/src/keyPair/index.js +0 -323
  61. package/src/keyPair/keyToPublicKey.d.ts +0 -2
  62. package/src/keyPair/keyToPublicKey.js +0 -47
  63. package/src/keyPair/keyToWalletId.d.ts +0 -2
  64. package/src/keyPair/keyToWalletId.js +0 -50
  65. package/src/keyPair/keyToXPrivateKey.d.ts +0 -3
  66. package/src/keyPair/keyToXPrivateKey.js +0 -50
  67. package/src/keyPair/keyToXPublicKey.d.ts +0 -3
  68. package/src/keyPair/keyToXPublicKey.js +0 -50
  69. package/src/keyPair/mnemonicToIdentityKey.d.ts +0 -3
  70. package/src/keyPair/mnemonicToIdentityKey.js +0 -57
  71. package/src/keyPair/mnemonicToSeed.js +0 -47
  72. package/src/keyPair/mnemonicToWallet.d.ts +0 -2
  73. package/src/keyPair/mnemonicToWallet.js +0 -55
  74. package/src/keyPair/privateKeyToWif.d.ts +0 -2
  75. package/src/keyPair/privateKeyToWif.js +0 -50
  76. package/src/keyPair/publicKeyToAddress.d.ts +0 -2
  77. package/src/keyPair/publicKeyToAddress.js +0 -50
  78. package/src/keyPair/seedToWallet.d.ts +0 -2
  79. package/src/keyPair/seedToWallet.js +0 -50
  80. package/src/keyPair/walletToIdentityKey.d.ts +0 -3
  81. package/src/keyPair/walletToIdentityKey.js +0 -56
  82. package/src/keyPair/xkeyToHDXKey.d.ts +0 -2
  83. package/src/keyPair/xkeyToHDXKey.js +0 -50
  84. package/src/names/index.js +0 -170
  85. package/src/names/registerName.js +0 -131
  86. package/src/names/searchByIdentity.js +0 -51
  87. package/src/names/searchByName.js +0 -64
  88. package/src/names/testNameContested.js +0 -6
  89. package/src/names/validateName.js +0 -14
  90. package/src/node/epochs.js +0 -88
  91. package/src/node/index.js +0 -102
  92. package/src/node/status.js +0 -85
  93. package/src/node/totalCredits.js +0 -76
  94. package/src/signer/AbstractSigner.js +0 -2
  95. package/src/signer/PrivateKeySigner.d.ts +0 -0
  96. package/src/signer/PrivateKeySigner.js +0 -64
  97. package/src/signer/setSigner.js +0 -8
  98. package/src/stateTransitions/broadcast.js +0 -60
  99. package/src/stateTransitions/index.js +0 -87
  100. package/src/stateTransitions/waitForStateTransitionResult.js +0 -60
  101. package/src/tokens/createStateTransition.js +0 -79
  102. package/src/tokens/getIdentitiesTokenBalances.js +0 -86
  103. package/src/tokens/getIdentityTokensBalances.js +0 -86
  104. package/src/tokens/getTokenContractInfo.js +0 -86
  105. package/src/tokens/getTokenTotalSupply.js +0 -84
  106. package/src/tokens/index.js +0 -175
  107. package/src/types.js +0 -25
  108. package/src/utils/base58ToBytes.js +0 -7
  109. package/src/utils/bytesToHex.js +0 -6
  110. package/src/utils/calculateMsgHash.js +0 -34
  111. package/src/utils/calculateSignHash.js +0 -11
  112. package/src/utils/calculateStateIdHash.js +0 -12
  113. package/src/utils/convertToHomographSafeChars.js +0 -14
  114. package/src/utils/createVoterIdentityId.js +0 -12
  115. package/src/utils/getEvonodeList.js +0 -63
  116. package/src/utils/getQuorumPublicKey.js +0 -69
  117. package/src/utils/getRandomArrayItem.js +0 -6
  118. package/src/utils/getRandomBytes.js +0 -7
  119. package/src/utils/hexToBytes.js +0 -7
  120. package/src/utils/index.js +0 -68
  121. package/src/utils/indexBytesToString.js +0 -7
  122. package/src/utils/sha256.js +0 -13
  123. package/src/utils/signHash.js +0 -25
  124. package/src/utils/signRequestId.js +0 -22
  125. package/src/utils/sleep.js +0 -51
  126. package/src/utils/stringToIndexValueBytes.js +0 -13
  127. package/src/utils/verifyTenderdashProof.js +0 -30
  128. package/src/voting/createStateTransition.js +0 -9
  129. package/src/voting/createVote.js +0 -8
  130. package/src/voting/index.js +0 -62
  131. package/test/unit/ContestedResources.spec.js +0 -338
  132. package/test/unit/DataContract.spec.js +0 -142
  133. package/test/unit/Document.spec.js +0 -199
  134. package/test/unit/Identity.spec.js +0 -357
  135. package/test/unit/KeyPair.spec.js +0 -149
  136. package/test/unit/Names.spec.js +0 -96
  137. package/test/unit/Node.spec.js +0 -129
  138. package/test/unit/SDK.spec.js +0 -12
  139. package/test/unit/Tokens.spec.js +0 -271
@@ -1,271 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- var types_1 = require("../../src/types");
40
- var pshenmic_dpp_1 = require("pshenmic-dpp");
41
- var sdk;
42
- describe('Tokens', function () {
43
- beforeAll(function () {
44
- sdk = new types_1.DashPlatformSDK();
45
- });
46
- test('should be able to get token total supply', function () { return __awaiter(void 0, void 0, void 0, function () {
47
- var tokenTotalSupply;
48
- return __generator(this, function (_a) {
49
- switch (_a.label) {
50
- case 0: return [4 /*yield*/, sdk.tokens.getTokenTotalSupply('9YxdbQUjJmQsmVPen95HjAU3Esj7tVkWSY2EQWT84ZQP')];
51
- case 1:
52
- tokenTotalSupply = _a.sent();
53
- expect(tokenTotalSupply.tokenId).toBeTruthy();
54
- expect(tokenTotalSupply.totalSystemAmount).toBeTruthy();
55
- expect(tokenTotalSupply.totalAggregatedAmountInUserAccounts).toBeTruthy();
56
- return [2 /*return*/];
57
- }
58
- });
59
- }); });
60
- test('should be able to get token contract info', function () { return __awaiter(void 0, void 0, void 0, function () {
61
- var tokenContractInfo;
62
- return __generator(this, function (_a) {
63
- switch (_a.label) {
64
- case 0: return [4 /*yield*/, sdk.tokens.getTokenContractInfo('9YxdbQUjJmQsmVPen95HjAU3Esj7tVkWSY2EQWT84ZQP')];
65
- case 1:
66
- tokenContractInfo = _a.sent();
67
- expect(tokenContractInfo.dataContractId.base58()).toEqual('Y189uedQG3CJCuu83P3DqnG7ngQaRKz69x3gY8uDzQe');
68
- expect(tokenContractInfo.tokenContractPosition).toEqual(0);
69
- return [2 /*return*/];
70
- }
71
- });
72
- }); });
73
- test('should be able to get identity tokens balances', function () { return __awaiter(void 0, void 0, void 0, function () {
74
- var tokensIdentityBalance;
75
- return __generator(this, function (_a) {
76
- switch (_a.label) {
77
- case 0: return [4 /*yield*/, sdk.tokens.getIdentityTokensBalances('8eTDkBhpQjHeqgbVeriwLeZr1tCa6yBGw76SckvD1cwc', ['9YxdbQUjJmQsmVPen95HjAU3Esj7tVkWSY2EQWT84ZQP'])];
78
- case 1:
79
- tokensIdentityBalance = _a.sent();
80
- expect(tokensIdentityBalance.length).toEqual(1);
81
- expect(tokensIdentityBalance[0].tokenId).toBeTruthy();
82
- expect(tokensIdentityBalance[0].balance).toBeTruthy();
83
- return [2 /*return*/];
84
- }
85
- });
86
- }); });
87
- test('should be able to get token identities token balances', function () { return __awaiter(void 0, void 0, void 0, function () {
88
- var tokensIdentityBalance;
89
- return __generator(this, function (_a) {
90
- switch (_a.label) {
91
- case 0: return [4 /*yield*/, sdk.tokens.getIdentitiesTokenBalances(['8eTDkBhpQjHeqgbVeriwLeZr1tCa6yBGw76SckvD1cwc'], '9YxdbQUjJmQsmVPen95HjAU3Esj7tVkWSY2EQWT84ZQP')];
92
- case 1:
93
- tokensIdentityBalance = _a.sent();
94
- expect(tokensIdentityBalance.length).toEqual(1);
95
- expect(tokensIdentityBalance[0].identityId).toBeTruthy();
96
- expect(tokensIdentityBalance[0].balance).toBeTruthy();
97
- return [2 /*return*/];
98
- }
99
- });
100
- }); });
101
- test('should be able to create base token transition', function () { return __awaiter(void 0, void 0, void 0, function () {
102
- var tokenBaseTransition;
103
- return __generator(this, function (_a) {
104
- switch (_a.label) {
105
- case 0: return [4 /*yield*/, sdk.tokens.createBaseTransition('A36eJF2kyYXwxCtJGsgbR3CTAscUFaNxZN19UqUfM1kw', '34vkjdeUTP2z798SiXqoB6EAuobh51kXYURqVa9xkujf')];
106
- case 1:
107
- tokenBaseTransition = _a.sent();
108
- expect(tokenBaseTransition).toBeInstanceOf(pshenmic_dpp_1.TokenBaseTransitionWASM);
109
- return [2 /*return*/];
110
- }
111
- });
112
- }); });
113
- describe('create state transitions', function () {
114
- test('should be able to create burn transition', function () { return __awaiter(void 0, void 0, void 0, function () {
115
- var tokenId, owner, amount, tokenBaseTransition, stateTransition;
116
- return __generator(this, function (_a) {
117
- switch (_a.label) {
118
- case 0:
119
- tokenId = '6niNoQpsT9zyVDJtXcbpV3tR3qEGi6BC6xoDdJyx1u7C';
120
- owner = 'HT3pUBM1Uv2mKgdPEN1gxa7A4PdsvNY89aJbdSKQb5wR';
121
- amount = BigInt(10);
122
- return [4 /*yield*/, sdk.tokens.createBaseTransition(tokenId, owner)];
123
- case 1:
124
- tokenBaseTransition = _a.sent();
125
- stateTransition = sdk.tokens.createStateTransition(tokenBaseTransition, owner, 'burn', { amount: amount });
126
- expect(stateTransition).toBeInstanceOf(pshenmic_dpp_1.StateTransitionWASM);
127
- return [2 /*return*/];
128
- }
129
- });
130
- }); });
131
- test('should be able to create mint transition', function () { return __awaiter(void 0, void 0, void 0, function () {
132
- var tokenId, owner, recipientId, amount, tokenBaseTransition, stateTransition;
133
- return __generator(this, function (_a) {
134
- switch (_a.label) {
135
- case 0:
136
- tokenId = '6niNoQpsT9zyVDJtXcbpV3tR3qEGi6BC6xoDdJyx1u7C';
137
- owner = 'HT3pUBM1Uv2mKgdPEN1gxa7A4PdsvNY89aJbdSKQb5wR';
138
- recipientId = '8GopLQQCViyroS2gHktesGaCMe2tueXWeQ6Y9vpMFTEC';
139
- amount = BigInt(10);
140
- return [4 /*yield*/, sdk.tokens.createBaseTransition(tokenId, owner)];
141
- case 1:
142
- tokenBaseTransition = _a.sent();
143
- stateTransition = sdk.tokens.createStateTransition(tokenBaseTransition, owner, 'mint', { identityId: recipientId, amount: amount });
144
- expect(stateTransition).toBeInstanceOf(pshenmic_dpp_1.StateTransitionWASM);
145
- return [2 /*return*/];
146
- }
147
- });
148
- }); });
149
- test('should be able to create transfer transition', function () { return __awaiter(void 0, void 0, void 0, function () {
150
- var tokenId, owner, recipient, amount, tokenBaseTransition, stateTransition;
151
- return __generator(this, function (_a) {
152
- switch (_a.label) {
153
- case 0:
154
- tokenId = '6niNoQpsT9zyVDJtXcbpV3tR3qEGi6BC6xoDdJyx1u7C';
155
- owner = 'HT3pUBM1Uv2mKgdPEN1gxa7A4PdsvNY89aJbdSKQb5wR';
156
- recipient = '8GopLQQCViyroS2gHktesGaCMe2tueXWeQ6Y9vpMFTEC';
157
- amount = BigInt(100);
158
- return [4 /*yield*/, sdk.tokens.createBaseTransition(tokenId, owner)];
159
- case 1:
160
- tokenBaseTransition = _a.sent();
161
- stateTransition = sdk.tokens.createStateTransition(tokenBaseTransition, owner, 'transfer', { identityId: recipient, amount: amount });
162
- expect(stateTransition).toBeInstanceOf(pshenmic_dpp_1.StateTransitionWASM);
163
- return [2 /*return*/];
164
- }
165
- });
166
- }); });
167
- test('should be able to create freeze transition', function () { return __awaiter(void 0, void 0, void 0, function () {
168
- var tokenId, owner, identityId, tokenBaseTransition, stateTransition;
169
- return __generator(this, function (_a) {
170
- switch (_a.label) {
171
- case 0:
172
- tokenId = '6niNoQpsT9zyVDJtXcbpV3tR3qEGi6BC6xoDdJyx1u7C';
173
- owner = 'HT3pUBM1Uv2mKgdPEN1gxa7A4PdsvNY89aJbdSKQb5wR';
174
- identityId = '8GopLQQCViyroS2gHktesGaCMe2tueXWeQ6Y9vpMFTEC';
175
- return [4 /*yield*/, sdk.tokens.createBaseTransition(tokenId, owner)];
176
- case 1:
177
- tokenBaseTransition = _a.sent();
178
- stateTransition = sdk.tokens.createStateTransition(tokenBaseTransition, owner, 'freeze', { identityId: identityId });
179
- expect(stateTransition).toBeInstanceOf(pshenmic_dpp_1.StateTransitionWASM);
180
- return [2 /*return*/];
181
- }
182
- });
183
- }); });
184
- test('should be able to create unfreeze transition', function () { return __awaiter(void 0, void 0, void 0, function () {
185
- var tokenId, owner, identityId, tokenBaseTransition, stateTransition;
186
- return __generator(this, function (_a) {
187
- switch (_a.label) {
188
- case 0:
189
- tokenId = '6niNoQpsT9zyVDJtXcbpV3tR3qEGi6BC6xoDdJyx1u7C';
190
- owner = 'HT3pUBM1Uv2mKgdPEN1gxa7A4PdsvNY89aJbdSKQb5wR';
191
- identityId = '8GopLQQCViyroS2gHktesGaCMe2tueXWeQ6Y9vpMFTEC';
192
- return [4 /*yield*/, sdk.tokens.createBaseTransition(tokenId, owner)];
193
- case 1:
194
- tokenBaseTransition = _a.sent();
195
- stateTransition = sdk.tokens.createStateTransition(tokenBaseTransition, owner, 'unfreeze', { identityId: identityId });
196
- expect(stateTransition).toBeInstanceOf(pshenmic_dpp_1.StateTransitionWASM);
197
- return [2 /*return*/];
198
- }
199
- });
200
- }); });
201
- test('should be able to create destroyFrozenFunds transition', function () { return __awaiter(void 0, void 0, void 0, function () {
202
- var tokenId, owner, identityId, tokenBaseTransition, stateTransition;
203
- return __generator(this, function (_a) {
204
- switch (_a.label) {
205
- case 0:
206
- tokenId = '6niNoQpsT9zyVDJtXcbpV3tR3qEGi6BC6xoDdJyx1u7C';
207
- owner = 'HT3pUBM1Uv2mKgdPEN1gxa7A4PdsvNY89aJbdSKQb5wR';
208
- identityId = '8GopLQQCViyroS2gHktesGaCMe2tueXWeQ6Y9vpMFTEC';
209
- return [4 /*yield*/, sdk.tokens.createBaseTransition(tokenId, owner)];
210
- case 1:
211
- tokenBaseTransition = _a.sent();
212
- stateTransition = sdk.tokens.createStateTransition(tokenBaseTransition, owner, 'destroyFrozenFunds', { identityId: identityId });
213
- expect(stateTransition).toBeInstanceOf(pshenmic_dpp_1.StateTransitionWASM);
214
- return [2 /*return*/];
215
- }
216
- });
217
- }); });
218
- test('should be able to create emergency action transition', function () { return __awaiter(void 0, void 0, void 0, function () {
219
- var tokenId, owner, emergencyAction, tokenBaseTransition, stateTransition;
220
- return __generator(this, function (_a) {
221
- switch (_a.label) {
222
- case 0:
223
- tokenId = '6niNoQpsT9zyVDJtXcbpV3tR3qEGi6BC6xoDdJyx1u7C';
224
- owner = 'HT3pUBM1Uv2mKgdPEN1gxa7A4PdsvNY89aJbdSKQb5wR';
225
- emergencyAction = pshenmic_dpp_1.TokenEmergencyActionWASM.Pause;
226
- return [4 /*yield*/, sdk.tokens.createBaseTransition(tokenId, owner)];
227
- case 1:
228
- tokenBaseTransition = _a.sent();
229
- stateTransition = sdk.tokens.createStateTransition(tokenBaseTransition, owner, 'emergencyAction', { emergencyAction: emergencyAction });
230
- expect(stateTransition).toBeInstanceOf(pshenmic_dpp_1.StateTransitionWASM);
231
- return [2 /*return*/];
232
- }
233
- });
234
- }); });
235
- test('should be able to create setPriceForDirectPurchase transition', function () { return __awaiter(void 0, void 0, void 0, function () {
236
- var tokenId, owner, price, tokenBaseTransition, stateTransition;
237
- return __generator(this, function (_a) {
238
- switch (_a.label) {
239
- case 0:
240
- tokenId = '6niNoQpsT9zyVDJtXcbpV3tR3qEGi6BC6xoDdJyx1u7C';
241
- owner = 'HT3pUBM1Uv2mKgdPEN1gxa7A4PdsvNY89aJbdSKQb5wR';
242
- price = BigInt(10);
243
- return [4 /*yield*/, sdk.tokens.createBaseTransition(tokenId, owner)];
244
- case 1:
245
- tokenBaseTransition = _a.sent();
246
- stateTransition = sdk.tokens.createStateTransition(tokenBaseTransition, owner, 'setPriceForDirectPurchase', { price: price });
247
- expect(stateTransition).toBeInstanceOf(pshenmic_dpp_1.StateTransitionWASM);
248
- return [2 /*return*/];
249
- }
250
- });
251
- }); });
252
- test('should be able to create directPurchase transition', function () { return __awaiter(void 0, void 0, void 0, function () {
253
- var tokenId, owner, amount, totalAgreedPrice, tokenBaseTransition, stateTransition;
254
- return __generator(this, function (_a) {
255
- switch (_a.label) {
256
- case 0:
257
- tokenId = '6niNoQpsT9zyVDJtXcbpV3tR3qEGi6BC6xoDdJyx1u7C';
258
- owner = 'HT3pUBM1Uv2mKgdPEN1gxa7A4PdsvNY89aJbdSKQb5wR';
259
- amount = BigInt(10);
260
- totalAgreedPrice = BigInt(100);
261
- return [4 /*yield*/, sdk.tokens.createBaseTransition(tokenId, owner)];
262
- case 1:
263
- tokenBaseTransition = _a.sent();
264
- stateTransition = sdk.tokens.createStateTransition(tokenBaseTransition, owner, 'directPurchase', { amount: amount, totalAgreedPrice: totalAgreedPrice });
265
- expect(stateTransition).toBeInstanceOf(pshenmic_dpp_1.StateTransitionWASM);
266
- return [2 /*return*/];
267
- }
268
- });
269
- }); });
270
- });
271
- });