Skip to content

Commit 0707ade

Browse files
committed
Merge branch 'role-based-permissions' into 'pbsa-develop'
Role based permissions See merge request PBSA/PeerplaysIO/tools-libs/peerplaysjs-lib!52
2 parents 38559f0 + cd7a598 commit 0707ade

File tree

9 files changed

+990
-34
lines changed

9 files changed

+990
-34
lines changed

build/peerplaysjs-lib.js

Lines changed: 302 additions & 11 deletions
Large diffs are not rendered by default.

build/peerplaysjs-lib.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/chain/src/ChainStore.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,6 +1796,7 @@ var ChainStore = function () {
17961796
current = current.set('bitasset', bad);
17971797
this.objects_by_id = this.objects_by_id.set(object.id, current);
17981798
}
1799+
17991800
//lottery asset
18001801
if (object.lottery_options && this.lotteries_ids.findIndex(function (item) {
18011802
return item === object.id;
@@ -2211,7 +2212,7 @@ var ChainStore = function () {
22112212
};
22122213

22132214
ChainStore.prototype.getLastIdLottery = function getLastIdLottery() {
2214-
return _ws.Apis.instance().db_api().exec("get_lotteries", ['1.3.0', 1, '1.3.0']).then(function (lotteries) {
2215+
return _ws.Apis.instance().db_api().exec('get_lotteries', ['1.3.0', 1, '1.3.0']).then(function (lotteries) {
22152216

22162217
if (!lotteries || !lotteries.length) {
22172218
return '1.3.0';
@@ -2241,9 +2242,9 @@ var ChainStore = function () {
22412242
return resolve(self.lotteries_ids);
22422243
}
22432244

2244-
return _ws.Apis.instance().db_api().exec("get_lotteries", [prevId, limit, nextId]).then(function (lotteries) {
2245+
return _ws.Apis.instance().db_api().exec('get_lotteries', [prevId, limit, nextId]).then(function (lotteries) {
22452246

2246-
if (!lotteries.length || !lotteries.length) {
2247+
if (!lotteries.length) {
22472248
self.lotteries_ids_initialized = true;
22482249
return resolve(self.lotteries_ids);
22492250
}

dist/chain/src/ChainTypes.js

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ var object_type = {
3434
betting_market_rules: 23,
3535
betting_market_group: 24,
3636
betting_market: 25,
37-
bet: 26
37+
bet: 26,
38+
custom_permission: 27,
39+
custom_account_authority: 28,
40+
offer: 29,
41+
nft_metadata: 30,
42+
nft: 31
3843
};
3944

4045
var impl_object_type = {
@@ -61,7 +66,8 @@ var impl_object_type = {
6166
betting_market_position: 20,
6267
global_betting_statistics: 21,
6368
lottery_balance: 22,
64-
sweeps_vesting_balance: 23
69+
sweeps_vesting_balance: 23,
70+
offer_history: 24
6571
};
6672

6773
var vote_type = {
@@ -152,7 +158,23 @@ var operations = {
152158
ticket_purchase: 78,
153159
lottery_reward: 79,
154160
lottery_end: 80,
155-
sweeps_vesting_claim: 81
161+
sweeps_vesting_claim: 81,
162+
custom_permission_create: 82,
163+
custom_permission_update: 83,
164+
custom_permission_delete: 84,
165+
custom_account_authority_create: 85,
166+
custom_account_authority_update: 86,
167+
custom_account_authority_delete: 87,
168+
offer: 88,
169+
bid: 89,
170+
cancel_offer: 90,
171+
finalize_offer: 91,
172+
nft_metadata_create: 92,
173+
nft_metadata_update: 93,
174+
nft_mint: 94,
175+
nft_safe_transfer_from: 95,
176+
nft_approve: 96,
177+
nft_set_approval_for_all: 97
156178
};
157179

158180
var ChainTypes = {

dist/serializer/src/operations.js

Lines changed: 252 additions & 8 deletions
Large diffs are not rendered by default.

dist/serializer/src/types.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,31 @@ Types.enumeration = function (values) {
12051205
return enumeration;
12061206
};
12071207

1208+
Types.double = {
1209+
fromByteBuffer: function fromByteBuffer(b) {
1210+
return b.readDouble();
1211+
},
1212+
appendByteBuffer: function appendByteBuffer(b, object) {
1213+
_SerializerValidation2.default.required(object);
1214+
_SerializerValidation2.default.number(object);
1215+
b.writeDouble(object);
1216+
},
1217+
fromObject: function fromObject(object) {
1218+
_SerializerValidation2.default.number(object);
1219+
return object;
1220+
},
1221+
toObject: function toObject(object) {
1222+
var debug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1223+
1224+
if (debug.use_default && object === undefined) {
1225+
return '0';
1226+
}
1227+
1228+
_SerializerValidation2.default.required(object);
1229+
return parseFloat(object);
1230+
}
1231+
};
1232+
12081233
Types.sha256 = Types.bytes(32);
12091234

12101235
exports.default = Types;

lib/chain/src/ChainTypes.js

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ const object_type = {
3131
betting_market_rules: 23,
3232
betting_market_group: 24,
3333
betting_market: 25,
34-
bet: 26
34+
bet: 26,
35+
custom_permission: 27,
36+
custom_account_authority: 28,
37+
offer: 29,
38+
nft_metadata: 30,
39+
nft: 31
3540
};
3641

3742
const impl_object_type = {
@@ -58,7 +63,8 @@ const impl_object_type = {
5863
betting_market_position: 20,
5964
global_betting_statistics: 21,
6065
lottery_balance: 22,
61-
sweeps_vesting_balance: 23
66+
sweeps_vesting_balance: 23,
67+
offer_history: 24
6268
};
6369

6470
const vote_type = {
@@ -149,7 +155,23 @@ const operations = {
149155
ticket_purchase: 78,
150156
lottery_reward: 79,
151157
lottery_end: 80,
152-
sweeps_vesting_claim: 81
158+
sweeps_vesting_claim: 81,
159+
custom_permission_create: 82,
160+
custom_permission_update: 83,
161+
custom_permission_delete: 84,
162+
custom_account_authority_create: 85,
163+
custom_account_authority_update: 86,
164+
custom_account_authority_delete: 87,
165+
offer: 88,
166+
bid: 89,
167+
cancel_offer: 90,
168+
finalize_offer: 91,
169+
nft_metadata_create: 92,
170+
nft_metadata_update: 93,
171+
nft_mint: 94,
172+
nft_safe_transfer_from: 95,
173+
nft_approve: 96,
174+
nft_set_approval_for_all: 97
153175
};
154176

155177
const ChainTypes = {

0 commit comments

Comments
 (0)