bitbadgesjs-sdk 0.0.6 → 0.1.0
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/dist/amino/objectConverter.d.ts +1 -1
- package/dist/amino/objectConverter.d.ts.map +1 -1
- package/dist/amino/registry.js +3 -3
- package/dist/amino/registry.js.map +1 -1
- package/dist/eip712/payload/createTypedData.d.ts +1 -1
- package/dist/eip712/payload/createTypedData.d.ts.map +1 -1
- package/dist/eip712/payload/createTypes/parseMessage.d.ts +1 -1
- package/dist/eip712/payload/createTypes/parseMessage.d.ts.map +1 -1
- package/dist/eip712/payload/createTypes/parseMessage.js.map +1 -1
- package/dist/eip712/payload/createTypes/parsePayload.d.ts +1 -1
- package/dist/eip712/payload/createTypes/parsePayload.d.ts.map +1 -1
- package/dist/eip712/payload/createTypes/parsePayload.js.map +1 -1
- package/dist/eip712/payload/flattenPayload.d.ts +1 -1
- package/dist/eip712/payload/flattenPayload.d.ts.map +1 -1
- package/dist/eip712/payload/samples/getSampleMsg.js +1 -1
- package/dist/eip712/payload/samples/getSampleMsg.js.map +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/transactions/messages/base.d.ts +3 -3
- package/dist/transactions/messages/base.d.ts.map +1 -1
- package/dist/transactions/messages/base.js +6 -9
- package/dist/transactions/messages/base.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.d.ts +12 -5
- package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.js +26 -14
- package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.d.ts +24 -6
- package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.js +75 -43
- package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.d.ts +14 -6
- package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.js +32 -21
- package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.d.ts +14 -6
- package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.js +35 -23
- package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.d.ts +22 -6
- package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.js +118 -55
- package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.d.ts +11 -6
- package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.js +108 -52
- package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.d.ts +23 -6
- package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.js +71 -31
- package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.js.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgCreateProtocol.d.ts +15 -3
- package/dist/transactions/messages/bitbadges/protocols/msgCreateProtocol.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgCreateProtocol.js +35 -6
- package/dist/transactions/messages/bitbadges/protocols/msgCreateProtocol.js.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgDeleteProtocol.d.ts +12 -5
- package/dist/transactions/messages/bitbadges/protocols/msgDeleteProtocol.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgDeleteProtocol.js +26 -6
- package/dist/transactions/messages/bitbadges/protocols/msgDeleteProtocol.js.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.d.ts +14 -4
- package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.js +36 -6
- package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.js.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgUnsetCollectionForProtocol.d.ts +12 -3
- package/dist/transactions/messages/bitbadges/protocols/msgUnsetCollectionForProtocol.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgUnsetCollectionForProtocol.js +26 -6
- package/dist/transactions/messages/bitbadges/protocols/msgUnsetCollectionForProtocol.js.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgUpdateProtocol.d.ts +15 -3
- package/dist/transactions/messages/bitbadges/protocols/msgUpdateProtocol.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgUpdateProtocol.js +35 -6
- package/dist/transactions/messages/bitbadges/protocols/msgUpdateProtocol.js.map +1 -1
- package/dist/transactions/messages/bitbadges/wasmx/msgExecuteContractCompat.d.ts +14 -3
- package/dist/transactions/messages/bitbadges/wasmx/msgExecuteContractCompat.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/wasmx/msgExecuteContractCompat.js +32 -6
- package/dist/transactions/messages/bitbadges/wasmx/msgExecuteContractCompat.js.map +1 -1
- package/dist/transactions/messages/bitbadges/wasmx/msgInstantiateContractCompat.d.ts +14 -3
- package/dist/transactions/messages/bitbadges/wasmx/msgInstantiateContractCompat.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/wasmx/msgInstantiateContractCompat.js +32 -11
- package/dist/transactions/messages/bitbadges/wasmx/msgInstantiateContractCompat.js.map +1 -1
- package/dist/transactions/messages/bitbadges/wasmx/msgStoreCodeCompat.d.ts +15 -2
- package/dist/transactions/messages/bitbadges/wasmx/msgStoreCodeCompat.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/wasmx/msgStoreCodeCompat.js +26 -9
- package/dist/transactions/messages/bitbadges/wasmx/msgStoreCodeCompat.js.map +1 -1
- package/dist/transactions/messages/common.d.ts +1 -1
- package/dist/transactions/messages/common.d.ts.map +1 -1
- package/dist/transactions/messages/msgSend.d.ts +2 -2
- package/dist/transactions/messages/msgSend.d.ts.map +1 -1
- package/dist/transactions/messages/transaction.d.ts +2 -2
- package/dist/transactions/messages/transaction.d.ts.map +1 -1
- package/dist/transactions/messages/transaction.js +1 -1
- package/dist/transactions/messages/transaction.js.map +1 -1
- package/dist/transactions/messages/txRaw.d.ts +2 -2
- package/dist/transactions/messages/txRaw.d.ts.map +1 -1
- package/dist/transactions/messages/txRaw.js.map +1 -1
- package/dist/transactions/messages/web3Extension.d.ts +2 -2
- package/dist/transactions/messages/web3Extension.d.ts.map +1 -1
- package/dist/transactions/messages/web3Extension.js +4 -4
- package/dist/transactions/messages/web3Extension.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/badges/aminoRegistry.d.ts +3 -0
- package/dist/types/badges/aminoRegistry.d.ts.map +1 -0
- package/dist/types/badges/aminoRegistry.js.map +1 -0
- package/dist/{proto-types → types}/badges/string-numbers.d.ts +2 -2
- package/dist/types/badges/string-numbers.d.ts.map +1 -0
- package/dist/types/badges/string-numbers.js.map +1 -0
- package/dist/types/badges/typeutils/approvals.d.ts +320 -0
- package/dist/types/badges/typeutils/approvals.d.ts.map +1 -0
- package/dist/types/badges/typeutils/approvals.js +690 -0
- package/dist/types/badges/typeutils/approvals.js.map +1 -0
- package/dist/types/badges/typeutils/permissions.d.ts +230 -0
- package/dist/types/badges/typeutils/permissions.d.ts.map +1 -0
- package/dist/types/badges/typeutils/permissions.js +675 -0
- package/dist/types/badges/typeutils/permissions.js.map +1 -0
- package/dist/types/badges/typeutils/typeUtils.d.ts +411 -0
- package/dist/types/badges/typeutils/typeUtils.d.ts.map +1 -0
- package/dist/types/badges/typeutils/typeUtils.js +1086 -0
- package/dist/types/badges/typeutils/typeUtils.js.map +1 -0
- package/dist/{proto-types → types}/base.d.ts +1 -1
- package/dist/types/base.d.ts.map +1 -0
- package/dist/types/base.js.map +1 -0
- package/dist/types/protocols/aminoRegistry.d.ts +3 -0
- package/dist/types/protocols/aminoRegistry.d.ts.map +1 -0
- package/dist/types/protocols/aminoRegistry.js.map +1 -0
- package/dist/types/protocols/types.d.ts +24 -0
- package/dist/types/protocols/types.d.ts.map +1 -0
- package/dist/types/protocols/types.js +50 -0
- package/dist/types/protocols/types.js.map +1 -0
- package/dist/types/txRaw.d.ts.map +1 -0
- package/dist/types/txRaw.js.map +1 -0
- package/dist/{proto-types → types}/utils.d.ts +2 -1
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/utils.js.map +1 -0
- package/dist/types/wasmx/aminoRegistry.d.ts +3 -0
- package/dist/types/wasmx/aminoRegistry.d.ts.map +1 -0
- package/dist/types/wasmx/aminoRegistry.js.map +1 -0
- package/dist/{proto-types → types}/web3Extension.d.ts +1 -1
- package/dist/types/web3Extension.d.ts.map +1 -0
- package/dist/{proto-types → types}/web3Extension.js +3 -3
- package/dist/types/web3Extension.js.map +1 -0
- package/dist/utils/addressLists.d.ts +1 -4
- package/dist/utils/addressLists.d.ts.map +1 -1
- package/dist/utils/addressLists.js +28 -44
- package/dist/utils/addressLists.js.map +1 -1
- package/dist/utils/aliases.d.ts +1 -1
- package/dist/utils/aliases.d.ts.map +1 -1
- package/dist/utils/api-sdk.d.ts +40 -45
- package/dist/utils/api-sdk.d.ts.map +1 -1
- package/dist/utils/api-sdk.js +84 -137
- package/dist/utils/api-sdk.js.map +1 -1
- package/dist/utils/api-utils.d.ts +3 -2
- package/dist/utils/api-utils.d.ts.map +1 -1
- package/dist/utils/api-utils.js +19 -37
- package/dist/utils/api-utils.js.map +1 -1
- package/dist/utils/approved_transfers_casts.d.ts.map +1 -1
- package/dist/utils/approved_transfers_casts.js +27 -24
- package/dist/utils/approved_transfers_casts.js.map +1 -1
- package/dist/utils/badgeMetadata.d.ts +4 -4
- package/dist/utils/badgeMetadata.d.ts.map +1 -1
- package/dist/utils/badgeMetadata.js +19 -17
- package/dist/utils/badgeMetadata.js.map +1 -1
- package/dist/utils/balances.d.ts +12 -16
- package/dist/utils/balances.d.ts.map +1 -1
- package/dist/utils/balances.js +119 -141
- package/dist/utils/balances.js.map +1 -1
- package/dist/utils/batch-utils.d.ts +11 -4
- package/dist/utils/batch-utils.d.ts.map +1 -1
- package/dist/utils/batch-utils.js +41 -20
- package/dist/utils/batch-utils.js.map +1 -1
- package/dist/utils/chains.d.ts +0 -2
- package/dist/utils/chains.d.ts.map +1 -1
- package/dist/utils/chains.js +12 -15
- package/dist/utils/chains.js.map +1 -1
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +5 -4
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/display.d.ts +1 -1
- package/dist/utils/display.d.ts.map +1 -1
- package/dist/utils/display.js +7 -5
- package/dist/utils/display.js.map +1 -1
- package/dist/utils/distribution.d.ts +4 -4
- package/dist/utils/distribution.d.ts.map +1 -1
- package/dist/utils/distribution.js +32 -31
- 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 +20 -19
- package/dist/utils/firstMatches.js.map +1 -1
- package/dist/utils/index.d.ts +1 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/math.d.ts +8 -2
- package/dist/utils/math.d.ts.map +1 -1
- package/dist/utils/math.js +63 -15
- package/dist/utils/math.js.map +1 -1
- package/dist/utils/metadataIds.d.ts +2 -2
- package/dist/utils/metadataIds.d.ts.map +1 -1
- package/dist/utils/metadataIds.js +8 -8
- package/dist/utils/metadataIds.js.map +1 -1
- package/dist/utils/node-rest-api/balances.d.ts +1 -1
- package/dist/utils/node-rest-api/balances.d.ts.map +1 -1
- package/dist/utils/node-rest-api/gov.d.ts +1 -1
- package/dist/utils/node-rest-api/gov.d.ts.map +1 -1
- package/dist/utils/node-rest-api/staking.d.ts +1 -1
- package/dist/utils/node-rest-api/staking.d.ts.map +1 -1
- package/dist/utils/overlaps.d.ts.map +1 -1
- package/dist/utils/overlaps.js +67 -67
- package/dist/utils/overlaps.js.map +1 -1
- package/dist/utils/permission_checks.d.ts +10 -10
- package/dist/utils/permission_checks.d.ts.map +1 -1
- package/dist/utils/permission_checks.js +58 -57
- package/dist/utils/permission_checks.js.map +1 -1
- package/dist/utils/permissions.d.ts +2 -2
- package/dist/utils/permissions.d.ts.map +1 -1
- package/dist/utils/permissions.js +20 -18
- package/dist/utils/permissions.js.map +1 -1
- package/dist/utils/types/activity.d.ts +51 -74
- package/dist/utils/types/activity.d.ts.map +1 -1
- package/dist/utils/types/activity.js +118 -105
- package/dist/utils/types/activity.js.map +1 -1
- package/dist/utils/types/api.d.ts +349 -134
- package/dist/utils/types/api.d.ts.map +1 -1
- package/dist/utils/types/api.js +512 -248
- package/dist/utils/types/api.js.map +1 -1
- package/dist/utils/types/coin.d.ts +9 -3
- package/dist/utils/types/coin.d.ts.map +1 -1
- package/dist/utils/types/coin.js +17 -9
- package/dist/utils/types/coin.js.map +1 -1
- package/dist/utils/types/collections.d.ts +263 -26
- package/dist/utils/types/collections.d.ts.map +1 -1
- package/dist/utils/types/collections.js +717 -99
- package/dist/utils/types/collections.js.map +1 -1
- package/dist/utils/types/db.d.ts +434 -187
- package/dist/utils/types/db.d.ts.map +1 -1
- package/dist/utils/types/db.js +859 -502
- package/dist/utils/types/db.js.map +1 -1
- package/dist/utils/types/indexer.d.ts +2 -2
- package/dist/utils/types/indexer.d.ts.map +1 -1
- package/dist/utils/types/metadata.d.ts +77 -9
- package/dist/utils/types/metadata.d.ts.map +1 -1
- package/dist/utils/types/metadata.js +133 -18
- package/dist/utils/types/metadata.js.map +1 -1
- package/dist/utils/types/routes.d.ts +49 -47
- package/dist/utils/types/routes.d.ts.map +1 -1
- package/dist/utils/types/routes.js +50 -93
- package/dist/utils/types/routes.js.map +1 -1
- package/dist/utils/types/schemas.d.ts +120 -0
- package/dist/utils/types/schemas.d.ts.map +1 -0
- package/dist/utils/types/schemas.js +261 -0
- package/dist/utils/types/schemas.js.map +1 -0
- package/dist/utils/types/transfers.d.ts +11 -5
- package/dist/utils/types/transfers.d.ts.map +1 -1
- package/dist/utils/types/transfers.js +22 -13
- package/dist/utils/types/transfers.js.map +1 -1
- package/dist/utils/types/types.d.ts +6 -6
- package/dist/utils/types/types.d.ts.map +1 -1
- package/dist/utils/types/types.js +3 -6
- package/dist/utils/types/types.js.map +1 -1
- package/dist/utils/types/users.d.ts +125 -15
- package/dist/utils/types/users.d.ts.map +1 -1
- package/dist/utils/types/users.js +275 -57
- package/dist/utils/types/users.js.map +1 -1
- package/dist/utils/uintRanges.d.ts +10 -14
- package/dist/utils/uintRanges.d.ts.map +1 -1
- package/dist/utils/uintRanges.js +53 -65
- package/dist/utils/uintRanges.js.map +1 -1
- package/dist/utils/update_checks.d.ts +2 -2
- package/dist/utils/update_checks.d.ts.map +1 -1
- package/dist/utils/update_checks.js +247 -185
- package/dist/utils/update_checks.js.map +1 -1
- package/dist/utils/userApprovals.d.ts.map +1 -1
- package/dist/utils/userApprovals.js +19 -34
- package/dist/utils/userApprovals.js.map +1 -1
- package/dist/utils/validate_permissions_updates.d.ts +2 -2
- package/dist/utils/validate_permissions_updates.d.ts.map +1 -1
- package/dist/utils/validate_permissions_updates.js.map +1 -1
- package/package.json +8 -16
- package/dist/proto-types/badges/aminoRegistry.d.ts +0 -3
- package/dist/proto-types/badges/aminoRegistry.d.ts.map +0 -1
- package/dist/proto-types/badges/aminoRegistry.js.map +0 -1
- package/dist/proto-types/badges/string-numbers.d.ts.map +0 -1
- package/dist/proto-types/badges/string-numbers.js.map +0 -1
- package/dist/proto-types/badges/typeutils/approvals.d.ts +0 -127
- package/dist/proto-types/badges/typeutils/approvals.d.ts.map +0 -1
- package/dist/proto-types/badges/typeutils/approvals.js +0 -209
- package/dist/proto-types/badges/typeutils/approvals.js.map +0 -1
- package/dist/proto-types/badges/typeutils/permissions.d.ts +0 -88
- package/dist/proto-types/badges/typeutils/permissions.d.ts.map +0 -1
- package/dist/proto-types/badges/typeutils/permissions.js +0 -124
- package/dist/proto-types/badges/typeutils/permissions.js.map +0 -1
- package/dist/proto-types/badges/typeutils/typeUtils.d.ts +0 -119
- package/dist/proto-types/badges/typeutils/typeUtils.d.ts.map +0 -1
- package/dist/proto-types/badges/typeutils/typeUtils.js +0 -146
- package/dist/proto-types/badges/typeutils/typeUtils.js.map +0 -1
- package/dist/proto-types/base.d.ts.map +0 -1
- package/dist/proto-types/base.js.map +0 -1
- package/dist/proto-types/protocols/aminoRegistry.d.ts +0 -3
- package/dist/proto-types/protocols/aminoRegistry.d.ts.map +0 -1
- package/dist/proto-types/protocols/aminoRegistry.js.map +0 -1
- package/dist/proto-types/protocols/types.d.ts +0 -8
- package/dist/proto-types/protocols/types.d.ts.map +0 -1
- package/dist/proto-types/protocols/types.js +0 -3
- package/dist/proto-types/protocols/types.js.map +0 -1
- package/dist/proto-types/txRaw.d.ts.map +0 -1
- package/dist/proto-types/txRaw.js.map +0 -1
- package/dist/proto-types/utils.d.ts.map +0 -1
- package/dist/proto-types/utils.js.map +0 -1
- package/dist/proto-types/wasmx/aminoRegistry.d.ts +0 -3
- package/dist/proto-types/wasmx/aminoRegistry.d.ts.map +0 -1
- package/dist/proto-types/wasmx/aminoRegistry.js.map +0 -1
- package/dist/proto-types/web3Extension.d.ts.map +0 -1
- package/dist/proto-types/web3Extension.js.map +0 -1
- package/dist/utils/collections.d.ts +0 -7
- package/dist/utils/collections.d.ts.map +0 -1
- package/dist/utils/collections.js +0 -99
- package/dist/utils/collections.js.map +0 -1
- package/dist/utils/timeline_helpers.d.ts +0 -30
- package/dist/utils/timeline_helpers.d.ts.map +0 -1
- package/dist/utils/timeline_helpers.js +0 -74
- package/dist/utils/timeline_helpers.js.map +0 -1
- package/dist/utils/timelines.d.ts +0 -32
- package/dist/utils/timelines.d.ts.map +0 -1
- package/dist/utils/timelines.js +0 -106
- package/dist/utils/timelines.js.map +0 -1
- package/dist/utils/types/utils.d.ts +0 -2
- package/dist/utils/types/utils.d.ts.map +0 -1
- package/dist/utils/types/utils.js +0 -26
- package/dist/utils/types/utils.js.map +0 -1
- package/dist/utils/utils/compare.d.ts +0 -2
- package/dist/utils/utils/compare.d.ts.map +0 -1
- package/dist/utils/utils/compare.js +0 -42
- package/dist/utils/utils/compare.js.map +0 -1
- /package/dist/{proto-types → types}/badges/aminoRegistry.js +0 -0
- /package/dist/{proto-types → types}/badges/string-numbers.js +0 -0
- /package/dist/{proto-types → types}/base.js +0 -0
- /package/dist/{proto-types → types}/protocols/aminoRegistry.js +0 -0
- /package/dist/{proto-types → types}/txRaw.d.ts +0 -0
- /package/dist/{proto-types → types}/txRaw.js +0 -0
- /package/dist/{proto-types → types}/utils.js +0 -0
- /package/dist/{proto-types → types}/wasmx/aminoRegistry.js +0 -0
|
@@ -0,0 +1,690 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApprovalCriteria = exports.CollectionApproval = exports.IncomingApprovalCriteria = exports.UserIncomingApproval = exports.MaxNumTransfers = exports.ApprovalAmounts = exports.PredeterminedOrderCalculationMethod = exports.IncrementedBalances = exports.ManualBalances = exports.PredeterminedBalances = exports.OutgoingApprovalCriteria = exports.UserOutgoingApproval = exports.UserBalanceStore = void 0;
|
|
4
|
+
const __1 = require("../../..");
|
|
5
|
+
const __2 = require("../../..");
|
|
6
|
+
const string_numbers_1 = require("../string-numbers");
|
|
7
|
+
const permissions_1 = require("./permissions");
|
|
8
|
+
const typeUtils_1 = require("./typeUtils");
|
|
9
|
+
class UserBalanceStore extends typeUtils_1.BaseNumberTypeClass {
|
|
10
|
+
balances;
|
|
11
|
+
incomingApprovals;
|
|
12
|
+
outgoingApprovals;
|
|
13
|
+
userPermissions;
|
|
14
|
+
autoApproveSelfInitiatedOutgoingTransfers;
|
|
15
|
+
autoApproveSelfInitiatedIncomingTransfers;
|
|
16
|
+
constructor(msg) {
|
|
17
|
+
super();
|
|
18
|
+
this.balances = msg.balances.map(x => new typeUtils_1.Balance(x));
|
|
19
|
+
this.incomingApprovals = msg.incomingApprovals.map(x => new UserIncomingApproval(x));
|
|
20
|
+
this.outgoingApprovals = msg.outgoingApprovals.map(x => new UserOutgoingApproval(x));
|
|
21
|
+
this.userPermissions = new permissions_1.UserPermissions(msg.userPermissions);
|
|
22
|
+
this.autoApproveSelfInitiatedOutgoingTransfers = msg.autoApproveSelfInitiatedOutgoingTransfers;
|
|
23
|
+
this.autoApproveSelfInitiatedIncomingTransfers = msg.autoApproveSelfInitiatedIncomingTransfers;
|
|
24
|
+
}
|
|
25
|
+
convert(convertFunction) {
|
|
26
|
+
return new UserBalanceStore((0, typeUtils_1.deepCopy)({
|
|
27
|
+
balances: this.balances.map((x) => x.convert(convertFunction)),
|
|
28
|
+
incomingApprovals: this.incomingApprovals.map((x) => x.convert(convertFunction)),
|
|
29
|
+
outgoingApprovals: this.outgoingApprovals.map((x) => x.convert(convertFunction)),
|
|
30
|
+
userPermissions: this.userPermissions.convert(convertFunction),
|
|
31
|
+
autoApproveSelfInitiatedOutgoingTransfers: this.autoApproveSelfInitiatedOutgoingTransfers,
|
|
32
|
+
autoApproveSelfInitiatedIncomingTransfers: this.autoApproveSelfInitiatedIncomingTransfers
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
toProto() {
|
|
36
|
+
return new __1.proto.badges.UserBalanceStore(this.convert(string_numbers_1.Stringify));
|
|
37
|
+
}
|
|
38
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
39
|
+
return this.convertFromProto(__1.proto.badges.UserBalanceStore.fromJson(jsonValue, options), convertFunction);
|
|
40
|
+
}
|
|
41
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
42
|
+
return this.convertFromProto(__1.proto.badges.UserBalanceStore.fromJsonString(jsonString, options), convertFunction);
|
|
43
|
+
}
|
|
44
|
+
static convertFromProto(item, convertFunction) {
|
|
45
|
+
return new UserBalanceStore({
|
|
46
|
+
balances: item.balances.map(x => typeUtils_1.Balance.convertFromProto(x, convertFunction)),
|
|
47
|
+
incomingApprovals: item.incomingApprovals.map(x => UserIncomingApproval.convertFromProto(x, convertFunction)),
|
|
48
|
+
outgoingApprovals: item.outgoingApprovals.map(x => UserOutgoingApproval.convertFromProto(x, convertFunction)),
|
|
49
|
+
userPermissions: item.userPermissions ? permissions_1.UserPermissions.convertFromProto(item.userPermissions, convertFunction) : permissions_1.UserPermissions.required().convert(convertFunction),
|
|
50
|
+
autoApproveSelfInitiatedOutgoingTransfers: item.autoApproveSelfInitiatedOutgoingTransfers,
|
|
51
|
+
autoApproveSelfInitiatedIncomingTransfers: item.autoApproveSelfInitiatedIncomingTransfers
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
getBalanceForIdAndTime(badgeId, ownedTime) {
|
|
55
|
+
return (0, __2.getBalanceForIdAndTime)(badgeId, ownedTime, this.balances.map(x => x.convert(string_numbers_1.BigIntify)));
|
|
56
|
+
}
|
|
57
|
+
getBalancesForId(badgeId) {
|
|
58
|
+
return (0, __1.getBalancesForId)(badgeId, this.balances.map(x => x.convert(string_numbers_1.BigIntify)));
|
|
59
|
+
}
|
|
60
|
+
getBalancesForTime(ownedTime) {
|
|
61
|
+
return (0, __1.getBalancesForTime)(ownedTime, this.balances.map(x => x.convert(string_numbers_1.BigIntify)));
|
|
62
|
+
}
|
|
63
|
+
filterZeroBalances() {
|
|
64
|
+
this.balances = this.balances.filter(x => x.amount !== BigInt(0));
|
|
65
|
+
}
|
|
66
|
+
subsetOf(threshold) {
|
|
67
|
+
return (0, __1.doBalancesExceedThreshold)(this.balances.map(x => x.convert(string_numbers_1.BigIntify)), threshold.balances.map(x => x.convert(string_numbers_1.BigIntify)));
|
|
68
|
+
}
|
|
69
|
+
equalBalances(other, checkZeroBalances = false) {
|
|
70
|
+
return (0, __1.areBalancesEqual)(this.balances.map(x => x.convert(string_numbers_1.BigIntify)), other.balances.map(x => x.convert(string_numbers_1.BigIntify)), checkZeroBalances);
|
|
71
|
+
}
|
|
72
|
+
updateBalances(newBalance) {
|
|
73
|
+
this.balances = (0, __1.updateBalances)(newBalance, this.balances);
|
|
74
|
+
}
|
|
75
|
+
addBalances(balancesToAdd) {
|
|
76
|
+
this.balances = (0, __1.addBalances)(balancesToAdd, this.balances);
|
|
77
|
+
}
|
|
78
|
+
addBalance(balanceToAdd) {
|
|
79
|
+
this.addBalances([balanceToAdd]);
|
|
80
|
+
}
|
|
81
|
+
subtractBalances(balancesToSubtract, allowUnderflow) {
|
|
82
|
+
this.balances = (0, __2.subtractBalances)(balancesToSubtract, this.balances, allowUnderflow);
|
|
83
|
+
}
|
|
84
|
+
subtractBalance(balanceToSubtract, allowUnderflow) {
|
|
85
|
+
this.subtractBalances([balanceToSubtract], allowUnderflow);
|
|
86
|
+
}
|
|
87
|
+
sortBalancesByAmount() {
|
|
88
|
+
this.balances = (0, __1.sortBalancesByAmount)(this.balances);
|
|
89
|
+
}
|
|
90
|
+
applyIncrements(incrementBadgeIdsBy, incrementOwnershipTimesBy, numIncrements) {
|
|
91
|
+
this.balances = (0, __1.applyIncrementsToBalances)(this.balances, incrementBadgeIdsBy, incrementOwnershipTimesBy, numIncrements);
|
|
92
|
+
}
|
|
93
|
+
getBalancesAfterTransfers(transfers, allowUnderflow) {
|
|
94
|
+
return (0, __1.getBalancesAfterTransfers)(this.balances, transfers, allowUnderflow);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.UserBalanceStore = UserBalanceStore;
|
|
98
|
+
class UserOutgoingApproval extends typeUtils_1.BaseNumberTypeClass {
|
|
99
|
+
toListId;
|
|
100
|
+
initiatedByListId;
|
|
101
|
+
transferTimes;
|
|
102
|
+
badgeIds;
|
|
103
|
+
ownershipTimes;
|
|
104
|
+
approvalId;
|
|
105
|
+
amountTrackerId;
|
|
106
|
+
challengeTrackerId;
|
|
107
|
+
uri;
|
|
108
|
+
customData;
|
|
109
|
+
approvalCriteria;
|
|
110
|
+
constructor(msg) {
|
|
111
|
+
super();
|
|
112
|
+
this.toListId = msg.toListId;
|
|
113
|
+
this.initiatedByListId = msg.initiatedByListId;
|
|
114
|
+
this.transferTimes = msg.transferTimes.map(x => new typeUtils_1.UintRange(x));
|
|
115
|
+
this.badgeIds = msg.badgeIds.map(x => new typeUtils_1.UintRange(x));
|
|
116
|
+
this.ownershipTimes = msg.ownershipTimes.map(x => new typeUtils_1.UintRange(x));
|
|
117
|
+
this.approvalId = msg.approvalId;
|
|
118
|
+
this.amountTrackerId = msg.amountTrackerId;
|
|
119
|
+
this.challengeTrackerId = msg.challengeTrackerId;
|
|
120
|
+
this.uri = msg.uri;
|
|
121
|
+
this.customData = msg.customData;
|
|
122
|
+
this.approvalCriteria = msg.approvalCriteria ? new OutgoingApprovalCriteria(msg.approvalCriteria) : undefined;
|
|
123
|
+
}
|
|
124
|
+
convert(convertFunction) {
|
|
125
|
+
return new UserOutgoingApproval((0, typeUtils_1.deepCopy)({
|
|
126
|
+
toListId: this.toListId,
|
|
127
|
+
initiatedByListId: this.initiatedByListId,
|
|
128
|
+
transferTimes: this.transferTimes.map((x) => x.convert(convertFunction)),
|
|
129
|
+
badgeIds: this.badgeIds.map((x) => x.convert(convertFunction)),
|
|
130
|
+
ownershipTimes: this.ownershipTimes.map((x) => x.convert(convertFunction)),
|
|
131
|
+
approvalId: this.approvalId,
|
|
132
|
+
amountTrackerId: this.amountTrackerId,
|
|
133
|
+
challengeTrackerId: this.challengeTrackerId,
|
|
134
|
+
uri: this.uri,
|
|
135
|
+
customData: this.customData,
|
|
136
|
+
approvalCriteria: this.approvalCriteria?.convert(convertFunction)
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
toProto() {
|
|
140
|
+
return new __1.proto.badges.UserOutgoingApproval(this.convert(string_numbers_1.Stringify));
|
|
141
|
+
}
|
|
142
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
143
|
+
return this.convertFromProto(__1.proto.badges.UserOutgoingApproval.fromJson(jsonValue, options), convertFunction);
|
|
144
|
+
}
|
|
145
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
146
|
+
return this.convertFromProto(__1.proto.badges.UserOutgoingApproval.fromJsonString(jsonString, options), convertFunction);
|
|
147
|
+
}
|
|
148
|
+
static convertFromProto(item, convertFunction) {
|
|
149
|
+
return new UserOutgoingApproval({
|
|
150
|
+
toListId: item.toListId,
|
|
151
|
+
initiatedByListId: item.initiatedByListId,
|
|
152
|
+
transferTimes: item.transferTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
153
|
+
badgeIds: item.badgeIds.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
154
|
+
ownershipTimes: item.ownershipTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
155
|
+
approvalId: item.approvalId,
|
|
156
|
+
amountTrackerId: item.amountTrackerId,
|
|
157
|
+
challengeTrackerId: item.challengeTrackerId,
|
|
158
|
+
uri: item.uri,
|
|
159
|
+
customData: item.customData,
|
|
160
|
+
approvalCriteria: item.approvalCriteria ? OutgoingApprovalCriteria.convertFromProto(item.approvalCriteria, convertFunction) : undefined
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
exports.UserOutgoingApproval = UserOutgoingApproval;
|
|
165
|
+
class OutgoingApprovalCriteria extends typeUtils_1.BaseNumberTypeClass {
|
|
166
|
+
mustOwnBadges;
|
|
167
|
+
merkleChallenge;
|
|
168
|
+
predeterminedBalances;
|
|
169
|
+
approvalAmounts;
|
|
170
|
+
maxNumTransfers;
|
|
171
|
+
requireToEqualsInitiatedBy;
|
|
172
|
+
requireToDoesNotEqualInitiatedBy;
|
|
173
|
+
constructor(msg) {
|
|
174
|
+
super();
|
|
175
|
+
this.mustOwnBadges = msg.mustOwnBadges?.map(x => new typeUtils_1.MustOwnBadges(x));
|
|
176
|
+
this.merkleChallenge = msg.merkleChallenge ? new typeUtils_1.MerkleChallenge(msg.merkleChallenge) : undefined;
|
|
177
|
+
this.predeterminedBalances = msg.predeterminedBalances ? new PredeterminedBalances(msg.predeterminedBalances) : undefined;
|
|
178
|
+
this.approvalAmounts = msg.approvalAmounts ? new ApprovalAmounts(msg.approvalAmounts) : undefined;
|
|
179
|
+
this.maxNumTransfers = msg.maxNumTransfers ? new MaxNumTransfers(msg.maxNumTransfers) : undefined;
|
|
180
|
+
this.requireToEqualsInitiatedBy = msg.requireToEqualsInitiatedBy;
|
|
181
|
+
this.requireToDoesNotEqualInitiatedBy = msg.requireToDoesNotEqualInitiatedBy;
|
|
182
|
+
}
|
|
183
|
+
convert(convertFunction) {
|
|
184
|
+
return new OutgoingApprovalCriteria((0, typeUtils_1.deepCopy)({
|
|
185
|
+
mustOwnBadges: this.mustOwnBadges?.map((x) => x.convert(convertFunction)),
|
|
186
|
+
merkleChallenge: this.merkleChallenge?.convert(convertFunction),
|
|
187
|
+
predeterminedBalances: this.predeterminedBalances?.convert(convertFunction),
|
|
188
|
+
approvalAmounts: this.approvalAmounts?.convert(convertFunction),
|
|
189
|
+
maxNumTransfers: this.maxNumTransfers?.convert(convertFunction),
|
|
190
|
+
requireToEqualsInitiatedBy: this.requireToEqualsInitiatedBy,
|
|
191
|
+
requireToDoesNotEqualInitiatedBy: this.requireToDoesNotEqualInitiatedBy
|
|
192
|
+
}));
|
|
193
|
+
}
|
|
194
|
+
toProto() {
|
|
195
|
+
return new __1.proto.badges.OutgoingApprovalCriteria(this.convert(string_numbers_1.Stringify));
|
|
196
|
+
}
|
|
197
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
198
|
+
return this.convertFromProto(__1.proto.badges.OutgoingApprovalCriteria.fromJson(jsonValue, options), convertFunction);
|
|
199
|
+
}
|
|
200
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
201
|
+
return this.convertFromProto(__1.proto.badges.OutgoingApprovalCriteria.fromJsonString(jsonString, options), convertFunction);
|
|
202
|
+
}
|
|
203
|
+
static convertFromProto(item, convertFunction) {
|
|
204
|
+
return new OutgoingApprovalCriteria({
|
|
205
|
+
mustOwnBadges: item.mustOwnBadges.map(x => typeUtils_1.MustOwnBadges.convertFromProto(x, convertFunction)),
|
|
206
|
+
merkleChallenge: item.merkleChallenge ? typeUtils_1.MerkleChallenge.convertFromProto(item.merkleChallenge, convertFunction) : undefined,
|
|
207
|
+
predeterminedBalances: item.predeterminedBalances ? PredeterminedBalances.convertFromProto(item.predeterminedBalances, convertFunction) : undefined,
|
|
208
|
+
approvalAmounts: item.approvalAmounts ? ApprovalAmounts.convertFromProto(item.approvalAmounts, convertFunction) : undefined,
|
|
209
|
+
maxNumTransfers: item.maxNumTransfers ? MaxNumTransfers.convertFromProto(item.maxNumTransfers, convertFunction) : undefined,
|
|
210
|
+
requireToEqualsInitiatedBy: item.requireToEqualsInitiatedBy,
|
|
211
|
+
requireToDoesNotEqualInitiatedBy: item.requireToDoesNotEqualInitiatedBy
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
exports.OutgoingApprovalCriteria = OutgoingApprovalCriteria;
|
|
216
|
+
class PredeterminedBalances extends typeUtils_1.BaseNumberTypeClass {
|
|
217
|
+
manualBalances;
|
|
218
|
+
incrementedBalances;
|
|
219
|
+
orderCalculationMethod;
|
|
220
|
+
constructor(msg) {
|
|
221
|
+
super();
|
|
222
|
+
this.manualBalances = msg.manualBalances.map(x => new ManualBalances(x));
|
|
223
|
+
this.incrementedBalances = new IncrementedBalances(msg.incrementedBalances);
|
|
224
|
+
this.orderCalculationMethod = new PredeterminedOrderCalculationMethod(msg.orderCalculationMethod);
|
|
225
|
+
}
|
|
226
|
+
convert(convertFunction) {
|
|
227
|
+
return new PredeterminedBalances((0, typeUtils_1.deepCopy)({
|
|
228
|
+
manualBalances: this.manualBalances.map((x) => x.convert(convertFunction)),
|
|
229
|
+
incrementedBalances: this.incrementedBalances.convert(convertFunction),
|
|
230
|
+
orderCalculationMethod: this.orderCalculationMethod
|
|
231
|
+
}));
|
|
232
|
+
}
|
|
233
|
+
toProto() {
|
|
234
|
+
return new __1.proto.badges.PredeterminedBalances(this.convert(string_numbers_1.Stringify));
|
|
235
|
+
}
|
|
236
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
237
|
+
return this.convertFromProto(__1.proto.badges.PredeterminedBalances.fromJson(jsonValue, options), convertFunction);
|
|
238
|
+
}
|
|
239
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
240
|
+
return this.convertFromProto(__1.proto.badges.PredeterminedBalances.fromJsonString(jsonString, options), convertFunction);
|
|
241
|
+
}
|
|
242
|
+
static convertFromProto(item, convertFunction) {
|
|
243
|
+
return new PredeterminedBalances({
|
|
244
|
+
manualBalances: item.manualBalances.map(x => ManualBalances.convertFromProto(x, convertFunction)),
|
|
245
|
+
incrementedBalances: item.incrementedBalances ? IncrementedBalances.convertFromProto(item.incrementedBalances, convertFunction) : new IncrementedBalances({ startBalances: [], incrementBadgeIdsBy: convertFunction(0), incrementOwnershipTimesBy: convertFunction(0) }),
|
|
246
|
+
orderCalculationMethod: item.orderCalculationMethod ? PredeterminedOrderCalculationMethod.convertFromProto(item.orderCalculationMethod) : new PredeterminedOrderCalculationMethod({
|
|
247
|
+
useOverallNumTransfers: false,
|
|
248
|
+
usePerFromAddressNumTransfers: false,
|
|
249
|
+
usePerToAddressNumTransfers: false,
|
|
250
|
+
usePerInitiatedByAddressNumTransfers: false,
|
|
251
|
+
useMerkleChallengeLeafIndex: false,
|
|
252
|
+
})
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
exports.PredeterminedBalances = PredeterminedBalances;
|
|
257
|
+
class ManualBalances extends typeUtils_1.BaseNumberTypeClass {
|
|
258
|
+
balances;
|
|
259
|
+
constructor(msg) {
|
|
260
|
+
super();
|
|
261
|
+
this.balances = msg.balances.map(x => new typeUtils_1.Balance(x));
|
|
262
|
+
}
|
|
263
|
+
convert(convertFunction) {
|
|
264
|
+
return new ManualBalances((0, typeUtils_1.deepCopy)({
|
|
265
|
+
balances: this.balances.map((x) => x.convert(convertFunction))
|
|
266
|
+
}));
|
|
267
|
+
}
|
|
268
|
+
toProto() {
|
|
269
|
+
return new __1.proto.badges.ManualBalances(this.convert(string_numbers_1.Stringify));
|
|
270
|
+
}
|
|
271
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
272
|
+
return this.convertFromProto(__1.proto.badges.ManualBalances.fromJson(jsonValue, options), convertFunction);
|
|
273
|
+
}
|
|
274
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
275
|
+
return this.convertFromProto(__1.proto.badges.ManualBalances.fromJsonString(jsonString, options), convertFunction);
|
|
276
|
+
}
|
|
277
|
+
static convertFromProto(item, convertFunction) {
|
|
278
|
+
return new ManualBalances({
|
|
279
|
+
balances: item.balances.map(x => typeUtils_1.Balance.convertFromProto(x, convertFunction))
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
exports.ManualBalances = ManualBalances;
|
|
284
|
+
class IncrementedBalances extends typeUtils_1.BaseNumberTypeClass {
|
|
285
|
+
startBalances;
|
|
286
|
+
incrementBadgeIdsBy;
|
|
287
|
+
incrementOwnershipTimesBy;
|
|
288
|
+
constructor(msg) {
|
|
289
|
+
super();
|
|
290
|
+
this.startBalances = msg.startBalances.map(x => new typeUtils_1.Balance(x));
|
|
291
|
+
this.incrementBadgeIdsBy = msg.incrementBadgeIdsBy;
|
|
292
|
+
this.incrementOwnershipTimesBy = msg.incrementOwnershipTimesBy;
|
|
293
|
+
}
|
|
294
|
+
convert(convertFunction) {
|
|
295
|
+
return new IncrementedBalances((0, typeUtils_1.deepCopy)({
|
|
296
|
+
startBalances: this.startBalances.map((x) => x.convert(convertFunction)),
|
|
297
|
+
incrementBadgeIdsBy: convertFunction(this.incrementBadgeIdsBy),
|
|
298
|
+
incrementOwnershipTimesBy: convertFunction(this.incrementOwnershipTimesBy)
|
|
299
|
+
}));
|
|
300
|
+
}
|
|
301
|
+
toProto() {
|
|
302
|
+
return new __1.proto.badges.IncrementedBalances(this.convert(string_numbers_1.Stringify));
|
|
303
|
+
}
|
|
304
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
305
|
+
return this.convertFromProto(__1.proto.badges.IncrementedBalances.fromJson(jsonValue, options), convertFunction);
|
|
306
|
+
}
|
|
307
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
308
|
+
return this.convertFromProto(__1.proto.badges.IncrementedBalances.fromJsonString(jsonString, options), convertFunction);
|
|
309
|
+
}
|
|
310
|
+
static convertFromProto(item, convertFunction) {
|
|
311
|
+
return new IncrementedBalances({
|
|
312
|
+
startBalances: item.startBalances.map(x => typeUtils_1.Balance.convertFromProto(x, convertFunction)),
|
|
313
|
+
incrementBadgeIdsBy: convertFunction(item.incrementBadgeIdsBy),
|
|
314
|
+
incrementOwnershipTimesBy: convertFunction(item.incrementOwnershipTimesBy)
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
exports.IncrementedBalances = IncrementedBalances;
|
|
319
|
+
class PredeterminedOrderCalculationMethod extends typeUtils_1.CustomTypeClass {
|
|
320
|
+
useOverallNumTransfers;
|
|
321
|
+
usePerToAddressNumTransfers;
|
|
322
|
+
usePerFromAddressNumTransfers;
|
|
323
|
+
usePerInitiatedByAddressNumTransfers;
|
|
324
|
+
useMerkleChallengeLeafIndex;
|
|
325
|
+
constructor(msg) {
|
|
326
|
+
super();
|
|
327
|
+
this.useOverallNumTransfers = msg.useOverallNumTransfers;
|
|
328
|
+
this.usePerToAddressNumTransfers = msg.usePerToAddressNumTransfers;
|
|
329
|
+
this.usePerFromAddressNumTransfers = msg.usePerFromAddressNumTransfers;
|
|
330
|
+
this.usePerInitiatedByAddressNumTransfers = msg.usePerInitiatedByAddressNumTransfers;
|
|
331
|
+
this.useMerkleChallengeLeafIndex = msg.useMerkleChallengeLeafIndex;
|
|
332
|
+
}
|
|
333
|
+
clone() {
|
|
334
|
+
return (0, typeUtils_1.deepCopy)(this);
|
|
335
|
+
}
|
|
336
|
+
toProto() {
|
|
337
|
+
return new __1.proto.badges.PredeterminedOrderCalculationMethod(this.toJson());
|
|
338
|
+
}
|
|
339
|
+
static fromJson(jsonValue, options) {
|
|
340
|
+
return PredeterminedOrderCalculationMethod.fromJson(jsonValue, options);
|
|
341
|
+
}
|
|
342
|
+
static fromJsonString(jsonString, options) {
|
|
343
|
+
return PredeterminedOrderCalculationMethod.fromJsonString(jsonString, options);
|
|
344
|
+
}
|
|
345
|
+
static convertFromProto(item) {
|
|
346
|
+
return new PredeterminedOrderCalculationMethod({
|
|
347
|
+
useOverallNumTransfers: item.useOverallNumTransfers,
|
|
348
|
+
usePerToAddressNumTransfers: item.usePerToAddressNumTransfers,
|
|
349
|
+
usePerFromAddressNumTransfers: item.usePerFromAddressNumTransfers,
|
|
350
|
+
usePerInitiatedByAddressNumTransfers: item.usePerInitiatedByAddressNumTransfers,
|
|
351
|
+
useMerkleChallengeLeafIndex: item.useMerkleChallengeLeafIndex
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
exports.PredeterminedOrderCalculationMethod = PredeterminedOrderCalculationMethod;
|
|
356
|
+
class ApprovalAmounts extends typeUtils_1.BaseNumberTypeClass {
|
|
357
|
+
overallApprovalAmount;
|
|
358
|
+
perToAddressApprovalAmount;
|
|
359
|
+
perFromAddressApprovalAmount;
|
|
360
|
+
perInitiatedByAddressApprovalAmount;
|
|
361
|
+
constructor(msg) {
|
|
362
|
+
super();
|
|
363
|
+
this.overallApprovalAmount = msg.overallApprovalAmount;
|
|
364
|
+
this.perToAddressApprovalAmount = msg.perToAddressApprovalAmount;
|
|
365
|
+
this.perFromAddressApprovalAmount = msg.perFromAddressApprovalAmount;
|
|
366
|
+
this.perInitiatedByAddressApprovalAmount = msg.perInitiatedByAddressApprovalAmount;
|
|
367
|
+
}
|
|
368
|
+
convert(convertFunction) {
|
|
369
|
+
return new ApprovalAmounts((0, typeUtils_1.deepCopy)({
|
|
370
|
+
overallApprovalAmount: convertFunction(this.overallApprovalAmount),
|
|
371
|
+
perToAddressApprovalAmount: convertFunction(this.perToAddressApprovalAmount),
|
|
372
|
+
perFromAddressApprovalAmount: convertFunction(this.perFromAddressApprovalAmount),
|
|
373
|
+
perInitiatedByAddressApprovalAmount: convertFunction(this.perInitiatedByAddressApprovalAmount)
|
|
374
|
+
}));
|
|
375
|
+
}
|
|
376
|
+
toProto() {
|
|
377
|
+
return new __1.proto.badges.ApprovalAmounts(this.convert(string_numbers_1.Stringify));
|
|
378
|
+
}
|
|
379
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
380
|
+
return this.convertFromProto(__1.proto.badges.ApprovalAmounts.fromJson(jsonValue, options), convertFunction);
|
|
381
|
+
}
|
|
382
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
383
|
+
return this.convertFromProto(__1.proto.badges.ApprovalAmounts.fromJsonString(jsonString, options), convertFunction);
|
|
384
|
+
}
|
|
385
|
+
static convertFromProto(item, convertFunction) {
|
|
386
|
+
return new ApprovalAmounts({
|
|
387
|
+
overallApprovalAmount: convertFunction(item.overallApprovalAmount),
|
|
388
|
+
perToAddressApprovalAmount: convertFunction(item.perToAddressApprovalAmount),
|
|
389
|
+
perFromAddressApprovalAmount: convertFunction(item.perFromAddressApprovalAmount),
|
|
390
|
+
perInitiatedByAddressApprovalAmount: convertFunction(item.perInitiatedByAddressApprovalAmount)
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
exports.ApprovalAmounts = ApprovalAmounts;
|
|
395
|
+
class MaxNumTransfers extends typeUtils_1.BaseNumberTypeClass {
|
|
396
|
+
overallMaxNumTransfers;
|
|
397
|
+
perToAddressMaxNumTransfers;
|
|
398
|
+
perFromAddressMaxNumTransfers;
|
|
399
|
+
perInitiatedByAddressMaxNumTransfers;
|
|
400
|
+
constructor(msg) {
|
|
401
|
+
super();
|
|
402
|
+
this.overallMaxNumTransfers = msg.overallMaxNumTransfers;
|
|
403
|
+
this.perToAddressMaxNumTransfers = msg.perToAddressMaxNumTransfers;
|
|
404
|
+
this.perFromAddressMaxNumTransfers = msg.perFromAddressMaxNumTransfers;
|
|
405
|
+
this.perInitiatedByAddressMaxNumTransfers = msg.perInitiatedByAddressMaxNumTransfers;
|
|
406
|
+
}
|
|
407
|
+
convert(convertFunction) {
|
|
408
|
+
return new MaxNumTransfers((0, typeUtils_1.deepCopy)({
|
|
409
|
+
overallMaxNumTransfers: convertFunction(this.overallMaxNumTransfers),
|
|
410
|
+
perToAddressMaxNumTransfers: convertFunction(this.perToAddressMaxNumTransfers),
|
|
411
|
+
perFromAddressMaxNumTransfers: convertFunction(this.perFromAddressMaxNumTransfers),
|
|
412
|
+
perInitiatedByAddressMaxNumTransfers: convertFunction(this.perInitiatedByAddressMaxNumTransfers)
|
|
413
|
+
}));
|
|
414
|
+
}
|
|
415
|
+
toProto() {
|
|
416
|
+
return new __1.proto.badges.MaxNumTransfers(this.convert(string_numbers_1.Stringify));
|
|
417
|
+
}
|
|
418
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
419
|
+
return this.convertFromProto(__1.proto.badges.MaxNumTransfers.fromJson(jsonValue, options), convertFunction);
|
|
420
|
+
}
|
|
421
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
422
|
+
return this.convertFromProto(__1.proto.badges.MaxNumTransfers.fromJsonString(jsonString, options), convertFunction);
|
|
423
|
+
}
|
|
424
|
+
static convertFromProto(item, convertFunction) {
|
|
425
|
+
return new MaxNumTransfers({
|
|
426
|
+
overallMaxNumTransfers: convertFunction(item.overallMaxNumTransfers),
|
|
427
|
+
perToAddressMaxNumTransfers: convertFunction(item.perToAddressMaxNumTransfers),
|
|
428
|
+
perFromAddressMaxNumTransfers: convertFunction(item.perFromAddressMaxNumTransfers),
|
|
429
|
+
perInitiatedByAddressMaxNumTransfers: convertFunction(item.perInitiatedByAddressMaxNumTransfers)
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
exports.MaxNumTransfers = MaxNumTransfers;
|
|
434
|
+
class UserIncomingApproval extends typeUtils_1.BaseNumberTypeClass {
|
|
435
|
+
fromListId;
|
|
436
|
+
initiatedByListId;
|
|
437
|
+
transferTimes;
|
|
438
|
+
badgeIds;
|
|
439
|
+
ownershipTimes;
|
|
440
|
+
approvalId;
|
|
441
|
+
amountTrackerId;
|
|
442
|
+
challengeTrackerId;
|
|
443
|
+
uri;
|
|
444
|
+
customData;
|
|
445
|
+
approvalCriteria;
|
|
446
|
+
constructor(msg) {
|
|
447
|
+
super();
|
|
448
|
+
this.fromListId = msg.fromListId;
|
|
449
|
+
this.initiatedByListId = msg.initiatedByListId;
|
|
450
|
+
this.transferTimes = msg.transferTimes.map(x => new typeUtils_1.UintRange(x));
|
|
451
|
+
this.badgeIds = msg.badgeIds.map(x => new typeUtils_1.UintRange(x));
|
|
452
|
+
this.ownershipTimes = msg.ownershipTimes.map(x => new typeUtils_1.UintRange(x));
|
|
453
|
+
this.approvalId = msg.approvalId;
|
|
454
|
+
this.amountTrackerId = msg.amountTrackerId;
|
|
455
|
+
this.challengeTrackerId = msg.challengeTrackerId;
|
|
456
|
+
this.uri = msg.uri;
|
|
457
|
+
this.customData = msg.customData;
|
|
458
|
+
this.approvalCriteria = msg.approvalCriteria ? new IncomingApprovalCriteria(msg.approvalCriteria) : undefined;
|
|
459
|
+
}
|
|
460
|
+
convert(convertFunction) {
|
|
461
|
+
return new UserIncomingApproval((0, typeUtils_1.deepCopy)({
|
|
462
|
+
fromListId: this.fromListId,
|
|
463
|
+
initiatedByListId: this.initiatedByListId,
|
|
464
|
+
transferTimes: this.transferTimes.map((b) => b.convert(convertFunction)),
|
|
465
|
+
badgeIds: this.badgeIds.map((b) => b.convert(convertFunction)),
|
|
466
|
+
ownershipTimes: this.ownershipTimes.map((b) => b.convert(convertFunction)),
|
|
467
|
+
approvalId: this.approvalId,
|
|
468
|
+
amountTrackerId: this.amountTrackerId,
|
|
469
|
+
challengeTrackerId: this.challengeTrackerId,
|
|
470
|
+
uri: this.uri,
|
|
471
|
+
customData: this.customData,
|
|
472
|
+
approvalCriteria: this.approvalCriteria ? this.approvalCriteria.convert(convertFunction) : undefined
|
|
473
|
+
}));
|
|
474
|
+
}
|
|
475
|
+
toProto() {
|
|
476
|
+
return new __1.proto.badges.UserIncomingApproval(this.convert(string_numbers_1.Stringify));
|
|
477
|
+
}
|
|
478
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
479
|
+
return this.convertFromProto(__1.proto.badges.UserIncomingApproval.fromJson(jsonValue, options), convertFunction);
|
|
480
|
+
}
|
|
481
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
482
|
+
return this.convertFromProto(__1.proto.badges.UserIncomingApproval.fromJsonString(jsonString, options), convertFunction);
|
|
483
|
+
}
|
|
484
|
+
static convertFromProto(item, convertFunction) {
|
|
485
|
+
return new UserIncomingApproval({
|
|
486
|
+
fromListId: item.fromListId,
|
|
487
|
+
initiatedByListId: item.initiatedByListId,
|
|
488
|
+
transferTimes: item.transferTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
489
|
+
badgeIds: item.badgeIds.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
490
|
+
ownershipTimes: item.ownershipTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
491
|
+
approvalId: item.approvalId,
|
|
492
|
+
amountTrackerId: item.amountTrackerId,
|
|
493
|
+
challengeTrackerId: item.challengeTrackerId,
|
|
494
|
+
uri: item.uri,
|
|
495
|
+
customData: item.customData,
|
|
496
|
+
approvalCriteria: item.approvalCriteria ? IncomingApprovalCriteria.convertFromProto(item.approvalCriteria, convertFunction) : undefined
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
exports.UserIncomingApproval = UserIncomingApproval;
|
|
501
|
+
class IncomingApprovalCriteria extends typeUtils_1.BaseNumberTypeClass {
|
|
502
|
+
mustOwnBadges;
|
|
503
|
+
merkleChallenge;
|
|
504
|
+
predeterminedBalances;
|
|
505
|
+
approvalAmounts;
|
|
506
|
+
maxNumTransfers;
|
|
507
|
+
requireFromEqualsInitiatedBy;
|
|
508
|
+
requireFromDoesNotEqualInitiatedBy;
|
|
509
|
+
constructor(msg) {
|
|
510
|
+
super();
|
|
511
|
+
this.mustOwnBadges = msg.mustOwnBadges?.map(x => new typeUtils_1.MustOwnBadges(x));
|
|
512
|
+
this.merkleChallenge = msg.merkleChallenge ? new typeUtils_1.MerkleChallenge(msg.merkleChallenge) : undefined;
|
|
513
|
+
this.predeterminedBalances = msg.predeterminedBalances ? new PredeterminedBalances(msg.predeterminedBalances) : undefined;
|
|
514
|
+
this.approvalAmounts = msg.approvalAmounts ? new ApprovalAmounts(msg.approvalAmounts) : undefined;
|
|
515
|
+
this.maxNumTransfers = msg.maxNumTransfers ? new MaxNumTransfers(msg.maxNumTransfers) : undefined;
|
|
516
|
+
this.requireFromEqualsInitiatedBy = msg.requireFromEqualsInitiatedBy;
|
|
517
|
+
this.requireFromDoesNotEqualInitiatedBy = msg.requireFromDoesNotEqualInitiatedBy;
|
|
518
|
+
}
|
|
519
|
+
convert(convertFunction) {
|
|
520
|
+
return new IncomingApprovalCriteria((0, typeUtils_1.deepCopy)({
|
|
521
|
+
mustOwnBadges: this.mustOwnBadges?.map((x) => x.convert(convertFunction)),
|
|
522
|
+
merkleChallenge: this.merkleChallenge ? this.merkleChallenge.convert(convertFunction) : undefined,
|
|
523
|
+
predeterminedBalances: this.predeterminedBalances ? this.predeterminedBalances.convert(convertFunction) : undefined,
|
|
524
|
+
approvalAmounts: this.approvalAmounts ? this.approvalAmounts.convert(convertFunction) : undefined,
|
|
525
|
+
maxNumTransfers: this.maxNumTransfers ? this.maxNumTransfers.convert(convertFunction) : undefined,
|
|
526
|
+
requireFromEqualsInitiatedBy: this.requireFromEqualsInitiatedBy,
|
|
527
|
+
requireFromDoesNotEqualInitiatedBy: this.requireFromDoesNotEqualInitiatedBy
|
|
528
|
+
}));
|
|
529
|
+
}
|
|
530
|
+
toProto() {
|
|
531
|
+
return new __1.proto.badges.IncomingApprovalCriteria(this.convert(string_numbers_1.Stringify));
|
|
532
|
+
}
|
|
533
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
534
|
+
return this.convertFromProto(__1.proto.badges.IncomingApprovalCriteria.fromJson(jsonValue, options), convertFunction);
|
|
535
|
+
}
|
|
536
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
537
|
+
return this.convertFromProto(__1.proto.badges.IncomingApprovalCriteria.fromJsonString(jsonString, options), convertFunction);
|
|
538
|
+
}
|
|
539
|
+
static convertFromProto(item, convertFunction) {
|
|
540
|
+
return new IncomingApprovalCriteria({
|
|
541
|
+
mustOwnBadges: item.mustOwnBadges.map(x => typeUtils_1.MustOwnBadges.convertFromProto(x, convertFunction)),
|
|
542
|
+
merkleChallenge: item.merkleChallenge ? typeUtils_1.MerkleChallenge.convertFromProto(item.merkleChallenge, convertFunction) : undefined,
|
|
543
|
+
predeterminedBalances: item.predeterminedBalances ? PredeterminedBalances.convertFromProto(item.predeterminedBalances, convertFunction) : undefined,
|
|
544
|
+
approvalAmounts: item.approvalAmounts ? ApprovalAmounts.convertFromProto(item.approvalAmounts, convertFunction) : undefined,
|
|
545
|
+
maxNumTransfers: item.maxNumTransfers ? MaxNumTransfers.convertFromProto(item.maxNumTransfers, convertFunction) : undefined,
|
|
546
|
+
requireFromEqualsInitiatedBy: item.requireFromEqualsInitiatedBy,
|
|
547
|
+
requireFromDoesNotEqualInitiatedBy: item.requireFromDoesNotEqualInitiatedBy
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
exports.IncomingApprovalCriteria = IncomingApprovalCriteria;
|
|
552
|
+
class CollectionApproval extends typeUtils_1.BaseNumberTypeClass {
|
|
553
|
+
toListId;
|
|
554
|
+
fromListId;
|
|
555
|
+
initiatedByListId;
|
|
556
|
+
transferTimes;
|
|
557
|
+
badgeIds;
|
|
558
|
+
ownershipTimes;
|
|
559
|
+
approvalId;
|
|
560
|
+
amountTrackerId;
|
|
561
|
+
challengeTrackerId;
|
|
562
|
+
uri;
|
|
563
|
+
customData;
|
|
564
|
+
approvalCriteria;
|
|
565
|
+
constructor(msg) {
|
|
566
|
+
super();
|
|
567
|
+
this.toListId = msg.toListId;
|
|
568
|
+
this.fromListId = msg.fromListId;
|
|
569
|
+
this.initiatedByListId = msg.initiatedByListId;
|
|
570
|
+
this.transferTimes = msg.transferTimes.map(x => new typeUtils_1.UintRange(x));
|
|
571
|
+
this.badgeIds = msg.badgeIds.map(x => new typeUtils_1.UintRange(x));
|
|
572
|
+
this.ownershipTimes = msg.ownershipTimes.map(x => new typeUtils_1.UintRange(x));
|
|
573
|
+
this.approvalId = msg.approvalId;
|
|
574
|
+
this.amountTrackerId = msg.amountTrackerId;
|
|
575
|
+
this.challengeTrackerId = msg.challengeTrackerId;
|
|
576
|
+
this.uri = msg.uri;
|
|
577
|
+
this.customData = msg.customData;
|
|
578
|
+
this.approvalCriteria = msg.approvalCriteria ? new ApprovalCriteria(msg.approvalCriteria) : undefined;
|
|
579
|
+
}
|
|
580
|
+
convert(convertFunction) {
|
|
581
|
+
return new CollectionApproval((0, typeUtils_1.deepCopy)({
|
|
582
|
+
toListId: this.toListId,
|
|
583
|
+
fromListId: this.fromListId,
|
|
584
|
+
initiatedByListId: this.initiatedByListId,
|
|
585
|
+
transferTimes: this.transferTimes.map((b) => b.convert(convertFunction)),
|
|
586
|
+
badgeIds: this.badgeIds.map((b) => b.convert(convertFunction)),
|
|
587
|
+
ownershipTimes: this.ownershipTimes.map((b) => b.convert(convertFunction)),
|
|
588
|
+
approvalId: this.approvalId,
|
|
589
|
+
amountTrackerId: this.amountTrackerId,
|
|
590
|
+
challengeTrackerId: this.challengeTrackerId,
|
|
591
|
+
uri: this.uri,
|
|
592
|
+
customData: this.customData,
|
|
593
|
+
approvalCriteria: this.approvalCriteria ? this.approvalCriteria.convert(convertFunction) : undefined
|
|
594
|
+
}));
|
|
595
|
+
}
|
|
596
|
+
toProto() {
|
|
597
|
+
return new __1.proto.badges.CollectionApproval(this.convert(string_numbers_1.Stringify));
|
|
598
|
+
}
|
|
599
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
600
|
+
return this.convertFromProto(__1.proto.badges.CollectionApproval.fromJson(jsonValue, options), convertFunction);
|
|
601
|
+
}
|
|
602
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
603
|
+
return this.convertFromProto(__1.proto.badges.CollectionApproval.fromJsonString(jsonString, options), convertFunction);
|
|
604
|
+
}
|
|
605
|
+
static convertFromProto(item, convertFunction) {
|
|
606
|
+
return new CollectionApproval({
|
|
607
|
+
toListId: item.toListId,
|
|
608
|
+
fromListId: item.fromListId,
|
|
609
|
+
initiatedByListId: item.initiatedByListId,
|
|
610
|
+
transferTimes: item.transferTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
611
|
+
badgeIds: item.badgeIds.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
612
|
+
ownershipTimes: item.ownershipTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
|
|
613
|
+
approvalId: item.approvalId,
|
|
614
|
+
amountTrackerId: item.amountTrackerId,
|
|
615
|
+
challengeTrackerId: item.challengeTrackerId,
|
|
616
|
+
uri: item.uri,
|
|
617
|
+
customData: item.customData,
|
|
618
|
+
approvalCriteria: item.approvalCriteria ? ApprovalCriteria.convertFromProto(item.approvalCriteria, convertFunction) : undefined
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
exports.CollectionApproval = CollectionApproval;
|
|
623
|
+
class ApprovalCriteria extends typeUtils_1.BaseNumberTypeClass {
|
|
624
|
+
mustOwnBadges;
|
|
625
|
+
merkleChallenge;
|
|
626
|
+
predeterminedBalances;
|
|
627
|
+
approvalAmounts;
|
|
628
|
+
maxNumTransfers;
|
|
629
|
+
requireToEqualsInitiatedBy;
|
|
630
|
+
requireFromEqualsInitiatedBy;
|
|
631
|
+
requireToDoesNotEqualInitiatedBy;
|
|
632
|
+
requireFromDoesNotEqualInitiatedBy;
|
|
633
|
+
overridesFromOutgoingApprovals;
|
|
634
|
+
overridesToIncomingApprovals;
|
|
635
|
+
constructor(msg) {
|
|
636
|
+
super();
|
|
637
|
+
this.mustOwnBadges = msg.mustOwnBadges?.map(x => new typeUtils_1.MustOwnBadges(x));
|
|
638
|
+
this.merkleChallenge = msg.merkleChallenge ? new typeUtils_1.MerkleChallenge(msg.merkleChallenge) : undefined;
|
|
639
|
+
this.predeterminedBalances = msg.predeterminedBalances ? new PredeterminedBalances(msg.predeterminedBalances) : undefined;
|
|
640
|
+
this.approvalAmounts = msg.approvalAmounts ? new ApprovalAmounts(msg.approvalAmounts) : undefined;
|
|
641
|
+
this.maxNumTransfers = msg.maxNumTransfers ? new MaxNumTransfers(msg.maxNumTransfers) : undefined;
|
|
642
|
+
this.requireToEqualsInitiatedBy = msg.requireToEqualsInitiatedBy;
|
|
643
|
+
this.requireFromEqualsInitiatedBy = msg.requireFromEqualsInitiatedBy;
|
|
644
|
+
this.requireToDoesNotEqualInitiatedBy = msg.requireToDoesNotEqualInitiatedBy;
|
|
645
|
+
this.requireFromDoesNotEqualInitiatedBy = msg.requireFromDoesNotEqualInitiatedBy;
|
|
646
|
+
this.overridesFromOutgoingApprovals = msg.overridesFromOutgoingApprovals;
|
|
647
|
+
this.overridesToIncomingApprovals = msg.overridesToIncomingApprovals;
|
|
648
|
+
}
|
|
649
|
+
convert(convertFunction) {
|
|
650
|
+
return new ApprovalCriteria((0, typeUtils_1.deepCopy)({
|
|
651
|
+
mustOwnBadges: this.mustOwnBadges?.map((x) => x.convert(convertFunction)),
|
|
652
|
+
merkleChallenge: this.merkleChallenge ? this.merkleChallenge.convert(convertFunction) : undefined,
|
|
653
|
+
predeterminedBalances: this.predeterminedBalances ? this.predeterminedBalances.convert(convertFunction) : undefined,
|
|
654
|
+
approvalAmounts: this.approvalAmounts ? this.approvalAmounts.convert(convertFunction) : undefined,
|
|
655
|
+
maxNumTransfers: this.maxNumTransfers ? this.maxNumTransfers.convert(convertFunction) : undefined,
|
|
656
|
+
requireToEqualsInitiatedBy: this.requireToEqualsInitiatedBy,
|
|
657
|
+
requireFromEqualsInitiatedBy: this.requireFromEqualsInitiatedBy,
|
|
658
|
+
requireToDoesNotEqualInitiatedBy: this.requireToDoesNotEqualInitiatedBy,
|
|
659
|
+
requireFromDoesNotEqualInitiatedBy: this.requireFromDoesNotEqualInitiatedBy,
|
|
660
|
+
overridesFromOutgoingApprovals: this.overridesFromOutgoingApprovals,
|
|
661
|
+
overridesToIncomingApprovals: this.overridesToIncomingApprovals
|
|
662
|
+
}));
|
|
663
|
+
}
|
|
664
|
+
toProto() {
|
|
665
|
+
return new __1.proto.badges.ApprovalCriteria(this.convert(string_numbers_1.Stringify));
|
|
666
|
+
}
|
|
667
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
668
|
+
return this.convertFromProto(__1.proto.badges.ApprovalCriteria.fromJson(jsonValue, options), convertFunction);
|
|
669
|
+
}
|
|
670
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
671
|
+
return this.convertFromProto(__1.proto.badges.ApprovalCriteria.fromJsonString(jsonString, options), convertFunction);
|
|
672
|
+
}
|
|
673
|
+
static convertFromProto(item, convertFunction) {
|
|
674
|
+
return new ApprovalCriteria({
|
|
675
|
+
mustOwnBadges: item.mustOwnBadges.map(x => typeUtils_1.MustOwnBadges.convertFromProto(x, convertFunction)),
|
|
676
|
+
merkleChallenge: item.merkleChallenge ? typeUtils_1.MerkleChallenge.convertFromProto(item.merkleChallenge, convertFunction) : undefined,
|
|
677
|
+
predeterminedBalances: item.predeterminedBalances ? PredeterminedBalances.convertFromProto(item.predeterminedBalances, convertFunction) : undefined,
|
|
678
|
+
approvalAmounts: item.approvalAmounts ? ApprovalAmounts.convertFromProto(item.approvalAmounts, convertFunction) : undefined,
|
|
679
|
+
maxNumTransfers: item.maxNumTransfers ? MaxNumTransfers.convertFromProto(item.maxNumTransfers, convertFunction) : undefined,
|
|
680
|
+
requireToEqualsInitiatedBy: item.requireToEqualsInitiatedBy,
|
|
681
|
+
requireFromEqualsInitiatedBy: item.requireFromEqualsInitiatedBy,
|
|
682
|
+
requireToDoesNotEqualInitiatedBy: item.requireToDoesNotEqualInitiatedBy,
|
|
683
|
+
requireFromDoesNotEqualInitiatedBy: item.requireFromDoesNotEqualInitiatedBy,
|
|
684
|
+
overridesFromOutgoingApprovals: item.overridesFromOutgoingApprovals,
|
|
685
|
+
overridesToIncomingApprovals: item.overridesToIncomingApprovals
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
exports.ApprovalCriteria = ApprovalCriteria;
|
|
690
|
+
//# sourceMappingURL=approvals.js.map
|