bitbadgesjs-sdk 0.1.0 → 0.1.2
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 +1 -1
- package/dist/eip712/payload/samples/getSampleMsg.js +8 -8
- package/dist/eip712/payload/samples/getSampleMsg.js.map +1 -1
- package/dist/index.d.ts +9 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/transactions/messages/base.d.ts +5 -1
- package/dist/transactions/messages/base.d.ts.map +1 -1
- package/dist/transactions/messages/base.js +14 -7
- package/dist/transactions/messages/base.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.d.ts +2 -1
- package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.js +7 -6
- package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.d.ts +6 -1
- package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.js +33 -28
- package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.d.ts +2 -2
- package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.js +7 -6
- package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.d.ts +3 -1
- package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.js +10 -8
- package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.d.ts +7 -2
- package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.js +33 -30
- package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.d.ts +7 -2
- package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.js +30 -26
- package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.d.ts +4 -1
- package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.js +15 -12
- package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.js.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgCreateProtocol.d.ts +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgCreateProtocol.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgCreateProtocol.js +4 -4
- package/dist/transactions/messages/bitbadges/protocols/msgCreateProtocol.js.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgDeleteProtocol.d.ts +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgDeleteProtocol.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgDeleteProtocol.js +4 -4
- package/dist/transactions/messages/bitbadges/protocols/msgDeleteProtocol.js.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.d.ts +2 -1
- package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.js +7 -6
- package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.js.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgUnsetCollectionForProtocol.d.ts +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgUnsetCollectionForProtocol.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgUnsetCollectionForProtocol.js +4 -4
- package/dist/transactions/messages/bitbadges/protocols/msgUnsetCollectionForProtocol.js.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgUpdateProtocol.d.ts +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgUpdateProtocol.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgUpdateProtocol.js +4 -4
- package/dist/transactions/messages/bitbadges/protocols/msgUpdateProtocol.js.map +1 -1
- package/dist/transactions/messages/bitbadges/wasmx/msgExecuteContractCompat.d.ts +1 -1
- package/dist/transactions/messages/bitbadges/wasmx/msgExecuteContractCompat.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/wasmx/msgExecuteContractCompat.js +4 -4
- package/dist/transactions/messages/bitbadges/wasmx/msgExecuteContractCompat.js.map +1 -1
- package/dist/transactions/messages/bitbadges/wasmx/msgInstantiateContractCompat.d.ts +1 -1
- package/dist/transactions/messages/bitbadges/wasmx/msgInstantiateContractCompat.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/wasmx/msgInstantiateContractCompat.js +4 -4
- package/dist/transactions/messages/bitbadges/wasmx/msgInstantiateContractCompat.js.map +1 -1
- package/dist/transactions/messages/bitbadges/wasmx/msgStoreCodeCompat.d.ts +1 -1
- package/dist/transactions/messages/bitbadges/wasmx/msgStoreCodeCompat.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/wasmx/msgStoreCodeCompat.js +4 -4
- package/dist/transactions/messages/bitbadges/wasmx/msgStoreCodeCompat.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/badges/addressLists.d.ts +39 -0
- package/dist/types/badges/addressLists.d.ts.map +1 -0
- package/dist/types/badges/addressLists.js +292 -0
- package/dist/types/badges/addressLists.js.map +1 -0
- package/dist/types/badges/{typeutils/approvals.d.ts → approvals.d.ts} +26 -39
- package/dist/types/badges/approvals.d.ts.map +1 -0
- package/dist/types/badges/{typeutils/approvals.js → approvals.js} +186 -151
- package/dist/types/badges/approvals.js.map +1 -0
- package/dist/types/badges/{typeutils/permissions.d.ts → permissions.d.ts} +140 -5
- package/dist/types/badges/permissions.d.ts.map +1 -0
- package/dist/types/badges/permissions.js +2030 -0
- package/dist/types/badges/permissions.js.map +1 -0
- package/dist/types/badges/{typeutils/typeUtils.d.ts → typeUtils.d.ts} +48 -47
- package/dist/types/badges/typeUtils.d.ts.map +1 -0
- package/dist/types/badges/{typeutils/typeUtils.js → typeUtils.js} +527 -283
- package/dist/types/badges/typeUtils.js.map +1 -0
- package/dist/types/badges/userBalances.d.ts +79 -0
- package/dist/types/badges/userBalances.d.ts.map +1 -0
- package/dist/types/badges/userBalances.js +154 -0
- package/dist/types/badges/userBalances.js.map +1 -0
- package/dist/types/base.d.ts +60 -5
- package/dist/types/base.d.ts.map +1 -1
- package/dist/types/base.js +203 -8
- package/dist/types/base.js.map +1 -1
- package/dist/{utils → types}/math.d.ts +4 -1
- package/dist/types/math.d.ts.map +1 -0
- package/dist/{utils → types}/math.js +10 -1
- package/dist/types/math.js.map +1 -0
- package/dist/types/protocols/types.d.ts +32 -6
- package/dist/types/protocols/types.d.ts.map +1 -1
- package/dist/types/protocols/types.js +53 -9
- package/dist/types/protocols/types.js.map +1 -1
- package/dist/types/string-numbers.d.ts.map +1 -0
- package/dist/types/string-numbers.js.map +1 -0
- package/dist/types/types.d.ts +27 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/{utils/types → types}/types.js +1 -19
- package/dist/types/types.js.map +1 -0
- package/dist/utils/aliases.d.ts +1 -1
- package/dist/utils/aliases.d.ts.map +1 -1
- package/dist/utils/api/BitBadgesAddressList.d.ts +96 -0
- package/dist/utils/api/BitBadgesAddressList.d.ts.map +1 -0
- package/dist/utils/api/BitBadgesAddressList.js +139 -0
- package/dist/utils/api/BitBadgesAddressList.js.map +1 -0
- package/dist/utils/{api-sdk.d.ts → api/BitBadgesApi.d.ts} +10 -18
- package/dist/utils/api/BitBadgesApi.d.ts.map +1 -0
- package/dist/utils/{api-sdk.js → api/BitBadgesApi.js} +49 -191
- package/dist/utils/api/BitBadgesApi.js.map +1 -0
- package/dist/utils/api/BitBadgesCollection.d.ts +314 -0
- package/dist/utils/api/BitBadgesCollection.d.ts.map +1 -0
- package/dist/utils/api/BitBadgesCollection.js +765 -0
- package/dist/utils/api/BitBadgesCollection.js.map +1 -0
- package/dist/utils/api/BitBadgesUserInfo.d.ts +210 -0
- package/dist/utils/api/BitBadgesUserInfo.d.ts.map +1 -0
- package/dist/utils/{types/users.js → api/BitBadgesUserInfo.js} +157 -59
- package/dist/utils/api/BitBadgesUserInfo.js.map +1 -0
- package/dist/utils/approved_transfers_casts.d.ts +1 -1
- package/dist/utils/approved_transfers_casts.d.ts.map +1 -1
- package/dist/utils/approved_transfers_casts.js +11 -11
- package/dist/utils/approved_transfers_casts.js.map +1 -1
- package/dist/utils/badgeMetadata.d.ts +3 -5
- package/dist/utils/badgeMetadata.d.ts.map +1 -1
- package/dist/utils/badgeMetadata.js +20 -28
- package/dist/utils/badgeMetadata.js.map +1 -1
- package/dist/utils/balances.d.ts +5 -5
- package/dist/utils/balances.d.ts.map +1 -1
- package/dist/utils/balances.js +70 -79
- package/dist/utils/balances.js.map +1 -1
- package/dist/utils/batch-utils.d.ts +3 -1
- package/dist/utils/batch-utils.d.ts.map +1 -1
- package/dist/utils/batch-utils.js +13 -11
- package/dist/utils/batch-utils.js.map +1 -1
- package/dist/utils/chains.d.ts +1 -11
- package/dist/utils/chains.d.ts.map +1 -1
- package/dist/utils/chains.js +5 -144
- package/dist/utils/chains.js.map +1 -1
- package/dist/utils/converter.d.ts +10 -0
- package/dist/utils/converter.d.ts.map +1 -1
- package/dist/utils/converter.js +140 -1
- package/dist/utils/converter.js.map +1 -1
- package/dist/utils/display.d.ts +2 -2
- package/dist/utils/display.d.ts.map +1 -1
- package/dist/utils/display.js +7 -6
- package/dist/utils/display.js.map +1 -1
- package/dist/utils/distribution.d.ts +2 -1
- package/dist/utils/distribution.d.ts.map +1 -1
- package/dist/utils/distribution.js +30 -27
- package/dist/utils/distribution.js.map +1 -1
- package/dist/utils/firstMatches.d.ts +2 -2
- package/dist/utils/firstMatches.d.ts.map +1 -1
- package/dist/utils/firstMatches.js +19 -19
- package/dist/utils/firstMatches.js.map +1 -1
- package/dist/utils/index.d.ts +9 -13
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +9 -13
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/metadataIds.d.ts +1 -7
- package/dist/utils/metadataIds.d.ts.map +1 -1
- package/dist/utils/metadataIds.js +6 -88
- package/dist/utils/metadataIds.js.map +1 -1
- package/dist/utils/overlaps.d.ts +1 -1
- package/dist/utils/overlaps.d.ts.map +1 -1
- package/dist/utils/overlaps.js +41 -40
- package/dist/utils/overlaps.js.map +1 -1
- package/dist/utils/types/activity.d.ts +3 -2
- package/dist/utils/types/activity.d.ts.map +1 -1
- package/dist/utils/types/activity.js +11 -10
- package/dist/utils/types/activity.js.map +1 -1
- package/dist/utils/types/api.d.ts +23 -274
- package/dist/utils/types/api.d.ts.map +1 -1
- package/dist/utils/types/api.js +50 -237
- package/dist/utils/types/api.js.map +1 -1
- package/dist/utils/types/coin.d.ts +2 -2
- package/dist/utils/types/coin.d.ts.map +1 -1
- package/dist/utils/types/coin.js +3 -3
- package/dist/utils/types/coin.js.map +1 -1
- package/dist/utils/types/collections.d.ts +55 -264
- package/dist/utils/types/collections.d.ts.map +1 -1
- package/dist/utils/types/collections.js +101 -562
- package/dist/utils/types/collections.js.map +1 -1
- package/dist/utils/types/db.d.ts +25 -63
- package/dist/utils/types/db.d.ts.map +1 -1
- package/dist/utils/types/db.js +107 -174
- package/dist/utils/types/db.js.map +1 -1
- package/dist/utils/types/metadata.d.ts +19 -59
- package/dist/utils/types/metadata.d.ts.map +1 -1
- package/dist/utils/types/metadata.js +23 -89
- package/dist/utils/types/metadata.js.map +1 -1
- package/dist/utils/types/routes.d.ts +1 -1
- package/dist/utils/types/routes.d.ts.map +1 -1
- package/dist/utils/types/routes.js.map +1 -1
- package/dist/utils/types/schemas.d.ts +1 -1
- package/dist/utils/types/schemas.d.ts.map +1 -1
- package/dist/utils/types/transfers.d.ts +6 -2
- package/dist/utils/types/transfers.d.ts.map +1 -1
- package/dist/utils/types/transfers.js +4 -3
- package/dist/utils/types/transfers.js.map +1 -1
- package/dist/utils/userApprovals.d.ts +1 -1
- package/dist/utils/userApprovals.d.ts.map +1 -1
- package/dist/utils/userApprovals.js +15 -15
- package/dist/utils/userApprovals.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/badges/string-numbers.d.ts.map +0 -1
- package/dist/types/badges/string-numbers.js.map +0 -1
- package/dist/types/badges/typeutils/approvals.d.ts.map +0 -1
- package/dist/types/badges/typeutils/approvals.js.map +0 -1
- package/dist/types/badges/typeutils/permissions.d.ts.map +0 -1
- package/dist/types/badges/typeutils/permissions.js +0 -675
- package/dist/types/badges/typeutils/permissions.js.map +0 -1
- package/dist/types/badges/typeutils/typeUtils.d.ts.map +0 -1
- package/dist/types/badges/typeutils/typeUtils.js.map +0 -1
- package/dist/utils/addressLists.d.ts +0 -6
- package/dist/utils/addressLists.d.ts.map +0 -1
- package/dist/utils/addressLists.js +0 -202
- package/dist/utils/addressLists.js.map +0 -1
- package/dist/utils/api-sdk.d.ts.map +0 -1
- package/dist/utils/api-sdk.js.map +0 -1
- package/dist/utils/api-utils.d.ts +0 -6
- package/dist/utils/api-utils.d.ts.map +0 -1
- package/dist/utils/api-utils.js +0 -167
- package/dist/utils/api-utils.js.map +0 -1
- package/dist/utils/math.d.ts.map +0 -1
- package/dist/utils/math.js.map +0 -1
- package/dist/utils/permission_checks.d.ts +0 -51
- package/dist/utils/permission_checks.d.ts.map +0 -1
- package/dist/utils/permission_checks.js +0 -330
- package/dist/utils/permission_checks.js.map +0 -1
- package/dist/utils/permissions.d.ts +0 -17
- package/dist/utils/permissions.d.ts.map +0 -1
- package/dist/utils/permissions.js +0 -280
- package/dist/utils/permissions.js.map +0 -1
- package/dist/utils/types/types.d.ts +0 -42
- package/dist/utils/types/types.d.ts.map +0 -1
- package/dist/utils/types/types.js.map +0 -1
- package/dist/utils/types/users.d.ts +0 -163
- package/dist/utils/types/users.d.ts.map +0 -1
- package/dist/utils/types/users.js.map +0 -1
- package/dist/utils/uintRanges.d.ts +0 -12
- package/dist/utils/uintRanges.d.ts.map +0 -1
- package/dist/utils/uintRanges.js +0 -182
- package/dist/utils/uintRanges.js.map +0 -1
- package/dist/utils/update_checks.d.ts +0 -15
- package/dist/utils/update_checks.d.ts.map +0 -1
- package/dist/utils/update_checks.js +0 -565
- package/dist/utils/update_checks.js.map +0 -1
- package/dist/utils/validate_permissions_updates.d.ts +0 -11
- package/dist/utils/validate_permissions_updates.d.ts.map +0 -1
- package/dist/utils/validate_permissions_updates.js +0 -227
- package/dist/utils/validate_permissions_updates.js.map +0 -1
- /package/dist/types/{badges/string-numbers.d.ts → string-numbers.d.ts} +0 -0
- /package/dist/types/{badges/string-numbers.js → string-numbers.js} +0 -0
|
@@ -1,675 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CollectionApprovalPermission = exports.TimedUpdateWithBadgeIdsPermission = exports.BalancesActionPermission = exports.TimedUpdatePermission = exports.ActionPermission = exports.CollectionPermissions = exports.getPermissionVariablesFromName = exports.UserIncomingApprovalPermission = exports.UserOutgoingApprovalPermission = exports.UserPermissions = void 0;
|
|
4
|
-
const __1 = require("../../..");
|
|
5
|
-
const string_numbers_1 = require("../string-numbers");
|
|
6
|
-
const typeUtils_1 = require("./typeUtils");
|
|
7
|
-
const proto_1 = require("../../../proto");
|
|
8
|
-
class UserPermissions extends typeUtils_1.BaseNumberTypeClass {
|
|
9
|
-
canUpdateOutgoingApprovals;
|
|
10
|
-
canUpdateIncomingApprovals;
|
|
11
|
-
canUpdateAutoApproveSelfInitiatedOutgoingTransfers;
|
|
12
|
-
canUpdateAutoApproveSelfInitiatedIncomingTransfers;
|
|
13
|
-
constructor(msg) {
|
|
14
|
-
super();
|
|
15
|
-
this.canUpdateOutgoingApprovals = msg.canUpdateOutgoingApprovals.map(x => new UserOutgoingApprovalPermission(x));
|
|
16
|
-
this.canUpdateIncomingApprovals = msg.canUpdateIncomingApprovals.map(x => new UserIncomingApprovalPermission(x));
|
|
17
|
-
this.canUpdateAutoApproveSelfInitiatedOutgoingTransfers = msg.canUpdateAutoApproveSelfInitiatedOutgoingTransfers.map(x => new ActionPermission(x));
|
|
18
|
-
this.canUpdateAutoApproveSelfInitiatedIncomingTransfers = msg.canUpdateAutoApproveSelfInitiatedIncomingTransfers.map(x => new ActionPermission(x));
|
|
19
|
-
}
|
|
20
|
-
static required() {
|
|
21
|
-
return new UserPermissions({
|
|
22
|
-
canUpdateOutgoingApprovals: [],
|
|
23
|
-
canUpdateIncomingApprovals: [],
|
|
24
|
-
canUpdateAutoApproveSelfInitiatedOutgoingTransfers: [],
|
|
25
|
-
canUpdateAutoApproveSelfInitiatedIncomingTransfers: []
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
convert(convertFunction) {
|
|
29
|
-
return new UserPermissions((0, typeUtils_1.deepCopy)({
|
|
30
|
-
canUpdateOutgoingApprovals: this.canUpdateOutgoingApprovals.map((x) => x.convert(convertFunction)),
|
|
31
|
-
canUpdateIncomingApprovals: this.canUpdateIncomingApprovals.map((x) => x.convert(convertFunction)),
|
|
32
|
-
canUpdateAutoApproveSelfInitiatedOutgoingTransfers: this.canUpdateAutoApproveSelfInitiatedOutgoingTransfers.map((x) => x.convert(convertFunction)),
|
|
33
|
-
canUpdateAutoApproveSelfInitiatedIncomingTransfers: this.canUpdateAutoApproveSelfInitiatedIncomingTransfers.map((x) => x.convert(convertFunction))
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
toProto() {
|
|
37
|
-
return new proto_1.badges.UserPermissions(this.convert(string_numbers_1.Stringify));
|
|
38
|
-
}
|
|
39
|
-
static fromJson(jsonValue, convertFunction, options) {
|
|
40
|
-
return this.convertFromProto(proto_1.badges.UserPermissions.fromJson(jsonValue, options), convertFunction);
|
|
41
|
-
}
|
|
42
|
-
static fromJsonString(jsonString, convertFunction, options) {
|
|
43
|
-
return this.convertFromProto(proto_1.badges.UserPermissions.fromJsonString(jsonString, options), convertFunction);
|
|
44
|
-
}
|
|
45
|
-
static convertFromProto(protoMsg, convertFunction) {
|
|
46
|
-
return new UserPermissions({
|
|
47
|
-
canUpdateOutgoingApprovals: protoMsg.canUpdateOutgoingApprovals.map(x => UserOutgoingApprovalPermission.convertFromProto(x, convertFunction)),
|
|
48
|
-
canUpdateIncomingApprovals: protoMsg.canUpdateIncomingApprovals.map(x => UserIncomingApprovalPermission.convertFromProto(x, convertFunction)),
|
|
49
|
-
canUpdateAutoApproveSelfInitiatedOutgoingTransfers: protoMsg.canUpdateAutoApproveSelfInitiatedOutgoingTransfers.map(x => ActionPermission.convertFromProto(x, convertFunction)),
|
|
50
|
-
canUpdateAutoApproveSelfInitiatedIncomingTransfers: protoMsg.canUpdateAutoApproveSelfInitiatedIncomingTransfers.map(x => ActionPermission.convertFromProto(x, convertFunction))
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.UserPermissions = UserPermissions;
|
|
55
|
-
class UserOutgoingApprovalPermission extends typeUtils_1.BaseNumberTypeClass {
|
|
56
|
-
toListId;
|
|
57
|
-
initiatedByListId;
|
|
58
|
-
transferTimes;
|
|
59
|
-
badgeIds;
|
|
60
|
-
ownershipTimes;
|
|
61
|
-
approvalId;
|
|
62
|
-
amountTrackerId;
|
|
63
|
-
challengeTrackerId;
|
|
64
|
-
permanentlyPermittedTimes;
|
|
65
|
-
permanentlyForbiddenTimes;
|
|
66
|
-
constructor(msg) {
|
|
67
|
-
super();
|
|
68
|
-
this.toListId = msg.toListId;
|
|
69
|
-
this.initiatedByListId = msg.initiatedByListId;
|
|
70
|
-
this.transferTimes = msg.transferTimes.map(x => new typeUtils_1.UintRange(x));
|
|
71
|
-
this.badgeIds = msg.badgeIds.map(x => new typeUtils_1.UintRange(x));
|
|
72
|
-
this.ownershipTimes = msg.ownershipTimes.map(x => new typeUtils_1.UintRange(x));
|
|
73
|
-
this.approvalId = msg.approvalId;
|
|
74
|
-
this.amountTrackerId = msg.amountTrackerId;
|
|
75
|
-
this.challengeTrackerId = msg.challengeTrackerId;
|
|
76
|
-
this.permanentlyPermittedTimes = msg.permanentlyPermittedTimes.map(x => new typeUtils_1.UintRange(x));
|
|
77
|
-
this.permanentlyForbiddenTimes = msg.permanentlyForbiddenTimes.map(x => new typeUtils_1.UintRange(x));
|
|
78
|
-
}
|
|
79
|
-
static required() {
|
|
80
|
-
return new UserOutgoingApprovalPermission({
|
|
81
|
-
toListId: '',
|
|
82
|
-
initiatedByListId: '',
|
|
83
|
-
transferTimes: [],
|
|
84
|
-
badgeIds: [],
|
|
85
|
-
ownershipTimes: [],
|
|
86
|
-
approvalId: '',
|
|
87
|
-
amountTrackerId: '',
|
|
88
|
-
challengeTrackerId: '',
|
|
89
|
-
permanentlyPermittedTimes: [],
|
|
90
|
-
permanentlyForbiddenTimes: []
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
convert(convertFunction) {
|
|
94
|
-
return new UserOutgoingApprovalPermission((0, typeUtils_1.deepCopy)({
|
|
95
|
-
toListId: this.toListId,
|
|
96
|
-
initiatedByListId: this.initiatedByListId,
|
|
97
|
-
transferTimes: this.transferTimes.map((x) => x.convert(convertFunction)),
|
|
98
|
-
badgeIds: this.badgeIds.map((x) => x.convert(convertFunction)),
|
|
99
|
-
ownershipTimes: this.ownershipTimes.map((x) => x.convert(convertFunction)),
|
|
100
|
-
approvalId: this.approvalId,
|
|
101
|
-
amountTrackerId: this.amountTrackerId,
|
|
102
|
-
challengeTrackerId: this.challengeTrackerId,
|
|
103
|
-
permanentlyPermittedTimes: this.permanentlyPermittedTimes.map((x) => x.convert(convertFunction)),
|
|
104
|
-
permanentlyForbiddenTimes: this.permanentlyForbiddenTimes.map((x) => x.convert(convertFunction))
|
|
105
|
-
}));
|
|
106
|
-
}
|
|
107
|
-
toProto() {
|
|
108
|
-
return new proto_1.badges.UserOutgoingApprovalPermission(this.convert(string_numbers_1.Stringify));
|
|
109
|
-
}
|
|
110
|
-
static fromJson(jsonValue, convertFunction, options) {
|
|
111
|
-
return this.convertFromProto(proto_1.badges.UserOutgoingApprovalPermission.fromJson(jsonValue, options), convertFunction);
|
|
112
|
-
}
|
|
113
|
-
static fromJsonString(jsonString, convertFunction, options) {
|
|
114
|
-
return this.convertFromProto(proto_1.badges.UserOutgoingApprovalPermission.fromJsonString(jsonString, options), convertFunction);
|
|
115
|
-
}
|
|
116
|
-
static convertFromProto(protoMsg, convertFunction) {
|
|
117
|
-
return new UserOutgoingApprovalPermission({
|
|
118
|
-
toListId: protoMsg.toListId,
|
|
119
|
-
initiatedByListId: protoMsg.initiatedByListId,
|
|
120
|
-
transferTimes: protoMsg.transferTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
121
|
-
badgeIds: protoMsg.badgeIds.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
122
|
-
ownershipTimes: protoMsg.ownershipTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
123
|
-
approvalId: protoMsg.approvalId,
|
|
124
|
-
amountTrackerId: protoMsg.amountTrackerId,
|
|
125
|
-
challengeTrackerId: protoMsg.challengeTrackerId,
|
|
126
|
-
permanentlyPermittedTimes: protoMsg.permanentlyPermittedTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
127
|
-
permanentlyForbiddenTimes: protoMsg.permanentlyForbiddenTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction))
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
exports.UserOutgoingApprovalPermission = UserOutgoingApprovalPermission;
|
|
132
|
-
class UserIncomingApprovalPermission extends typeUtils_1.BaseNumberTypeClass {
|
|
133
|
-
fromListId;
|
|
134
|
-
initiatedByListId;
|
|
135
|
-
transferTimes;
|
|
136
|
-
badgeIds;
|
|
137
|
-
ownershipTimes;
|
|
138
|
-
approvalId;
|
|
139
|
-
amountTrackerId;
|
|
140
|
-
challengeTrackerId;
|
|
141
|
-
permanentlyPermittedTimes;
|
|
142
|
-
permanentlyForbiddenTimes;
|
|
143
|
-
constructor(msg) {
|
|
144
|
-
super();
|
|
145
|
-
this.fromListId = msg.fromListId;
|
|
146
|
-
this.initiatedByListId = msg.initiatedByListId;
|
|
147
|
-
this.approvalId = msg.approvalId;
|
|
148
|
-
this.amountTrackerId = msg.amountTrackerId;
|
|
149
|
-
this.challengeTrackerId = msg.challengeTrackerId;
|
|
150
|
-
this.transferTimes = msg.transferTimes.map(x => new typeUtils_1.UintRange(x));
|
|
151
|
-
this.badgeIds = msg.badgeIds.map(x => new typeUtils_1.UintRange(x));
|
|
152
|
-
this.ownershipTimes = msg.ownershipTimes.map(x => new typeUtils_1.UintRange(x));
|
|
153
|
-
this.approvalId = msg.approvalId;
|
|
154
|
-
this.amountTrackerId = msg.amountTrackerId;
|
|
155
|
-
this.challengeTrackerId = msg.challengeTrackerId;
|
|
156
|
-
this.permanentlyPermittedTimes = msg.permanentlyPermittedTimes.map(x => new typeUtils_1.UintRange(x));
|
|
157
|
-
this.permanentlyForbiddenTimes = msg.permanentlyForbiddenTimes.map(x => new typeUtils_1.UintRange(x));
|
|
158
|
-
}
|
|
159
|
-
static required() {
|
|
160
|
-
return new UserIncomingApprovalPermission({
|
|
161
|
-
fromListId: '',
|
|
162
|
-
initiatedByListId: '',
|
|
163
|
-
transferTimes: [],
|
|
164
|
-
badgeIds: [],
|
|
165
|
-
ownershipTimes: [],
|
|
166
|
-
approvalId: '',
|
|
167
|
-
amountTrackerId: '',
|
|
168
|
-
challengeTrackerId: '',
|
|
169
|
-
permanentlyPermittedTimes: [],
|
|
170
|
-
permanentlyForbiddenTimes: []
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
convert(convertFunction) {
|
|
174
|
-
return new UserIncomingApprovalPermission((0, typeUtils_1.deepCopy)({
|
|
175
|
-
fromListId: this.fromListId,
|
|
176
|
-
initiatedByListId: this.initiatedByListId,
|
|
177
|
-
transferTimes: this.transferTimes.map((x) => x.convert(convertFunction)),
|
|
178
|
-
badgeIds: this.badgeIds.map((x) => x.convert(convertFunction)),
|
|
179
|
-
ownershipTimes: this.ownershipTimes.map((x) => x.convert(convertFunction)),
|
|
180
|
-
approvalId: this.approvalId,
|
|
181
|
-
amountTrackerId: this.amountTrackerId,
|
|
182
|
-
challengeTrackerId: this.challengeTrackerId,
|
|
183
|
-
permanentlyPermittedTimes: this.permanentlyPermittedTimes.map((x) => x.convert(convertFunction)),
|
|
184
|
-
permanentlyForbiddenTimes: this.permanentlyForbiddenTimes.map((x) => x.convert(convertFunction))
|
|
185
|
-
}));
|
|
186
|
-
}
|
|
187
|
-
toProto() {
|
|
188
|
-
return new proto_1.badges.UserIncomingApprovalPermission(this.convert(string_numbers_1.Stringify));
|
|
189
|
-
}
|
|
190
|
-
static fromJson(jsonValue, convertFunction, options) {
|
|
191
|
-
return this.convertFromProto(proto_1.badges.UserIncomingApprovalPermission.fromJson(jsonValue, options), convertFunction);
|
|
192
|
-
}
|
|
193
|
-
static fromJsonString(jsonString, convertFunction, options) {
|
|
194
|
-
return this.convertFromProto(proto_1.badges.UserIncomingApprovalPermission.fromJsonString(jsonString, options), convertFunction);
|
|
195
|
-
}
|
|
196
|
-
static convertFromProto(protoMsg, convertFunction) {
|
|
197
|
-
return new UserIncomingApprovalPermission({
|
|
198
|
-
fromListId: protoMsg.fromListId,
|
|
199
|
-
initiatedByListId: protoMsg.initiatedByListId,
|
|
200
|
-
transferTimes: protoMsg.transferTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
201
|
-
badgeIds: protoMsg.badgeIds.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
202
|
-
ownershipTimes: protoMsg.ownershipTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
203
|
-
approvalId: protoMsg.approvalId,
|
|
204
|
-
amountTrackerId: protoMsg.amountTrackerId,
|
|
205
|
-
challengeTrackerId: protoMsg.challengeTrackerId,
|
|
206
|
-
permanentlyPermittedTimes: protoMsg.permanentlyPermittedTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
207
|
-
permanentlyForbiddenTimes: protoMsg.permanentlyForbiddenTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction))
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
exports.UserIncomingApprovalPermission = UserIncomingApprovalPermission;
|
|
212
|
-
const getPermissionVariablesFromName = (permissionName) => {
|
|
213
|
-
let castFunction = () => { return []; };
|
|
214
|
-
let flags = __1.ApprovalPermissionUsedFlags;
|
|
215
|
-
let validateFunction = undefined;
|
|
216
|
-
let validatePermissionUpdateFunction = undefined;
|
|
217
|
-
switch (permissionName) {
|
|
218
|
-
case 'canArchiveCollection':
|
|
219
|
-
validateFunction = __1.validateIsArchivedUpdate;
|
|
220
|
-
break;
|
|
221
|
-
case 'canUpdateOffChainBalancesMetadata':
|
|
222
|
-
validateFunction = __1.validateOffChainBalancesMetadataUpdate;
|
|
223
|
-
break;
|
|
224
|
-
case 'canUpdateManager':
|
|
225
|
-
validateFunction = __1.validateManagerUpdate;
|
|
226
|
-
break;
|
|
227
|
-
case 'canUpdateCollectionMetadata':
|
|
228
|
-
validateFunction = __1.validateCollectionMetadataUpdate;
|
|
229
|
-
break;
|
|
230
|
-
case 'canUpdateBadgeMetadata':
|
|
231
|
-
validateFunction = __1.validateBadgeMetadataUpdate;
|
|
232
|
-
break;
|
|
233
|
-
case 'canUpdateCollectionApprovals':
|
|
234
|
-
validateFunction = __1.validateCollectionApprovalsUpdate;
|
|
235
|
-
break;
|
|
236
|
-
}
|
|
237
|
-
switch (permissionName) {
|
|
238
|
-
case 'canDeleteCollection':
|
|
239
|
-
case 'canUpdateAutoApproveSelfInitiatedOutgoingTransfers':
|
|
240
|
-
case 'canUpdateAutoApproveSelfInitiatedIncomingTransfers':
|
|
241
|
-
validatePermissionUpdateFunction = __1.validateActionPermissionUpdate;
|
|
242
|
-
break;
|
|
243
|
-
case 'canArchiveCollection':
|
|
244
|
-
case 'canUpdateOffChainBalancesMetadata':
|
|
245
|
-
case 'canUpdateStandards':
|
|
246
|
-
case 'canUpdateCustomData':
|
|
247
|
-
case 'canUpdateManager':
|
|
248
|
-
case 'canUpdateCollectionMetadata':
|
|
249
|
-
validatePermissionUpdateFunction = __1.validateTimedUpdatePermissionUpdate;
|
|
250
|
-
break;
|
|
251
|
-
case 'canCreateMoreBadges':
|
|
252
|
-
validatePermissionUpdateFunction = __1.validateBalancesActionPermissionUpdate;
|
|
253
|
-
break;
|
|
254
|
-
case 'canUpdateBadgeMetadata':
|
|
255
|
-
validatePermissionUpdateFunction = __1.validateTimedUpdateWithBadgeIdsPermissionUpdate;
|
|
256
|
-
break;
|
|
257
|
-
case 'canUpdateCollectionApprovals':
|
|
258
|
-
validatePermissionUpdateFunction = __1.validateCollectionApprovalPermissionsUpdate;
|
|
259
|
-
break;
|
|
260
|
-
}
|
|
261
|
-
let question = "";
|
|
262
|
-
switch (permissionName) {
|
|
263
|
-
case 'canDeleteCollection':
|
|
264
|
-
question = "Can delete the collection?";
|
|
265
|
-
break;
|
|
266
|
-
case 'canArchiveCollection':
|
|
267
|
-
question = "Can archive the collection?";
|
|
268
|
-
break;
|
|
269
|
-
case 'canUpdateOffChainBalancesMetadata':
|
|
270
|
-
question = "Can update the off-chain balances metadata?";
|
|
271
|
-
break;
|
|
272
|
-
case 'canUpdateStandards':
|
|
273
|
-
question = "Can update the standards?";
|
|
274
|
-
break;
|
|
275
|
-
case 'canUpdateCustomData':
|
|
276
|
-
question = "Can update the custom data?";
|
|
277
|
-
break;
|
|
278
|
-
case 'canUpdateManager':
|
|
279
|
-
question = "Can update the manager?";
|
|
280
|
-
break;
|
|
281
|
-
case 'canUpdateCollectionMetadata':
|
|
282
|
-
question = "Can update the collection metadata?";
|
|
283
|
-
break;
|
|
284
|
-
case 'canCreateMoreBadges':
|
|
285
|
-
question = "Can create more badges?";
|
|
286
|
-
break;
|
|
287
|
-
case 'canUpdateBadgeMetadata':
|
|
288
|
-
question = "Can update the badge metadata?";
|
|
289
|
-
break;
|
|
290
|
-
case 'canUpdateCollectionApprovals':
|
|
291
|
-
question = "Can update collection approvals?";
|
|
292
|
-
break;
|
|
293
|
-
case 'canUpdateAutoApproveSelfInitiatedOutgoingTransfers':
|
|
294
|
-
question = "Can update auto approve self initiated outgoing transfers?";
|
|
295
|
-
break;
|
|
296
|
-
case 'canUpdateAutoApproveSelfInitiatedIncomingTransfers':
|
|
297
|
-
question = "Can update auto approve self initiated incoming transfers?";
|
|
298
|
-
break;
|
|
299
|
-
}
|
|
300
|
-
switch (permissionName) {
|
|
301
|
-
case 'canDeleteCollection':
|
|
302
|
-
case 'canUpdateAutoApproveSelfInitiatedOutgoingTransfers':
|
|
303
|
-
case 'canUpdateAutoApproveSelfInitiatedIncomingTransfers':
|
|
304
|
-
castFunction = __1.castActionPermissionToUniversalPermission;
|
|
305
|
-
flags = __1.ActionPermissionUsedFlags;
|
|
306
|
-
break;
|
|
307
|
-
case 'canArchiveCollection':
|
|
308
|
-
case 'canUpdateOffChainBalancesMetadata':
|
|
309
|
-
case 'canUpdateStandards':
|
|
310
|
-
case 'canUpdateCustomData':
|
|
311
|
-
case 'canUpdateManager':
|
|
312
|
-
case 'canUpdateCollectionMetadata':
|
|
313
|
-
castFunction = __1.castTimedUpdatePermissionToUniversalPermission;
|
|
314
|
-
flags = __1.TimedUpdatePermissionUsedFlags;
|
|
315
|
-
break;
|
|
316
|
-
case 'canCreateMoreBadges':
|
|
317
|
-
castFunction = __1.castBalancesActionPermissionToUniversalPermission;
|
|
318
|
-
flags = __1.BalancesActionPermissionUsedFlags;
|
|
319
|
-
break;
|
|
320
|
-
case 'canUpdateBadgeMetadata':
|
|
321
|
-
castFunction = __1.castTimedUpdateWithBadgeIdsPermissionToUniversalPermission;
|
|
322
|
-
flags = __1.TimedUpdateWithBadgeIdsPermissionUsedFlags;
|
|
323
|
-
break;
|
|
324
|
-
case 'canUpdateCollectionApprovals':
|
|
325
|
-
castFunction = __1.castCollectionApprovalPermissionToUniversalPermission;
|
|
326
|
-
flags = __1.ApprovalPermissionUsedFlags;
|
|
327
|
-
break;
|
|
328
|
-
}
|
|
329
|
-
if (!castFunction)
|
|
330
|
-
throw new Error('');
|
|
331
|
-
return {
|
|
332
|
-
castFunction,
|
|
333
|
-
flags,
|
|
334
|
-
question,
|
|
335
|
-
validateFunction,
|
|
336
|
-
validatePermissionUpdateFunction
|
|
337
|
-
};
|
|
338
|
-
};
|
|
339
|
-
exports.getPermissionVariablesFromName = getPermissionVariablesFromName;
|
|
340
|
-
class CollectionPermissions extends typeUtils_1.BaseNumberTypeClass {
|
|
341
|
-
canDeleteCollection;
|
|
342
|
-
canArchiveCollection;
|
|
343
|
-
canUpdateOffChainBalancesMetadata;
|
|
344
|
-
canUpdateStandards;
|
|
345
|
-
canUpdateCustomData;
|
|
346
|
-
canUpdateManager;
|
|
347
|
-
canUpdateCollectionMetadata;
|
|
348
|
-
canCreateMoreBadges;
|
|
349
|
-
canUpdateBadgeMetadata;
|
|
350
|
-
canUpdateCollectionApprovals;
|
|
351
|
-
constructor(msg) {
|
|
352
|
-
super();
|
|
353
|
-
this.canDeleteCollection = msg.canDeleteCollection.map(x => new ActionPermission(x));
|
|
354
|
-
this.canArchiveCollection = msg.canArchiveCollection.map(x => new TimedUpdatePermission(x));
|
|
355
|
-
this.canUpdateOffChainBalancesMetadata = msg.canUpdateOffChainBalancesMetadata.map(x => new TimedUpdatePermission(x));
|
|
356
|
-
this.canUpdateStandards = msg.canUpdateStandards.map(x => new TimedUpdatePermission(x));
|
|
357
|
-
this.canUpdateCustomData = msg.canUpdateCustomData.map(x => new TimedUpdatePermission(x));
|
|
358
|
-
this.canUpdateManager = msg.canUpdateManager.map(x => new TimedUpdatePermission(x));
|
|
359
|
-
this.canUpdateCollectionMetadata = msg.canUpdateCollectionMetadata.map(x => new TimedUpdatePermission(x));
|
|
360
|
-
this.canCreateMoreBadges = msg.canCreateMoreBadges.map(x => new BalancesActionPermission(x));
|
|
361
|
-
this.canUpdateBadgeMetadata = msg.canUpdateBadgeMetadata.map(x => new TimedUpdateWithBadgeIdsPermission(x));
|
|
362
|
-
this.canUpdateCollectionApprovals = msg.canUpdateCollectionApprovals.map(x => new CollectionApprovalPermission(x));
|
|
363
|
-
}
|
|
364
|
-
static required() {
|
|
365
|
-
return new CollectionPermissions({
|
|
366
|
-
canDeleteCollection: [],
|
|
367
|
-
canArchiveCollection: [],
|
|
368
|
-
canUpdateOffChainBalancesMetadata: [],
|
|
369
|
-
canUpdateStandards: [],
|
|
370
|
-
canUpdateCustomData: [],
|
|
371
|
-
canUpdateManager: [],
|
|
372
|
-
canUpdateCollectionMetadata: [],
|
|
373
|
-
canCreateMoreBadges: [],
|
|
374
|
-
canUpdateBadgeMetadata: [],
|
|
375
|
-
canUpdateCollectionApprovals: []
|
|
376
|
-
});
|
|
377
|
-
}
|
|
378
|
-
convert(convertFunction) {
|
|
379
|
-
return new CollectionPermissions((0, typeUtils_1.deepCopy)({
|
|
380
|
-
canDeleteCollection: this.canDeleteCollection.map((x) => x.convert(convertFunction)),
|
|
381
|
-
canArchiveCollection: this.canArchiveCollection.map((x) => x.convert(convertFunction)),
|
|
382
|
-
canUpdateOffChainBalancesMetadata: this.canUpdateOffChainBalancesMetadata.map((x) => x.convert(convertFunction)),
|
|
383
|
-
canUpdateStandards: this.canUpdateStandards.map((x) => x.convert(convertFunction)),
|
|
384
|
-
canUpdateCustomData: this.canUpdateCustomData.map((x) => x.convert(convertFunction)),
|
|
385
|
-
canUpdateManager: this.canUpdateManager.map((x) => x.convert(convertFunction)),
|
|
386
|
-
canUpdateCollectionMetadata: this.canUpdateCollectionMetadata.map((x) => x.convert(convertFunction)),
|
|
387
|
-
canCreateMoreBadges: this.canCreateMoreBadges.map((x) => x.convert(convertFunction)),
|
|
388
|
-
canUpdateBadgeMetadata: this.canUpdateBadgeMetadata.map((x) => x.convert(convertFunction)),
|
|
389
|
-
canUpdateCollectionApprovals: this.canUpdateCollectionApprovals.map((x) => x.convert(convertFunction))
|
|
390
|
-
}));
|
|
391
|
-
}
|
|
392
|
-
toProto() {
|
|
393
|
-
return new proto_1.badges.CollectionPermissions(this.convert(string_numbers_1.Stringify));
|
|
394
|
-
}
|
|
395
|
-
static fromJson(jsonValue, convertFunction, options) {
|
|
396
|
-
return this.convertFromProto(proto_1.badges.CollectionPermissions.fromJson(jsonValue, options), convertFunction);
|
|
397
|
-
}
|
|
398
|
-
static fromJsonString(jsonString, convertFunction, options) {
|
|
399
|
-
return this.convertFromProto(proto_1.badges.CollectionPermissions.fromJsonString(jsonString, options), convertFunction);
|
|
400
|
-
}
|
|
401
|
-
static convertFromProto(protoMsg, convertFunction) {
|
|
402
|
-
return new CollectionPermissions({
|
|
403
|
-
canDeleteCollection: protoMsg.canDeleteCollection.map(x => ActionPermission.convertFromProto(x, convertFunction)),
|
|
404
|
-
canArchiveCollection: protoMsg.canArchiveCollection.map(x => TimedUpdatePermission.convertFromProto(x, convertFunction)),
|
|
405
|
-
canUpdateOffChainBalancesMetadata: protoMsg.canUpdateOffChainBalancesMetadata.map(x => TimedUpdatePermission.convertFromProto(x, convertFunction)),
|
|
406
|
-
canUpdateStandards: protoMsg.canUpdateStandards.map(x => TimedUpdatePermission.convertFromProto(x, convertFunction)),
|
|
407
|
-
canUpdateCustomData: protoMsg.canUpdateCustomData.map(x => TimedUpdatePermission.convertFromProto(x, convertFunction)),
|
|
408
|
-
canUpdateManager: protoMsg.canUpdateManager.map(x => TimedUpdatePermission.convertFromProto(x, convertFunction)),
|
|
409
|
-
canUpdateCollectionMetadata: protoMsg.canUpdateCollectionMetadata.map(x => TimedUpdatePermission.convertFromProto(x, convertFunction)),
|
|
410
|
-
canCreateMoreBadges: protoMsg.canCreateMoreBadges.map(x => BalancesActionPermission.convertFromProto(x, convertFunction)),
|
|
411
|
-
canUpdateBadgeMetadata: protoMsg.canUpdateBadgeMetadata.map(x => TimedUpdateWithBadgeIdsPermission.convertFromProto(x, convertFunction)),
|
|
412
|
-
canUpdateCollectionApprovals: protoMsg.canUpdateCollectionApprovals.map(x => CollectionApprovalPermission.convertFromProto(x, convertFunction))
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
exports.CollectionPermissions = CollectionPermissions;
|
|
417
|
-
class ActionPermission extends typeUtils_1.BaseNumberTypeClass {
|
|
418
|
-
permanentlyPermittedTimes;
|
|
419
|
-
permanentlyForbiddenTimes;
|
|
420
|
-
constructor(msg) {
|
|
421
|
-
super();
|
|
422
|
-
this.permanentlyPermittedTimes = msg.permanentlyPermittedTimes.map(x => new typeUtils_1.UintRange(x));
|
|
423
|
-
this.permanentlyForbiddenTimes = msg.permanentlyForbiddenTimes.map(x => new typeUtils_1.UintRange(x));
|
|
424
|
-
}
|
|
425
|
-
static required() {
|
|
426
|
-
return new ActionPermission({
|
|
427
|
-
permanentlyPermittedTimes: [],
|
|
428
|
-
permanentlyForbiddenTimes: []
|
|
429
|
-
});
|
|
430
|
-
}
|
|
431
|
-
convert(convertFunction) {
|
|
432
|
-
return new ActionPermission((0, typeUtils_1.deepCopy)({
|
|
433
|
-
permanentlyPermittedTimes: this.permanentlyPermittedTimes.map((x) => x.convert(convertFunction)),
|
|
434
|
-
permanentlyForbiddenTimes: this.permanentlyForbiddenTimes.map((x) => x.convert(convertFunction))
|
|
435
|
-
}));
|
|
436
|
-
}
|
|
437
|
-
toProto() {
|
|
438
|
-
return new proto_1.badges.ActionPermission(this.convert(string_numbers_1.Stringify));
|
|
439
|
-
}
|
|
440
|
-
static fromJson(jsonValue, convertFunction, options) {
|
|
441
|
-
return this.convertFromProto(proto_1.badges.ActionPermission.fromJson(jsonValue, options), convertFunction);
|
|
442
|
-
}
|
|
443
|
-
static fromJsonString(jsonString, convertFunction, options) {
|
|
444
|
-
return this.convertFromProto(proto_1.badges.ActionPermission.fromJsonString(jsonString, options), convertFunction);
|
|
445
|
-
}
|
|
446
|
-
static convertFromProto(protoMsg, convertFunction) {
|
|
447
|
-
return new ActionPermission({
|
|
448
|
-
permanentlyPermittedTimes: protoMsg.permanentlyPermittedTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
449
|
-
permanentlyForbiddenTimes: protoMsg.permanentlyForbiddenTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction))
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
exports.ActionPermission = ActionPermission;
|
|
454
|
-
class TimedUpdatePermission extends typeUtils_1.BaseNumberTypeClass {
|
|
455
|
-
timelineTimes;
|
|
456
|
-
permanentlyPermittedTimes;
|
|
457
|
-
permanentlyForbiddenTimes;
|
|
458
|
-
constructor(msg) {
|
|
459
|
-
super();
|
|
460
|
-
this.timelineTimes = msg.timelineTimes.map(x => new typeUtils_1.UintRange(x));
|
|
461
|
-
this.permanentlyPermittedTimes = msg.permanentlyPermittedTimes.map(x => new typeUtils_1.UintRange(x));
|
|
462
|
-
this.permanentlyForbiddenTimes = msg.permanentlyForbiddenTimes.map(x => new typeUtils_1.UintRange(x));
|
|
463
|
-
}
|
|
464
|
-
static required() {
|
|
465
|
-
return new TimedUpdatePermission({
|
|
466
|
-
timelineTimes: [],
|
|
467
|
-
permanentlyPermittedTimes: [],
|
|
468
|
-
permanentlyForbiddenTimes: []
|
|
469
|
-
});
|
|
470
|
-
}
|
|
471
|
-
convert(convertFunction) {
|
|
472
|
-
return new TimedUpdatePermission((0, typeUtils_1.deepCopy)({
|
|
473
|
-
timelineTimes: this.timelineTimes.map((x) => x.convert(convertFunction)),
|
|
474
|
-
permanentlyPermittedTimes: this.permanentlyPermittedTimes.map((x) => x.convert(convertFunction)),
|
|
475
|
-
permanentlyForbiddenTimes: this.permanentlyForbiddenTimes.map((x) => x.convert(convertFunction))
|
|
476
|
-
}));
|
|
477
|
-
}
|
|
478
|
-
toProto() {
|
|
479
|
-
return new proto_1.badges.TimedUpdatePermission(this.convert(string_numbers_1.Stringify));
|
|
480
|
-
}
|
|
481
|
-
equals(other, normalizeNumberTypes) {
|
|
482
|
-
return (0, typeUtils_1.compareNumberTypeConvertibles)(this, other, normalizeNumberTypes);
|
|
483
|
-
}
|
|
484
|
-
static fromJson(jsonValue, convertFunction, options) {
|
|
485
|
-
return this.convertFromProto(proto_1.badges.TimedUpdatePermission.fromJson(jsonValue, options), convertFunction);
|
|
486
|
-
}
|
|
487
|
-
static fromJsonString(jsonString, convertFunction, options) {
|
|
488
|
-
return this.convertFromProto(proto_1.badges.TimedUpdatePermission.fromJsonString(jsonString, options), convertFunction);
|
|
489
|
-
}
|
|
490
|
-
static convertFromProto(protoMsg, convertFunction) {
|
|
491
|
-
return new TimedUpdatePermission({
|
|
492
|
-
timelineTimes: protoMsg.timelineTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
493
|
-
permanentlyPermittedTimes: protoMsg.permanentlyPermittedTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
494
|
-
permanentlyForbiddenTimes: protoMsg.permanentlyForbiddenTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction))
|
|
495
|
-
});
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
exports.TimedUpdatePermission = TimedUpdatePermission;
|
|
499
|
-
class BalancesActionPermission extends typeUtils_1.BaseNumberTypeClass {
|
|
500
|
-
badgeIds;
|
|
501
|
-
ownershipTimes;
|
|
502
|
-
permanentlyPermittedTimes;
|
|
503
|
-
permanentlyForbiddenTimes;
|
|
504
|
-
constructor(msg) {
|
|
505
|
-
super();
|
|
506
|
-
this.badgeIds = msg.badgeIds.map(x => new typeUtils_1.UintRange(x));
|
|
507
|
-
this.ownershipTimes = msg.ownershipTimes.map(x => new typeUtils_1.UintRange(x));
|
|
508
|
-
this.permanentlyPermittedTimes = msg.permanentlyPermittedTimes.map(x => new typeUtils_1.UintRange(x));
|
|
509
|
-
this.permanentlyForbiddenTimes = msg.permanentlyForbiddenTimes.map(x => new typeUtils_1.UintRange(x));
|
|
510
|
-
}
|
|
511
|
-
static required() {
|
|
512
|
-
return new BalancesActionPermission({
|
|
513
|
-
badgeIds: [],
|
|
514
|
-
ownershipTimes: [],
|
|
515
|
-
permanentlyPermittedTimes: [],
|
|
516
|
-
permanentlyForbiddenTimes: []
|
|
517
|
-
});
|
|
518
|
-
}
|
|
519
|
-
convert(convertFunction) {
|
|
520
|
-
return new BalancesActionPermission((0, typeUtils_1.deepCopy)({
|
|
521
|
-
badgeIds: this.badgeIds.map((x) => x.convert(convertFunction)),
|
|
522
|
-
ownershipTimes: this.ownershipTimes.map((x) => x.convert(convertFunction)),
|
|
523
|
-
permanentlyPermittedTimes: this.permanentlyPermittedTimes.map((x) => x.convert(convertFunction)),
|
|
524
|
-
permanentlyForbiddenTimes: this.permanentlyForbiddenTimes.map((x) => x.convert(convertFunction))
|
|
525
|
-
}));
|
|
526
|
-
}
|
|
527
|
-
toProto() {
|
|
528
|
-
return new proto_1.badges.BalancesActionPermission(this.convert(string_numbers_1.Stringify));
|
|
529
|
-
}
|
|
530
|
-
static fromJson(jsonValue, convertFunction, options) {
|
|
531
|
-
return this.convertFromProto(proto_1.badges.BalancesActionPermission.fromJson(jsonValue, options), convertFunction);
|
|
532
|
-
}
|
|
533
|
-
static fromJsonString(jsonString, convertFunction, options) {
|
|
534
|
-
return this.convertFromProto(proto_1.badges.BalancesActionPermission.fromJsonString(jsonString, options), convertFunction);
|
|
535
|
-
}
|
|
536
|
-
static convertFromProto(protoMsg, convertFunction) {
|
|
537
|
-
return new BalancesActionPermission({
|
|
538
|
-
badgeIds: protoMsg.badgeIds.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
539
|
-
ownershipTimes: protoMsg.ownershipTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
540
|
-
permanentlyPermittedTimes: protoMsg.permanentlyPermittedTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
541
|
-
permanentlyForbiddenTimes: protoMsg.permanentlyForbiddenTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction))
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
exports.BalancesActionPermission = BalancesActionPermission;
|
|
546
|
-
class TimedUpdateWithBadgeIdsPermission extends typeUtils_1.BaseNumberTypeClass {
|
|
547
|
-
timelineTimes;
|
|
548
|
-
badgeIds;
|
|
549
|
-
permanentlyPermittedTimes;
|
|
550
|
-
permanentlyForbiddenTimes;
|
|
551
|
-
constructor(msg) {
|
|
552
|
-
super();
|
|
553
|
-
this.timelineTimes = msg.timelineTimes.map(x => new typeUtils_1.UintRange(x));
|
|
554
|
-
this.badgeIds = msg.badgeIds.map(x => new typeUtils_1.UintRange(x));
|
|
555
|
-
this.permanentlyPermittedTimes = msg.permanentlyPermittedTimes.map(x => new typeUtils_1.UintRange(x));
|
|
556
|
-
this.permanentlyForbiddenTimes = msg.permanentlyForbiddenTimes.map(x => new typeUtils_1.UintRange(x));
|
|
557
|
-
}
|
|
558
|
-
static required() {
|
|
559
|
-
return new TimedUpdateWithBadgeIdsPermission({
|
|
560
|
-
timelineTimes: [],
|
|
561
|
-
badgeIds: [],
|
|
562
|
-
permanentlyPermittedTimes: [],
|
|
563
|
-
permanentlyForbiddenTimes: []
|
|
564
|
-
});
|
|
565
|
-
}
|
|
566
|
-
convert(convertFunction) {
|
|
567
|
-
return new TimedUpdateWithBadgeIdsPermission((0, typeUtils_1.deepCopy)({
|
|
568
|
-
timelineTimes: this.timelineTimes.map((x) => x.convert(convertFunction)),
|
|
569
|
-
badgeIds: this.badgeIds.map((x) => x.convert(convertFunction)),
|
|
570
|
-
permanentlyPermittedTimes: this.permanentlyPermittedTimes.map((x) => x.convert(convertFunction)),
|
|
571
|
-
permanentlyForbiddenTimes: this.permanentlyForbiddenTimes.map((x) => x.convert(convertFunction))
|
|
572
|
-
}));
|
|
573
|
-
}
|
|
574
|
-
toProto() {
|
|
575
|
-
return new proto_1.badges.TimedUpdateWithBadgeIdsPermission(this.convert(string_numbers_1.Stringify));
|
|
576
|
-
}
|
|
577
|
-
static fromJson(jsonValue, convertFunction, options) {
|
|
578
|
-
return this.convertFromProto(proto_1.badges.TimedUpdateWithBadgeIdsPermission.fromJson(jsonValue, options), convertFunction);
|
|
579
|
-
}
|
|
580
|
-
static fromJsonString(jsonString, convertFunction, options) {
|
|
581
|
-
return this.convertFromProto(proto_1.badges.TimedUpdateWithBadgeIdsPermission.fromJsonString(jsonString, options), convertFunction);
|
|
582
|
-
}
|
|
583
|
-
static convertFromProto(protoMsg, convertFunction) {
|
|
584
|
-
return new TimedUpdateWithBadgeIdsPermission({
|
|
585
|
-
timelineTimes: protoMsg.timelineTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
586
|
-
badgeIds: protoMsg.badgeIds.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
587
|
-
permanentlyPermittedTimes: protoMsg.permanentlyPermittedTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
588
|
-
permanentlyForbiddenTimes: protoMsg.permanentlyForbiddenTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction))
|
|
589
|
-
});
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
exports.TimedUpdateWithBadgeIdsPermission = TimedUpdateWithBadgeIdsPermission;
|
|
593
|
-
class CollectionApprovalPermission extends typeUtils_1.BaseNumberTypeClass {
|
|
594
|
-
fromListId;
|
|
595
|
-
toListId;
|
|
596
|
-
initiatedByListId;
|
|
597
|
-
transferTimes;
|
|
598
|
-
badgeIds;
|
|
599
|
-
ownershipTimes;
|
|
600
|
-
approvalId;
|
|
601
|
-
amountTrackerId;
|
|
602
|
-
challengeTrackerId;
|
|
603
|
-
permanentlyPermittedTimes;
|
|
604
|
-
permanentlyForbiddenTimes;
|
|
605
|
-
constructor(msg) {
|
|
606
|
-
super();
|
|
607
|
-
this.fromListId = msg.fromListId;
|
|
608
|
-
this.toListId = msg.toListId;
|
|
609
|
-
this.initiatedByListId = msg.initiatedByListId;
|
|
610
|
-
this.transferTimes = msg.transferTimes.map(x => new typeUtils_1.UintRange(x));
|
|
611
|
-
this.badgeIds = msg.badgeIds.map(x => new typeUtils_1.UintRange(x));
|
|
612
|
-
this.ownershipTimes = msg.ownershipTimes.map(x => new typeUtils_1.UintRange(x));
|
|
613
|
-
this.approvalId = msg.approvalId;
|
|
614
|
-
this.amountTrackerId = msg.amountTrackerId;
|
|
615
|
-
this.challengeTrackerId = msg.challengeTrackerId;
|
|
616
|
-
this.permanentlyPermittedTimes = msg.permanentlyPermittedTimes.map(x => new typeUtils_1.UintRange(x));
|
|
617
|
-
this.permanentlyForbiddenTimes = msg.permanentlyForbiddenTimes.map(x => new typeUtils_1.UintRange(x));
|
|
618
|
-
}
|
|
619
|
-
static required() {
|
|
620
|
-
return new CollectionApprovalPermission({
|
|
621
|
-
fromListId: '',
|
|
622
|
-
toListId: '',
|
|
623
|
-
initiatedByListId: '',
|
|
624
|
-
transferTimes: [],
|
|
625
|
-
badgeIds: [],
|
|
626
|
-
ownershipTimes: [],
|
|
627
|
-
approvalId: '',
|
|
628
|
-
amountTrackerId: '',
|
|
629
|
-
challengeTrackerId: '',
|
|
630
|
-
permanentlyPermittedTimes: [],
|
|
631
|
-
permanentlyForbiddenTimes: []
|
|
632
|
-
});
|
|
633
|
-
}
|
|
634
|
-
convert(convertFunction) {
|
|
635
|
-
return new CollectionApprovalPermission((0, typeUtils_1.deepCopy)({
|
|
636
|
-
fromListId: this.fromListId,
|
|
637
|
-
toListId: this.toListId,
|
|
638
|
-
initiatedByListId: this.initiatedByListId,
|
|
639
|
-
transferTimes: this.transferTimes.map((x) => x.convert(convertFunction)),
|
|
640
|
-
badgeIds: this.badgeIds.map((x) => x.convert(convertFunction)),
|
|
641
|
-
ownershipTimes: this.ownershipTimes.map((x) => x.convert(convertFunction)),
|
|
642
|
-
approvalId: this.approvalId,
|
|
643
|
-
amountTrackerId: this.amountTrackerId,
|
|
644
|
-
challengeTrackerId: this.challengeTrackerId,
|
|
645
|
-
permanentlyPermittedTimes: this.permanentlyPermittedTimes.map((x) => x.convert(convertFunction)),
|
|
646
|
-
permanentlyForbiddenTimes: this.permanentlyForbiddenTimes.map((x) => x.convert(convertFunction))
|
|
647
|
-
}));
|
|
648
|
-
}
|
|
649
|
-
toProto() {
|
|
650
|
-
return new proto_1.badges.CollectionApprovalPermission(this.convert(string_numbers_1.Stringify));
|
|
651
|
-
}
|
|
652
|
-
static fromJson(jsonValue, convertFunction, options) {
|
|
653
|
-
return this.convertFromProto(proto_1.badges.CollectionApprovalPermission.fromJson(jsonValue, options), convertFunction);
|
|
654
|
-
}
|
|
655
|
-
static fromJsonString(jsonString, convertFunction, options) {
|
|
656
|
-
return this.convertFromProto(proto_1.badges.CollectionApprovalPermission.fromJsonString(jsonString, options), convertFunction);
|
|
657
|
-
}
|
|
658
|
-
static convertFromProto(protoMsg, convertFunction) {
|
|
659
|
-
return new CollectionApprovalPermission({
|
|
660
|
-
fromListId: protoMsg.fromListId,
|
|
661
|
-
toListId: protoMsg.toListId,
|
|
662
|
-
initiatedByListId: protoMsg.initiatedByListId,
|
|
663
|
-
transferTimes: protoMsg.transferTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
664
|
-
badgeIds: protoMsg.badgeIds.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
665
|
-
ownershipTimes: protoMsg.ownershipTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
666
|
-
approvalId: protoMsg.approvalId,
|
|
667
|
-
amountTrackerId: protoMsg.amountTrackerId,
|
|
668
|
-
challengeTrackerId: protoMsg.challengeTrackerId,
|
|
669
|
-
permanentlyPermittedTimes: protoMsg.permanentlyPermittedTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
670
|
-
permanentlyForbiddenTimes: protoMsg.permanentlyForbiddenTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction))
|
|
671
|
-
});
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
exports.CollectionApprovalPermission = CollectionApprovalPermission;
|
|
675
|
-
//# sourceMappingURL=permissions.js.map
|