protobuf-platform 1.2.718 → 1.2.719
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/bonus/bonus.proto +6 -0
- package/bonus/bonus_pb.js +147 -3
- package/package.json +1 -1
- package/scripts/verify-bonus-currency-contract.js +34 -0
package/bonus/bonus.proto
CHANGED
|
@@ -642,6 +642,8 @@ message ActiveWageringUserBonusItem {
|
|
|
642
642
|
optional string priority_bankroll = 12;
|
|
643
643
|
// Business-allowed: "real" | "bonus"
|
|
644
644
|
optional string payout_destination = 13;
|
|
645
|
+
// Denomination of this UserBonus monetary amounts and wagering; absence is unknown.
|
|
646
|
+
optional string currency = 14;
|
|
645
647
|
}
|
|
646
648
|
message GetCommonUserBonusItemsRequest {
|
|
647
649
|
int32 user_id = 1;
|
|
@@ -665,6 +667,8 @@ message ValidateSelectedWageringUserBonusRequest {
|
|
|
665
667
|
uint64 selected_user_bonus_id = 2;
|
|
666
668
|
uint64 wager_games_list_id = 3;
|
|
667
669
|
string selected_balance_type = 4; // Business-allowed: "real" | "bonus"
|
|
670
|
+
// Actual selected Payment wallet currency; absence is not a currency match.
|
|
671
|
+
optional string wallet_currency = 5;
|
|
668
672
|
}
|
|
669
673
|
message ValidateSelectedWageringUserBonusResponse {
|
|
670
674
|
uint64 selected_user_bonus_id = 1;
|
|
@@ -686,6 +690,8 @@ message ValidateSelectedWageringUserBonusResponse {
|
|
|
686
690
|
optional string priority_bankroll = 14;
|
|
687
691
|
// Business-allowed: "real" | "bonus"
|
|
688
692
|
optional string payout_destination = 15;
|
|
693
|
+
// Denomination of this UserBonus monetary amounts and wagering; absence is unknown.
|
|
694
|
+
optional string currency = 16;
|
|
689
695
|
}
|
|
690
696
|
//Common Lists
|
|
691
697
|
message BonusType {
|
package/bonus/bonus_pb.js
CHANGED
|
@@ -25936,7 +25936,8 @@ proto.bonus.ActiveWageringUserBonusItem.toObject = function(includeInstance, msg
|
|
|
25936
25936
|
wagerBalancePriority: jspb.Message.getFieldWithDefault(msg, 10, ""),
|
|
25937
25937
|
bankrollMode: jspb.Message.getFieldWithDefault(msg, 11, ""),
|
|
25938
25938
|
priorityBankroll: jspb.Message.getFieldWithDefault(msg, 12, ""),
|
|
25939
|
-
payoutDestination: jspb.Message.getFieldWithDefault(msg, 13, "")
|
|
25939
|
+
payoutDestination: jspb.Message.getFieldWithDefault(msg, 13, ""),
|
|
25940
|
+
currency: jspb.Message.getFieldWithDefault(msg, 14, "")
|
|
25940
25941
|
};
|
|
25941
25942
|
|
|
25942
25943
|
if (includeInstance) {
|
|
@@ -26025,6 +26026,10 @@ proto.bonus.ActiveWageringUserBonusItem.deserializeBinaryFromReader = function(m
|
|
|
26025
26026
|
var value = /** @type {string} */ (reader.readString());
|
|
26026
26027
|
msg.setPayoutDestination(value);
|
|
26027
26028
|
break;
|
|
26029
|
+
case 14:
|
|
26030
|
+
var value = /** @type {string} */ (reader.readString());
|
|
26031
|
+
msg.setCurrency(value);
|
|
26032
|
+
break;
|
|
26028
26033
|
default:
|
|
26029
26034
|
reader.skipField();
|
|
26030
26035
|
break;
|
|
@@ -26145,6 +26150,13 @@ proto.bonus.ActiveWageringUserBonusItem.serializeBinaryToWriter = function(messa
|
|
|
26145
26150
|
f
|
|
26146
26151
|
);
|
|
26147
26152
|
}
|
|
26153
|
+
f = /** @type {string} */ (jspb.Message.getField(message, 14));
|
|
26154
|
+
if (f != null) {
|
|
26155
|
+
writer.writeString(
|
|
26156
|
+
14,
|
|
26157
|
+
f
|
|
26158
|
+
);
|
|
26159
|
+
}
|
|
26148
26160
|
};
|
|
26149
26161
|
|
|
26150
26162
|
|
|
@@ -26599,6 +26611,42 @@ proto.bonus.ActiveWageringUserBonusItem.prototype.hasPayoutDestination = functio
|
|
|
26599
26611
|
};
|
|
26600
26612
|
|
|
26601
26613
|
|
|
26614
|
+
/**
|
|
26615
|
+
* optional string currency = 14;
|
|
26616
|
+
* @return {string}
|
|
26617
|
+
*/
|
|
26618
|
+
proto.bonus.ActiveWageringUserBonusItem.prototype.getCurrency = function() {
|
|
26619
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 14, ""));
|
|
26620
|
+
};
|
|
26621
|
+
|
|
26622
|
+
|
|
26623
|
+
/**
|
|
26624
|
+
* @param {string} value
|
|
26625
|
+
* @return {!proto.bonus.ActiveWageringUserBonusItem} returns this
|
|
26626
|
+
*/
|
|
26627
|
+
proto.bonus.ActiveWageringUserBonusItem.prototype.setCurrency = function(value) {
|
|
26628
|
+
return jspb.Message.setField(this, 14, value);
|
|
26629
|
+
};
|
|
26630
|
+
|
|
26631
|
+
|
|
26632
|
+
/**
|
|
26633
|
+
* Clears the field making it undefined.
|
|
26634
|
+
* @return {!proto.bonus.ActiveWageringUserBonusItem} returns this
|
|
26635
|
+
*/
|
|
26636
|
+
proto.bonus.ActiveWageringUserBonusItem.prototype.clearCurrency = function() {
|
|
26637
|
+
return jspb.Message.setField(this, 14, undefined);
|
|
26638
|
+
};
|
|
26639
|
+
|
|
26640
|
+
|
|
26641
|
+
/**
|
|
26642
|
+
* Returns whether this field is set.
|
|
26643
|
+
* @return {boolean}
|
|
26644
|
+
*/
|
|
26645
|
+
proto.bonus.ActiveWageringUserBonusItem.prototype.hasCurrency = function() {
|
|
26646
|
+
return jspb.Message.getField(this, 14) != null;
|
|
26647
|
+
};
|
|
26648
|
+
|
|
26649
|
+
|
|
26602
26650
|
|
|
26603
26651
|
|
|
26604
26652
|
|
|
@@ -27368,7 +27416,8 @@ proto.bonus.ValidateSelectedWageringUserBonusRequest.toObject = function(include
|
|
|
27368
27416
|
userId: jspb.Message.getFieldWithDefault(msg, 1, 0),
|
|
27369
27417
|
selectedUserBonusId: jspb.Message.getFieldWithDefault(msg, 2, 0),
|
|
27370
27418
|
wagerGamesListId: jspb.Message.getFieldWithDefault(msg, 3, 0),
|
|
27371
|
-
selectedBalanceType: jspb.Message.getFieldWithDefault(msg, 4, "")
|
|
27419
|
+
selectedBalanceType: jspb.Message.getFieldWithDefault(msg, 4, ""),
|
|
27420
|
+
walletCurrency: jspb.Message.getFieldWithDefault(msg, 5, "")
|
|
27372
27421
|
};
|
|
27373
27422
|
|
|
27374
27423
|
if (includeInstance) {
|
|
@@ -27421,6 +27470,10 @@ proto.bonus.ValidateSelectedWageringUserBonusRequest.deserializeBinaryFromReader
|
|
|
27421
27470
|
var value = /** @type {string} */ (reader.readString());
|
|
27422
27471
|
msg.setSelectedBalanceType(value);
|
|
27423
27472
|
break;
|
|
27473
|
+
case 5:
|
|
27474
|
+
var value = /** @type {string} */ (reader.readString());
|
|
27475
|
+
msg.setWalletCurrency(value);
|
|
27476
|
+
break;
|
|
27424
27477
|
default:
|
|
27425
27478
|
reader.skipField();
|
|
27426
27479
|
break;
|
|
@@ -27478,6 +27531,13 @@ proto.bonus.ValidateSelectedWageringUserBonusRequest.serializeBinaryToWriter = f
|
|
|
27478
27531
|
f
|
|
27479
27532
|
);
|
|
27480
27533
|
}
|
|
27534
|
+
f = /** @type {string} */ (jspb.Message.getField(message, 5));
|
|
27535
|
+
if (f != null) {
|
|
27536
|
+
writer.writeString(
|
|
27537
|
+
5,
|
|
27538
|
+
f
|
|
27539
|
+
);
|
|
27540
|
+
}
|
|
27481
27541
|
};
|
|
27482
27542
|
|
|
27483
27543
|
|
|
@@ -27553,6 +27613,42 @@ proto.bonus.ValidateSelectedWageringUserBonusRequest.prototype.setSelectedBalanc
|
|
|
27553
27613
|
};
|
|
27554
27614
|
|
|
27555
27615
|
|
|
27616
|
+
/**
|
|
27617
|
+
* optional string wallet_currency = 5;
|
|
27618
|
+
* @return {string}
|
|
27619
|
+
*/
|
|
27620
|
+
proto.bonus.ValidateSelectedWageringUserBonusRequest.prototype.getWalletCurrency = function() {
|
|
27621
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
|
|
27622
|
+
};
|
|
27623
|
+
|
|
27624
|
+
|
|
27625
|
+
/**
|
|
27626
|
+
* @param {string} value
|
|
27627
|
+
* @return {!proto.bonus.ValidateSelectedWageringUserBonusRequest} returns this
|
|
27628
|
+
*/
|
|
27629
|
+
proto.bonus.ValidateSelectedWageringUserBonusRequest.prototype.setWalletCurrency = function(value) {
|
|
27630
|
+
return jspb.Message.setField(this, 5, value);
|
|
27631
|
+
};
|
|
27632
|
+
|
|
27633
|
+
|
|
27634
|
+
/**
|
|
27635
|
+
* Clears the field making it undefined.
|
|
27636
|
+
* @return {!proto.bonus.ValidateSelectedWageringUserBonusRequest} returns this
|
|
27637
|
+
*/
|
|
27638
|
+
proto.bonus.ValidateSelectedWageringUserBonusRequest.prototype.clearWalletCurrency = function() {
|
|
27639
|
+
return jspb.Message.setField(this, 5, undefined);
|
|
27640
|
+
};
|
|
27641
|
+
|
|
27642
|
+
|
|
27643
|
+
/**
|
|
27644
|
+
* Returns whether this field is set.
|
|
27645
|
+
* @return {boolean}
|
|
27646
|
+
*/
|
|
27647
|
+
proto.bonus.ValidateSelectedWageringUserBonusRequest.prototype.hasWalletCurrency = function() {
|
|
27648
|
+
return jspb.Message.getField(this, 5) != null;
|
|
27649
|
+
};
|
|
27650
|
+
|
|
27651
|
+
|
|
27556
27652
|
|
|
27557
27653
|
/**
|
|
27558
27654
|
* List of repeated fields within this message type.
|
|
@@ -27606,7 +27702,8 @@ proto.bonus.ValidateSelectedWageringUserBonusResponse.toObject = function(includ
|
|
|
27606
27702
|
wagerBalancePriority: jspb.Message.getFieldWithDefault(msg, 12, ""),
|
|
27607
27703
|
bankrollMode: jspb.Message.getFieldWithDefault(msg, 13, ""),
|
|
27608
27704
|
priorityBankroll: jspb.Message.getFieldWithDefault(msg, 14, ""),
|
|
27609
|
-
payoutDestination: jspb.Message.getFieldWithDefault(msg, 15, "")
|
|
27705
|
+
payoutDestination: jspb.Message.getFieldWithDefault(msg, 15, ""),
|
|
27706
|
+
currency: jspb.Message.getFieldWithDefault(msg, 16, "")
|
|
27610
27707
|
};
|
|
27611
27708
|
|
|
27612
27709
|
if (includeInstance) {
|
|
@@ -27703,6 +27800,10 @@ proto.bonus.ValidateSelectedWageringUserBonusResponse.deserializeBinaryFromReade
|
|
|
27703
27800
|
var value = /** @type {string} */ (reader.readString());
|
|
27704
27801
|
msg.setPayoutDestination(value);
|
|
27705
27802
|
break;
|
|
27803
|
+
case 16:
|
|
27804
|
+
var value = /** @type {string} */ (reader.readString());
|
|
27805
|
+
msg.setCurrency(value);
|
|
27806
|
+
break;
|
|
27706
27807
|
default:
|
|
27707
27808
|
reader.skipField();
|
|
27708
27809
|
break;
|
|
@@ -27837,6 +27938,13 @@ proto.bonus.ValidateSelectedWageringUserBonusResponse.serializeBinaryToWriter =
|
|
|
27837
27938
|
f
|
|
27838
27939
|
);
|
|
27839
27940
|
}
|
|
27941
|
+
f = /** @type {string} */ (jspb.Message.getField(message, 16));
|
|
27942
|
+
if (f != null) {
|
|
27943
|
+
writer.writeString(
|
|
27944
|
+
16,
|
|
27945
|
+
f
|
|
27946
|
+
);
|
|
27947
|
+
}
|
|
27840
27948
|
};
|
|
27841
27949
|
|
|
27842
27950
|
|
|
@@ -28201,6 +28309,42 @@ proto.bonus.ValidateSelectedWageringUserBonusResponse.prototype.hasPayoutDestina
|
|
|
28201
28309
|
};
|
|
28202
28310
|
|
|
28203
28311
|
|
|
28312
|
+
/**
|
|
28313
|
+
* optional string currency = 16;
|
|
28314
|
+
* @return {string}
|
|
28315
|
+
*/
|
|
28316
|
+
proto.bonus.ValidateSelectedWageringUserBonusResponse.prototype.getCurrency = function() {
|
|
28317
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 16, ""));
|
|
28318
|
+
};
|
|
28319
|
+
|
|
28320
|
+
|
|
28321
|
+
/**
|
|
28322
|
+
* @param {string} value
|
|
28323
|
+
* @return {!proto.bonus.ValidateSelectedWageringUserBonusResponse} returns this
|
|
28324
|
+
*/
|
|
28325
|
+
proto.bonus.ValidateSelectedWageringUserBonusResponse.prototype.setCurrency = function(value) {
|
|
28326
|
+
return jspb.Message.setField(this, 16, value);
|
|
28327
|
+
};
|
|
28328
|
+
|
|
28329
|
+
|
|
28330
|
+
/**
|
|
28331
|
+
* Clears the field making it undefined.
|
|
28332
|
+
* @return {!proto.bonus.ValidateSelectedWageringUserBonusResponse} returns this
|
|
28333
|
+
*/
|
|
28334
|
+
proto.bonus.ValidateSelectedWageringUserBonusResponse.prototype.clearCurrency = function() {
|
|
28335
|
+
return jspb.Message.setField(this, 16, undefined);
|
|
28336
|
+
};
|
|
28337
|
+
|
|
28338
|
+
|
|
28339
|
+
/**
|
|
28340
|
+
* Returns whether this field is set.
|
|
28341
|
+
* @return {boolean}
|
|
28342
|
+
*/
|
|
28343
|
+
proto.bonus.ValidateSelectedWageringUserBonusResponse.prototype.hasCurrency = function() {
|
|
28344
|
+
return jspb.Message.getField(this, 16) != null;
|
|
28345
|
+
};
|
|
28346
|
+
|
|
28347
|
+
|
|
28204
28348
|
|
|
28205
28349
|
|
|
28206
28350
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const assert = require('node:assert/strict');
|
|
3
|
+
const { execFileSync } = require('node:child_process');
|
|
4
|
+
const vm = require('node:vm');
|
|
5
|
+
const current = require('../bonus/bonus_pb');
|
|
6
|
+
// Actual last bindings before the additive contract, isolated from global proto symbols.
|
|
7
|
+
const legacySource = execFileSync('git', ['show', '6e9c17f:bonus/bonus_pb.js'], { encoding: 'utf8', maxBuffer: 8 * 1024 * 1024 });
|
|
8
|
+
const sandbox = { exports: {}, proto: {}, require, console };
|
|
9
|
+
sandbox.global = sandbox;
|
|
10
|
+
vm.runInNewContext(legacySource, sandbox);
|
|
11
|
+
const legacy = sandbox.exports;
|
|
12
|
+
for (const [name, getter, setter, has, clear, identitySetter, identityGetter] of [
|
|
13
|
+
['ValidateSelectedWageringUserBonusRequest', 'getWalletCurrency', 'setWalletCurrency', 'hasWalletCurrency', 'clearWalletCurrency', 'setUserId', 'getUserId'],
|
|
14
|
+
['ValidateSelectedWageringUserBonusResponse', 'getCurrency', 'setCurrency', 'hasCurrency', 'clearCurrency', 'setSelectedUserBonusId', 'getSelectedUserBonusId'],
|
|
15
|
+
['ActiveWageringUserBonusItem', 'getCurrency', 'setCurrency', 'hasCurrency', 'clearCurrency', 'setUserBonusId', 'getUserBonusId'],
|
|
16
|
+
]) {
|
|
17
|
+
const old = new legacy[name](); old[identitySetter](462);
|
|
18
|
+
const received = current[name].deserializeBinary(old.serializeBinary());
|
|
19
|
+
assert.equal(received[has](), false);
|
|
20
|
+
assert.equal(received[getter](), '');
|
|
21
|
+
assert.equal(received[identityGetter](), 462);
|
|
22
|
+
for (const currency of ['USDT', 'BTC', '']) {
|
|
23
|
+
received[setter](currency);
|
|
24
|
+
const roundTrip = current[name].deserializeBinary(received.serializeBinary());
|
|
25
|
+
assert.equal(roundTrip[has](), true);
|
|
26
|
+
assert.equal(roundTrip[getter](), currency);
|
|
27
|
+
const oldReader = legacy[name].deserializeBinary(received.serializeBinary());
|
|
28
|
+
assert.equal(oldReader[identityGetter](), 462);
|
|
29
|
+
// Older reserialization drops unknown fields; new readers must still treat that as unknown.
|
|
30
|
+
assert.equal(current[name].deserializeBinary(oldReader.serializeBinary())[has](), false);
|
|
31
|
+
}
|
|
32
|
+
received[clear](); assert.equal(received[has](), false);
|
|
33
|
+
}
|
|
34
|
+
console.log('PASS bonus currency mixed-version wire contract');
|