bitbadgesjs-sdk 0.0.7 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/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 +8 -8
- package/dist/eip712/payload/samples/getSampleMsg.js.map +1 -1
- package/dist/index.d.ts +14 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -12
- package/dist/index.js.map +1 -1
- package/dist/transactions/messages/base.d.ts +7 -3
- package/dist/transactions/messages/base.d.ts.map +1 -1
- package/dist/transactions/messages/base.js +20 -13
- package/dist/transactions/messages/base.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.d.ts +13 -5
- package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.js +27 -14
- package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.d.ts +29 -6
- package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.js +81 -44
- 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 +33 -21
- package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.d.ts +16 -6
- package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.js +38 -24
- package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.d.ts +27 -6
- package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.js +121 -55
- package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.d.ts +16 -6
- package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.js +112 -52
- package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.js.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.d.ts +26 -6
- package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.js +75 -32
- 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 +15 -4
- package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.d.ts.map +1 -1
- package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.js +37 -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/addressLists.d.ts +42 -0
- package/dist/types/badges/addressLists.d.ts.map +1 -0
- package/dist/types/badges/addressLists.js +308 -0
- package/dist/types/badges/addressLists.js.map +1 -0
- 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/types/badges/approvals.d.ts +307 -0
- package/dist/types/badges/approvals.d.ts.map +1 -0
- package/dist/types/badges/approvals.js +725 -0
- package/dist/types/badges/approvals.js.map +1 -0
- package/dist/types/badges/permissions.d.ts +367 -0
- package/dist/types/badges/permissions.d.ts.map +1 -0
- package/dist/types/badges/permissions.js +2040 -0
- package/dist/types/badges/permissions.js.map +1 -0
- package/dist/types/badges/typeUtils.d.ts +425 -0
- package/dist/types/badges/typeUtils.d.ts.map +1 -0
- package/dist/types/badges/typeUtils.js +1376 -0
- package/dist/types/badges/typeUtils.js.map +1 -0
- package/dist/types/badges/userBalances.d.ts +79 -0
- package/dist/types/badges/userBalances.d.ts.map +1 -0
- package/dist/types/badges/userBalances.js +154 -0
- package/dist/types/badges/userBalances.js.map +1 -0
- package/dist/types/base.d.ts +61 -0
- package/dist/types/base.d.ts.map +1 -0
- package/dist/types/base.js +206 -0
- package/dist/types/base.js.map +1 -0
- package/dist/types/math.d.ts +12 -0
- package/dist/types/math.d.ts.map +1 -0
- package/dist/types/math.js +84 -0
- package/dist/types/math.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 +50 -0
- package/dist/types/protocols/types.d.ts.map +1 -0
- package/dist/types/protocols/types.js +94 -0
- package/dist/types/protocols/types.js.map +1 -0
- package/dist/{proto-types/badges → types}/string-numbers.d.ts +2 -2
- package/dist/types/string-numbers.d.ts.map +1 -0
- package/dist/types/string-numbers.js.map +1 -0
- package/dist/types/txRaw.d.ts.map +1 -0
- package/dist/types/txRaw.js.map +1 -0
- package/dist/types/types.d.ts +27 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/{utils/types → types}/types.js +1 -22
- package/dist/types/types.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/aliases.d.ts +1 -1
- package/dist/utils/aliases.d.ts.map +1 -1
- package/dist/utils/api/BitBadgesAddressList.d.ts +96 -0
- package/dist/utils/api/BitBadgesAddressList.d.ts.map +1 -0
- package/dist/utils/api/BitBadgesAddressList.js +139 -0
- package/dist/utils/api/BitBadgesAddressList.js.map +1 -0
- package/dist/utils/api/BitBadgesApi.d.ts +52 -0
- package/dist/utils/api/BitBadgesApi.d.ts.map +1 -0
- package/dist/utils/api/BitBadgesApi.js +345 -0
- package/dist/utils/api/BitBadgesApi.js.map +1 -0
- package/dist/utils/api/BitBadgesCollection.d.ts +314 -0
- package/dist/utils/api/BitBadgesCollection.d.ts.map +1 -0
- package/dist/utils/api/BitBadgesCollection.js +765 -0
- package/dist/utils/api/BitBadgesCollection.js.map +1 -0
- package/dist/utils/api/BitBadgesUserInfo.d.ts +210 -0
- package/dist/utils/api/BitBadgesUserInfo.d.ts.map +1 -0
- package/dist/utils/api/BitBadgesUserInfo.js +383 -0
- package/dist/utils/api/BitBadgesUserInfo.js.map +1 -0
- package/dist/utils/approved_transfers_casts.d.ts +1 -1
- package/dist/utils/approved_transfers_casts.d.ts.map +1 -1
- package/dist/utils/approved_transfers_casts.js +30 -27
- package/dist/utils/approved_transfers_casts.js.map +1 -1
- package/dist/utils/badgeMetadata.d.ts +6 -8
- package/dist/utils/badgeMetadata.d.ts.map +1 -1
- package/dist/utils/badgeMetadata.js +28 -33
- package/dist/utils/badgeMetadata.js.map +1 -1
- package/dist/utils/balances.d.ts +15 -19
- package/dist/utils/balances.d.ts.map +1 -1
- package/dist/utils/balances.js +120 -151
- package/dist/utils/balances.js.map +1 -1
- package/dist/utils/batch-utils.d.ts +13 -4
- package/dist/utils/batch-utils.d.ts.map +1 -1
- package/dist/utils/batch-utils.js +45 -22
- package/dist/utils/batch-utils.js.map +1 -1
- package/dist/utils/chains.d.ts +1 -13
- package/dist/utils/chains.d.ts.map +1 -1
- package/dist/utils/chains.js +9 -151
- 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/converter.d.ts +10 -0
- package/dist/utils/converter.d.ts.map +1 -1
- package/dist/utils/converter.js +140 -1
- package/dist/utils/converter.js.map +1 -1
- package/dist/utils/display.d.ts +2 -2
- package/dist/utils/display.d.ts.map +1 -1
- package/dist/utils/display.js +10 -7
- package/dist/utils/display.js.map +1 -1
- package/dist/utils/distribution.d.ts +5 -4
- package/dist/utils/distribution.d.ts.map +1 -1
- package/dist/utils/distribution.js +38 -34
- 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 +33 -32
- package/dist/utils/firstMatches.js.map +1 -1
- package/dist/utils/index.d.ts +10 -15
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +10 -15
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/metadataIds.d.ts +1 -7
- package/dist/utils/metadataIds.d.ts.map +1 -1
- package/dist/utils/metadataIds.js +7 -89
- 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 +1 -1
- package/dist/utils/overlaps.d.ts.map +1 -1
- package/dist/utils/overlaps.js +75 -74
- package/dist/utils/overlaps.js.map +1 -1
- package/dist/utils/types/activity.d.ts +52 -74
- package/dist/utils/types/activity.d.ts.map +1 -1
- package/dist/utils/types/activity.js +120 -106
- package/dist/utils/types/activity.js.map +1 -1
- package/dist/utils/types/api.d.ts +259 -295
- package/dist/utils/types/api.d.ts.map +1 -1
- package/dist/utils/types/api.js +328 -251
- 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 +100 -72
- package/dist/utils/types/collections.d.ts.map +1 -1
- package/dist/utils/types/collections.js +265 -108
- package/dist/utils/types/collections.js.map +1 -1
- package/dist/utils/types/db.d.ts +423 -214
- package/dist/utils/types/db.d.ts.map +1 -1
- package/dist/utils/types/db.js +795 -505
- 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 +45 -17
- package/dist/utils/types/metadata.d.ts.map +1 -1
- package/dist/utils/types/metadata.js +68 -19
- 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 +15 -5
- package/dist/utils/types/transfers.d.ts.map +1 -1
- package/dist/utils/types/transfers.js +24 -14
- package/dist/utils/types/transfers.js.map +1 -1
- package/dist/utils/userApprovals.d.ts +1 -1
- package/dist/utils/userApprovals.d.ts.map +1 -1
- package/dist/utils/userApprovals.js +22 -37
- package/dist/utils/userApprovals.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 +0 -6
- package/dist/proto-types/base.d.ts.map +0 -1
- package/dist/proto-types/base.js +0 -11
- 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/addressLists.d.ts +0 -9
- package/dist/utils/addressLists.d.ts.map +0 -1
- package/dist/utils/addressLists.js +0 -218
- package/dist/utils/addressLists.js.map +0 -1
- package/dist/utils/api-sdk.d.ts +0 -65
- package/dist/utils/api-sdk.d.ts.map +0 -1
- package/dist/utils/api-sdk.js +0 -540
- package/dist/utils/api-sdk.js.map +0 -1
- package/dist/utils/api-utils.d.ts +0 -5
- package/dist/utils/api-utils.d.ts.map +0 -1
- package/dist/utils/api-utils.js +0 -185
- package/dist/utils/api-utils.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/math.d.ts +0 -3
- package/dist/utils/math.d.ts.map +0 -1
- package/dist/utils/math.js +0 -27
- package/dist/utils/math.js.map +0 -1
- package/dist/utils/permission_checks.d.ts +0 -51
- package/dist/utils/permission_checks.d.ts.map +0 -1
- package/dist/utils/permission_checks.js +0 -329
- package/dist/utils/permission_checks.js.map +0 -1
- package/dist/utils/permissions.d.ts +0 -17
- package/dist/utils/permissions.d.ts.map +0 -1
- package/dist/utils/permissions.js +0 -278
- package/dist/utils/permissions.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/types.d.ts +0 -42
- package/dist/utils/types/types.d.ts.map +0 -1
- package/dist/utils/types/types.js.map +0 -1
- package/dist/utils/types/users.d.ts +0 -53
- package/dist/utils/types/users.d.ts.map +0 -1
- package/dist/utils/types/users.js +0 -67
- package/dist/utils/types/users.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/uintRanges.d.ts +0 -16
- package/dist/utils/uintRanges.d.ts.map +0 -1
- package/dist/utils/uintRanges.js +0 -194
- package/dist/utils/uintRanges.js.map +0 -1
- package/dist/utils/update_checks.d.ts +0 -15
- package/dist/utils/update_checks.d.ts.map +0 -1
- package/dist/utils/update_checks.js +0 -503
- package/dist/utils/update_checks.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/utils/validate_permissions_updates.d.ts +0 -11
- package/dist/utils/validate_permissions_updates.d.ts.map +0 -1
- package/dist/utils/validate_permissions_updates.js +0 -227
- package/dist/utils/validate_permissions_updates.js.map +0 -1
- /package/dist/{proto-types → types}/badges/aminoRegistry.js +0 -0
- /package/dist/{proto-types → types}/protocols/aminoRegistry.js +0 -0
- /package/dist/{proto-types/badges → types}/string-numbers.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,1376 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.AllDefaultValues = exports.IsArchivedTimeline = exports.StandardsTimeline = exports.CustomDataTimeline = exports.OffChainBalancesMetadataTimeline = exports.BadgeMetadataTimeline = exports.CollectionMetadataTimeline = exports.ManagerTimeline = exports.TimelineItem = exports.MerkleProof = exports.MerklePathItem = exports.MerkleChallenge = exports.AmountTrackerIdDetails = exports.ApprovalIdentifierDetails = exports.Transfer = exports.AddressList = exports.Balance = exports.MustOwnBadges = exports.OffChainBalancesMetadata = exports.CollectionMetadata = exports.BadgeMetadata = exports.UintRange = void 0;
|
|
27
|
+
const string_numbers_1 = require("../string-numbers");
|
|
28
|
+
const base_1 = require("../base");
|
|
29
|
+
const proto = __importStar(require("../../proto"));
|
|
30
|
+
const math_1 = require("../math");
|
|
31
|
+
const converter_1 = require("../../utils/converter");
|
|
32
|
+
class UintRange extends base_1.BaseNumberTypeClass {
|
|
33
|
+
start;
|
|
34
|
+
end;
|
|
35
|
+
constructor(uintRange) {
|
|
36
|
+
super();
|
|
37
|
+
this.start = uintRange.start;
|
|
38
|
+
this.end = uintRange.end;
|
|
39
|
+
}
|
|
40
|
+
convert(convertFunction) {
|
|
41
|
+
return new UintRange((0, base_1.deepCopy)({
|
|
42
|
+
start: convertFunction(this.start),
|
|
43
|
+
end: convertFunction(this.end)
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
toProto() {
|
|
47
|
+
return new proto.badges.UintRange(this.convert(string_numbers_1.Stringify));
|
|
48
|
+
}
|
|
49
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
50
|
+
return this.convertFromProto(proto.badges.UintRange.fromJson(jsonValue, options), convertFunction);
|
|
51
|
+
}
|
|
52
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
53
|
+
return this.convertFromProto(proto.badges.UintRange.fromJsonString(jsonString, options), convertFunction);
|
|
54
|
+
}
|
|
55
|
+
static convertFromProto(item, convertFunction) {
|
|
56
|
+
return new UintRange({
|
|
57
|
+
start: convertFunction(BigInt(item.start)),
|
|
58
|
+
end: convertFunction(BigInt(item.end))
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
size() {
|
|
62
|
+
const diff = (0, math_1.safeSubtractUints)(this.end, this.start);
|
|
63
|
+
return (0, math_1.safeAddKeepLeft)(diff, 1);
|
|
64
|
+
}
|
|
65
|
+
isFull() {
|
|
66
|
+
return BigInt(this.start) == 1n && BigInt(this.end) == math_1.GO_MAX_UINT_64;
|
|
67
|
+
}
|
|
68
|
+
static FullRange() {
|
|
69
|
+
return new UintRange({
|
|
70
|
+
start: 1n,
|
|
71
|
+
end: math_1.GO_MAX_UINT_64
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
static From(val) {
|
|
75
|
+
return new UintRange({
|
|
76
|
+
start: val,
|
|
77
|
+
end: val
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
overlaps(other) {
|
|
81
|
+
const otherArr = Array.isArray(other) ? other : [other];
|
|
82
|
+
try {
|
|
83
|
+
UintRange.assertRangesDoNotOverlapAtAll([this.convert(string_numbers_1.BigIntify)], [...otherArr.map((o) => o.convert(string_numbers_1.BigIntify))]);
|
|
84
|
+
}
|
|
85
|
+
catch (e) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
invert(minId = 1n, maxId = math_1.GO_MAX_UINT_64) {
|
|
91
|
+
const converterFunction = (0, base_1.getConverterFunction)(this.start);
|
|
92
|
+
const bounds = new UintRange({ start: minId, end: maxId }).convert(converterFunction);
|
|
93
|
+
return UintRange.invert([
|
|
94
|
+
new UintRange({ start: this.start, end: this.end })
|
|
95
|
+
], bounds);
|
|
96
|
+
}
|
|
97
|
+
includes(id) {
|
|
98
|
+
return this.start <= id && this.end >= id;
|
|
99
|
+
}
|
|
100
|
+
static sortAndMerge(uintRanges) {
|
|
101
|
+
uintRanges = uintRanges.map(base_1.deepCopy);
|
|
102
|
+
if (uintRanges.length <= 1) {
|
|
103
|
+
return uintRanges;
|
|
104
|
+
}
|
|
105
|
+
for (let i = 1; i < uintRanges.length; i++) {
|
|
106
|
+
const uintRange = uintRanges[i];
|
|
107
|
+
let j = i - 1;
|
|
108
|
+
while (j >= 0 && uintRanges[j].start > uintRange.start) {
|
|
109
|
+
uintRanges[j + 1] = uintRanges[j];
|
|
110
|
+
j--;
|
|
111
|
+
}
|
|
112
|
+
uintRanges[j + 1] = uintRange;
|
|
113
|
+
}
|
|
114
|
+
const mergedRanges = [];
|
|
115
|
+
let currRange = uintRanges[0];
|
|
116
|
+
for (let i = 1; i < uintRanges.length; i++) {
|
|
117
|
+
const range = uintRanges[i];
|
|
118
|
+
if (BigInt(range.start) <= BigInt(currRange.end) + 1n) {
|
|
119
|
+
if (BigInt(range.end) > BigInt(currRange.end)) {
|
|
120
|
+
currRange.end = range.end;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
mergedRanges.push(currRange);
|
|
125
|
+
currRange = range;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
mergedRanges.push(currRange);
|
|
129
|
+
return mergedRanges;
|
|
130
|
+
}
|
|
131
|
+
static createUintRange(start, end) {
|
|
132
|
+
return new UintRange({
|
|
133
|
+
start: (0, base_1.deepCopy)(start),
|
|
134
|
+
end: (0, base_1.deepCopy)(end)
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
static deepCopyRanges(ranges) {
|
|
138
|
+
const newRanges = [];
|
|
139
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
140
|
+
const rangeObject = ranges[i];
|
|
141
|
+
newRanges.push(this.createUintRange(rangeObject.start, rangeObject.end));
|
|
142
|
+
}
|
|
143
|
+
return newRanges;
|
|
144
|
+
}
|
|
145
|
+
static searchForId(id, uintRanges) {
|
|
146
|
+
let ranges = this.deepCopyRanges(uintRanges);
|
|
147
|
+
ranges = this.sortAndMerge(ranges);
|
|
148
|
+
let low = 0;
|
|
149
|
+
let high = ranges.length - 1;
|
|
150
|
+
while (low <= high) {
|
|
151
|
+
const median = Math.floor((low + high) / 2);
|
|
152
|
+
const currRange = ranges[median];
|
|
153
|
+
if (currRange.includes(id)) {
|
|
154
|
+
return [BigInt(median), true];
|
|
155
|
+
}
|
|
156
|
+
else if (currRange.start > id) {
|
|
157
|
+
high = median - 1;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
low = median + 1;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return [BigInt(-1), false];
|
|
164
|
+
}
|
|
165
|
+
static invert(uintRanges, bounds) {
|
|
166
|
+
let ranges = [bounds];
|
|
167
|
+
for (let i = 0; i < uintRanges.length; i++) {
|
|
168
|
+
const uintRange = uintRanges[i];
|
|
169
|
+
let newRanges = [];
|
|
170
|
+
for (let j = 0; j < ranges.length; j++) {
|
|
171
|
+
const rangeObject = ranges[j];
|
|
172
|
+
const [rangesAfterRemoval, _] = this.removeUintRangeFromUintRange(uintRange, rangeObject);
|
|
173
|
+
newRanges = newRanges.concat(rangesAfterRemoval);
|
|
174
|
+
}
|
|
175
|
+
ranges = newRanges;
|
|
176
|
+
}
|
|
177
|
+
return ranges;
|
|
178
|
+
}
|
|
179
|
+
static removeUintRangeFromUintRange(idxsToRemove, rangeObject) {
|
|
180
|
+
if (idxsToRemove.end < rangeObject.start || idxsToRemove.start > rangeObject.end) {
|
|
181
|
+
return [[rangeObject], []];
|
|
182
|
+
}
|
|
183
|
+
const newRanges = [];
|
|
184
|
+
let removedRanges = [];
|
|
185
|
+
if (idxsToRemove.start <= rangeObject.start && idxsToRemove.end >= rangeObject.end) {
|
|
186
|
+
return [newRanges, [rangeObject]];
|
|
187
|
+
}
|
|
188
|
+
if (idxsToRemove.start > rangeObject.start) {
|
|
189
|
+
newRanges.push(new UintRange({
|
|
190
|
+
start: rangeObject.start,
|
|
191
|
+
end: (0, math_1.safeSubtractKeepLeft)(idxsToRemove.start, 1n)
|
|
192
|
+
}));
|
|
193
|
+
const minEnd = (0, math_1.bigIntMin)(BigInt(idxsToRemove.end), BigInt(rangeObject.end));
|
|
194
|
+
removedRanges.push(new UintRange({
|
|
195
|
+
start: idxsToRemove.start,
|
|
196
|
+
end: (0, math_1.matchTypes)(idxsToRemove.end, minEnd)
|
|
197
|
+
}));
|
|
198
|
+
}
|
|
199
|
+
if (idxsToRemove.end < rangeObject.end) {
|
|
200
|
+
newRanges.push(new UintRange({
|
|
201
|
+
start: (0, math_1.safeAddKeepLeft)(idxsToRemove.end, 1n),
|
|
202
|
+
end: rangeObject.end
|
|
203
|
+
}));
|
|
204
|
+
const maxStart = (0, math_1.bigIntMax)(BigInt(idxsToRemove.start), BigInt(rangeObject.start));
|
|
205
|
+
removedRanges.push(new UintRange({
|
|
206
|
+
start: (0, math_1.matchTypes)(idxsToRemove.start, maxStart),
|
|
207
|
+
end: idxsToRemove.end
|
|
208
|
+
}));
|
|
209
|
+
}
|
|
210
|
+
if (idxsToRemove.end < rangeObject.end && idxsToRemove.start > rangeObject.start) {
|
|
211
|
+
removedRanges = [idxsToRemove];
|
|
212
|
+
}
|
|
213
|
+
return [newRanges, removedRanges];
|
|
214
|
+
}
|
|
215
|
+
static removeUintRangesFromUintRanges(idsToRemove, rangeToRemoveFrom) {
|
|
216
|
+
if (idsToRemove.length === 0) {
|
|
217
|
+
return [rangeToRemoveFrom, []];
|
|
218
|
+
}
|
|
219
|
+
let removedRanges = [];
|
|
220
|
+
for (let i = 0; i < idsToRemove.length; i++) {
|
|
221
|
+
const handledValue = idsToRemove[i];
|
|
222
|
+
let newRanges = [];
|
|
223
|
+
for (let j = 0; j < rangeToRemoveFrom.length; j++) {
|
|
224
|
+
const oldPermittedTime = rangeToRemoveFrom[j];
|
|
225
|
+
const [rangesAfterRemoval, removed] = this.removeUintRangeFromUintRange(handledValue, oldPermittedTime);
|
|
226
|
+
newRanges = newRanges.concat(rangesAfterRemoval);
|
|
227
|
+
removedRanges = removedRanges.concat(removed);
|
|
228
|
+
}
|
|
229
|
+
rangeToRemoveFrom = newRanges;
|
|
230
|
+
}
|
|
231
|
+
return [rangeToRemoveFrom, removedRanges];
|
|
232
|
+
}
|
|
233
|
+
static assertRangesDoNotOverlapAtAll(rangeToCheck, overlappingRange) {
|
|
234
|
+
for (let i = 0; i < rangeToCheck.length; i++) {
|
|
235
|
+
const oldAllowedTime = rangeToCheck[i];
|
|
236
|
+
for (let j = 0; j < overlappingRange.length; j++) {
|
|
237
|
+
const newAllowedTime = overlappingRange[j];
|
|
238
|
+
const [, removed] = this.removeUintRangeFromUintRange(newAllowedTime, oldAllowedTime);
|
|
239
|
+
if (removed.length > 0) {
|
|
240
|
+
throw new Error("RangesOverlap");
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
static hasOverlaps(uintRanges) {
|
|
246
|
+
try {
|
|
247
|
+
this.assertRangesDoNotOverlapAtAll(uintRanges, uintRanges);
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
catch (e) {
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
static isFull(uintRanges) {
|
|
255
|
+
uintRanges = this.sortAndMerge(uintRanges);
|
|
256
|
+
return uintRanges.length == 1 && uintRanges[0].isFull();
|
|
257
|
+
}
|
|
258
|
+
static getTotalNumberOfBadgeIds = (badgeIds) => {
|
|
259
|
+
let sum = 0n;
|
|
260
|
+
for (const range of badgeIds) {
|
|
261
|
+
sum = (0, math_1.safeAddKeepLeft)(range.size(), sum);
|
|
262
|
+
}
|
|
263
|
+
return sum;
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
exports.UintRange = UintRange;
|
|
267
|
+
class BadgeMetadata extends base_1.BaseNumberTypeClass {
|
|
268
|
+
uri;
|
|
269
|
+
badgeIds;
|
|
270
|
+
customData;
|
|
271
|
+
constructor(badgeMetadata) {
|
|
272
|
+
super();
|
|
273
|
+
this.uri = badgeMetadata.uri;
|
|
274
|
+
this.badgeIds = badgeMetadata.badgeIds.map((b) => new UintRange(b));
|
|
275
|
+
this.customData = badgeMetadata.customData;
|
|
276
|
+
}
|
|
277
|
+
static required() {
|
|
278
|
+
return new BadgeMetadata({
|
|
279
|
+
uri: '',
|
|
280
|
+
badgeIds: [],
|
|
281
|
+
customData: ''
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
convert(convertFunction) {
|
|
285
|
+
return new BadgeMetadata((0, base_1.deepCopy)({
|
|
286
|
+
uri: this.uri,
|
|
287
|
+
badgeIds: this.badgeIds.map((b) => b.convert(convertFunction)),
|
|
288
|
+
customData: this.customData
|
|
289
|
+
}));
|
|
290
|
+
}
|
|
291
|
+
toProto() {
|
|
292
|
+
return new proto.badges.BadgeMetadata({
|
|
293
|
+
uri: this.uri,
|
|
294
|
+
badgeIds: this.badgeIds.map((b) => b.toProto()),
|
|
295
|
+
customData: this.customData
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
equals(other, normalizeNumberTypes) {
|
|
299
|
+
return (0, base_1.compareNumberTypeConvertibles)(this, other, normalizeNumberTypes);
|
|
300
|
+
}
|
|
301
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
302
|
+
return this.convertFromProto(proto.badges.BadgeMetadata.fromJson(jsonValue, options), convertFunction);
|
|
303
|
+
}
|
|
304
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
305
|
+
return this.convertFromProto(proto.badges.BadgeMetadata.fromJsonString(jsonString, options), convertFunction);
|
|
306
|
+
}
|
|
307
|
+
static convertFromProto(item, convertFunction) {
|
|
308
|
+
return new BadgeMetadata({
|
|
309
|
+
uri: item.uri,
|
|
310
|
+
badgeIds: item.badgeIds.map((b) => UintRange.convertFromProto(b, convertFunction)),
|
|
311
|
+
customData: item.customData
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
exports.BadgeMetadata = BadgeMetadata;
|
|
316
|
+
class CollectionMetadata extends base_1.CustomTypeClass {
|
|
317
|
+
uri;
|
|
318
|
+
customData;
|
|
319
|
+
constructor(collectionMetadata) {
|
|
320
|
+
super();
|
|
321
|
+
this.uri = collectionMetadata.uri;
|
|
322
|
+
this.customData = collectionMetadata.customData;
|
|
323
|
+
}
|
|
324
|
+
static required() {
|
|
325
|
+
return new CollectionMetadata({
|
|
326
|
+
uri: '',
|
|
327
|
+
customData: ''
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
toProto() {
|
|
331
|
+
return new proto.badges.CollectionMetadata({
|
|
332
|
+
uri: this.uri,
|
|
333
|
+
customData: this.customData
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
clone() {
|
|
337
|
+
return new CollectionMetadata({ uri: this.uri, customData: this.customData });
|
|
338
|
+
}
|
|
339
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
340
|
+
return this.convertFromProto(proto.badges.CollectionMetadata.fromJson(jsonValue, options), convertFunction);
|
|
341
|
+
}
|
|
342
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
343
|
+
return this.convertFromProto(proto.badges.CollectionMetadata.fromJsonString(jsonString, options), convertFunction);
|
|
344
|
+
}
|
|
345
|
+
static convertFromProto(item, convertFunction) {
|
|
346
|
+
return new CollectionMetadata({
|
|
347
|
+
uri: item.uri,
|
|
348
|
+
customData: item.customData
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
exports.CollectionMetadata = CollectionMetadata;
|
|
353
|
+
class OffChainBalancesMetadata extends base_1.CustomTypeClass {
|
|
354
|
+
uri;
|
|
355
|
+
customData;
|
|
356
|
+
constructor(offChainBalancesMetadata) {
|
|
357
|
+
super();
|
|
358
|
+
this.uri = offChainBalancesMetadata.uri;
|
|
359
|
+
this.customData = offChainBalancesMetadata.customData;
|
|
360
|
+
}
|
|
361
|
+
static required() {
|
|
362
|
+
return new OffChainBalancesMetadata({
|
|
363
|
+
uri: '',
|
|
364
|
+
customData: ''
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
toProto() {
|
|
368
|
+
return new proto.badges.OffChainBalancesMetadata({
|
|
369
|
+
uri: this.uri,
|
|
370
|
+
customData: this.customData
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
clone() {
|
|
374
|
+
return new OffChainBalancesMetadata({ uri: this.uri, customData: this.customData });
|
|
375
|
+
}
|
|
376
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
377
|
+
return this.convertFromProto(proto.badges.OffChainBalancesMetadata.fromJson(jsonValue, options), convertFunction);
|
|
378
|
+
}
|
|
379
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
380
|
+
return this.convertFromProto(proto.badges.OffChainBalancesMetadata.fromJsonString(jsonString, options), convertFunction);
|
|
381
|
+
}
|
|
382
|
+
static convertFromProto(item, convertFunction) {
|
|
383
|
+
return new OffChainBalancesMetadata({
|
|
384
|
+
uri: item.uri,
|
|
385
|
+
customData: item.customData
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
exports.OffChainBalancesMetadata = OffChainBalancesMetadata;
|
|
390
|
+
class MustOwnBadges extends base_1.BaseNumberTypeClass {
|
|
391
|
+
collectionId;
|
|
392
|
+
amountRange;
|
|
393
|
+
ownershipTimes;
|
|
394
|
+
badgeIds;
|
|
395
|
+
overrideWithCurrentTime;
|
|
396
|
+
mustSatisfyForAllAssets;
|
|
397
|
+
constructor(mustOwn) {
|
|
398
|
+
super();
|
|
399
|
+
this.collectionId = mustOwn.collectionId;
|
|
400
|
+
this.amountRange = new UintRange(mustOwn.amountRange);
|
|
401
|
+
this.ownershipTimes = mustOwn.ownershipTimes.map((b) => new UintRange(b));
|
|
402
|
+
this.badgeIds = mustOwn.badgeIds.map((b) => new UintRange(b));
|
|
403
|
+
this.overrideWithCurrentTime = mustOwn.overrideWithCurrentTime;
|
|
404
|
+
this.mustSatisfyForAllAssets = mustOwn.mustSatisfyForAllAssets;
|
|
405
|
+
}
|
|
406
|
+
convert(convertFunction) {
|
|
407
|
+
return new MustOwnBadges((0, base_1.deepCopy)({
|
|
408
|
+
collectionId: convertFunction(this.collectionId),
|
|
409
|
+
amountRange: this.amountRange.convert(convertFunction),
|
|
410
|
+
ownershipTimes: this.ownershipTimes.map((b) => b.convert(convertFunction)),
|
|
411
|
+
badgeIds: this.badgeIds.map((b) => b.convert(convertFunction)),
|
|
412
|
+
overrideWithCurrentTime: this.overrideWithCurrentTime,
|
|
413
|
+
mustSatisfyForAllAssets: this.mustSatisfyForAllAssets
|
|
414
|
+
}));
|
|
415
|
+
}
|
|
416
|
+
toProto() {
|
|
417
|
+
return new proto.badges.MustOwnBadges(this.convert(string_numbers_1.Stringify));
|
|
418
|
+
}
|
|
419
|
+
toJson() {
|
|
420
|
+
return (0, base_1.convertClassPropertiesToJson)(this);
|
|
421
|
+
}
|
|
422
|
+
toJsonString() {
|
|
423
|
+
return JSON.stringify(this.toJson());
|
|
424
|
+
}
|
|
425
|
+
equals(other, normalizeNumberTypes) {
|
|
426
|
+
return (0, base_1.compareNumberTypeConvertibles)(this, other, normalizeNumberTypes);
|
|
427
|
+
}
|
|
428
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
429
|
+
return this.convertFromProto(proto.badges.MustOwnBadges.fromJson(jsonValue, options), convertFunction);
|
|
430
|
+
}
|
|
431
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
432
|
+
return this.convertFromProto(proto.badges.MustOwnBadges.fromJsonString(jsonString, options), convertFunction);
|
|
433
|
+
}
|
|
434
|
+
static convertFromProto(item, convertFunction) {
|
|
435
|
+
if (!item.amountRange) {
|
|
436
|
+
throw new Error('amountRange is required');
|
|
437
|
+
}
|
|
438
|
+
return new MustOwnBadges({
|
|
439
|
+
collectionId: convertFunction(BigInt(item.collectionId)),
|
|
440
|
+
amountRange: UintRange.convertFromProto(item.amountRange, convertFunction),
|
|
441
|
+
ownershipTimes: item.ownershipTimes.map((b) => UintRange.convertFromProto(b, convertFunction)),
|
|
442
|
+
badgeIds: item.badgeIds.map((b) => UintRange.convertFromProto(b, convertFunction)),
|
|
443
|
+
overrideWithCurrentTime: item.overrideWithCurrentTime,
|
|
444
|
+
mustSatisfyForAllAssets: item.mustSatisfyForAllAssets
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
exports.MustOwnBadges = MustOwnBadges;
|
|
449
|
+
class Balance extends base_1.BaseNumberTypeClass {
|
|
450
|
+
amount;
|
|
451
|
+
badgeIds;
|
|
452
|
+
ownershipTimes;
|
|
453
|
+
constructor(balance) {
|
|
454
|
+
super();
|
|
455
|
+
this.amount = balance.amount;
|
|
456
|
+
this.badgeIds = balance.badgeIds.map((b) => new UintRange(b));
|
|
457
|
+
this.ownershipTimes = balance.ownershipTimes.map((b) => new UintRange(b));
|
|
458
|
+
}
|
|
459
|
+
static required() {
|
|
460
|
+
return new Balance({
|
|
461
|
+
amount: 0,
|
|
462
|
+
badgeIds: [],
|
|
463
|
+
ownershipTimes: []
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
convert(convertFunction) {
|
|
467
|
+
return new Balance((0, base_1.deepCopy)({
|
|
468
|
+
amount: convertFunction(this.amount),
|
|
469
|
+
badgeIds: this.badgeIds.map((b) => b.convert(convertFunction)),
|
|
470
|
+
ownershipTimes: this.ownershipTimes.map((b) => b.convert(convertFunction))
|
|
471
|
+
}));
|
|
472
|
+
}
|
|
473
|
+
toProto() {
|
|
474
|
+
return new proto.badges.Balance(this.convert(string_numbers_1.Stringify));
|
|
475
|
+
}
|
|
476
|
+
toJson() {
|
|
477
|
+
return (0, base_1.convertClassPropertiesToJson)(this);
|
|
478
|
+
}
|
|
479
|
+
toJsonString() {
|
|
480
|
+
return JSON.stringify(this.toJson());
|
|
481
|
+
}
|
|
482
|
+
equals(other, normalizeNumberTypes) {
|
|
483
|
+
return (0, base_1.compareNumberTypeConvertibles)(this, other, normalizeNumberTypes);
|
|
484
|
+
}
|
|
485
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
486
|
+
return this.convertFromProto(proto.badges.Balance.fromJson(jsonValue, options), convertFunction);
|
|
487
|
+
}
|
|
488
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
489
|
+
return this.convertFromProto(proto.badges.Balance.fromJsonString(jsonString, options), convertFunction);
|
|
490
|
+
}
|
|
491
|
+
static convertFromProto(item, convertFunction) {
|
|
492
|
+
return new Balance({
|
|
493
|
+
amount: convertFunction(BigInt(item.amount)),
|
|
494
|
+
badgeIds: item.badgeIds.map((b) => UintRange.convertFromProto(b, convertFunction)),
|
|
495
|
+
ownershipTimes: item.ownershipTimes.map((b) => UintRange.convertFromProto(b, convertFunction))
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
exports.Balance = Balance;
|
|
500
|
+
class AddressList extends base_1.CustomTypeClass {
|
|
501
|
+
listId;
|
|
502
|
+
addresses;
|
|
503
|
+
whitelist;
|
|
504
|
+
uri;
|
|
505
|
+
customData;
|
|
506
|
+
createdBy;
|
|
507
|
+
aliasAddress;
|
|
508
|
+
constructor(addressList) {
|
|
509
|
+
super();
|
|
510
|
+
this.listId = addressList.listId;
|
|
511
|
+
this.addresses = addressList.addresses;
|
|
512
|
+
this.whitelist = addressList.whitelist;
|
|
513
|
+
this.uri = addressList.uri;
|
|
514
|
+
this.customData = addressList.customData;
|
|
515
|
+
this.createdBy = addressList.createdBy;
|
|
516
|
+
this.aliasAddress = addressList.aliasAddress;
|
|
517
|
+
}
|
|
518
|
+
static required() {
|
|
519
|
+
return new AddressList({
|
|
520
|
+
listId: '',
|
|
521
|
+
addresses: [],
|
|
522
|
+
whitelist: false,
|
|
523
|
+
uri: '',
|
|
524
|
+
customData: ''
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
addDefaults() {
|
|
528
|
+
this.createdBy = this.createdBy ? this.createdBy : '';
|
|
529
|
+
this.aliasAddress = this.aliasAddress ? this.aliasAddress : '';
|
|
530
|
+
}
|
|
531
|
+
toProto() {
|
|
532
|
+
return new proto.badges.AddressList(this.clone().toJson());
|
|
533
|
+
}
|
|
534
|
+
clone() {
|
|
535
|
+
return new AddressList({ ...this });
|
|
536
|
+
}
|
|
537
|
+
static fromJson(jsonValue, options) {
|
|
538
|
+
return this.convertFromProto(proto.badges.AddressList.fromJson(jsonValue, options));
|
|
539
|
+
}
|
|
540
|
+
static fromJsonString(jsonString, options) {
|
|
541
|
+
return this.convertFromProto(proto.badges.AddressList.fromJsonString(jsonString, options));
|
|
542
|
+
}
|
|
543
|
+
static convertFromProto(item) {
|
|
544
|
+
return new AddressList({ ...item });
|
|
545
|
+
}
|
|
546
|
+
checkAddress(address) {
|
|
547
|
+
let found = this.addresses.includes(address);
|
|
548
|
+
if (!this.whitelist) {
|
|
549
|
+
found = !found;
|
|
550
|
+
}
|
|
551
|
+
return found;
|
|
552
|
+
}
|
|
553
|
+
isEmpty() {
|
|
554
|
+
return this.addresses.length === 0 && this.whitelist;
|
|
555
|
+
}
|
|
556
|
+
invert() {
|
|
557
|
+
this.whitelist = !this.whitelist;
|
|
558
|
+
}
|
|
559
|
+
removeAddress(address) {
|
|
560
|
+
const addressListToRemove = new AddressList({
|
|
561
|
+
listId: '',
|
|
562
|
+
addresses: [address],
|
|
563
|
+
whitelist: true,
|
|
564
|
+
uri: '',
|
|
565
|
+
customData: '',
|
|
566
|
+
createdBy: '',
|
|
567
|
+
});
|
|
568
|
+
const [remaining] = AddressList.removeAddressListFromAddressList(addressListToRemove, this);
|
|
569
|
+
this.addresses = remaining.addresses;
|
|
570
|
+
this.whitelist = remaining.whitelist;
|
|
571
|
+
}
|
|
572
|
+
removeAddressList(addressListToRemove) {
|
|
573
|
+
const [remaining] = AddressList.removeAddressListFromAddressList(addressListToRemove, this);
|
|
574
|
+
this.addresses = remaining.addresses;
|
|
575
|
+
this.whitelist = remaining.whitelist;
|
|
576
|
+
}
|
|
577
|
+
getOverlappingAddresses(addressList) {
|
|
578
|
+
const [, removed] = AddressList.removeAddressListFromAddressList(addressList, this);
|
|
579
|
+
return removed;
|
|
580
|
+
}
|
|
581
|
+
static AllAddresses() {
|
|
582
|
+
return AddressList.getReservedAddressList('All');
|
|
583
|
+
}
|
|
584
|
+
static removeAddressListFromAddressList(addressesToRemove, addressList) {
|
|
585
|
+
const duplicates = [];
|
|
586
|
+
const inToRemoveButNotList = [];
|
|
587
|
+
const inListButNotToRemove = [];
|
|
588
|
+
for (const address of addressesToRemove.addresses) {
|
|
589
|
+
const found = addressList.addresses.includes(address);
|
|
590
|
+
if (found) {
|
|
591
|
+
duplicates.push(address);
|
|
592
|
+
}
|
|
593
|
+
else {
|
|
594
|
+
inToRemoveButNotList.push(address);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
for (const address of addressList.addresses) {
|
|
598
|
+
const found = addressesToRemove.addresses.includes(address);
|
|
599
|
+
if (!found) {
|
|
600
|
+
inListButNotToRemove.push(address);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
const removed = new AddressList({
|
|
604
|
+
addresses: [],
|
|
605
|
+
whitelist: false,
|
|
606
|
+
listId: '',
|
|
607
|
+
uri: '',
|
|
608
|
+
customData: '',
|
|
609
|
+
createdBy: '',
|
|
610
|
+
});
|
|
611
|
+
const remaining = new AddressList({
|
|
612
|
+
addresses: [],
|
|
613
|
+
whitelist: false,
|
|
614
|
+
listId: '',
|
|
615
|
+
uri: '',
|
|
616
|
+
customData: '',
|
|
617
|
+
createdBy: '',
|
|
618
|
+
});
|
|
619
|
+
if (addressesToRemove.whitelist && addressList.whitelist) {
|
|
620
|
+
removed.whitelist = true;
|
|
621
|
+
removed.addresses = duplicates;
|
|
622
|
+
remaining.whitelist = true;
|
|
623
|
+
remaining.addresses = inListButNotToRemove;
|
|
624
|
+
}
|
|
625
|
+
else if (!addressesToRemove.whitelist &&
|
|
626
|
+
addressList.whitelist) {
|
|
627
|
+
removed.whitelist = true;
|
|
628
|
+
removed.addresses = inListButNotToRemove;
|
|
629
|
+
remaining.whitelist = true;
|
|
630
|
+
remaining.addresses = duplicates;
|
|
631
|
+
}
|
|
632
|
+
else if (addressesToRemove.whitelist &&
|
|
633
|
+
!addressList.whitelist) {
|
|
634
|
+
removed.whitelist = true;
|
|
635
|
+
removed.addresses = inToRemoveButNotList;
|
|
636
|
+
remaining.whitelist = false;
|
|
637
|
+
remaining.addresses = [
|
|
638
|
+
...inListButNotToRemove,
|
|
639
|
+
...inToRemoveButNotList,
|
|
640
|
+
...duplicates,
|
|
641
|
+
];
|
|
642
|
+
}
|
|
643
|
+
else if (!addressesToRemove.whitelist &&
|
|
644
|
+
!addressList.whitelist) {
|
|
645
|
+
removed.whitelist = false;
|
|
646
|
+
removed.addresses = [
|
|
647
|
+
...inListButNotToRemove,
|
|
648
|
+
...inToRemoveButNotList,
|
|
649
|
+
...duplicates,
|
|
650
|
+
];
|
|
651
|
+
remaining.whitelist = true;
|
|
652
|
+
remaining.addresses = inToRemoveButNotList;
|
|
653
|
+
}
|
|
654
|
+
return [remaining, removed];
|
|
655
|
+
}
|
|
656
|
+
static getReservedTrackerList(trackerListId) {
|
|
657
|
+
return AddressList.getReservedList(trackerListId, true);
|
|
658
|
+
}
|
|
659
|
+
static getReservedAddressList(addressListId) {
|
|
660
|
+
return AddressList.getReservedList(addressListId);
|
|
661
|
+
}
|
|
662
|
+
static getReservedList(addressListId, allowAliases) {
|
|
663
|
+
let inverted = false;
|
|
664
|
+
let addressList = undefined;
|
|
665
|
+
const addressListIdCopy = addressListId;
|
|
666
|
+
if (addressListId[0] === '!' && !addressListId.startsWith('!(')) {
|
|
667
|
+
inverted = true;
|
|
668
|
+
addressListId = addressListId.slice(1);
|
|
669
|
+
}
|
|
670
|
+
else if (addressListId.startsWith('!(') && addressListId.endsWith(')')) {
|
|
671
|
+
inverted = true;
|
|
672
|
+
addressListId = addressListId.slice(2, -1);
|
|
673
|
+
}
|
|
674
|
+
if (addressListId === 'Mint') {
|
|
675
|
+
addressList = new AddressList({
|
|
676
|
+
listId: 'Mint',
|
|
677
|
+
addresses: ['Mint'],
|
|
678
|
+
whitelist: true,
|
|
679
|
+
uri: '',
|
|
680
|
+
customData: '',
|
|
681
|
+
createdBy: '',
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
else if (addressListId.startsWith('AllWithout')) {
|
|
685
|
+
addressList = new AddressList({
|
|
686
|
+
listId: addressListId,
|
|
687
|
+
addresses: [],
|
|
688
|
+
whitelist: false,
|
|
689
|
+
uri: '',
|
|
690
|
+
customData: '',
|
|
691
|
+
createdBy: '',
|
|
692
|
+
});
|
|
693
|
+
const addresses = addressListId.slice(10).split(':');
|
|
694
|
+
for (const address of addresses) {
|
|
695
|
+
addressList.addresses.push(address);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
else if (addressListId === 'AllWithMint' || addressListId === 'All') {
|
|
699
|
+
addressList = new AddressList({
|
|
700
|
+
listId: addressListId,
|
|
701
|
+
addresses: [],
|
|
702
|
+
whitelist: false,
|
|
703
|
+
uri: '',
|
|
704
|
+
customData: '',
|
|
705
|
+
createdBy: '',
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
else if (addressListId === 'None') {
|
|
709
|
+
addressList = new AddressList({
|
|
710
|
+
listId: 'None',
|
|
711
|
+
addresses: [],
|
|
712
|
+
whitelist: true,
|
|
713
|
+
uri: '',
|
|
714
|
+
customData: '',
|
|
715
|
+
createdBy: '',
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
else {
|
|
719
|
+
const addressesToCheck = addressListId.split(':');
|
|
720
|
+
let allAreValid = true;
|
|
721
|
+
if (!allowAliases) {
|
|
722
|
+
for (const address of addressesToCheck) {
|
|
723
|
+
if (address != 'Mint' && !(0, converter_1.convertToCosmosAddress)(address)) {
|
|
724
|
+
allAreValid = false;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
if (allAreValid) {
|
|
729
|
+
addressList = new AddressList({
|
|
730
|
+
listId: addressListId,
|
|
731
|
+
addresses: addressesToCheck,
|
|
732
|
+
whitelist: true,
|
|
733
|
+
uri: '',
|
|
734
|
+
customData: '',
|
|
735
|
+
createdBy: '',
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
if (inverted && addressList) {
|
|
740
|
+
addressList.whitelist = !addressList.whitelist;
|
|
741
|
+
}
|
|
742
|
+
if (!addressList) {
|
|
743
|
+
throw new Error(`Invalid address list ID: ${addressListId}`);
|
|
744
|
+
}
|
|
745
|
+
return new AddressList({
|
|
746
|
+
...addressList,
|
|
747
|
+
listId: addressListIdCopy,
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
static generateReservedListId = (addressList) => {
|
|
751
|
+
let listId = '';
|
|
752
|
+
if (addressList.whitelist) {
|
|
753
|
+
if (addressList.addresses.length > 0) {
|
|
754
|
+
const addresses = addressList.addresses
|
|
755
|
+
.map((x) => ((0, converter_1.isAddressValid)(x) ? (0, converter_1.convertToCosmosAddress)(x) : x))
|
|
756
|
+
.join(':');
|
|
757
|
+
listId = `${addresses}`;
|
|
758
|
+
}
|
|
759
|
+
else {
|
|
760
|
+
listId = 'None';
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
else {
|
|
764
|
+
if (addressList.addresses.length > 0) {
|
|
765
|
+
const addresses = addressList.addresses
|
|
766
|
+
.map((x) => ((0, converter_1.isAddressValid)(x) ? (0, converter_1.convertToCosmosAddress)(x) : x))
|
|
767
|
+
.join(':');
|
|
768
|
+
listId = `!(${addresses})`;
|
|
769
|
+
}
|
|
770
|
+
else {
|
|
771
|
+
listId = 'All';
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
return listId;
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
exports.AddressList = AddressList;
|
|
778
|
+
class Transfer extends base_1.BaseNumberTypeClass {
|
|
779
|
+
from;
|
|
780
|
+
toAddresses;
|
|
781
|
+
balances;
|
|
782
|
+
precalculateBalancesFromApproval;
|
|
783
|
+
merkleProofs;
|
|
784
|
+
memo;
|
|
785
|
+
prioritizedApprovals;
|
|
786
|
+
onlyCheckPrioritizedApprovals;
|
|
787
|
+
constructor(transfer) {
|
|
788
|
+
super();
|
|
789
|
+
this.from = transfer.from;
|
|
790
|
+
this.toAddresses = transfer.toAddresses;
|
|
791
|
+
this.balances = transfer.balances;
|
|
792
|
+
this.precalculateBalancesFromApproval = transfer.precalculateBalancesFromApproval;
|
|
793
|
+
this.merkleProofs = transfer.merkleProofs;
|
|
794
|
+
this.memo = transfer.memo;
|
|
795
|
+
this.prioritizedApprovals = transfer.prioritizedApprovals;
|
|
796
|
+
this.onlyCheckPrioritizedApprovals = transfer.onlyCheckPrioritizedApprovals;
|
|
797
|
+
}
|
|
798
|
+
static required() {
|
|
799
|
+
return new Transfer({
|
|
800
|
+
from: '',
|
|
801
|
+
toAddresses: [],
|
|
802
|
+
balances: [],
|
|
803
|
+
precalculateBalancesFromApproval: ApprovalIdentifierDetails.required(),
|
|
804
|
+
merkleProofs: [],
|
|
805
|
+
memo: '',
|
|
806
|
+
prioritizedApprovals: [],
|
|
807
|
+
onlyCheckPrioritizedApprovals: false
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
addDefaults() {
|
|
811
|
+
this.precalculateBalancesFromApproval = this.precalculateBalancesFromApproval ? this.precalculateBalancesFromApproval : ApprovalIdentifierDetails.required();
|
|
812
|
+
this.merkleProofs = this.merkleProofs ? this.merkleProofs : [];
|
|
813
|
+
this.memo = this.memo ? this.memo : '';
|
|
814
|
+
this.prioritizedApprovals = this.prioritizedApprovals ? this.prioritizedApprovals : [];
|
|
815
|
+
this.onlyCheckPrioritizedApprovals = this.onlyCheckPrioritizedApprovals ? this.onlyCheckPrioritizedApprovals : false;
|
|
816
|
+
}
|
|
817
|
+
convert(convertFunction) {
|
|
818
|
+
return new Transfer((0, base_1.deepCopy)({
|
|
819
|
+
from: this.from,
|
|
820
|
+
toAddresses: this.toAddresses,
|
|
821
|
+
balances: this.balances.map((b) => b.convert(convertFunction)),
|
|
822
|
+
precalculateBalancesFromApproval: this.precalculateBalancesFromApproval ? this.precalculateBalancesFromApproval : undefined,
|
|
823
|
+
merkleProofs: this.merkleProofs ? this.merkleProofs : undefined,
|
|
824
|
+
memo: this.memo ? this.memo : undefined,
|
|
825
|
+
prioritizedApprovals: this.prioritizedApprovals ? this.prioritizedApprovals : undefined,
|
|
826
|
+
onlyCheckPrioritizedApprovals: this.onlyCheckPrioritizedApprovals ? this.onlyCheckPrioritizedApprovals : undefined
|
|
827
|
+
}));
|
|
828
|
+
}
|
|
829
|
+
toProto() {
|
|
830
|
+
return new proto.badges.Transfer(this.convert(string_numbers_1.Stringify));
|
|
831
|
+
}
|
|
832
|
+
toJson() {
|
|
833
|
+
return (0, base_1.convertClassPropertiesToJson)(this);
|
|
834
|
+
}
|
|
835
|
+
toJsonString() {
|
|
836
|
+
return JSON.stringify(this.toJson());
|
|
837
|
+
}
|
|
838
|
+
equals(other, normalizeNumberTypes) {
|
|
839
|
+
return (0, base_1.compareNumberTypeConvertibles)(this, other, normalizeNumberTypes);
|
|
840
|
+
}
|
|
841
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
842
|
+
return this.convertFromProto(proto.badges.Transfer.fromJson(jsonValue, options), convertFunction);
|
|
843
|
+
}
|
|
844
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
845
|
+
return this.convertFromProto(proto.badges.Transfer.fromJsonString(jsonString, options), convertFunction);
|
|
846
|
+
}
|
|
847
|
+
static convertFromProto(item, convertFunction) {
|
|
848
|
+
return new Transfer({
|
|
849
|
+
from: item.from,
|
|
850
|
+
toAddresses: item.toAddresses,
|
|
851
|
+
balances: item.balances.map((b) => Balance.convertFromProto(b, convertFunction)),
|
|
852
|
+
precalculateBalancesFromApproval: item.precalculateBalancesFromApproval ? ApprovalIdentifierDetails.convertFromProto(item.precalculateBalancesFromApproval) : undefined,
|
|
853
|
+
merkleProofs: item.merkleProofs ? item.merkleProofs.map((b) => MerkleProof.convertFromProto(b)) : undefined,
|
|
854
|
+
memo: item.memo ? item.memo : undefined,
|
|
855
|
+
prioritizedApprovals: item.prioritizedApprovals ? item.prioritizedApprovals.map((b) => ApprovalIdentifierDetails.convertFromProto(b)) : undefined,
|
|
856
|
+
onlyCheckPrioritizedApprovals: item.onlyCheckPrioritizedApprovals ? item.onlyCheckPrioritizedApprovals : undefined
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
exports.Transfer = Transfer;
|
|
861
|
+
class ApprovalIdentifierDetails extends base_1.CustomTypeClass {
|
|
862
|
+
approvalId;
|
|
863
|
+
approvalLevel;
|
|
864
|
+
approverAddress;
|
|
865
|
+
constructor(approvalIdDetails) {
|
|
866
|
+
super();
|
|
867
|
+
this.approvalId = approvalIdDetails.approvalId;
|
|
868
|
+
this.approvalLevel = approvalIdDetails.approvalLevel;
|
|
869
|
+
this.approverAddress = approvalIdDetails.approverAddress;
|
|
870
|
+
}
|
|
871
|
+
static required() {
|
|
872
|
+
return new ApprovalIdentifierDetails({
|
|
873
|
+
approvalId: '',
|
|
874
|
+
approvalLevel: '',
|
|
875
|
+
approverAddress: ''
|
|
876
|
+
});
|
|
877
|
+
}
|
|
878
|
+
toProto() {
|
|
879
|
+
return new proto.badges.ApprovalIdentifierDetails(this.clone().toJson());
|
|
880
|
+
}
|
|
881
|
+
clone() {
|
|
882
|
+
return new ApprovalIdentifierDetails({ ...this });
|
|
883
|
+
}
|
|
884
|
+
static fromJson(jsonValue, options) {
|
|
885
|
+
return this.convertFromProto(proto.badges.ApprovalIdentifierDetails.fromJson(jsonValue, options));
|
|
886
|
+
}
|
|
887
|
+
static fromJsonString(jsonString, options) {
|
|
888
|
+
return this.convertFromProto(proto.badges.ApprovalIdentifierDetails.fromJsonString(jsonString, options));
|
|
889
|
+
}
|
|
890
|
+
static convertFromProto(item) {
|
|
891
|
+
return new ApprovalIdentifierDetails({ ...item });
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
exports.ApprovalIdentifierDetails = ApprovalIdentifierDetails;
|
|
895
|
+
class AmountTrackerIdDetails extends base_1.BaseNumberTypeClass {
|
|
896
|
+
collectionId;
|
|
897
|
+
amountTrackerId;
|
|
898
|
+
approvalLevel;
|
|
899
|
+
approverAddress;
|
|
900
|
+
trackerType;
|
|
901
|
+
approvedAddress;
|
|
902
|
+
constructor(approvalIdDetails) {
|
|
903
|
+
super();
|
|
904
|
+
this.collectionId = approvalIdDetails.collectionId;
|
|
905
|
+
this.amountTrackerId = approvalIdDetails.amountTrackerId;
|
|
906
|
+
this.approvalLevel = approvalIdDetails.approvalLevel;
|
|
907
|
+
this.approverAddress = approvalIdDetails.approverAddress;
|
|
908
|
+
this.trackerType = approvalIdDetails.trackerType;
|
|
909
|
+
this.approvedAddress = approvalIdDetails.approvedAddress;
|
|
910
|
+
}
|
|
911
|
+
static required() {
|
|
912
|
+
return new AmountTrackerIdDetails({
|
|
913
|
+
collectionId: 0,
|
|
914
|
+
amountTrackerId: '',
|
|
915
|
+
approvalLevel: '',
|
|
916
|
+
approverAddress: '',
|
|
917
|
+
trackerType: '',
|
|
918
|
+
approvedAddress: ''
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
convert(convertFunction) {
|
|
922
|
+
return new AmountTrackerIdDetails((0, base_1.deepCopy)({
|
|
923
|
+
collectionId: convertFunction(this.collectionId),
|
|
924
|
+
amountTrackerId: this.amountTrackerId,
|
|
925
|
+
approvalLevel: this.approvalLevel,
|
|
926
|
+
approverAddress: this.approverAddress,
|
|
927
|
+
trackerType: this.trackerType,
|
|
928
|
+
approvedAddress: this.approvedAddress
|
|
929
|
+
}));
|
|
930
|
+
}
|
|
931
|
+
toJson() {
|
|
932
|
+
return (0, base_1.convertClassPropertiesToJson)(this);
|
|
933
|
+
}
|
|
934
|
+
toJsonString() {
|
|
935
|
+
return JSON.stringify(this.toJson());
|
|
936
|
+
}
|
|
937
|
+
equals(other, normalizeNumberTypes) {
|
|
938
|
+
return (0, base_1.compareNumberTypeConvertibles)(this, other, normalizeNumberTypes);
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
exports.AmountTrackerIdDetails = AmountTrackerIdDetails;
|
|
942
|
+
class MerkleChallenge extends base_1.BaseNumberTypeClass {
|
|
943
|
+
root;
|
|
944
|
+
expectedProofLength;
|
|
945
|
+
useCreatorAddressAsLeaf;
|
|
946
|
+
maxUsesPerLeaf;
|
|
947
|
+
uri;
|
|
948
|
+
customData;
|
|
949
|
+
constructor(merkleChallenge) {
|
|
950
|
+
super();
|
|
951
|
+
this.root = merkleChallenge.root;
|
|
952
|
+
this.expectedProofLength = merkleChallenge.expectedProofLength;
|
|
953
|
+
this.useCreatorAddressAsLeaf = merkleChallenge.useCreatorAddressAsLeaf;
|
|
954
|
+
this.maxUsesPerLeaf = merkleChallenge.maxUsesPerLeaf;
|
|
955
|
+
this.uri = merkleChallenge.uri;
|
|
956
|
+
this.customData = merkleChallenge.customData;
|
|
957
|
+
}
|
|
958
|
+
static required() {
|
|
959
|
+
return new MerkleChallenge({
|
|
960
|
+
root: '',
|
|
961
|
+
expectedProofLength: 0,
|
|
962
|
+
useCreatorAddressAsLeaf: false,
|
|
963
|
+
maxUsesPerLeaf: 0,
|
|
964
|
+
uri: '',
|
|
965
|
+
customData: ''
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
convert(convertFunction) {
|
|
969
|
+
return new MerkleChallenge((0, base_1.deepCopy)({
|
|
970
|
+
root: this.root,
|
|
971
|
+
expectedProofLength: convertFunction(this.expectedProofLength),
|
|
972
|
+
useCreatorAddressAsLeaf: this.useCreatorAddressAsLeaf,
|
|
973
|
+
maxUsesPerLeaf: convertFunction(this.maxUsesPerLeaf),
|
|
974
|
+
uri: this.uri,
|
|
975
|
+
customData: this.customData
|
|
976
|
+
}));
|
|
977
|
+
}
|
|
978
|
+
toProto() {
|
|
979
|
+
return new proto.badges.MerkleChallenge(this.convert(string_numbers_1.Stringify));
|
|
980
|
+
}
|
|
981
|
+
toJson() {
|
|
982
|
+
return (0, base_1.convertClassPropertiesToJson)(this);
|
|
983
|
+
}
|
|
984
|
+
toJsonString() {
|
|
985
|
+
return JSON.stringify(this.toJson());
|
|
986
|
+
}
|
|
987
|
+
equals(other, normalizeNumberTypes) {
|
|
988
|
+
return (0, base_1.compareNumberTypeConvertibles)(this, other, normalizeNumberTypes);
|
|
989
|
+
}
|
|
990
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
991
|
+
return this.convertFromProto(proto.badges.MerkleChallenge.fromJson(jsonValue, options), convertFunction);
|
|
992
|
+
}
|
|
993
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
994
|
+
return this.convertFromProto(proto.badges.MerkleChallenge.fromJsonString(jsonString, options), convertFunction);
|
|
995
|
+
}
|
|
996
|
+
static convertFromProto(item, convertFunction) {
|
|
997
|
+
return new MerkleChallenge({
|
|
998
|
+
root: item.root,
|
|
999
|
+
expectedProofLength: convertFunction(BigInt(item.expectedProofLength)),
|
|
1000
|
+
useCreatorAddressAsLeaf: item.useCreatorAddressAsLeaf,
|
|
1001
|
+
maxUsesPerLeaf: convertFunction(BigInt(item.maxUsesPerLeaf)),
|
|
1002
|
+
uri: item.uri,
|
|
1003
|
+
customData: item.customData
|
|
1004
|
+
});
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
exports.MerkleChallenge = MerkleChallenge;
|
|
1008
|
+
class MerklePathItem extends base_1.CustomTypeClass {
|
|
1009
|
+
aunt;
|
|
1010
|
+
onRight;
|
|
1011
|
+
constructor(merklePathItem) {
|
|
1012
|
+
super();
|
|
1013
|
+
this.aunt = merklePathItem.aunt;
|
|
1014
|
+
this.onRight = merklePathItem.onRight;
|
|
1015
|
+
}
|
|
1016
|
+
static required() {
|
|
1017
|
+
return new MerklePathItem({
|
|
1018
|
+
aunt: '',
|
|
1019
|
+
onRight: false
|
|
1020
|
+
});
|
|
1021
|
+
}
|
|
1022
|
+
toProto() {
|
|
1023
|
+
return new proto.badges.MerklePathItem(this.clone().toJson());
|
|
1024
|
+
}
|
|
1025
|
+
clone() {
|
|
1026
|
+
return new MerklePathItem({ ...this });
|
|
1027
|
+
}
|
|
1028
|
+
static fromJson(jsonValue, options) {
|
|
1029
|
+
return this.convertFromProto(proto.badges.MerklePathItem.fromJson(jsonValue, options));
|
|
1030
|
+
}
|
|
1031
|
+
static fromJsonString(jsonString, options) {
|
|
1032
|
+
return this.convertFromProto(proto.badges.MerklePathItem.fromJsonString(jsonString, options));
|
|
1033
|
+
}
|
|
1034
|
+
static convertFromProto(item) {
|
|
1035
|
+
return new MerklePathItem({ ...item });
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
exports.MerklePathItem = MerklePathItem;
|
|
1039
|
+
class MerkleProof extends base_1.CustomTypeClass {
|
|
1040
|
+
aunts;
|
|
1041
|
+
leaf;
|
|
1042
|
+
constructor(merkleProof) {
|
|
1043
|
+
super();
|
|
1044
|
+
this.aunts = merkleProof.aunts;
|
|
1045
|
+
this.leaf = merkleProof.leaf;
|
|
1046
|
+
}
|
|
1047
|
+
static required() {
|
|
1048
|
+
return new MerkleProof({
|
|
1049
|
+
aunts: [],
|
|
1050
|
+
leaf: ''
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
toProto() {
|
|
1054
|
+
return new proto.badges.MerkleProof(this.clone().toJson());
|
|
1055
|
+
}
|
|
1056
|
+
clone() {
|
|
1057
|
+
return new MerkleProof({ ...this });
|
|
1058
|
+
}
|
|
1059
|
+
static fromJson(jsonValue, options) {
|
|
1060
|
+
return this.convertFromProto(proto.badges.MerkleProof.fromJson(jsonValue, options));
|
|
1061
|
+
}
|
|
1062
|
+
static fromJsonString(jsonString, options) {
|
|
1063
|
+
return this.convertFromProto(proto.badges.MerkleProof.fromJsonString(jsonString, options));
|
|
1064
|
+
}
|
|
1065
|
+
static convertFromProto(item) {
|
|
1066
|
+
return new MerkleProof({
|
|
1067
|
+
aunts: item.aunts.map((b) => MerklePathItem.convertFromProto(b)),
|
|
1068
|
+
leaf: item.leaf
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
exports.MerkleProof = MerkleProof;
|
|
1073
|
+
class TimelineItem extends base_1.BaseNumberTypeClass {
|
|
1074
|
+
timelineTimes;
|
|
1075
|
+
constructor(timelineItem) {
|
|
1076
|
+
super();
|
|
1077
|
+
this.timelineTimes = timelineItem.timelineTimes.map((b) => new UintRange(b));
|
|
1078
|
+
}
|
|
1079
|
+
convert(convertFunction) {
|
|
1080
|
+
return new TimelineItem((0, base_1.deepCopy)({
|
|
1081
|
+
timelineTimes: this.timelineTimes.map((b) => b.convert(convertFunction))
|
|
1082
|
+
}));
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
exports.TimelineItem = TimelineItem;
|
|
1086
|
+
class ManagerTimeline extends base_1.BaseNumberTypeClass {
|
|
1087
|
+
manager;
|
|
1088
|
+
timelineTimes;
|
|
1089
|
+
constructor(managerTimeline) {
|
|
1090
|
+
super();
|
|
1091
|
+
this.manager = managerTimeline.manager;
|
|
1092
|
+
this.timelineTimes = managerTimeline.timelineTimes.map((b) => new UintRange(b));
|
|
1093
|
+
}
|
|
1094
|
+
static required() {
|
|
1095
|
+
return new ManagerTimeline({
|
|
1096
|
+
manager: '',
|
|
1097
|
+
timelineTimes: []
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1100
|
+
convert(convertFunction) {
|
|
1101
|
+
return new ManagerTimeline((0, base_1.deepCopy)({
|
|
1102
|
+
manager: this.manager,
|
|
1103
|
+
timelineTimes: this.timelineTimes.map((b) => b.convert(convertFunction))
|
|
1104
|
+
}));
|
|
1105
|
+
}
|
|
1106
|
+
toProto() {
|
|
1107
|
+
return new proto.badges.ManagerTimeline(this.convert(string_numbers_1.Stringify));
|
|
1108
|
+
}
|
|
1109
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
1110
|
+
return this.convertFromProto(proto.badges.ManagerTimeline.fromJson(jsonValue, options), convertFunction);
|
|
1111
|
+
}
|
|
1112
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
1113
|
+
return this.convertFromProto(proto.badges.ManagerTimeline.fromJsonString(jsonString, options), convertFunction);
|
|
1114
|
+
}
|
|
1115
|
+
static convertFromProto(item, convertFunction) {
|
|
1116
|
+
return new ManagerTimeline({
|
|
1117
|
+
manager: item.manager,
|
|
1118
|
+
timelineTimes: item.timelineTimes.map((b) => UintRange.convertFromProto(b, convertFunction))
|
|
1119
|
+
});
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
exports.ManagerTimeline = ManagerTimeline;
|
|
1123
|
+
class CollectionMetadataTimeline extends base_1.BaseNumberTypeClass {
|
|
1124
|
+
collectionMetadata;
|
|
1125
|
+
timelineTimes;
|
|
1126
|
+
constructor(collectionMetadataTimeline) {
|
|
1127
|
+
super();
|
|
1128
|
+
this.collectionMetadata = new CollectionMetadata(collectionMetadataTimeline.collectionMetadata);
|
|
1129
|
+
this.timelineTimes = collectionMetadataTimeline.timelineTimes.map((b) => new UintRange(b));
|
|
1130
|
+
}
|
|
1131
|
+
static required() {
|
|
1132
|
+
return new CollectionMetadataTimeline({
|
|
1133
|
+
collectionMetadata: CollectionMetadata.required(),
|
|
1134
|
+
timelineTimes: []
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
convert(convertFunction) {
|
|
1138
|
+
return new CollectionMetadataTimeline((0, base_1.deepCopy)({
|
|
1139
|
+
collectionMetadata: this.collectionMetadata,
|
|
1140
|
+
timelineTimes: this.timelineTimes.map((b) => b.convert(convertFunction))
|
|
1141
|
+
}));
|
|
1142
|
+
}
|
|
1143
|
+
toProto() {
|
|
1144
|
+
return new proto.badges.CollectionMetadataTimeline(this.convert(string_numbers_1.Stringify));
|
|
1145
|
+
}
|
|
1146
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
1147
|
+
return this.convertFromProto(proto.badges.CollectionMetadataTimeline.fromJson(jsonValue, options), convertFunction);
|
|
1148
|
+
}
|
|
1149
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
1150
|
+
return this.convertFromProto(proto.badges.CollectionMetadataTimeline.fromJsonString(jsonString, options), convertFunction);
|
|
1151
|
+
}
|
|
1152
|
+
static convertFromProto(item, convertFunction) {
|
|
1153
|
+
if (item.collectionMetadata === undefined) {
|
|
1154
|
+
throw new Error('CollectionMetadataTimeline: invalid collectionMetadata');
|
|
1155
|
+
}
|
|
1156
|
+
return new CollectionMetadataTimeline({
|
|
1157
|
+
collectionMetadata: CollectionMetadata.convertFromProto(item.collectionMetadata, convertFunction),
|
|
1158
|
+
timelineTimes: item.timelineTimes.map((b) => UintRange.convertFromProto(b, convertFunction))
|
|
1159
|
+
});
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
exports.CollectionMetadataTimeline = CollectionMetadataTimeline;
|
|
1163
|
+
class BadgeMetadataTimeline extends base_1.BaseNumberTypeClass {
|
|
1164
|
+
badgeMetadata;
|
|
1165
|
+
timelineTimes;
|
|
1166
|
+
constructor(badgeMetadataTimeline) {
|
|
1167
|
+
super();
|
|
1168
|
+
this.timelineTimes = badgeMetadataTimeline.timelineTimes.map((b) => new UintRange(b));
|
|
1169
|
+
this.badgeMetadata = badgeMetadataTimeline.badgeMetadata.map((b) => new BadgeMetadata(b));
|
|
1170
|
+
}
|
|
1171
|
+
static required() {
|
|
1172
|
+
return new BadgeMetadataTimeline({
|
|
1173
|
+
badgeMetadata: [],
|
|
1174
|
+
timelineTimes: []
|
|
1175
|
+
});
|
|
1176
|
+
}
|
|
1177
|
+
convert(convertFunction) {
|
|
1178
|
+
return new BadgeMetadataTimeline((0, base_1.deepCopy)({
|
|
1179
|
+
badgeMetadata: this.badgeMetadata.map((b) => b.convert(convertFunction)),
|
|
1180
|
+
timelineTimes: this.timelineTimes.map((b) => b.convert(convertFunction))
|
|
1181
|
+
}));
|
|
1182
|
+
}
|
|
1183
|
+
toProto() {
|
|
1184
|
+
return new proto.badges.BadgeMetadataTimeline(this.convert(string_numbers_1.Stringify));
|
|
1185
|
+
}
|
|
1186
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
1187
|
+
return this.convertFromProto(proto.badges.BadgeMetadataTimeline.fromJson(jsonValue, options), convertFunction);
|
|
1188
|
+
}
|
|
1189
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
1190
|
+
return this.convertFromProto(proto.badges.BadgeMetadataTimeline.fromJsonString(jsonString, options), convertFunction);
|
|
1191
|
+
}
|
|
1192
|
+
static convertFromProto(item, convertFunction) {
|
|
1193
|
+
return new BadgeMetadataTimeline({
|
|
1194
|
+
badgeMetadata: item.badgeMetadata.map((b) => BadgeMetadata.convertFromProto(b, convertFunction)),
|
|
1195
|
+
timelineTimes: item.timelineTimes.map((b) => UintRange.convertFromProto(b, convertFunction))
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
exports.BadgeMetadataTimeline = BadgeMetadataTimeline;
|
|
1200
|
+
class OffChainBalancesMetadataTimeline extends base_1.BaseNumberTypeClass {
|
|
1201
|
+
offChainBalancesMetadata;
|
|
1202
|
+
timelineTimes;
|
|
1203
|
+
constructor(offChainBalancesMetadataTimeline) {
|
|
1204
|
+
super();
|
|
1205
|
+
this.offChainBalancesMetadata = new OffChainBalancesMetadata(offChainBalancesMetadataTimeline.offChainBalancesMetadata);
|
|
1206
|
+
this.timelineTimes = offChainBalancesMetadataTimeline.timelineTimes.map((b) => new UintRange(b));
|
|
1207
|
+
}
|
|
1208
|
+
static required() {
|
|
1209
|
+
return new OffChainBalancesMetadataTimeline({
|
|
1210
|
+
offChainBalancesMetadata: OffChainBalancesMetadata.required(),
|
|
1211
|
+
timelineTimes: []
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
convert(convertFunction) {
|
|
1215
|
+
return new OffChainBalancesMetadataTimeline((0, base_1.deepCopy)({
|
|
1216
|
+
offChainBalancesMetadata: this.offChainBalancesMetadata,
|
|
1217
|
+
timelineTimes: this.timelineTimes.map((b) => b.convert(convertFunction))
|
|
1218
|
+
}));
|
|
1219
|
+
}
|
|
1220
|
+
toProto() {
|
|
1221
|
+
return new proto.badges.OffChainBalancesMetadataTimeline(this.convert(string_numbers_1.Stringify));
|
|
1222
|
+
}
|
|
1223
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
1224
|
+
return this.convertFromProto(proto.badges.OffChainBalancesMetadataTimeline.fromJson(jsonValue, options), convertFunction);
|
|
1225
|
+
}
|
|
1226
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
1227
|
+
return this.convertFromProto(proto.badges.OffChainBalancesMetadataTimeline.fromJsonString(jsonString, options), convertFunction);
|
|
1228
|
+
}
|
|
1229
|
+
static convertFromProto(item, convertFunction) {
|
|
1230
|
+
if (!item.offChainBalancesMetadata) {
|
|
1231
|
+
throw new Error("OffChainBalancesMetadataTimeline: offChainBalancesMetadata is required");
|
|
1232
|
+
}
|
|
1233
|
+
return new OffChainBalancesMetadataTimeline({
|
|
1234
|
+
offChainBalancesMetadata: OffChainBalancesMetadata.convertFromProto(item.offChainBalancesMetadata, convertFunction),
|
|
1235
|
+
timelineTimes: item.timelineTimes.map((b) => UintRange.convertFromProto(b, convertFunction))
|
|
1236
|
+
});
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
exports.OffChainBalancesMetadataTimeline = OffChainBalancesMetadataTimeline;
|
|
1240
|
+
class CustomDataTimeline extends base_1.BaseNumberTypeClass {
|
|
1241
|
+
customData;
|
|
1242
|
+
timelineTimes;
|
|
1243
|
+
constructor(customDataTimeline) {
|
|
1244
|
+
super();
|
|
1245
|
+
this.customData = customDataTimeline.customData;
|
|
1246
|
+
this.timelineTimes = customDataTimeline.timelineTimes.map((b) => new UintRange(b));
|
|
1247
|
+
}
|
|
1248
|
+
static required() {
|
|
1249
|
+
return new CustomDataTimeline({
|
|
1250
|
+
customData: '',
|
|
1251
|
+
timelineTimes: []
|
|
1252
|
+
});
|
|
1253
|
+
}
|
|
1254
|
+
convert(convertFunction) {
|
|
1255
|
+
return new CustomDataTimeline((0, base_1.deepCopy)({
|
|
1256
|
+
customData: this.customData,
|
|
1257
|
+
timelineTimes: this.timelineTimes.map((b) => b.convert(convertFunction))
|
|
1258
|
+
}));
|
|
1259
|
+
}
|
|
1260
|
+
toProto() {
|
|
1261
|
+
return new proto.badges.CustomDataTimeline(this.convert(string_numbers_1.Stringify));
|
|
1262
|
+
}
|
|
1263
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
1264
|
+
return this.convertFromProto(proto.badges.CustomDataTimeline.fromJson(jsonValue, options), convertFunction);
|
|
1265
|
+
}
|
|
1266
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
1267
|
+
return this.convertFromProto(proto.badges.CustomDataTimeline.fromJsonString(jsonString, options), convertFunction);
|
|
1268
|
+
}
|
|
1269
|
+
static convertFromProto(item, convertFunction) {
|
|
1270
|
+
return new CustomDataTimeline({
|
|
1271
|
+
customData: item.customData,
|
|
1272
|
+
timelineTimes: item.timelineTimes.map((b) => UintRange.convertFromProto(b, convertFunction))
|
|
1273
|
+
});
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
exports.CustomDataTimeline = CustomDataTimeline;
|
|
1277
|
+
class StandardsTimeline extends base_1.BaseNumberTypeClass {
|
|
1278
|
+
standards;
|
|
1279
|
+
timelineTimes;
|
|
1280
|
+
constructor(standardsTimeline) {
|
|
1281
|
+
super();
|
|
1282
|
+
this.standards = standardsTimeline.standards;
|
|
1283
|
+
this.timelineTimes = standardsTimeline.timelineTimes.map((b) => new UintRange(b));
|
|
1284
|
+
}
|
|
1285
|
+
static required() {
|
|
1286
|
+
return new StandardsTimeline({
|
|
1287
|
+
standards: [],
|
|
1288
|
+
timelineTimes: []
|
|
1289
|
+
});
|
|
1290
|
+
}
|
|
1291
|
+
convert(convertFunction) {
|
|
1292
|
+
return new StandardsTimeline((0, base_1.deepCopy)({
|
|
1293
|
+
standards: this.standards,
|
|
1294
|
+
timelineTimes: this.timelineTimes.map((b) => b.convert(convertFunction))
|
|
1295
|
+
}));
|
|
1296
|
+
}
|
|
1297
|
+
toProto() {
|
|
1298
|
+
return new proto.badges.StandardsTimeline(this.convert(string_numbers_1.Stringify));
|
|
1299
|
+
}
|
|
1300
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
1301
|
+
return this.convertFromProto(proto.badges.StandardsTimeline.fromJson(jsonValue, options), convertFunction);
|
|
1302
|
+
}
|
|
1303
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
1304
|
+
return this.convertFromProto(proto.badges.StandardsTimeline.fromJsonString(jsonString, options), convertFunction);
|
|
1305
|
+
}
|
|
1306
|
+
static convertFromProto(item, convertFunction) {
|
|
1307
|
+
return new StandardsTimeline({
|
|
1308
|
+
standards: item.standards,
|
|
1309
|
+
timelineTimes: item.timelineTimes.map((b) => UintRange.convertFromProto(b, convertFunction))
|
|
1310
|
+
});
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
exports.StandardsTimeline = StandardsTimeline;
|
|
1314
|
+
class IsArchivedTimeline extends base_1.BaseNumberTypeClass {
|
|
1315
|
+
isArchived;
|
|
1316
|
+
timelineTimes;
|
|
1317
|
+
constructor(isArchivedTimeline) {
|
|
1318
|
+
super();
|
|
1319
|
+
this.isArchived = isArchivedTimeline.isArchived;
|
|
1320
|
+
this.timelineTimes = isArchivedTimeline.timelineTimes.map((b) => new UintRange(b));
|
|
1321
|
+
}
|
|
1322
|
+
static required() {
|
|
1323
|
+
return new IsArchivedTimeline({
|
|
1324
|
+
isArchived: false,
|
|
1325
|
+
timelineTimes: []
|
|
1326
|
+
});
|
|
1327
|
+
}
|
|
1328
|
+
convert(convertFunction) {
|
|
1329
|
+
return new IsArchivedTimeline((0, base_1.deepCopy)({
|
|
1330
|
+
isArchived: this.isArchived,
|
|
1331
|
+
timelineTimes: this.timelineTimes.map((b) => b.convert(convertFunction))
|
|
1332
|
+
}));
|
|
1333
|
+
}
|
|
1334
|
+
toProto() {
|
|
1335
|
+
return new proto.badges.IsArchivedTimeline(this.convert(string_numbers_1.Stringify));
|
|
1336
|
+
}
|
|
1337
|
+
static fromJson(jsonValue, convertFunction, options) {
|
|
1338
|
+
return this.convertFromProto(proto.badges.IsArchivedTimeline.fromJson(jsonValue, options), convertFunction);
|
|
1339
|
+
}
|
|
1340
|
+
static fromJsonString(jsonString, convertFunction, options) {
|
|
1341
|
+
return this.convertFromProto(proto.badges.IsArchivedTimeline.fromJsonString(jsonString, options), convertFunction);
|
|
1342
|
+
}
|
|
1343
|
+
static convertFromProto(item, convertFunction) {
|
|
1344
|
+
return new IsArchivedTimeline({
|
|
1345
|
+
isArchived: item.isArchived,
|
|
1346
|
+
timelineTimes: item.timelineTimes.map((b) => UintRange.convertFromProto(b, convertFunction))
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
exports.IsArchivedTimeline = IsArchivedTimeline;
|
|
1351
|
+
exports.AllDefaultValues = {
|
|
1352
|
+
permanentlyPermittedTimes: [],
|
|
1353
|
+
permanentlyForbiddenTimes: [],
|
|
1354
|
+
badgeIds: [],
|
|
1355
|
+
timelineTimes: [],
|
|
1356
|
+
transferTimes: [],
|
|
1357
|
+
ownershipTimes: [],
|
|
1358
|
+
fromList: AddressList.AllAddresses(),
|
|
1359
|
+
toList: AddressList.AllAddresses(),
|
|
1360
|
+
initiatedByList: AddressList.AllAddresses(),
|
|
1361
|
+
approvalIdList: AddressList.AllAddresses(),
|
|
1362
|
+
amountTrackerIdList: AddressList.AllAddresses(),
|
|
1363
|
+
challengeTrackerIdList: AddressList.AllAddresses(),
|
|
1364
|
+
usesAmountTrackerIdList: false,
|
|
1365
|
+
usesChallengeTrackerIdList: false,
|
|
1366
|
+
usesApprovalIdList: false,
|
|
1367
|
+
usesBadgeIds: false,
|
|
1368
|
+
usesTimelineTimes: false,
|
|
1369
|
+
usesTransferTimes: false,
|
|
1370
|
+
usesToList: false,
|
|
1371
|
+
usesFromList: false,
|
|
1372
|
+
usesInitiatedByList: false,
|
|
1373
|
+
usesOwnershipTimes: false,
|
|
1374
|
+
arbitraryValue: undefined,
|
|
1375
|
+
};
|
|
1376
|
+
//# sourceMappingURL=typeUtils.js.map
|