diff --git a/db/migrations/12_add_new_8_chain_events.sql b/db/migrations/12_add_new_8_chain_events.sql new file mode 100644 index 0000000..50ab412 --- /dev/null +++ b/db/migrations/12_add_new_8_chain_events.sql @@ -0,0 +1,50 @@ +alter type "7a0b4cc03e" add value if not exists 'beefy' after 'validators'; +alter type "7a0b4cc03e" add value if not exists 'revive' after 'beefy'; + +alter type "0bf3c7d4ef" add value if not exists 'self_register_did' after 'unlink_child_identity'; +alter type "0bf3c7d4ef" add value if not exists 'remove_key' after 'sudo_as'; +alter type "0bf3c7d4ef" add value if not exists 'set_mandatory_receiver_affirmation' after 'lock_instruction'; +alter type "0bf3c7d4ef" add value if not exists 'transfer_funds' after 'set_mandatory_receiver_affirmation'; +alter type "0bf3c7d4ef" add value if not exists 'unlock_instruction' after 'transfer_funds'; +alter type "0bf3c7d4ef" add value if not exists 'approve_subsidy' after 'decrease_polyx_limit'; +alter type "0bf3c7d4ef" add value if not exists 'revoke_subsidy' after 'approve_subsidy'; +alter type "0bf3c7d4ef" add value if not exists 'accept_subsidy' after 'revoke_subsidy'; +alter type "0bf3c7d4ef" add value if not exists 'remove_subsidy' after 'accept_subsidy'; +alter type "0bf3c7d4ef" add value if not exists 'report_double_voting' after 'redeem_nft'; +alter type "0bf3c7d4ef" add value if not exists 'report_double_voting_unsigned' after 'redeem_nft'; +alter type "0bf3c7d4ef" add value if not exists 'set_new_genesis' after 'redeem_nft'; +alter type "0bf3c7d4ef" add value if not exists 'report_fork_voting' after 'sumbit_unsigned'; +alter type "0bf3c7d4ef" add value if not exists 'report_fork_voting_unsigned' after 'report_fork_voting'; +alter type "0bf3c7d4ef" add value if not exists 'report_future_block_voting' after 'report_fork_voting_unsigned'; +alter type "0bf3c7d4ef" add value if not exists 'report_future_block_voting_unsigned' after 'report_future_block_voting'; +alter type "0bf3c7d4ef" add value if not exists 'eth_transact' after 'report_future_block_voting_unsigned'; +alter type "0bf3c7d4ef" add value if not exists 'eth_instantiate_with_code' after 'eth_transact'; +alter type "0bf3c7d4ef" add value if not exists 'eth_call' after 'eth_instantiate_with_code'; +alter type "0bf3c7d4ef" add value if not exists 'eth_substrate_call' after 'eth_call'; +alter type "0bf3c7d4ef" add value if not exists 'map_account' after 'eth_substrate_call'; +alter type "0bf3c7d4ef" add value if not exists 'unmap_account' after 'map_account'; +alter type "0bf3c7d4ef" add value if not exists 'dispatch_as_fallback_account' after 'unmap_account'; + + +alter type "8f5a39c8ee" add value if not exists 'BurnedDebt' after 'Withdraw'; +alter type "8f5a39c8ee" add value if not exists 'BurnedHeld' after 'BurnedDebt'; +alter type "8f5a39c8ee" add value if not exists 'Held' after 'BurnedHeld'; +alter type "8f5a39c8ee" add value if not exists 'MintedCredit' after 'Held'; +alter type "8f5a39c8ee" add value if not exists 'Released' after 'MintedCredit'; +alter type "8f5a39c8ee" add value if not exists 'TransferAndHold' after 'Released'; +alter type "8f5a39c8ee" add value if not exists 'TransferOnHold' after 'TransferAndHold'; +alter type "8f5a39c8ee" add value if not exists 'Unexpected' after 'TransferOnHold'; +alter type "8f5a39c8ee" add value if not exists 'RootsPruned' after 'Slashed'; +alter type "8f5a39c8ee" add value if not exists 'RootStored' after 'RootsPruned'; +alter type "8f5a39c8ee" add value if not exists 'NFTHoldingsUpdated' after 'NFTPortfolioUpdated'; +alter type "8f5a39c8ee" add value if not exists 'NewQueued' after 'ValidatorReenabled'; +alter type "8f5a39c8ee" add value if not exists 'KeyRemoved' after 'KeyChanged'; +alter type "8f5a39c8ee" add value if not exists 'InstructionUnlocked' after 'VenueSignersUpdated'; +alter type "8f5a39c8ee" add value if not exists 'MandatoryReceiverAffirmationSet' after 'InstructionUnlocked'; +alter type "8f5a39c8ee" add value if not exists 'AcceptedSubsidy' after 'UpdatedPolyxLimit'; +alter type "8f5a39c8ee" add value if not exists 'ApprovedSubsidy' after 'AcceptedSubsidy'; +alter type "8f5a39c8ee" add value if not exists 'RemovedPendingSubsidy' after 'ApprovedSubsidy'; +alter type "8f5a39c8ee" add value if not exists 'RemovedSubsidy' after 'RemovedPendingSubsidy'; +alter type "8f5a39c8ee" add value if not exists 'SubsidyDebited' after 'RemovedSubsidy'; +alter type "8f5a39c8ee" add value if not exists 'EthExtrinsicRevert' after 'RootStored'; + diff --git a/docker-compose.yml b/docker-compose.yml index 10f94a7..5ad99bc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,7 +38,7 @@ services: NETWORK_HTTP_ENDPOINT: 'http://host.docker.internal:9933' # Staging # NETWORK_ENDPOINT: wss://staging-rpc.polymesh.dev/ - # NETWORK_CHAIN_ID: '0x3c3183f6d701500766ff7d147b79c4f10014a095eaaa98e960dcef6b3ead50ee' + # NETWORK_CHAIN_ID: '0xd12a4b22b06f4eabaef920226b2dfb0fa9a5b99d4f2b1e72729da97e07dd374d' # NETWORK_DICTIONARY: https://subql-dictionary.polymesh.dev # Testnet # NETWORK_ENDPOINT: wss://testnet-rpc.polymesh.live diff --git a/package.json b/package.json index aa08b4b..fb2ab55 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "scripts": { "build": "subql build", "sql": "ts-node scripts/run-sql.ts", + "run:dev": "subql-node -f=./ --batch-size=50", "migrations": "ts-node scripts/run-migrations.ts", "prepack": "rm -rf dist && yarn build", "prepare": "husky install", @@ -36,7 +37,7 @@ "@polkadot/api": "^16.5.2", "@polkadot/types-support": "^16.5.2", "@polymeshassociation/polymesh-types": "^7.2.0", - "@subql/cli": "^6.6.0", + "@subql/cli": "^6.6.3", "@subql/types": "^3.15.0", "@subql/types-core": "^2.2.0", "bignumber.js": "^9.0.2", diff --git a/project.ts b/project.ts index 2e40790..859f136 100644 --- a/project.ts +++ b/project.ts @@ -216,7 +216,8 @@ const filters = { ProposalFailedToExecute: [], }, nft: { - NFTPortfolioUpdated: ['handleNftPortfolioUpdates'], + NFTPortfolioUpdated: ['handleNftHoldingsUpdates'], + NFTHoldingsUpdated: ['handleNftHoldingsUpdates'], NftCollectionCreated: ['handleNftCollectionCreated'], }, pips: { diff --git a/schema.graphql b/schema.graphql index f2b5705..fe1d7b4 100644 --- a/schema.graphql +++ b/schema.graphql @@ -58,6 +58,8 @@ enum ModuleIdEnum { statetriemigration electionprovidermultiphase validators + beefy + revive ## deprecated ## confidential @deprecated @@ -125,6 +127,14 @@ enum EventIdEnum { Unlocked Upgraded Withdraw + BurnedDebt + BurnedHeld + Held + MintedCredit + Released + TransferAndHold + TransferOnHold + Unexpected ## transactionpayment ## @@ -144,11 +154,15 @@ enum EventIdEnum { AuthorizationRejected AuthorizationConsumed AuthorizationRetryLimitReached + "`CddRequirementForPrimaryKeyUpdated` has been deprecated from 8.0.0 chain version" CddRequirementForPrimaryKeyUpdated + "`CddClaimsInvalidated` has been deprecated from 8.0.0 chain version" CddClaimsInvalidated SecondaryKeysFrozen SecondaryKeysUnfrozen + "`ChildDidCreated` has been deprecated from 8.0.0 chain version" ChildDidCreated + "`ChildDidUnlinked` has been deprecated from 8.0.0 chain version" ChildDidUnlinked ## cddserviceproviders ## @@ -172,13 +186,14 @@ enum EventIdEnum { ExpiresAfterUpdated VoteThresholdUpdated - ## committeemembership ## + ## didRegistrars ## MemberAdded MemberRemoved MemberRevoked MembersSwapped MembersReset ActiveLimitChanged + "`Dummy` has been deprecated from 8.0.0 chain version" Dummy ## technicalcommittee ## @@ -332,6 +347,7 @@ enum EventIdEnum { NewSession ValidatorDisabled ValidatorReenabled + NewQueued ## authoritydiscovery ## @@ -352,6 +368,7 @@ enum EventIdEnum { ## sudo ## Sudid KeyChanged + KeyRemoved SudoAsDone ## asset ## @@ -526,10 +543,14 @@ enum EventIdEnum { InstructionFailed InstructionExecuted VenueUnauthorized + "`SchedulingFailed` has been deprecated from 8.0.0 chain version" SchedulingFailed SettlementManuallyExecuted + "`InstructionRescheduled` has been deprecated from 8.0.0 chain version" InstructionRescheduled VenueSignersUpdated + InstructionUnlocked + MandatoryReceiverAffirmationSet RemoveAssetAffirmationExemption AssetAffirmationExemption @@ -587,6 +608,7 @@ enum EventIdEnum { RelayedTx ## base ## + "`UnexpectedError` has been deprecated from 8.0.0 chain version" UnexpectedError ## externalagents ## @@ -601,6 +623,11 @@ enum EventIdEnum { AcceptedPayingKey RemovedPayingKey UpdatedPolyxLimit + AcceptedSubsidy + ApprovedSubsidy + RemovedPendingSubsidy + RemovedSubsidy + SubsidyDebited ## rewards ## ItnRewardClaimed @@ -637,7 +664,9 @@ enum EventIdEnum { NftCollectionCreated "`RedeemedNFT` has been deprecated from 6.0.0 chain version" RedeemedNFT + "`NFTPortfolioUpdated` has been renamed as `NFTHoldingsUpdated` from 8.0.0 chain version" NFTPortfolioUpdated + NFTHoldingsUpdated ## confidential assets ## AccountCreated @@ -664,8 +693,17 @@ enum EventIdEnum { Slashed # SolutionStored -> defined before in staking + ## historical ## + RootsPruned + RootStored + + ## revive ## + # ContractEmitted (already defined in contracts) + EthExtrinsicRevert + # Instantiated (already defined in contracts) + ## deprecated ## - Approval @deprecated + Approval AssetPurchased @deprecated AssetRuleChanged @deprecated AssetRuleRemoved @deprecated @@ -840,6 +878,7 @@ enum CallIdEnum { create_child_identities create_child_identity unlink_child_identity + self_register_did ## cddserviceproviders ## set_active_members_limit @@ -1066,6 +1105,7 @@ enum CallIdEnum { sudo_unchecked_weight set_key sudo_as + remove_key ## asset ## "`register_ticker` has been renamed to `register_unique_ticker` from 7.0.0 chain version" @@ -1285,6 +1325,9 @@ enum CallIdEnum { reject_instruction_as_mediator add_and_affirm_with_mediators lock_instruction + set_mandatory_receiver_affirmation + transfer_funds + unlock_instruction ## statistics ## set_active_asset_stats @@ -1339,6 +1382,10 @@ enum CallIdEnum { update_polyx_limit increase_polyx_limit decrease_polyx_limit + approve_subsidy + revoke_subsidy + accept_subsidy + remove_subsidy ## rewards ## claim_itn_reward @@ -1384,6 +1431,7 @@ enum CallIdEnum { create_nft_collection issue_nft redeem_nft + transfer_nft ## confidential assets ## add_mediator_account @@ -1433,6 +1481,30 @@ enum CallIdEnum { # set_commission_cap (already was defined in staking) # update_permissioned_validator_intended_count (already was defined in staking) + ### beefy ### + report_double_voting + report_double_voting_unsigned + set_new_genesis + report_fork_voting + report_fork_voting_unsigned + report_future_block_voting + report_future_block_voting_unsigned + + ### revive ### + eth_transact + # call (already defined in contracts) + # instantiate (already defined in contracts) + # instantiate_with_code (already defined in contracts) + eth_instantiate_with_code + eth_call + eth_substrate_call + # upload_code (already defined in contracts) + # remove_code (already defined in contracts) + # set_code (already defined in contracts) + map_account + unmap_account + dispatch_as_fallback_account + ## deprecated ## accept_authorization @deprecated accept_master_key @deprecated @@ -2084,7 +2156,7 @@ type Leg @entity { fromAccount: String "`fromPortfolio` is null for off chain legs" fromPortfolio: Int - to: String! @index(unique: false) + to: String @index(unique: false) toAccount: String "`toPortfolio` is null for off chain legs" toPortfolio: Int @@ -2133,7 +2205,7 @@ type InstructionAffirmation @entity { id: ID! instruction: Instruction! @index(unique: false) party: InstructionParty! - identity: String! @index(unique: false) + identity: String @index(unique: false) account: String "`portfolio` will be null for mediator affirmation and off chain affirmation" portfolios: [Int] @@ -2505,7 +2577,7 @@ Represents how much of a given Asset an Identity owns """ type AssetHolder @entity { id: ID! # assetId/did - identity: Identity! @index(unique: false) + identity: Identity @index(unique: false) asset: Asset! @index(unique: false) amount: BigInt! createdBlock: Block! @@ -2517,7 +2589,7 @@ Represents what NFTs of a collection an Identity owns """ type NftHolder @entity { id: ID! #assetId/did - identity: Identity! @index(unique: false) + identity: Identity @index(unique: false) asset: Asset! @index(unique: false) nftIds: [Int] createdBlock: Block! diff --git a/src/mappings/entities/assets/mapAsset.ts b/src/mappings/entities/assets/mapAsset.ts index d907e9e..0802631 100644 --- a/src/mappings/entities/assets/mapAsset.ts +++ b/src/mappings/entities/assets/mapAsset.ts @@ -17,6 +17,7 @@ import { camelToSnakeCase, coerceHexToString, emptyDid, + extractAssetHolder, getAssetId, getAssetType, getBigIntValue, @@ -25,7 +26,6 @@ import { getFirstKeyFromJson, getFirstValueFromJson, getNumberValue, - getPortfolioIdOrAccount, getSecurityIdentifiers, getStringArrayValue, getTextValue, @@ -413,7 +413,7 @@ export const handleAssetOwnershipTransferred = async (event: SubstrateEvent): Pr export const handleAssetTransfer = async (event: SubstrateEvent): Promise => { const { params, blockId, block, eventIdx, extrinsic, blockEventId } = extractArgs(event); - const [, rawAssetId, rawFromPortfolio, rawToPortfolio, rawAmount] = params; + const [, rawAssetId, rawFromHolder, rawToHolder, rawAmount] = params; const assetId = await getAssetId(rawAssetId, block); const transferAmount = getBigIntValue(rawAmount); @@ -421,12 +421,12 @@ export const handleAssetTransfer = async (event: SubstrateEvent): Promise account: fromAccount, portfolioId: fromPortfolioId, identityId: fromDid, - } = getPortfolioIdOrAccount(rawFromPortfolio); + } = await extractAssetHolder(rawFromHolder, block); const { account: toAccount, portfolioId: toPortfolioIdValue, identityId: toDid, - } = getPortfolioIdOrAccount(rawToPortfolio); + } = await extractAssetHolder(rawToHolder, block); let toPortfolioId = toPortfolioIdValue; const promises = []; @@ -496,7 +496,7 @@ export const handleAssetTransfer = async (event: SubstrateEvent): Promise export const handleAssetBalanceUpdated = async (event: SubstrateEvent): Promise => { const { params, blockId, eventIdx, block, extrinsic, blockEventId } = extractArgs(event); - const [, rawAssetId, rawAmount, rawFromPortfolio, rawToPortfolio, rawUpdateReason] = params; + const [, rawAssetId, rawAmount, rawFromHolder, rawToHolder, rawUpdateReason] = params; let fromDid: string, toDid: string, fromAccount: string, toAccount: string; @@ -513,30 +513,34 @@ export const handleAssetBalanceUpdated = async (event: SubstrateEvent): Promise< const transferAmount = getBigIntValue(rawAmount); - if (!rawFromPortfolio.isEmpty) { + if (!rawFromHolder.isEmpty) { ({ account: fromAccount, portfolioId: fromPortfolioId, identityId: fromDid, - } = getPortfolioIdOrAccount(rawFromPortfolio)); + } = await extractAssetHolder(rawFromHolder, block)); - const fromHolder = await getAssetHolder(assetId, fromDid, blockId); - fromHolder.amount = fromHolder.amount - transferAmount; - fromHolder.updatedBlockId = blockId; - promises.push(fromHolder.save()); + if (fromDid) { + const fromHolder = await getAssetHolder(assetId, fromDid, blockId); + fromHolder.amount = fromHolder.amount - transferAmount; + fromHolder.updatedBlockId = blockId; + promises.push(fromHolder.save()); + } } - if (!rawToPortfolio.isEmpty) { + if (!rawToHolder.isEmpty) { ({ account: toAccount, portfolioId: toPortfolioId, identityId: toDid, - } = getPortfolioIdOrAccount(rawToPortfolio)); + } = await extractAssetHolder(rawToHolder, block)); - const toHolder = await getAssetHolder(assetId, toDid, blockId); - toHolder.amount = toHolder.amount + transferAmount; - toHolder.updatedBlockId = blockId; - promises.push(toHolder.save()); + if (toDid) { + const toHolder = await getAssetHolder(assetId, toDid, blockId); + toHolder.amount = toHolder.amount + transferAmount; + toHolder.updatedBlockId = blockId; + promises.push(toHolder.save()); + } } const updateReason = getFirstKeyFromJson(rawUpdateReason); diff --git a/src/mappings/entities/assets/mapNfts.ts b/src/mappings/entities/assets/mapNfts.ts index 99e959d..414cdf4 100644 --- a/src/mappings/entities/assets/mapNfts.ts +++ b/src/mappings/entities/assets/mapNfts.ts @@ -3,11 +3,11 @@ import { SubstrateEvent } from '@subql/types'; import { EventIdEnum, NftHolder } from '../../../types'; import { bytesToString, + extractAssetHolder, getAssetId, getFirstKeyFromJson, getFirstValueFromJson, getNftId, - getPortfolioIdOrAccount, getTextValue, } from '../../../utils'; import { extractArgs, getAsset } from './../common'; @@ -48,27 +48,27 @@ export const handleNftCollectionCreated = async (event: SubstrateEvent): Promise return asset.save(); }; -export const handleNftPortfolioUpdates = async (event: SubstrateEvent): Promise => { +export const handleNftHoldingsUpdates = async (event: SubstrateEvent): Promise => { const { params, blockId, eventIdx, block, extrinsic, blockEventId } = extractArgs(event); - const [rawId, rawNftId, rawFromPortfolio, rawToPortfolio, rawUpdateReason] = params; + const [rawId, rawNftId, rawFromHolder, rawToHolder, rawUpdateReason] = params; let fromDid, fromPortfolioId; let fromAccount: string; - if (!rawFromPortfolio.isEmpty) { + if (!rawFromHolder.isEmpty) { ({ account: fromAccount, portfolioId: fromPortfolioId, identityId: fromDid, - } = getPortfolioIdOrAccount(rawFromPortfolio)); + } = await extractAssetHolder(rawFromHolder, block)); } let toDid, toPortfolioId; let toAccount: string; - if (!rawToPortfolio.isEmpty) { + if (!rawToHolder.isEmpty) { ({ account: toAccount, portfolioId: toPortfolioId, identityId: toDid, - } = getPortfolioIdOrAccount(rawToPortfolio)); + } = await extractAssetHolder(rawToHolder, block)); } const promises = []; @@ -84,7 +84,6 @@ export const handleNftPortfolioUpdates = async (event: SubstrateEvent): Promise< let instructionId: string; let instructionMemo: string; - let eventId: EventIdEnum; if (reason === 'issued') { eventId = EventIdEnum.IssuedNFT; diff --git a/src/mappings/entities/identities/mapIdentities.ts b/src/mappings/entities/identities/mapIdentities.ts index f34ca05..cf0b34e 100644 --- a/src/mappings/entities/identities/mapIdentities.ts +++ b/src/mappings/entities/identities/mapIdentities.ts @@ -275,8 +275,8 @@ const getPermissions = (accountPermissions: Record): Permission type, values: portfolioPermissions[type]?.map(meshPortfolio => { const data = meshPortfolioToPortfolioOrAccount(meshPortfolio); - if ('accountId' in data) { - return { did: data.identityId, accountId: data.accountId }; + if ('account' in data) { + return { did: data.identityId, account: data.account }; } return { did: data.identityId, number: data.number }; }), @@ -447,10 +447,7 @@ export const handleSecondaryKeysAdded = async (event: SubstrateEvent): Promise => { return instruction; }; -const getPartyId = (instructionId: string, did: string, isMediator: boolean) => - `${instructionId}/${did}/${isMediator}`; +const getPartyId = (instructionId: string, did: string, account: string, isMediator: boolean) => + `${instructionId}/${account ?? did}/${isMediator}`; const createInstructionParty = async ( instructionId: string, @@ -139,7 +139,7 @@ const createInstructionParty = async ( ): Promise => { const promises = Object.keys(parties).map(did => InstructionParty.create({ - id: getPartyId(instructionId, did, isMediator), + id: getPartyId(instructionId, did, undefined, isMediator), instructionId, isMediator, identity: did, @@ -154,13 +154,14 @@ const createInstructionParty = async ( const mapAutomaticAffirmation = async ( params: Codec[], + block: SubstrateBlock, blockId: string, eventIndex: number, blockEventId: string ): Promise<[InstructionEvent, InstructionAffirmation]> => { - const [, rawPortfolio, rawInstructionId] = params; + const [, rawHolder, rawInstructionId] = params; const instructionId = processInstructionId(rawInstructionId); - const { identity, account, portfolio } = getPortfolioOrAccount(rawPortfolio); + const { identity, account, portfolio } = await getPortfolioOrAccount(rawHolder, block); const automaticAffirmationEvent = InstructionEvent.create({ id: blockEventId, @@ -175,7 +176,7 @@ const mapAutomaticAffirmation = async ( createdEventId: blockEventId, }); - const partyId = getPartyId(instructionId, identity, false); + const partyId = getPartyId(instructionId, identity, account, false); const affirmation = await InstructionAffirmation.get(partyId); @@ -266,16 +267,24 @@ export const handleInstructionCreated = async (event: SubstrateEvent): Promise { - const addParty = (did: string, portfolio: number): void => { - if (portfolio !== undefined) { - parties[did] = [...(parties[did] || []), portfolio]; - } else { + const addParty = (did: string, portfolio?: number): void => { + if (portfolio === undefined) { parties[did] = undefined; + } else { + parties[did] = [...(parties[did] || []), portfolio]; } }; - addParty(leg.from, leg.fromPortfolio); - addParty(leg.to, leg.toPortfolio); + if (leg.fromAccount) { + addParty(leg.fromAccount); + } else { + addParty(leg.from, leg.fromPortfolio); + } + if (leg.toAccount) { + addParty(leg.toAccount); + } else { + addParty(leg.to, leg.toPortfolio); + } }); const instructionCreatedEvent = InstructionEvent.create({ @@ -310,12 +319,12 @@ export const handleInstructionCreated = async (event: SubstrateEvent): Promise => { - const { params, extrinsic, eventIdx, blockId, blockEventId } = extractArgs(event); + const { params, extrinsic, eventIdx, blockId, block, blockEventId } = extractArgs(event); const address = getSignerAddress(extrinsic); const [, rawPortfolio, rawInstructionId] = params; const instructionId = processInstructionId(rawInstructionId); - const { identity, account, portfolio } = getPortfolioOrAccount(rawPortfolio); + const { identity, account, portfolio } = await getPortfolioOrAccount(rawPortfolio, block); - const partyId = getPartyId(instructionId, identity, false); + const partyId = getPartyId(instructionId, identity, account, false); let affirmation = await InstructionAffirmation.get(partyId); @@ -387,14 +396,14 @@ export const handleInstructionUpdate = async (event: SubstrateEvent): Promise => { - const { params, eventIdx, blockId, blockEventId } = extractArgs(event); + const { params, eventIdx, blockId, block, blockEventId } = extractArgs(event); const [, rawPortfolio, rawInstructionId] = params; const instructionId = processInstructionId(rawInstructionId); - const { identity, account, portfolio } = getPortfolioOrAccount(rawPortfolio); + const { identity, account, portfolio } = await getPortfolioOrAccount(rawPortfolio, block); - const partyId = getPartyId(instructionId, identity, false); + const partyId = getPartyId(instructionId, identity, account, false); const affirmation = await InstructionAffirmation.get(partyId); const promises = [ @@ -434,6 +443,7 @@ export const handleAffirmationWithdrawn = async (event: SubstrateEvent): Promise export const handleAutomaticAffirmation = async (event: SubstrateEvent): Promise => { const { params, + block, blockId, block: { specVersion }, eventIdx, @@ -449,6 +459,7 @@ export const handleAutomaticAffirmation = async (event: SubstrateEvent): Promise if (specVersion >= 6003001 || specName === 'polymesh_private_dev') { const [instructionEvent, instructionAffirmation] = await mapAutomaticAffirmation( params, + block, blockId, eventIdx, blockEventId @@ -474,7 +485,7 @@ export const handleInstructionRejected = async (event: SubstrateEvent): Promise< const isMediator = instruction.mediators.includes(identityId); - const partyId = getPartyId(instructionId, identityId, isMediator); + const partyId = getPartyId(instructionId, identityId, undefined, isMediator); const rejection = InstructionAffirmation.create({ id: partyId, @@ -595,7 +606,7 @@ export const handleMediatorAffirmationReceived = async (event: SubstrateEvent): const instructionId = processInstructionId(rawInstructionId); const expiry = getDateValue(expiryOpt); - const partyId = getPartyId(instructionId, identityId, true); + const partyId = getPartyId(instructionId, identityId, undefined, true); const mediatorAffirmation = InstructionAffirmation.create({ id: partyId, instructionId, @@ -641,7 +652,7 @@ export const handleMediatorAffirmationWithdrawn = async (event: SubstrateEvent): }); await Promise.all([ - InstructionAffirmation.remove(getPartyId(instructionId, identityId, true)), + InstructionAffirmation.remove(getPartyId(instructionId, identityId, undefined, true)), affirmationWithdrawnEvent.save(), ]); }; @@ -707,7 +718,7 @@ export const handleReceiptClaimed = async (event: SubstrateEvent): Promise updatedBlockId: blockId, }); - const partyId = getPartyId(instructionId, identityId, false); + const partyId = getPartyId(instructionId, identityId, undefined, false); const affirmation = InstructionAffirmation.create({ id: `${partyId}/${signer}/${uid}`, diff --git a/src/utils/assets.ts b/src/utils/assets.ts index 3029bc8..8dbce4e 100644 --- a/src/utils/assets.ts +++ b/src/utils/assets.ts @@ -10,9 +10,14 @@ import { getTextValue, hexToString, is7xChain, + is8xChain, serializeTicker, } from './common'; -import { getPortfolioOrAccountValue } from './portfolios'; +import { + getPortfolioOrAccountValue, + meshAssetHolderToPortfolioOrAccount, + PortfolioOrAccount, +} from './portfolios'; export interface AssetIdWithTicker { assetId: string; @@ -156,19 +161,35 @@ export const getAssetIdWithTicker = async ( }; }; -export const getPortfolioIdOrAccount = ( - item: Codec -): { identityId: string; account?: string; portfolioId?: string } => { - const data = getPortfolioOrAccountValue(item); - +const extractPortfolioOrAccount = (data: PortfolioOrAccount) => { let portfolioId: string | undefined; let account: string | undefined; let identityId: string; - if ('accountId' in data) { - ({ accountId: account, identityId } = data); + if ('account' in data) { + ({ account, identityId } = data); } else { ({ identityId } = data); portfolioId = `${data.identityId}/${data.number}`; } return { account, portfolioId, identityId }; }; + +export const getPortfolioIdOrAccount = ( + item: Codec +): { identityId?: string; account?: string; portfolioId?: string } => { + const data = getPortfolioOrAccountValue(item); + return extractPortfolioOrAccount(data); +}; + +export const extractAssetHolder = async ( + item: Codec, + block: SubstrateBlock +): Promise<{ identityId?: string; account?: string; portfolioId?: string }> => { + if (is8xChain(block)) { + const meshAssetHolder = JSON.parse(item.toString()); + const data = await meshAssetHolderToPortfolioOrAccount(meshAssetHolder); + return extractPortfolioOrAccount(data); + } + + return getPortfolioIdOrAccount(item); +}; diff --git a/src/utils/distributions.ts b/src/utils/distributions.ts index 16e5115..c454f5f 100644 --- a/src/utils/distributions.ts +++ b/src/utils/distributions.ts @@ -15,7 +15,7 @@ export const getDistributionValue = async ( const { from, currency, amount, remaining, ...rest } = JSON.parse(item.toString()); const fromData = meshPortfolioToPortfolioOrAccount(from); - if ('accountId' in fromData) { + if ('account' in fromData) { return null; } diff --git a/src/utils/portfolios.ts b/src/utils/portfolios.ts index 3c92b3a..cc7c6b2 100644 --- a/src/utils/portfolios.ts +++ b/src/utils/portfolios.ts @@ -1,11 +1,12 @@ import { Codec } from '@polkadot/types/types'; import { SubstrateBlock } from '@subql/types'; -import { Distribution, Portfolio } from '../types'; +import { Account, Distribution, Portfolio } from '../types'; import { getAssetId } from './assets'; -import { extractNumber } from './common'; +import { extractNumber, is8xChain } from './common'; -export type PortfolioOrAccount = Pick & - (Pick | { accountId: string }); +export type PortfolioOrAccount = + | { account: string; identityId?: string } + | { identityId: string; number: number }; export interface MeshPortfolio { did: string; kind: @@ -16,6 +17,8 @@ export interface MeshPortfolio { | { accountId: string }; } +export type MeshAssetHolder = { account: string } | { portfolio: MeshPortfolio }; + export const meshPortfolioToPortfolioOrAccount = ( meshPortfolio: MeshPortfolio ): PortfolioOrAccount => { @@ -23,7 +26,7 @@ export const meshPortfolioToPortfolioOrAccount = ( if ('accountId' in meshPortfolio.kind) { return { identityId: meshPortfolio.did, - accountId: meshPortfolio.kind.accountId, + account: meshPortfolio.kind.accountId, }; } if ('user' in meshPortfolio.kind) { @@ -40,6 +43,36 @@ export const getPortfolioOrAccountValue = (item: Codec): PortfolioOrAccount => { return meshPortfolioToPortfolioOrAccount(meshPortfolio); }; +export const meshAssetHolderToPortfolioOrAccount = async ( + meshAssetHolder: MeshAssetHolder +): Promise => { + if ('account' in meshAssetHolder) { + const account = await Account.get(meshAssetHolder.account); + if (account) { + return { identityId: account.identityId, account: meshAssetHolder.account }; + } + return { account: meshAssetHolder.account }; + } + + const { did, kind } = meshAssetHolder.portfolio; + + let number = 0; + if ('user' in kind) { + number = kind.user; + } + return { identityId: did, number }; +}; + +export const extractAccountOrPortfolio = async ( + value: MeshAssetHolder | MeshPortfolio, + block: SubstrateBlock +): Promise => { + if (is8xChain(block)) { + return await meshAssetHolderToPortfolioOrAccount(value as MeshAssetHolder); + } + return meshPortfolioToPortfolioOrAccount(value as MeshPortfolio); +}; + export const getPortfolioId = ({ identityId, number, diff --git a/src/utils/settlements.ts b/src/utils/settlements.ts index 7e638a6..65c6196 100644 --- a/src/utils/settlements.ts +++ b/src/utils/settlements.ts @@ -14,7 +14,7 @@ import { } from '../utils'; import { Leg } from './../types'; import { InstructionTypeEnum } from './../types/enums'; -import { getPortfolioOrAccountValue, meshPortfolioToPortfolioOrAccount } from './portfolios'; +import { extractAccountOrPortfolio, meshPortfolioToPortfolioOrAccount } from './portfolios'; export type LegDetails = Omit, 'instructionId' | 'addresses'>; @@ -37,13 +37,13 @@ export const getLegsValue = async (item: Codec, block: SubstrateBlock): Promise< let from: string, to: string; // for dids let fromPortfolio: number | undefined, toPortfolio: number | undefined; - if ('accountId' in fromData) { - ({ accountId: fromAccount, identityId: from } = fromData); + if ('account' in fromData) { + ({ account: fromAccount, identityId: from } = fromData); } else { ({ identityId: from, number: fromPortfolio } = fromData); } - if ('accountId' in toData) { - ({ accountId: toAccount, identityId: to } = toData); + if ('account' in toData) { + ({ account: toAccount, identityId: to } = toData); } else { ({ identityId: to, number: toPortfolio } = toData); } @@ -91,20 +91,20 @@ const processOnChainLeg = async ( legIndex: number, block: SubstrateBlock ): Promise => { - const fromData = meshPortfolioToPortfolioOrAccount(legValue.sender); - const toData = meshPortfolioToPortfolioOrAccount(legValue.receiver); + const fromData = await extractAccountOrPortfolio(legValue.sender, block); + const toData = await extractAccountOrPortfolio(legValue.receiver, block); let from: string, to: string; let fromAccount: string | undefined, toAccount: string | undefined; let fromPortfolio: number | undefined, toPortfolio: number | undefined; - if ('accountId' in fromData) { - ({ accountId: fromAccount, identityId: from } = fromData); + if ('account' in fromData) { + ({ account: fromAccount, identityId: from } = fromData); } else { ({ identityId: from, number: fromPortfolio } = fromData); } - if ('accountId' in toData) { - ({ accountId: toAccount, identityId: to } = toData); + if ('account' in toData) { + ({ account: toAccount, identityId: to } = toData); } else { ({ identityId: to, number: toPortfolio } = toData); } @@ -197,15 +197,17 @@ export const getSettlementTypeDetails = ( }; }; -export const getPortfolioOrAccount = ( - rawPortfolio: Codec -): { identity: string; account?: string; portfolio?: number } => { - const data = getPortfolioOrAccountValue(rawPortfolio); +export const getPortfolioOrAccount = async ( + rawItem: Codec, + block: SubstrateBlock +): Promise<{ identity: string; account?: string; portfolio?: number }> => { + const item = JSON.parse(rawItem.toString()); + const data = await extractAccountOrPortfolio(item, block); let account: string | undefined; let portfolio: number | undefined; let identityId: string; - if ('accountId' in data) { - ({ accountId: account, identityId } = data); + if ('account' in data) { + ({ account, identityId } = data); } else { ({ identityId, number: portfolio } = data); } diff --git a/src/utils/stos.ts b/src/utils/stos.ts index 65cd523..762960e 100644 --- a/src/utils/stos.ts +++ b/src/utils/stos.ts @@ -26,7 +26,7 @@ export const getFundraiserDetails = async ( extractValue(rest, 'raising_portfolio') ); - if ('accountId' in offeringPortfolio || 'accountId' in raisingPortfolio) { + if ('account' in offeringPortfolio || 'account' in raisingPortfolio) { return null; } diff --git a/yarn.lock b/yarn.lock index ff2fac1..f3f04ae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2247,6 +2247,13 @@ __metadata: languageName: node linkType: hard +"@isaacs/cliui@npm:^9.0.0": + version: 9.0.0 + resolution: "@isaacs/cliui@npm:9.0.0" + checksum: 10c0/971063b7296419f85053dacd0a0285dcadaa3dfc139228b23e016c1a9848121ad4aa5e7fcca7522062014e1eb6239a7424188b9f2cba893a79c90aae5710319c + languageName: node + linkType: hard + "@isaacs/fs-minipass@npm:^4.0.0": version: 4.0.1 resolution: "@isaacs/fs-minipass@npm:4.0.1" @@ -2601,9 +2608,9 @@ __metadata: languageName: node linkType: hard -"@modelcontextprotocol/sdk@npm:^1.17.2": - version: 1.21.1 - resolution: "@modelcontextprotocol/sdk@npm:1.21.1" +"@modelcontextprotocol/sdk@npm:1.24.3": + version: 1.24.3 + resolution: "@modelcontextprotocol/sdk@npm:1.24.3" dependencies: ajv: "npm:^8.17.1" ajv-formats: "npm:^3.0.1" @@ -2614,16 +2621,20 @@ __metadata: eventsource-parser: "npm:^3.0.0" express: "npm:^5.0.1" express-rate-limit: "npm:^7.5.0" + jose: "npm:^6.1.1" pkce-challenge: "npm:^5.0.0" raw-body: "npm:^3.0.0" - zod: "npm:^3.23.8" - zod-to-json-schema: "npm:^3.24.1" + zod: "npm:^3.25 || ^4.0" + zod-to-json-schema: "npm:^3.25.0" peerDependencies: "@cfworker/json-schema": ^4.1.1 + zod: ^3.25 || ^4.0 peerDependenciesMeta: "@cfworker/json-schema": optional: true - checksum: 10c0/5493af701bf7131abd375c1769195220d5d9452373f9ec4ed01782e46bf5ad59537d5bf1926c813dc435a4b26bc6fa91e66c45c81eb250e3165a9bb53eba57af + zod: + optional: false + checksum: 10c0/91746ddf347d61815c09d2a09d3dc7564576b417f7349c33c672a7e3c69dcd215a52a066b02fcd9eaab1cdeab60cc827f3382b28b2ab68e7fc46d2e1f3824cad languageName: node linkType: hard @@ -3087,9 +3098,9 @@ __metadata: languageName: node linkType: hard -"@oclif/core@npm:^4.3.3": - version: 4.8.0 - resolution: "@oclif/core@npm:4.8.0" +"@oclif/core@npm:^4.8.0": + version: 4.11.0 + resolution: "@oclif/core@npm:4.11.0" dependencies: ansi-escapes: "npm:^4.3.2" ansis: "npm:^3.17.0" @@ -3101,7 +3112,7 @@ __metadata: indent-string: "npm:^4.0.0" is-wsl: "npm:^2.2.0" lilconfig: "npm:^3.1.3" - minimatch: "npm:^9.0.5" + minimatch: "npm:^10.2.5" semver: "npm:^7.7.3" string-width: "npm:^4.2.3" supports-color: "npm:^8" @@ -3109,7 +3120,7 @@ __metadata: widest-line: "npm:^3.1.0" wordwrap: "npm:^1.0.0" wrap-ansi: "npm:^7.0.0" - checksum: 10c0/83347c86250390b9c53d7eeb4f85adcc57578827b2de65be606b609290f4101f24b4245bd9c1dbeaca10a5e29c3fc68eaa3b5efa5f801d222e4f8e59691e8a86 + checksum: 10c0/ad775d4a7afab14b0ea8380773b46b074068ff1dabd1accdbbd10ad907561c41b2c48d5e8b33c9840d4de00c00e438fc8088cc37ec3faae53c8a0c3bcf0b7ffb languageName: node linkType: hard @@ -4709,15 +4720,15 @@ __metadata: languageName: node linkType: hard -"@subql/cli@npm:^6.6.0": - version: 6.6.0 - resolution: "@subql/cli@npm:6.6.0" +"@subql/cli@npm:^6.6.3": + version: 6.6.3 + resolution: "@subql/cli@npm:6.6.3" dependencies: "@apollo/client": "npm:^3.14.0" "@inquirer/prompts": "npm:^5.3.6" - "@modelcontextprotocol/sdk": "npm:^1.17.2" - "@oclif/core": "npm:^4.3.3" - "@subql/common": "npm:~5.8.2-0" + "@modelcontextprotocol/sdk": "npm:1.24.3" + "@oclif/core": "npm:^4.8.0" + "@subql/common": "npm:~5.8.2" "@subql/contract-sdk": "npm:^1.9.0" "@subql/network-clients": "npm:^1.1.0" "@subql/utils": "npm:~2.22.1" @@ -4728,7 +4739,7 @@ __metadata: dotenv: "npm:^16.4.5" ejs: "npm:^3.1.10" fuzzy: "npm:^0.1.3" - glob: "npm:^10.4" + glob: "npm:^11.1" graphql: "npm:^16.11.0" graphql-request: "npm:^7.2.0" json5: "npm:^2.2.3" @@ -4753,7 +4764,7 @@ __metadata: zod: "npm:^3.25.67" bin: subql: ./bin/run - checksum: 10c0/30479c1f8f94c92503652e38c509ea47f158a11be4968a46c2c2f87967a289573b5c948b73d77ce12e720001681b68ce0fc553d740326ca8dfccedd8c31b27ed + checksum: 10c0/62a889b15736932a65bf0100eb4f2a4570ae3c001b2dcd95ed615651269da0380cbd8916d2e8cd2aeb6360d73477b754a6b7f14d02de8efd1496f3d3783f63b0 languageName: node linkType: hard @@ -4804,9 +4815,9 @@ __metadata: languageName: node linkType: hard -"@subql/common@npm:~5.8.2-0": - version: 5.8.2-0 - resolution: "@subql/common@npm:5.8.2-0" +"@subql/common@npm:~5.8.2": + version: 5.8.2 + resolution: "@subql/common@npm:5.8.2" dependencies: "@subql/types-core": "npm:~2.2.0" axios: "npm:^1.13.1" @@ -4817,7 +4828,7 @@ __metadata: reflect-metadata: "npm:^0.2.2" semver: "npm:^7.6.3" update-notifier: "npm:^5.1.0" - checksum: 10c0/e6bd9273f5d60bbe539892808276ae8a0f79f9b677a54d78b096c2831b6763b01127c4924f73054857b21163b4383a73c55d1edeff02bbc6729195e211ba1210 + checksum: 10c0/946938419a1d76ae1bc9551d8764791718f0dcc6e0c9389f644b47e57d5b734f50ce9b20f77277403a93fd0b287cbf6a86a043c05bb26d621b974479a64a6789 languageName: node linkType: hard @@ -6900,6 +6911,13 @@ __metadata: languageName: node linkType: hard +"balanced-match@npm:^4.0.2": + version: 4.0.4 + resolution: "balanced-match@npm:4.0.4" + checksum: 10c0/07e86102a3eb2ee2a6a1a89164f29d0dbaebd28f2ca3f5ca786f36b8b23d9e417eb3be45a4acf754f837be5ac0a2317de90d3fcb7f4f4dc95720a1f36b26a17b + languageName: node + linkType: hard + "base-x@npm:^5.0.0": version: 5.0.1 resolution: "base-x@npm:5.0.1" @@ -7086,6 +7104,15 @@ __metadata: languageName: node linkType: hard +"brace-expansion@npm:^5.0.5": + version: 5.0.5 + resolution: "brace-expansion@npm:5.0.5" + dependencies: + balanced-match: "npm:^4.0.2" + checksum: 10c0/4d238e14ed4f5cc9c07285550a41cef23121ca08ba99fa9eb5b55b580dcb6bf868b8210aa10526bdc9f8dc97f33ca2a7259039c4cc131a93042beddb424c48e3 + languageName: node + linkType: hard + "braces@npm:^3.0.3": version: 3.0.3 resolution: "braces@npm:3.0.3" @@ -9877,7 +9904,7 @@ __metadata: languageName: node linkType: hard -"foreground-child@npm:^3.1.0": +"foreground-child@npm:^3.1.0, foreground-child@npm:^3.3.1": version: 3.3.1 resolution: "foreground-child@npm:3.3.1" dependencies: @@ -10242,7 +10269,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.3.7, glob@npm:^10.4, glob@npm:^10.4.5": +"glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.3.7, glob@npm:^10.4.5": version: 10.4.5 resolution: "glob@npm:10.4.5" dependencies: @@ -10258,6 +10285,22 @@ __metadata: languageName: node linkType: hard +"glob@npm:^11.1": + version: 11.1.0 + resolution: "glob@npm:11.1.0" + dependencies: + foreground-child: "npm:^3.3.1" + jackspeak: "npm:^4.1.1" + minimatch: "npm:^10.1.1" + minipass: "npm:^7.1.2" + package-json-from-dist: "npm:^1.0.0" + path-scurry: "npm:^2.0.0" + bin: + glob: dist/esm/bin.mjs + checksum: 10c0/1ceae07f23e316a6fa74581d9a74be6e8c2e590d2f7205034dd5c0435c53f5f7b712c2be00c3b65bf0a49294a1c6f4b98cd84c7637e29453b5aa13b79f1763a2 + languageName: node + linkType: hard + "glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4": version: 7.2.3 resolution: "glob@npm:7.2.3" @@ -11560,6 +11603,15 @@ __metadata: languageName: node linkType: hard +"jackspeak@npm:^4.1.1": + version: 4.2.3 + resolution: "jackspeak@npm:4.2.3" + dependencies: + "@isaacs/cliui": "npm:^9.0.0" + checksum: 10c0/b5c0c414f1607c2aa0597f4bf2c03b8443897fccd5fd3c2b3e4f77d556b2bc7c3d3413828ba91e0789f6fb40ad90242f7f89fb20aee9e9d705bc1681f7564f67 + languageName: node + linkType: hard + "jake@npm:^10.8.5": version: 10.9.2 resolution: "jake@npm:10.9.2" @@ -12132,6 +12184,13 @@ __metadata: languageName: node linkType: hard +"jose@npm:^6.1.1": + version: 6.2.3 + resolution: "jose@npm:6.2.3" + checksum: 10c0/aa91bccba22cc84d86308f833749bcb0b00441e35c24e0ac79abeac5f76dc62d47bdef9c1da6a0c609f5da6478595f52b252085888b89dbdb163861e40ea4188 + languageName: node + linkType: hard + "js-sha3@npm:0.8.0, js-sha3@npm:^0.8.0": version: 0.8.0 resolution: "js-sha3@npm:0.8.0" @@ -12914,6 +12973,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^11.0.0": + version: 11.3.6 + resolution: "lru-cache@npm:11.3.6" + checksum: 10c0/3afe3e3000e424c18b640dcea5776b5c1de8684b7dac9718d58792dff1a4692b38cc14e263cbb41bdab98ffcf5408f003b33133b179ce5d271284be72a3ff2a9 + languageName: node + linkType: hard + "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -13263,6 +13329,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^10.1.1, minimatch@npm:^10.2.5": + version: 10.2.5 + resolution: "minimatch@npm:10.2.5" + dependencies: + brace-expansion: "npm:^5.0.5" + checksum: 10c0/6bb058bd6324104b9ec2f763476a35386d05079c1f5fe4fbf1f324a25237cd4534d6813ecd71f48208f4e635c1221899bef94c3c89f7df55698fe373aaae20fd + languageName: node + linkType: hard + "minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" @@ -14542,6 +14617,16 @@ __metadata: languageName: node linkType: hard +"path-scurry@npm:^2.0.0": + version: 2.0.2 + resolution: "path-scurry@npm:2.0.2" + dependencies: + lru-cache: "npm:^11.0.0" + minipass: "npm:^7.1.2" + checksum: 10c0/b35ad37cf6557a87fd057121ce2be7695380c9138d93e87ae928609da259ea0a170fac6f3ef1eb3ece8a068e8b7f2f3adf5bb2374cf4d4a57fe484954fcc9482 + languageName: node + linkType: hard + "path-to-regexp@npm:8.2.0, path-to-regexp@npm:^8.0.0": version: 8.2.0 resolution: "path-to-regexp@npm:8.2.0" @@ -14792,7 +14877,7 @@ __metadata: "@semantic-release/changelog": "npm:^6.0.3" "@semantic-release/exec": "npm:^6.0.3" "@semantic-release/npm": "npm:^11.0.0" - "@subql/cli": "npm:^6.6.0" + "@subql/cli": "npm:^6.6.3" "@subql/node": "npm:^5.11.2" "@subql/types": "npm:^3.15.0" "@subql/types-core": "npm:^2.2.0" @@ -18776,16 +18861,23 @@ __metadata: languageName: node linkType: hard -"zod-to-json-schema@npm:^3.24.1": - version: 3.24.6 - resolution: "zod-to-json-schema@npm:3.24.6" +"zod-to-json-schema@npm:^3.25.0": + version: 3.25.2 + resolution: "zod-to-json-schema@npm:3.25.2" peerDependencies: - zod: ^3.24.1 - checksum: 10c0/b907ab6d057100bd25a37e5545bf5f0efa5902cd84d3c3ec05c2e51541431a47bd9bf1e5e151a244273409b45f5986d55b26e5d207f98abc5200702f733eb368 + zod: ^3.25.28 || ^4 + checksum: 10c0/dd300554393903022487688af14fbda5c719ba8179702bb55b3aa86318830467f0f7beb7d654036975ac963dc4843b72e59636448bfff9a0608f277bb6a14939 + languageName: node + linkType: hard + +"zod@npm:^3.25 || ^4.0": + version: 4.4.3 + resolution: "zod@npm:4.4.3" + checksum: 10c0/7ea31b558e88f9faf44f31dd185e2e1cbf51fed3081787fb96cc2534749b50c0acfc6da7f0922a7353ed092dd358c7d50c28ea96c94d04af64191bd33152eca3 languageName: node linkType: hard -"zod@npm:^3.23.8, zod@npm:^3.25.67": +"zod@npm:^3.25.67": version: 3.25.76 resolution: "zod@npm:3.25.76" checksum: 10c0/5718ec35e3c40b600316c5b4c5e4976f7fee68151bc8f8d90ec18a469be9571f072e1bbaace10f1e85cf8892ea12d90821b200e980ab46916a6166a4260a983c