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
|
@@ -5,10 +5,9 @@ const __1 = require("..");
|
|
|
5
5
|
const overlaps_1 = require("./overlaps");
|
|
6
6
|
const permission_checks_1 = require("./permission_checks");
|
|
7
7
|
const permissions_1 = require("./permissions");
|
|
8
|
-
const timeline_helpers_1 = require("./timeline_helpers");
|
|
9
8
|
const userApprovals_1 = require("./userApprovals");
|
|
10
9
|
function getPotentialUpdatesForTimelineValues(times, values) {
|
|
11
|
-
|
|
10
|
+
const castedPermissions = [];
|
|
12
11
|
for (let idx = 0; idx < times.length; idx++) {
|
|
13
12
|
castedPermissions.push({
|
|
14
13
|
timelineTimes: times[idx],
|
|
@@ -26,17 +25,17 @@ function getPotentialUpdatesForTimelineValues(times, values) {
|
|
|
26
25
|
badgeIds: [],
|
|
27
26
|
ownershipTimes: [],
|
|
28
27
|
transferTimes: [],
|
|
29
|
-
toList:
|
|
30
|
-
fromList:
|
|
31
|
-
initiatedByList:
|
|
32
|
-
approvalIdList:
|
|
33
|
-
amountTrackerIdList:
|
|
34
|
-
challengeTrackerIdList:
|
|
28
|
+
toList: __1.AddressList.AllAddresses(),
|
|
29
|
+
fromList: __1.AddressList.AllAddresses(),
|
|
30
|
+
initiatedByList: __1.AddressList.AllAddresses(),
|
|
31
|
+
approvalIdList: __1.AddressList.AllAddresses(),
|
|
32
|
+
amountTrackerIdList: __1.AddressList.AllAddresses(),
|
|
33
|
+
challengeTrackerIdList: __1.AddressList.AllAddresses(),
|
|
35
34
|
usesAmountTrackerIdList: false,
|
|
36
35
|
usesChallengeTrackerIdList: false,
|
|
37
36
|
});
|
|
38
37
|
}
|
|
39
|
-
|
|
38
|
+
const firstMatches = (0, overlaps_1.GetFirstMatchOnly)(castedPermissions);
|
|
40
39
|
return firstMatches;
|
|
41
40
|
}
|
|
42
41
|
exports.getPotentialUpdatesForTimelineValues = getPotentialUpdatesForTimelineValues;
|
|
@@ -125,28 +124,28 @@ function getFirstMatchOnlyWithApprovalCriteria(permissions) {
|
|
|
125
124
|
return returnArr;
|
|
126
125
|
}
|
|
127
126
|
function validateCollectionApprovalsUpdate(oldApprovals, newApprovals, canUpdateCollectionApprovals) {
|
|
128
|
-
const dummyRanges = [[{ start: 1n, end: 1n }]];
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
127
|
+
const dummyRanges = [[new __1.UintRange(new __1.UintRange({ start: 1n, end: 1n }))]];
|
|
128
|
+
const oldTimelineFirstMatches = getPotentialUpdatesForTimelineValues((0, __1.deepCopy)(dummyRanges), [(0, __1.deepCopy)(oldApprovals)]);
|
|
129
|
+
const newTimelineFirstMatches = getPotentialUpdatesForTimelineValues((0, __1.deepCopy)(dummyRanges), [(0, __1.deepCopy)(newApprovals)]);
|
|
130
|
+
const detailsToCheck = (0, permission_checks_1.getUpdateCombinationsToCheck)(oldTimelineFirstMatches, newTimelineFirstMatches, [], function (oldValue, newValue) {
|
|
131
|
+
const expandedOldApprovals = (0, userApprovals_1.expandCollectionApprovals)(oldValue);
|
|
132
|
+
const expandedNewApprovals = (0, userApprovals_1.expandCollectionApprovals)(newValue);
|
|
133
|
+
const oldApprovals = (0, permissions_1.castCollectionApprovalToUniversalPermission)(expandedOldApprovals);
|
|
135
134
|
if (!oldApprovals) {
|
|
136
135
|
throw new Error("InvalidOldValue");
|
|
137
136
|
}
|
|
138
|
-
|
|
137
|
+
const newApprovals = (0, permissions_1.castCollectionApprovalToUniversalPermission)(expandedNewApprovals);
|
|
139
138
|
if (!newApprovals) {
|
|
140
139
|
throw new Error("InvalidNewValue");
|
|
141
140
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
for (
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
141
|
+
const firstMatchesForOld = getFirstMatchOnlyWithApprovalCriteria(oldApprovals);
|
|
142
|
+
const firstMatchesForNew = getFirstMatchOnlyWithApprovalCriteria(newApprovals);
|
|
143
|
+
const detailsToReturn = [];
|
|
144
|
+
const [overlapObjects, inOldButNotNew, inNewButNotOld] = (0, overlaps_1.getOverlapsAndNonOverlaps)(firstMatchesForOld, firstMatchesForNew);
|
|
145
|
+
for (const overlapObject of overlapObjects) {
|
|
146
|
+
const overlap = overlapObject.overlap;
|
|
147
|
+
const oldDetails = overlapObject.firstDetails;
|
|
148
|
+
const newDetails = overlapObject.secondDetails;
|
|
150
149
|
let different = false;
|
|
151
150
|
if ((oldDetails.arbitraryValue === null && newDetails.arbitraryValue !== null) || (oldDetails.arbitraryValue !== null && newDetails.arbitraryValue === null)) {
|
|
152
151
|
different = true;
|
|
@@ -178,7 +177,7 @@ function validateCollectionApprovalsUpdate(oldApprovals, newApprovals, canUpdate
|
|
|
178
177
|
detailsToReturn.push(...inNewButNotOld);
|
|
179
178
|
return detailsToReturn;
|
|
180
179
|
});
|
|
181
|
-
|
|
180
|
+
const details = detailsToCheck.map(x => {
|
|
182
181
|
const result = {
|
|
183
182
|
timelineTimes: [x.timelineTime],
|
|
184
183
|
badgeIds: [x.badgeId],
|
|
@@ -193,7 +192,7 @@ function validateCollectionApprovalsUpdate(oldApprovals, newApprovals, canUpdate
|
|
|
193
192
|
};
|
|
194
193
|
return result;
|
|
195
194
|
});
|
|
196
|
-
|
|
195
|
+
const err = (0, permission_checks_1.checkIfCollectionApprovalPermissionPermits)(details, canUpdateCollectionApprovals);
|
|
197
196
|
if (err) {
|
|
198
197
|
return err;
|
|
199
198
|
}
|
|
@@ -201,27 +200,27 @@ function validateCollectionApprovalsUpdate(oldApprovals, newApprovals, canUpdate
|
|
|
201
200
|
}
|
|
202
201
|
exports.validateCollectionApprovalsUpdate = validateCollectionApprovalsUpdate;
|
|
203
202
|
function validateBadgeMetadataUpdate(oldBadgeMetadata, newBadgeMetadata, canUpdateBadgeMetadata) {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
for (
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
203
|
+
const { times: oldTimes, values: oldValues } = getBadgeMetadataTimesAndValues(oldBadgeMetadata);
|
|
204
|
+
const oldTimelineFirstMatches = getPotentialUpdatesForTimelineValues(oldTimes, oldValues);
|
|
205
|
+
const { times: newTimes, values: newValues } = getBadgeMetadataTimesAndValues(newBadgeMetadata);
|
|
206
|
+
const newTimelineFirstMatches = getPotentialUpdatesForTimelineValues(newTimes, newValues);
|
|
207
|
+
const detailsToCheck = (0, permission_checks_1.getUpdateCombinationsToCheck)(oldTimelineFirstMatches, newTimelineFirstMatches, [], function (oldValue, newValue) {
|
|
208
|
+
const oldBadgeMetadata = oldValue;
|
|
209
|
+
const firstMatchesForOld = (0, overlaps_1.GetFirstMatchOnly)((0, permissions_1.castBadgeMetadataToUniversalPermission)(oldBadgeMetadata));
|
|
210
|
+
const newBadgeMetadata = newValue;
|
|
211
|
+
const firstMatchesForNew = (0, overlaps_1.GetFirstMatchOnly)((0, permissions_1.castBadgeMetadataToUniversalPermission)(newBadgeMetadata));
|
|
212
|
+
const detailsToReturn = [];
|
|
213
|
+
const [overlapObjects, inOldButNotNew, inNewButNotOld] = (0, overlaps_1.getOverlapsAndNonOverlaps)(firstMatchesForOld, firstMatchesForNew);
|
|
214
|
+
for (const overlapObject of overlapObjects) {
|
|
215
|
+
const overlap = overlapObject.overlap;
|
|
216
|
+
const oldDetails = overlapObject.firstDetails;
|
|
217
|
+
const newDetails = overlapObject.secondDetails;
|
|
219
218
|
if ((oldDetails.arbitraryValue === null && newDetails.arbitraryValue !== null) || (oldDetails.arbitraryValue !== null && newDetails.arbitraryValue === null)) {
|
|
220
219
|
detailsToReturn.push(overlap);
|
|
221
220
|
}
|
|
222
221
|
else {
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
const oldVal = oldDetails.arbitraryValue;
|
|
223
|
+
const newVal = newDetails.arbitraryValue;
|
|
225
224
|
if (newVal !== oldVal) {
|
|
226
225
|
detailsToReturn.push(overlap);
|
|
227
226
|
}
|
|
@@ -231,7 +230,7 @@ function validateBadgeMetadataUpdate(oldBadgeMetadata, newBadgeMetadata, canUpda
|
|
|
231
230
|
detailsToReturn.push(...inNewButNotOld);
|
|
232
231
|
return detailsToReturn;
|
|
233
232
|
});
|
|
234
|
-
|
|
233
|
+
const details = detailsToCheck.map(x => {
|
|
235
234
|
const result = {
|
|
236
235
|
timelineTimes: [x.timelineTime],
|
|
237
236
|
badgeIds: [x.badgeId],
|
|
@@ -243,7 +242,7 @@ function validateBadgeMetadataUpdate(oldBadgeMetadata, newBadgeMetadata, canUpda
|
|
|
243
242
|
};
|
|
244
243
|
return result;
|
|
245
244
|
});
|
|
246
|
-
|
|
245
|
+
const err = (0, permission_checks_1.checkIfTimedUpdateWithBadgeIdsPermissionPermits)(details, canUpdateBadgeMetadata);
|
|
247
246
|
if (err) {
|
|
248
247
|
return err;
|
|
249
248
|
}
|
|
@@ -251,52 +250,52 @@ function validateBadgeMetadataUpdate(oldBadgeMetadata, newBadgeMetadata, canUpda
|
|
|
251
250
|
}
|
|
252
251
|
exports.validateBadgeMetadataUpdate = validateBadgeMetadataUpdate;
|
|
253
252
|
function validateCollectionMetadataUpdate(oldCollectionMetadata, newCollectionMetadata, canUpdateCollectionMetadata) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
253
|
+
const { times: oldTimes, values: oldValues } = getCollectionMetadataTimesAndValues(oldCollectionMetadata);
|
|
254
|
+
const oldTimelineFirstMatches = getPotentialUpdatesForTimelineValues(oldTimes, oldValues);
|
|
255
|
+
const { times: newTimes, values: newValues } = getCollectionMetadataTimesAndValues(newCollectionMetadata);
|
|
256
|
+
const newTimelineFirstMatches = getPotentialUpdatesForTimelineValues(newTimes, newValues);
|
|
257
|
+
const detailsToCheck = (0, permission_checks_1.getUpdateCombinationsToCheck)(oldTimelineFirstMatches, newTimelineFirstMatches, {}, function (oldValue, newValue) {
|
|
258
|
+
const detailsToCheck = [];
|
|
260
259
|
if (oldValue === null && newValue !== null) {
|
|
261
260
|
detailsToCheck.push({
|
|
262
|
-
timelineTime: { start: 1n, end: 1n },
|
|
263
|
-
badgeId: { start: 1n, end: 1n },
|
|
264
|
-
ownershipTime: { start: 1n, end: 1n },
|
|
265
|
-
transferTime: { start: 1n, end: 1n },
|
|
266
|
-
toList:
|
|
267
|
-
fromList:
|
|
268
|
-
initiatedByList:
|
|
269
|
-
approvalIdList:
|
|
270
|
-
amountTrackerIdList:
|
|
271
|
-
challengeTrackerIdList:
|
|
261
|
+
timelineTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
262
|
+
badgeId: new __1.UintRange({ start: 1n, end: 1n }),
|
|
263
|
+
ownershipTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
264
|
+
transferTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
265
|
+
toList: __1.AddressList.AllAddresses(),
|
|
266
|
+
fromList: __1.AddressList.AllAddresses(),
|
|
267
|
+
initiatedByList: __1.AddressList.AllAddresses(),
|
|
268
|
+
approvalIdList: __1.AddressList.AllAddresses(),
|
|
269
|
+
amountTrackerIdList: __1.AddressList.AllAddresses(),
|
|
270
|
+
challengeTrackerIdList: __1.AddressList.AllAddresses(),
|
|
272
271
|
permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
|
|
273
272
|
});
|
|
274
273
|
}
|
|
275
274
|
else {
|
|
276
|
-
|
|
277
|
-
|
|
275
|
+
const oldVal = oldValue;
|
|
276
|
+
const newVal = newValue;
|
|
278
277
|
if (oldVal.uri !== newVal.uri || oldVal.customData !== newVal.customData) {
|
|
279
278
|
detailsToCheck.push({
|
|
280
|
-
timelineTime: { start: 1n, end: 1n },
|
|
281
|
-
badgeId: { start: 1n, end: 1n },
|
|
282
|
-
ownershipTime: { start: 1n, end: 1n },
|
|
283
|
-
transferTime: { start: 1n, end: 1n },
|
|
284
|
-
toList:
|
|
285
|
-
fromList:
|
|
286
|
-
initiatedByList:
|
|
287
|
-
approvalIdList:
|
|
288
|
-
amountTrackerIdList:
|
|
289
|
-
challengeTrackerIdList:
|
|
279
|
+
timelineTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
280
|
+
badgeId: new __1.UintRange({ start: 1n, end: 1n }),
|
|
281
|
+
ownershipTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
282
|
+
transferTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
283
|
+
toList: __1.AddressList.AllAddresses(),
|
|
284
|
+
fromList: __1.AddressList.AllAddresses(),
|
|
285
|
+
initiatedByList: __1.AddressList.AllAddresses(),
|
|
286
|
+
approvalIdList: __1.AddressList.AllAddresses(),
|
|
287
|
+
amountTrackerIdList: __1.AddressList.AllAddresses(),
|
|
288
|
+
challengeTrackerIdList: __1.AddressList.AllAddresses(),
|
|
290
289
|
permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
|
|
291
290
|
});
|
|
292
291
|
}
|
|
293
292
|
}
|
|
294
293
|
return detailsToCheck;
|
|
295
294
|
});
|
|
296
|
-
|
|
295
|
+
const details = detailsToCheck.map(x => {
|
|
297
296
|
return [x.timelineTime];
|
|
298
297
|
}).flat();
|
|
299
|
-
|
|
298
|
+
const err = (0, permission_checks_1.checkIfTimedUpdatePermissionPermits)(details, canUpdateCollectionMetadata);
|
|
300
299
|
if (err) {
|
|
301
300
|
return err;
|
|
302
301
|
}
|
|
@@ -304,50 +303,50 @@ function validateCollectionMetadataUpdate(oldCollectionMetadata, newCollectionMe
|
|
|
304
303
|
}
|
|
305
304
|
exports.validateCollectionMetadataUpdate = validateCollectionMetadataUpdate;
|
|
306
305
|
function validateOffChainBalancesMetadataUpdate(oldOffChainBalancesMetadata, newOffChainBalancesMetadata, canUpdateOffChainBalancesMetadata) {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
306
|
+
const { times: oldTimes, values: oldValues } = getOffChainBalancesMetadataTimesAndValues(oldOffChainBalancesMetadata);
|
|
307
|
+
const oldTimelineFirstMatches = getPotentialUpdatesForTimelineValues(oldTimes, oldValues);
|
|
308
|
+
const { times: newTimes, values: newValues } = getOffChainBalancesMetadataTimesAndValues(newOffChainBalancesMetadata);
|
|
309
|
+
const newTimelineFirstMatches = getPotentialUpdatesForTimelineValues(newTimes, newValues);
|
|
310
|
+
const detailsToCheck = (0, permission_checks_1.getUpdateCombinationsToCheck)(oldTimelineFirstMatches, newTimelineFirstMatches, {}, function (oldValue, newValue) {
|
|
311
|
+
const detailsToCheck = [];
|
|
313
312
|
if (oldValue === null && newValue !== null) {
|
|
314
313
|
detailsToCheck.push({
|
|
315
|
-
timelineTime: { start: 1n, end: 1n },
|
|
316
|
-
badgeId: { start: 1n, end: 1n },
|
|
317
|
-
ownershipTime: { start: 1n, end: 1n },
|
|
318
|
-
transferTime: { start: 1n, end: 1n },
|
|
319
|
-
toList:
|
|
320
|
-
fromList:
|
|
321
|
-
initiatedByList:
|
|
322
|
-
approvalIdList:
|
|
323
|
-
amountTrackerIdList:
|
|
324
|
-
challengeTrackerIdList:
|
|
314
|
+
timelineTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
315
|
+
badgeId: new __1.UintRange({ start: 1n, end: 1n }),
|
|
316
|
+
ownershipTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
317
|
+
transferTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
318
|
+
toList: __1.AddressList.AllAddresses(),
|
|
319
|
+
fromList: __1.AddressList.AllAddresses(),
|
|
320
|
+
initiatedByList: __1.AddressList.AllAddresses(),
|
|
321
|
+
approvalIdList: __1.AddressList.AllAddresses(),
|
|
322
|
+
amountTrackerIdList: __1.AddressList.AllAddresses(),
|
|
323
|
+
challengeTrackerIdList: __1.AddressList.AllAddresses(),
|
|
325
324
|
permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
|
|
326
325
|
});
|
|
327
326
|
}
|
|
328
327
|
else {
|
|
329
|
-
|
|
330
|
-
|
|
328
|
+
const oldVal = oldValue;
|
|
329
|
+
const newVal = newValue;
|
|
331
330
|
if (oldVal.uri !== newVal.uri || oldVal.customData !== newVal.customData) {
|
|
332
331
|
detailsToCheck.push({
|
|
333
|
-
timelineTime: { start: 1n, end: 1n },
|
|
334
|
-
badgeId: { start: 1n, end: 1n },
|
|
335
|
-
ownershipTime: { start: 1n, end: 1n },
|
|
336
|
-
transferTime: { start: 1n, end: 1n },
|
|
337
|
-
toList:
|
|
338
|
-
fromList:
|
|
339
|
-
initiatedByList:
|
|
340
|
-
approvalIdList:
|
|
341
|
-
amountTrackerIdList:
|
|
342
|
-
challengeTrackerIdList:
|
|
332
|
+
timelineTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
333
|
+
badgeId: new __1.UintRange({ start: 1n, end: 1n }),
|
|
334
|
+
ownershipTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
335
|
+
transferTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
336
|
+
toList: __1.AddressList.AllAddresses(),
|
|
337
|
+
fromList: __1.AddressList.AllAddresses(),
|
|
338
|
+
initiatedByList: __1.AddressList.AllAddresses(),
|
|
339
|
+
approvalIdList: __1.AddressList.AllAddresses(),
|
|
340
|
+
amountTrackerIdList: __1.AddressList.AllAddresses(),
|
|
341
|
+
challengeTrackerIdList: __1.AddressList.AllAddresses(),
|
|
343
342
|
permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
|
|
344
343
|
});
|
|
345
344
|
}
|
|
346
345
|
}
|
|
347
346
|
return detailsToCheck;
|
|
348
347
|
});
|
|
349
|
-
|
|
350
|
-
|
|
348
|
+
const details = detailsToCheck.map(x => x.timelineTime);
|
|
349
|
+
const err = (0, permission_checks_1.checkIfTimedUpdatePermissionPermits)(details, canUpdateOffChainBalancesMetadata);
|
|
351
350
|
if (err) {
|
|
352
351
|
return err;
|
|
353
352
|
}
|
|
@@ -355,19 +354,19 @@ function validateOffChainBalancesMetadataUpdate(oldOffChainBalancesMetadata, new
|
|
|
355
354
|
}
|
|
356
355
|
exports.validateOffChainBalancesMetadataUpdate = validateOffChainBalancesMetadataUpdate;
|
|
357
356
|
function getUpdatedStringCombinations(oldValue, newValue) {
|
|
358
|
-
|
|
357
|
+
const x = [];
|
|
359
358
|
if ((oldValue === null && newValue !== null) || (oldValue !== null && newValue === null) || oldValue !== newValue) {
|
|
360
359
|
x.push({
|
|
361
|
-
timelineTime: { start: 1n, end: 1n },
|
|
362
|
-
badgeId: { start: 1n, end: 1n },
|
|
363
|
-
ownershipTime: { start: 1n, end: 1n },
|
|
364
|
-
transferTime: { start: 1n, end: 1n },
|
|
365
|
-
toList:
|
|
366
|
-
fromList:
|
|
367
|
-
initiatedByList:
|
|
368
|
-
approvalIdList:
|
|
369
|
-
amountTrackerIdList:
|
|
370
|
-
challengeTrackerIdList:
|
|
360
|
+
timelineTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
361
|
+
badgeId: new __1.UintRange({ start: 1n, end: 1n }),
|
|
362
|
+
ownershipTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
363
|
+
transferTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
364
|
+
toList: __1.AddressList.AllAddresses(),
|
|
365
|
+
fromList: __1.AddressList.AllAddresses(),
|
|
366
|
+
initiatedByList: __1.AddressList.AllAddresses(),
|
|
367
|
+
approvalIdList: __1.AddressList.AllAddresses(),
|
|
368
|
+
amountTrackerIdList: __1.AddressList.AllAddresses(),
|
|
369
|
+
challengeTrackerIdList: __1.AddressList.AllAddresses(),
|
|
371
370
|
permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
|
|
372
371
|
});
|
|
373
372
|
}
|
|
@@ -377,16 +376,16 @@ exports.getUpdatedStringCombinations = getUpdatedStringCombinations;
|
|
|
377
376
|
function getUpdatedBoolCombinations(oldValue, newValue) {
|
|
378
377
|
if ((oldValue === null && newValue !== null) || (oldValue !== null && newValue === null) || oldValue !== newValue) {
|
|
379
378
|
return [{
|
|
380
|
-
timelineTime: { start: 1n, end: 1n },
|
|
381
|
-
badgeId: { start: 1n, end: 1n },
|
|
382
|
-
ownershipTime: { start: 1n, end: 1n },
|
|
383
|
-
transferTime: { start: 1n, end: 1n },
|
|
384
|
-
toList:
|
|
385
|
-
fromList:
|
|
386
|
-
initiatedByList:
|
|
387
|
-
approvalIdList:
|
|
388
|
-
amountTrackerIdList:
|
|
389
|
-
challengeTrackerIdList:
|
|
379
|
+
timelineTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
380
|
+
badgeId: new __1.UintRange({ start: 1n, end: 1n }),
|
|
381
|
+
ownershipTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
382
|
+
transferTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
383
|
+
toList: __1.AddressList.AllAddresses(),
|
|
384
|
+
fromList: __1.AddressList.AllAddresses(),
|
|
385
|
+
initiatedByList: __1.AddressList.AllAddresses(),
|
|
386
|
+
approvalIdList: __1.AddressList.AllAddresses(),
|
|
387
|
+
amountTrackerIdList: __1.AddressList.AllAddresses(),
|
|
388
|
+
challengeTrackerIdList: __1.AddressList.AllAddresses(),
|
|
390
389
|
permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
|
|
391
390
|
}];
|
|
392
391
|
}
|
|
@@ -394,13 +393,13 @@ function getUpdatedBoolCombinations(oldValue, newValue) {
|
|
|
394
393
|
}
|
|
395
394
|
exports.getUpdatedBoolCombinations = getUpdatedBoolCombinations;
|
|
396
395
|
function validateManagerUpdate(oldManager, newManager, canUpdateManager) {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
396
|
+
const { times: oldTimes, values: oldValues } = getManagerTimesAndValues(oldManager);
|
|
397
|
+
const oldTimelineFirstMatches = getPotentialUpdatesForTimelineValues(oldTimes, oldValues);
|
|
398
|
+
const { times: newTimes, values: newValues } = getManagerTimesAndValues(newManager);
|
|
399
|
+
const newTimelineFirstMatches = getPotentialUpdatesForTimelineValues(newTimes, newValues);
|
|
400
|
+
const updatedTimelineTimes = (0, permission_checks_1.getUpdateCombinationsToCheck)(oldTimelineFirstMatches, newTimelineFirstMatches, "", getUpdatedStringCombinations);
|
|
401
|
+
const details = updatedTimelineTimes.map(x => x.timelineTime);
|
|
402
|
+
const err = (0, permission_checks_1.checkIfTimedUpdatePermissionPermits)(details, canUpdateManager);
|
|
404
403
|
if (err) {
|
|
405
404
|
return err;
|
|
406
405
|
}
|
|
@@ -408,13 +407,13 @@ function validateManagerUpdate(oldManager, newManager, canUpdateManager) {
|
|
|
408
407
|
}
|
|
409
408
|
exports.validateManagerUpdate = validateManagerUpdate;
|
|
410
409
|
function validateCustomDataUpdate(oldCustomData, newCustomData, canUpdateCustomData) {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
410
|
+
const { times: oldTimes, values: oldValues } = getCustomDataTimesAndValues(oldCustomData);
|
|
411
|
+
const oldTimelineFirstMatches = getPotentialUpdatesForTimelineValues(oldTimes, oldValues);
|
|
412
|
+
const { times: newTimes, values: newValues } = getCustomDataTimesAndValues(newCustomData);
|
|
413
|
+
const newTimelineFirstMatches = getPotentialUpdatesForTimelineValues(newTimes, newValues);
|
|
414
|
+
const updatedTimelineTimes = (0, permission_checks_1.getUpdateCombinationsToCheck)(oldTimelineFirstMatches, newTimelineFirstMatches, "", getUpdatedStringCombinations);
|
|
415
|
+
const details = updatedTimelineTimes.map(x => x.timelineTime);
|
|
416
|
+
const err = (0, permission_checks_1.checkIfTimedUpdatePermissionPermits)(details, canUpdateCustomData);
|
|
418
417
|
if (err) {
|
|
419
418
|
return err;
|
|
420
419
|
}
|
|
@@ -422,38 +421,38 @@ function validateCustomDataUpdate(oldCustomData, newCustomData, canUpdateCustomD
|
|
|
422
421
|
}
|
|
423
422
|
exports.validateCustomDataUpdate = validateCustomDataUpdate;
|
|
424
423
|
function validateStandardsUpdate(oldStandards, newStandards, canUpdateStandards) {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
424
|
+
const { times: oldTimes, values: oldValues } = getStandardsTimesAndValues(oldStandards);
|
|
425
|
+
const oldTimelineFirstMatches = getPotentialUpdatesForTimelineValues(oldTimes, oldValues);
|
|
426
|
+
const { times: newTimes, values: newValues } = getStandardsTimesAndValues(newStandards);
|
|
427
|
+
const newTimelineFirstMatches = getPotentialUpdatesForTimelineValues(newTimes, newValues);
|
|
428
|
+
const updatedTimelineTimes = (0, permission_checks_1.getUpdateCombinationsToCheck)(oldTimelineFirstMatches, newTimelineFirstMatches, [], function (oldValue, newValue) {
|
|
430
429
|
if ((oldValue == null && newValue != null) || (oldValue != null && newValue == null)) {
|
|
431
430
|
return [{
|
|
432
|
-
timelineTime: { start: 1n, end: 1n },
|
|
433
|
-
badgeId: { start: 1n, end: 1n },
|
|
434
|
-
ownershipTime: { start: 1n, end: 1n },
|
|
435
|
-
transferTime: { start: 1n, end: 1n },
|
|
436
|
-
toList:
|
|
437
|
-
fromList:
|
|
438
|
-
initiatedByList:
|
|
439
|
-
approvalIdList:
|
|
440
|
-
amountTrackerIdList:
|
|
441
|
-
challengeTrackerIdList:
|
|
431
|
+
timelineTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
432
|
+
badgeId: new __1.UintRange({ start: 1n, end: 1n }),
|
|
433
|
+
ownershipTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
434
|
+
transferTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
435
|
+
toList: __1.AddressList.AllAddresses(),
|
|
436
|
+
fromList: __1.AddressList.AllAddresses(),
|
|
437
|
+
initiatedByList: __1.AddressList.AllAddresses(),
|
|
438
|
+
approvalIdList: __1.AddressList.AllAddresses(),
|
|
439
|
+
amountTrackerIdList: __1.AddressList.AllAddresses(),
|
|
440
|
+
challengeTrackerIdList: __1.AddressList.AllAddresses(),
|
|
442
441
|
permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
|
|
443
442
|
}];
|
|
444
443
|
}
|
|
445
444
|
else if (oldValue.length != newValue.length) {
|
|
446
445
|
return [{
|
|
447
|
-
timelineTime: { start: 1n, end: 1n },
|
|
448
|
-
badgeId: { start: 1n, end: 1n },
|
|
449
|
-
ownershipTime: { start: 1n, end: 1n },
|
|
450
|
-
transferTime: { start: 1n, end: 1n },
|
|
451
|
-
toList:
|
|
452
|
-
fromList:
|
|
453
|
-
initiatedByList:
|
|
454
|
-
approvalIdList:
|
|
455
|
-
amountTrackerIdList:
|
|
456
|
-
challengeTrackerIdList:
|
|
446
|
+
timelineTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
447
|
+
badgeId: new __1.UintRange({ start: 1n, end: 1n }),
|
|
448
|
+
ownershipTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
449
|
+
transferTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
450
|
+
toList: __1.AddressList.AllAddresses(),
|
|
451
|
+
fromList: __1.AddressList.AllAddresses(),
|
|
452
|
+
initiatedByList: __1.AddressList.AllAddresses(),
|
|
453
|
+
approvalIdList: __1.AddressList.AllAddresses(),
|
|
454
|
+
amountTrackerIdList: __1.AddressList.AllAddresses(),
|
|
455
|
+
challengeTrackerIdList: __1.AddressList.AllAddresses(),
|
|
457
456
|
permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
|
|
458
457
|
}];
|
|
459
458
|
}
|
|
@@ -461,16 +460,16 @@ function validateStandardsUpdate(oldStandards, newStandards, canUpdateStandards)
|
|
|
461
460
|
for (let i = 0; i < oldValue.length; i++) {
|
|
462
461
|
if (oldValue[i] != newValue[i]) {
|
|
463
462
|
return [{
|
|
464
|
-
timelineTime: { start: 1n, end: 1n },
|
|
465
|
-
badgeId: { start: 1n, end: 1n },
|
|
466
|
-
ownershipTime: { start: 1n, end: 1n },
|
|
467
|
-
transferTime: { start: 1n, end: 1n },
|
|
468
|
-
toList:
|
|
469
|
-
fromList:
|
|
470
|
-
initiatedByList:
|
|
471
|
-
approvalIdList:
|
|
472
|
-
amountTrackerIdList:
|
|
473
|
-
challengeTrackerIdList:
|
|
463
|
+
timelineTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
464
|
+
badgeId: new __1.UintRange({ start: 1n, end: 1n }),
|
|
465
|
+
ownershipTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
466
|
+
transferTime: new __1.UintRange({ start: 1n, end: 1n }),
|
|
467
|
+
toList: __1.AddressList.AllAddresses(),
|
|
468
|
+
fromList: __1.AddressList.AllAddresses(),
|
|
469
|
+
initiatedByList: __1.AddressList.AllAddresses(),
|
|
470
|
+
approvalIdList: __1.AddressList.AllAddresses(),
|
|
471
|
+
amountTrackerIdList: __1.AddressList.AllAddresses(),
|
|
472
|
+
challengeTrackerIdList: __1.AddressList.AllAddresses(),
|
|
474
473
|
permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
|
|
475
474
|
}];
|
|
476
475
|
}
|
|
@@ -478,8 +477,8 @@ function validateStandardsUpdate(oldStandards, newStandards, canUpdateStandards)
|
|
|
478
477
|
}
|
|
479
478
|
return [];
|
|
480
479
|
});
|
|
481
|
-
|
|
482
|
-
|
|
480
|
+
const details = updatedTimelineTimes.map(x => x.timelineTime);
|
|
481
|
+
const err = (0, permission_checks_1.checkIfTimedUpdatePermissionPermits)(details, canUpdateStandards);
|
|
483
482
|
if (err) {
|
|
484
483
|
return err;
|
|
485
484
|
}
|
|
@@ -487,17 +486,80 @@ function validateStandardsUpdate(oldStandards, newStandards, canUpdateStandards)
|
|
|
487
486
|
}
|
|
488
487
|
exports.validateStandardsUpdate = validateStandardsUpdate;
|
|
489
488
|
function validateIsArchivedUpdate(oldIsArchived, newIsArchived, canUpdateIsArchived) {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
489
|
+
const { times: oldTimes, values: oldValues } = getIsArchivedTimesAndValues(oldIsArchived);
|
|
490
|
+
const oldTimelineFirstMatches = getPotentialUpdatesForTimelineValues(oldTimes, oldValues);
|
|
491
|
+
const { times: newTimes, values: newValues } = getIsArchivedTimesAndValues(newIsArchived);
|
|
492
|
+
const newTimelineFirstMatches = getPotentialUpdatesForTimelineValues(newTimes, newValues);
|
|
493
|
+
const updatedTimelineTimes = (0, permission_checks_1.getUpdateCombinationsToCheck)(oldTimelineFirstMatches, newTimelineFirstMatches, false, getUpdatedBoolCombinations);
|
|
494
|
+
const details = updatedTimelineTimes.map(x => x.timelineTime);
|
|
495
|
+
const err = (0, permission_checks_1.checkIfTimedUpdatePermissionPermits)(details, canUpdateIsArchived);
|
|
497
496
|
if (err) {
|
|
498
497
|
return err;
|
|
499
498
|
}
|
|
500
499
|
return null;
|
|
501
500
|
}
|
|
502
501
|
exports.validateIsArchivedUpdate = validateIsArchivedUpdate;
|
|
502
|
+
function getIsArchivedTimesAndValues(isArchivedTimeline) {
|
|
503
|
+
const times = [];
|
|
504
|
+
const values = [];
|
|
505
|
+
for (const timelineVal of isArchivedTimeline) {
|
|
506
|
+
times.push(timelineVal.timelineTimes);
|
|
507
|
+
values.push(timelineVal.isArchived);
|
|
508
|
+
}
|
|
509
|
+
return { times, values };
|
|
510
|
+
}
|
|
511
|
+
function getOffChainBalancesMetadataTimesAndValues(inheritedBalancesMetadata) {
|
|
512
|
+
const times = [];
|
|
513
|
+
const values = [];
|
|
514
|
+
for (const timelineVal of inheritedBalancesMetadata) {
|
|
515
|
+
times.push(timelineVal.timelineTimes);
|
|
516
|
+
values.push(timelineVal.offChainBalancesMetadata);
|
|
517
|
+
}
|
|
518
|
+
return { times, values };
|
|
519
|
+
}
|
|
520
|
+
function getCollectionMetadataTimesAndValues(timeline) {
|
|
521
|
+
const times = [];
|
|
522
|
+
const values = [];
|
|
523
|
+
for (const timelineVal of timeline) {
|
|
524
|
+
times.push(timelineVal.timelineTimes);
|
|
525
|
+
values.push(timelineVal.collectionMetadata);
|
|
526
|
+
}
|
|
527
|
+
return { times, values };
|
|
528
|
+
}
|
|
529
|
+
function getBadgeMetadataTimesAndValues(timeline) {
|
|
530
|
+
const times = [];
|
|
531
|
+
const values = [];
|
|
532
|
+
for (const timelineVal of timeline) {
|
|
533
|
+
times.push(timelineVal.timelineTimes);
|
|
534
|
+
values.push(timelineVal.badgeMetadata);
|
|
535
|
+
}
|
|
536
|
+
return { times, values };
|
|
537
|
+
}
|
|
538
|
+
function getManagerTimesAndValues(managerTimeline) {
|
|
539
|
+
const times = [];
|
|
540
|
+
const values = [];
|
|
541
|
+
for (const timelineVal of managerTimeline) {
|
|
542
|
+
times.push(timelineVal.timelineTimes);
|
|
543
|
+
values.push(timelineVal.manager);
|
|
544
|
+
}
|
|
545
|
+
return { times, values };
|
|
546
|
+
}
|
|
547
|
+
function getCustomDataTimesAndValues(customDataTimeline) {
|
|
548
|
+
const times = [];
|
|
549
|
+
const values = [];
|
|
550
|
+
for (const timelineVal of customDataTimeline) {
|
|
551
|
+
times.push(timelineVal.timelineTimes);
|
|
552
|
+
values.push(timelineVal.customData);
|
|
553
|
+
}
|
|
554
|
+
return { times, values };
|
|
555
|
+
}
|
|
556
|
+
function getStandardsTimesAndValues(standardsTimeline) {
|
|
557
|
+
const times = [];
|
|
558
|
+
const values = [];
|
|
559
|
+
for (const timelineVal of standardsTimeline) {
|
|
560
|
+
times.push(timelineVal.timelineTimes);
|
|
561
|
+
values.push(timelineVal.standards);
|
|
562
|
+
}
|
|
563
|
+
return { times, values };
|
|
564
|
+
}
|
|
503
565
|
//# sourceMappingURL=update_checks.js.map
|