@ar.io/sdk 3.24.0 → 4.0.0-solana.10
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 +143 -23
- package/lib/esm/cli/cli.js +200 -40
- package/lib/esm/cli/commands/antCommands.js +40 -14
- package/lib/esm/cli/commands/arnsPurchaseCommands.js +46 -7
- package/lib/esm/cli/commands/escrowCommands.js +208 -0
- package/lib/esm/cli/commands/gatewayWriteCommands.js +132 -22
- package/lib/esm/cli/commands/pruneCommands.js +166 -0
- package/lib/esm/cli/commands/readCommands.js +10 -2
- package/lib/esm/cli/commands/transfer.js +6 -6
- package/lib/esm/cli/options.js +141 -2
- package/lib/esm/cli/utils.js +280 -39
- package/lib/esm/common/ant-registry.js +25 -3
- package/lib/esm/common/ant.js +50 -5
- package/lib/esm/common/contracts/ao-process.js +4 -6
- package/lib/esm/common/io.js +41 -0
- package/lib/esm/common/marketplace.js +24 -79
- package/lib/esm/constants.js +13 -1
- package/lib/esm/solana/ant-readable.js +387 -0
- package/lib/esm/solana/ant-registry-readable.js +118 -0
- package/lib/esm/solana/ant-registry-writeable.js +457 -0
- package/lib/esm/solana/ant-writeable.js +352 -0
- package/lib/esm/solana/ata.js +55 -0
- package/lib/esm/solana/canonical-message.js +92 -0
- package/lib/esm/solana/clusters.js +62 -0
- package/lib/esm/solana/constants.js +130 -0
- package/lib/esm/solana/delegation-math.js +63 -0
- package/lib/esm/solana/deserialize.js +1182 -0
- package/lib/esm/solana/escrow.js +797 -0
- package/lib/esm/solana/events.js +210 -0
- package/lib/esm/solana/funding-plan.js +682 -0
- package/lib/esm/solana/generated/ant/events/aclEntryAddedEvent.js +21 -0
- package/lib/esm/solana/generated/ant/events/aclEntryRemovedEvent.js +21 -0
- package/lib/esm/solana/generated/ant/events/antMetadataUpdatedEvent.js +21 -0
- package/lib/esm/solana/generated/ant/events/antReconciledEvent.js +21 -0
- package/lib/esm/solana/generated/ant/events/antTransferredEvent.js +21 -0
- package/lib/esm/solana/generated/ant/events/attributesClearedEvent.js +21 -0
- package/lib/esm/solana/generated/ant/events/attributesSyncedEvent.js +21 -0
- package/lib/esm/solana/generated/ant/events/controllerAddedEvent.js +21 -0
- package/lib/esm/solana/generated/ant/events/controllerRemovedEvent.js +21 -0
- package/lib/esm/solana/generated/ant/events/index.js +16 -0
- package/lib/esm/solana/generated/ant/events/recordMetadataPrunedEvent.js +21 -0
- package/lib/esm/solana/generated/ant/events/recordMetadataRemovedEvent.js +21 -0
- package/lib/esm/solana/generated/ant/events/recordMetadataUpdatedEvent.js +21 -0
- package/lib/esm/solana/generated/ant/events/recordRemovedEvent.js +21 -0
- package/lib/esm/solana/generated/ant/events/recordSetEvent.js +21 -0
- package/lib/esm/solana/generated/ant/events/recordTransferredEvent.js +21 -0
- package/lib/esm/solana/generated/ant-escrow/events/escrowCancelledEvent.js +21 -0
- package/lib/esm/solana/generated/ant-escrow/events/escrowClaimedEvent.js +21 -0
- package/lib/esm/solana/generated/ant-escrow/events/escrowDepositedEvent.js +21 -0
- package/lib/esm/solana/generated/ant-escrow/events/escrowRecipientUpdatedEvent.js +21 -0
- package/lib/esm/solana/generated/ant-escrow/events/index.js +5 -0
- package/lib/esm/solana/generated/arns/events/demandFactorUpdatedEvent.js +21 -0
- package/lib/esm/solana/generated/arns/events/index.js +13 -0
- package/lib/esm/solana/generated/arns/events/leaseExtendedEvent.js +21 -0
- package/lib/esm/solana/generated/arns/events/namePurchasedEvent.js +21 -0
- package/lib/esm/solana/generated/arns/events/nameReassignedEvent.js +21 -0
- package/lib/esm/solana/generated/arns/events/nameReleasedEvent.js +21 -0
- package/lib/esm/solana/generated/arns/events/nameReservedEvent.js +21 -0
- package/lib/esm/solana/generated/arns/events/nameUnreservedEvent.js +21 -0
- package/lib/esm/solana/generated/arns/events/nameUpgradedEvent.js +21 -0
- package/lib/esm/solana/generated/arns/events/namesPrunedEvent.js +21 -0
- package/lib/esm/solana/generated/arns/events/reservedNameClaimedEvent.js +21 -0
- package/lib/esm/solana/generated/arns/events/returnedNamePurchasedEvent.js +21 -0
- package/lib/esm/solana/generated/arns/events/undernameIncreasedEvent.js +21 -0
- package/lib/esm/solana/generated/core/events/configUpdatedEvent.js +21 -0
- package/lib/esm/solana/generated/core/events/coreMigrationFinalizedEvent.js +21 -0
- package/lib/esm/solana/generated/core/events/index.js +14 -0
- package/lib/esm/solana/generated/core/events/primaryNameRemovedEvent.js +21 -0
- package/lib/esm/solana/generated/core/events/primaryNameRequestExpiredEvent.js +21 -0
- package/lib/esm/solana/generated/core/events/primaryNameRequestedEvent.js +21 -0
- package/lib/esm/solana/generated/core/events/primaryNameSetEvent.js +21 -0
- package/lib/esm/solana/generated/core/events/supplyFinalizedEvent.js +21 -0
- package/lib/esm/solana/generated/core/events/transferEvent.js +21 -0
- package/lib/esm/solana/generated/core/events/vaultCreatedEvent.js +21 -0
- package/lib/esm/solana/generated/core/events/vaultExtendedEvent.js +21 -0
- package/lib/esm/solana/generated/core/events/vaultIncreasedEvent.js +21 -0
- package/lib/esm/solana/generated/core/events/vaultReleasedEvent.js +21 -0
- package/lib/esm/solana/generated/core/events/vaultRevokedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/allowlistToggledEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/delegateAllowlistedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/delegationClosedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/delegationDecreasedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/delegationEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/epochClosedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/epochCreatedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/epochDistributedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/epochPrescribedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/epochWeightsTalliedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/epochsToggledEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/fundingPlanAppliedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/garMigrationFinalizedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/gatewayFinalizedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/gatewayJoinedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/gatewayLeavingEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/gatewayPrunedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/gatewaySettingsUpdatedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/index.js +31 -0
- package/lib/esm/solana/generated/gar/events/instantWithdrawalEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/observationSubmittedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/observerAddressUpdatedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/operatorStakeIncreasedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/redelegationEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/residueVaultCreatedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/rewardsCompoundedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/stakePaymentEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/withdrawalCancelledEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/withdrawalClaimedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/withdrawalCreatedEvent.js +21 -0
- package/lib/esm/solana/generated/gar/events/withdrawalPaymentEvent.js +21 -0
- package/lib/esm/solana/generated/mpl-core/accounts/assetV1.js +42 -0
- package/lib/esm/solana/generated/mpl-core/accounts/collectionV1.js +42 -0
- package/lib/esm/solana/generated/mpl-core/accounts/hashedAssetV1.js +45 -0
- package/lib/esm/solana/generated/mpl-core/accounts/index.js +12 -0
- package/lib/esm/solana/generated/mpl-core/accounts/pluginHeaderV1.js +45 -0
- package/lib/esm/solana/generated/mpl-core/accounts/pluginRegistryV1.js +42 -0
- package/lib/esm/solana/generated/mpl-core/errors/index.js +8 -0
- package/lib/esm/solana/generated/mpl-core/errors/mplCore.js +136 -0
- package/lib/esm/solana/generated/mpl-core/index.js +8 -0
- package/lib/esm/solana/generated/mpl-core/instructions/addCollectionExternalPluginAdapterV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/addCollectionPluginV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/addExternalPluginAdapterV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/addPluginV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/approveCollectionPluginAuthorityV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/approvePluginAuthorityV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/burnCollectionV1.js +49 -0
- package/lib/esm/solana/generated/mpl-core/instructions/burnV1.js +49 -0
- package/lib/esm/solana/generated/mpl-core/instructions/collect.js +42 -0
- package/lib/esm/solana/generated/mpl-core/instructions/compressV1.js +50 -0
- package/lib/esm/solana/generated/mpl-core/instructions/createCollectionV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/createCollectionV2.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/createV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/createV2.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/decompressV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/executeV1.js +56 -0
- package/lib/esm/solana/generated/mpl-core/instructions/index.js +40 -0
- package/lib/esm/solana/generated/mpl-core/instructions/removeCollectionExternalPluginAdapterV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/removeCollectionPluginV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/removeExternalPluginAdapterV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/removePluginV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/revokeCollectionPluginAuthorityV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/revokePluginAuthorityV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/transferV1.js +49 -0
- package/lib/esm/solana/generated/mpl-core/instructions/updateCollectionExternalPluginAdapterV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/updateCollectionInfoV1.js +45 -0
- package/lib/esm/solana/generated/mpl-core/instructions/updateCollectionPluginV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/updateCollectionV1.js +52 -0
- package/lib/esm/solana/generated/mpl-core/instructions/updateExternalPluginAdapterV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/updatePluginV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/updateV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/updateV2.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/writeCollectionExternalPluginAdapterDataV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/instructions/writeExternalPluginAdapterDataV1.js +53 -0
- package/lib/esm/solana/generated/mpl-core/program-address.js +1 -0
- package/lib/esm/solana/generated/mpl-core/types/addAssetsToGroupV1Args.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/addBlocker.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/addCollectionsToGroupV1Args.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/addGroupsToGroupV1Args.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/agentIdentity.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/agentIdentityInitInfo.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/agentIdentityUpdateInfo.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/appData.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/appDataInitInfo.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/appDataUpdateInfo.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/attribute.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/attributes.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/authority.js +24 -0
- package/lib/esm/solana/generated/mpl-core/types/autograph.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/autographSignature.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/bubblegumV2.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/burnDelegate.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/closeGroupV1Args.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/compressionProof.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/creator.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/dataSection.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/dataSectionInitInfo.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/dataSectionUpdateInfo.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/dataState.js +23 -0
- package/lib/esm/solana/generated/mpl-core/types/edition.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/externalCheckResult.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/externalPluginAdapter.js +25 -0
- package/lib/esm/solana/generated/mpl-core/types/externalPluginAdapterInitInfo.js +25 -0
- package/lib/esm/solana/generated/mpl-core/types/externalPluginAdapterKey.js +25 -0
- package/lib/esm/solana/generated/mpl-core/types/externalPluginAdapterSchema.js +24 -0
- package/lib/esm/solana/generated/mpl-core/types/externalPluginAdapterType.js +28 -0
- package/lib/esm/solana/generated/mpl-core/types/externalPluginAdapterUpdateInfo.js +25 -0
- package/lib/esm/solana/generated/mpl-core/types/externalRegistryRecord.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/externalValidationResult.js +24 -0
- package/lib/esm/solana/generated/mpl-core/types/extraAccount.js +25 -0
- package/lib/esm/solana/generated/mpl-core/types/freezeDelegate.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/freezeExecute.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/groups.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/hashablePluginSchema.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/hashedAssetSchema.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/hookableLifecycleEvent.js +26 -0
- package/lib/esm/solana/generated/mpl-core/types/immutableMetadata.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/index.js +89 -0
- package/lib/esm/solana/generated/mpl-core/types/key.js +28 -0
- package/lib/esm/solana/generated/mpl-core/types/lifecycleHook.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/lifecycleHookInitInfo.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/lifecycleHookUpdateInfo.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/linkedAppData.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/linkedAppDataInitInfo.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/linkedAppDataUpdateInfo.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/linkedDataKey.js +25 -0
- package/lib/esm/solana/generated/mpl-core/types/linkedLifecycleHook.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/linkedLifecycleHookInitInfo.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/linkedLifecycleHookUpdateInfo.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/masterEdition.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/oracle.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/oracleInitInfo.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/oracleUpdateInfo.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/oracleValidation.js +25 -0
- package/lib/esm/solana/generated/mpl-core/types/permanentBurnDelegate.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/permanentFreezeDelegate.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/permanentFreezeExecute.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/permanentTransferDelegate.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/plugin.js +25 -0
- package/lib/esm/solana/generated/mpl-core/types/pluginAuthorityPair.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/pluginType.js +40 -0
- package/lib/esm/solana/generated/mpl-core/types/registryRecord.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/relationshipKind.js +25 -0
- package/lib/esm/solana/generated/mpl-core/types/removeAssetsFromGroupV1Args.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/removeCollectionsFromGroupV1Args.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/removeGroupsFromGroupV1Args.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/royalties.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/ruleSet.js +24 -0
- package/lib/esm/solana/generated/mpl-core/types/seed.js +24 -0
- package/lib/esm/solana/generated/mpl-core/types/transferDelegate.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/updateAuthority.js +24 -0
- package/lib/esm/solana/generated/mpl-core/types/updateDelegate.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/updateGroupV1Args.js +17 -0
- package/lib/esm/solana/generated/mpl-core/types/updateType.js +24 -0
- package/lib/esm/solana/generated/mpl-core/types/validationResult.js +25 -0
- package/lib/esm/solana/generated/mpl-core/types/validationResultsOffset.js +24 -0
- package/lib/esm/solana/generated/mpl-core/types/verifiedCreators.js +18 -0
- package/lib/esm/solana/generated/mpl-core/types/verifiedCreatorsSignature.js +17 -0
- package/lib/esm/solana/index.js +85 -0
- package/lib/esm/solana/instruction.js +24 -0
- package/lib/esm/solana/io-readable.js +1752 -0
- package/lib/esm/solana/io-writeable.js +2215 -0
- package/lib/esm/solana/json-rpc.js +74 -0
- package/lib/esm/solana/metadata.js +66 -0
- package/lib/esm/solana/mpl-core.js +142 -0
- package/lib/esm/solana/pda.js +317 -0
- package/lib/esm/solana/send.js +117 -0
- package/lib/esm/solana/spawn-ant.js +210 -0
- package/lib/esm/solana/types.js +1 -0
- package/lib/esm/types/ant.js +19 -7
- package/lib/esm/types/io.js +8 -1
- package/lib/esm/utils/ant.js +1 -0
- package/lib/esm/utils/ao.js +1 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/cli/commands/antCommands.d.ts +2 -7
- package/lib/types/cli/commands/arnsPurchaseCommands.d.ts +12 -0
- package/lib/types/cli/commands/escrowCommands.d.ts +62 -0
- package/lib/types/cli/commands/pruneCommands.d.ts +31 -0
- package/lib/types/cli/commands/readCommands.d.ts +2 -0
- package/lib/types/cli/options.d.ts +112 -0
- package/lib/types/cli/types.d.ts +6 -0
- package/lib/types/cli/utils.d.ts +43 -5
- package/lib/types/common/ant-registry.d.ts +41 -0
- package/lib/types/common/ant.d.ts +35 -2
- package/lib/types/common/contracts/ao-process.d.ts +2 -16
- package/lib/types/common/io.d.ts +42 -2
- package/lib/types/common/marketplace.d.ts +2 -14
- package/lib/types/constants.d.ts +11 -1
- package/lib/types/solana/ant-readable.d.ts +121 -0
- package/lib/types/solana/ant-registry-readable.d.ts +90 -0
- package/lib/types/solana/ant-registry-writeable.d.ts +234 -0
- package/lib/types/solana/ant-writeable.d.ts +162 -0
- package/lib/types/solana/ata.d.ts +29 -0
- package/lib/types/solana/canonical-message.d.ts +82 -0
- package/lib/types/solana/clusters.d.ts +62 -0
- package/lib/types/solana/constants.d.ts +103 -0
- package/lib/types/solana/delegation-math.d.ts +20 -0
- package/lib/types/solana/deserialize.d.ts +440 -0
- package/lib/types/solana/escrow.d.ts +403 -0
- package/lib/types/solana/events.d.ts +156 -0
- package/lib/types/solana/funding-plan.d.ts +210 -0
- package/lib/types/solana/generated/ant/events/aclEntryAddedEvent.d.ts +26 -0
- package/lib/types/solana/generated/ant/events/aclEntryRemovedEvent.d.ts +26 -0
- package/lib/types/solana/generated/ant/events/antMetadataUpdatedEvent.d.ts +28 -0
- package/lib/types/solana/generated/ant/events/antReconciledEvent.d.ts +28 -0
- package/lib/types/solana/generated/ant/events/antTransferredEvent.d.ts +26 -0
- package/lib/types/solana/generated/ant/events/attributesClearedEvent.d.ts +26 -0
- package/lib/types/solana/generated/ant/events/attributesSyncedEvent.d.ts +24 -0
- package/lib/types/solana/generated/ant/events/controllerAddedEvent.d.ts +26 -0
- package/lib/types/solana/generated/ant/events/controllerRemovedEvent.d.ts +26 -0
- package/lib/types/solana/generated/ant/events/index.d.ts +15 -0
- package/lib/types/solana/generated/ant/events/recordMetadataPrunedEvent.d.ts +26 -0
- package/lib/types/solana/generated/ant/events/recordMetadataRemovedEvent.d.ts +26 -0
- package/lib/types/solana/generated/ant/events/recordMetadataUpdatedEvent.d.ts +28 -0
- package/lib/types/solana/generated/ant/events/recordRemovedEvent.d.ts +26 -0
- package/lib/types/solana/generated/ant/events/recordSetEvent.d.ts +34 -0
- package/lib/types/solana/generated/ant/events/recordTransferredEvent.d.ts +30 -0
- package/lib/types/solana/generated/ant-escrow/events/escrowCancelledEvent.d.ts +28 -0
- package/lib/types/solana/generated/ant-escrow/events/escrowClaimedEvent.d.ts +32 -0
- package/lib/types/solana/generated/ant-escrow/events/escrowDepositedEvent.d.ts +36 -0
- package/lib/types/solana/generated/ant-escrow/events/escrowRecipientUpdatedEvent.d.ts +26 -0
- package/lib/types/solana/generated/ant-escrow/events/index.d.ts +4 -0
- package/lib/types/solana/generated/arns/events/demandFactorUpdatedEvent.d.ts +28 -0
- package/lib/types/solana/generated/arns/events/index.d.ts +12 -0
- package/lib/types/solana/generated/arns/events/leaseExtendedEvent.d.ts +32 -0
- package/lib/types/solana/generated/arns/events/namePurchasedEvent.d.ts +34 -0
- package/lib/types/solana/generated/arns/events/nameReassignedEvent.d.ts +28 -0
- package/lib/types/solana/generated/arns/events/nameReleasedEvent.d.ts +24 -0
- package/lib/types/solana/generated/arns/events/nameReservedEvent.d.ts +28 -0
- package/lib/types/solana/generated/arns/events/nameUnreservedEvent.d.ts +24 -0
- package/lib/types/solana/generated/arns/events/nameUpgradedEvent.d.ts +28 -0
- package/lib/types/solana/generated/arns/events/namesPrunedEvent.d.ts +26 -0
- package/lib/types/solana/generated/arns/events/reservedNameClaimedEvent.d.ts +24 -0
- package/lib/types/solana/generated/arns/events/returnedNamePurchasedEvent.d.ts +32 -0
- package/lib/types/solana/generated/arns/events/undernameIncreasedEvent.d.ts +32 -0
- package/lib/types/solana/generated/core/events/configUpdatedEvent.d.ts +26 -0
- package/lib/types/solana/generated/core/events/coreMigrationFinalizedEvent.d.ts +26 -0
- package/lib/types/solana/generated/core/events/index.d.ts +13 -0
- package/lib/types/solana/generated/core/events/primaryNameRemovedEvent.d.ts +26 -0
- package/lib/types/solana/generated/core/events/primaryNameRequestExpiredEvent.d.ts +26 -0
- package/lib/types/solana/generated/core/events/primaryNameRequestedEvent.d.ts +30 -0
- package/lib/types/solana/generated/core/events/primaryNameSetEvent.d.ts +24 -0
- package/lib/types/solana/generated/core/events/supplyFinalizedEvent.d.ts +26 -0
- package/lib/types/solana/generated/core/events/transferEvent.d.ts +26 -0
- package/lib/types/solana/generated/core/events/vaultCreatedEvent.d.ts +28 -0
- package/lib/types/solana/generated/core/events/vaultExtendedEvent.d.ts +26 -0
- package/lib/types/solana/generated/core/events/vaultIncreasedEvent.d.ts +28 -0
- package/lib/types/solana/generated/core/events/vaultReleasedEvent.d.ts +26 -0
- package/lib/types/solana/generated/core/events/vaultRevokedEvent.d.ts +28 -0
- package/lib/types/solana/generated/gar/events/allowlistToggledEvent.d.ts +24 -0
- package/lib/types/solana/generated/gar/events/delegateAllowlistedEvent.d.ts +26 -0
- package/lib/types/solana/generated/gar/events/delegationClosedEvent.d.ts +24 -0
- package/lib/types/solana/generated/gar/events/delegationDecreasedEvent.d.ts +28 -0
- package/lib/types/solana/generated/gar/events/delegationEvent.d.ts +28 -0
- package/lib/types/solana/generated/gar/events/epochClosedEvent.d.ts +24 -0
- package/lib/types/solana/generated/gar/events/epochCreatedEvent.d.ts +26 -0
- package/lib/types/solana/generated/gar/events/epochDistributedEvent.d.ts +26 -0
- package/lib/types/solana/generated/gar/events/epochPrescribedEvent.d.ts +28 -0
- package/lib/types/solana/generated/gar/events/epochWeightsTalliedEvent.d.ts +26 -0
- package/lib/types/solana/generated/gar/events/epochsToggledEvent.d.ts +24 -0
- package/lib/types/solana/generated/gar/events/fundingPlanAppliedEvent.d.ts +28 -0
- package/lib/types/solana/generated/gar/events/garMigrationFinalizedEvent.d.ts +26 -0
- package/lib/types/solana/generated/gar/events/gatewayFinalizedEvent.d.ts +24 -0
- package/lib/types/solana/generated/gar/events/gatewayJoinedEvent.d.ts +26 -0
- package/lib/types/solana/generated/gar/events/gatewayLeavingEvent.d.ts +22 -0
- package/lib/types/solana/generated/gar/events/gatewayPrunedEvent.d.ts +26 -0
- package/lib/types/solana/generated/gar/events/gatewaySettingsUpdatedEvent.d.ts +24 -0
- package/lib/types/solana/generated/gar/events/index.d.ts +30 -0
- package/lib/types/solana/generated/gar/events/instantWithdrawalEvent.d.ts +30 -0
- package/lib/types/solana/generated/gar/events/observationSubmittedEvent.d.ts +28 -0
- package/lib/types/solana/generated/gar/events/observerAddressUpdatedEvent.d.ts +24 -0
- package/lib/types/solana/generated/gar/events/operatorStakeIncreasedEvent.d.ts +26 -0
- package/lib/types/solana/generated/gar/events/redelegationEvent.d.ts +30 -0
- package/lib/types/solana/generated/gar/events/residueVaultCreatedEvent.d.ts +30 -0
- package/lib/types/solana/generated/gar/events/rewardsCompoundedEvent.d.ts +26 -0
- package/lib/types/solana/generated/gar/events/stakePaymentEvent.d.ts +28 -0
- package/lib/types/solana/generated/gar/events/withdrawalCancelledEvent.d.ts +30 -0
- package/lib/types/solana/generated/gar/events/withdrawalClaimedEvent.d.ts +26 -0
- package/lib/types/solana/generated/gar/events/withdrawalCreatedEvent.d.ts +28 -0
- package/lib/types/solana/generated/gar/events/withdrawalPaymentEvent.d.ts +28 -0
- package/lib/types/solana/generated/mpl-core/accounts/assetV1.d.ts +37 -0
- package/lib/types/solana/generated/mpl-core/accounts/collectionV1.d.ts +37 -0
- package/lib/types/solana/generated/mpl-core/accounts/hashedAssetV1.d.ts +30 -0
- package/lib/types/solana/generated/mpl-core/accounts/index.d.ts +12 -0
- package/lib/types/solana/generated/mpl-core/accounts/pluginHeaderV1.d.ts +30 -0
- package/lib/types/solana/generated/mpl-core/accounts/pluginRegistryV1.d.ts +31 -0
- package/lib/types/solana/generated/mpl-core/errors/index.d.ts +8 -0
- package/lib/types/solana/generated/mpl-core/errors/mplCore.d.ts +133 -0
- package/lib/types/solana/generated/mpl-core/index.d.ts +8 -0
- package/lib/types/solana/generated/mpl-core/instructions/addCollectionExternalPluginAdapterV1.d.ts +56 -0
- package/lib/types/solana/generated/mpl-core/instructions/addCollectionPluginV1.d.ts +59 -0
- package/lib/types/solana/generated/mpl-core/instructions/addExternalPluginAdapterV1.d.ts +60 -0
- package/lib/types/solana/generated/mpl-core/instructions/addPluginV1.d.ts +63 -0
- package/lib/types/solana/generated/mpl-core/instructions/approveCollectionPluginAuthorityV1.d.ts +59 -0
- package/lib/types/solana/generated/mpl-core/instructions/approvePluginAuthorityV1.d.ts +63 -0
- package/lib/types/solana/generated/mpl-core/instructions/burnCollectionV1.d.ts +52 -0
- package/lib/types/solana/generated/mpl-core/instructions/burnV1.d.ts +60 -0
- package/lib/types/solana/generated/mpl-core/instructions/collect.d.ts +39 -0
- package/lib/types/solana/generated/mpl-core/instructions/compressV1.d.ts +55 -0
- package/lib/types/solana/generated/mpl-core/instructions/createCollectionV1.d.ts +58 -0
- package/lib/types/solana/generated/mpl-core/instructions/createCollectionV2.d.ts +61 -0
- package/lib/types/solana/generated/mpl-core/instructions/createV1.d.ts +77 -0
- package/lib/types/solana/generated/mpl-core/instructions/createV2.d.ts +80 -0
- package/lib/types/solana/generated/mpl-core/instructions/decompressV1.d.ts +60 -0
- package/lib/types/solana/generated/mpl-core/instructions/executeV1.d.ts +63 -0
- package/lib/types/solana/generated/mpl-core/instructions/index.d.ts +40 -0
- package/lib/types/solana/generated/mpl-core/instructions/removeCollectionExternalPluginAdapterV1.d.ts +56 -0
- package/lib/types/solana/generated/mpl-core/instructions/removeCollectionPluginV1.d.ts +56 -0
- package/lib/types/solana/generated/mpl-core/instructions/removeExternalPluginAdapterV1.d.ts +60 -0
- package/lib/types/solana/generated/mpl-core/instructions/removePluginV1.d.ts +60 -0
- package/lib/types/solana/generated/mpl-core/instructions/revokeCollectionPluginAuthorityV1.d.ts +56 -0
- package/lib/types/solana/generated/mpl-core/instructions/revokePluginAuthorityV1.d.ts +60 -0
- package/lib/types/solana/generated/mpl-core/instructions/transferV1.d.ts +64 -0
- package/lib/types/solana/generated/mpl-core/instructions/updateCollectionExternalPluginAdapterV1.d.ts +59 -0
- package/lib/types/solana/generated/mpl-core/instructions/updateCollectionInfoV1.d.ts +47 -0
- package/lib/types/solana/generated/mpl-core/instructions/updateCollectionPluginV1.d.ts +56 -0
- package/lib/types/solana/generated/mpl-core/instructions/updateCollectionV1.d.ts +62 -0
- package/lib/types/solana/generated/mpl-core/instructions/updateExternalPluginAdapterV1.d.ts +63 -0
- package/lib/types/solana/generated/mpl-core/instructions/updatePluginV1.d.ts +60 -0
- package/lib/types/solana/generated/mpl-core/instructions/updateV1.d.ts +66 -0
- package/lib/types/solana/generated/mpl-core/instructions/updateV2.d.ts +70 -0
- package/lib/types/solana/generated/mpl-core/instructions/writeCollectionExternalPluginAdapterDataV1.d.ts +63 -0
- package/lib/types/solana/generated/mpl-core/instructions/writeExternalPluginAdapterDataV1.d.ts +67 -0
- package/lib/types/solana/generated/mpl-core/program-address.d.ts +7 -0
- package/lib/types/solana/generated/mpl-core/types/addAssetsToGroupV1Args.d.ts +13 -0
- package/lib/types/solana/generated/mpl-core/types/addBlocker.d.ts +13 -0
- package/lib/types/solana/generated/mpl-core/types/addCollectionsToGroupV1Args.d.ts +13 -0
- package/lib/types/solana/generated/mpl-core/types/addGroupsToGroupV1Args.d.ts +15 -0
- package/lib/types/solana/generated/mpl-core/types/agentIdentity.d.ts +15 -0
- package/lib/types/solana/generated/mpl-core/types/agentIdentityInitInfo.d.ts +22 -0
- package/lib/types/solana/generated/mpl-core/types/agentIdentityUpdateInfo.d.ts +20 -0
- package/lib/types/solana/generated/mpl-core/types/appData.d.ts +20 -0
- package/lib/types/solana/generated/mpl-core/types/appDataInitInfo.d.ts +22 -0
- package/lib/types/solana/generated/mpl-core/types/appDataUpdateInfo.d.ts +18 -0
- package/lib/types/solana/generated/mpl-core/types/attribute.d.ts +16 -0
- package/lib/types/solana/generated/mpl-core/types/attributes.d.ts +18 -0
- package/lib/types/solana/generated/mpl-core/types/authority.d.ts +29 -0
- package/lib/types/solana/generated/mpl-core/types/autograph.d.ts +18 -0
- package/lib/types/solana/generated/mpl-core/types/autographSignature.d.ts +16 -0
- package/lib/types/solana/generated/mpl-core/types/bubblegumV2.d.ts +13 -0
- package/lib/types/solana/generated/mpl-core/types/burnDelegate.d.ts +13 -0
- package/lib/types/solana/generated/mpl-core/types/closeGroupV1Args.d.ts +13 -0
- package/lib/types/solana/generated/mpl-core/types/compressionProof.d.ts +28 -0
- package/lib/types/solana/generated/mpl-core/types/creator.d.ts +16 -0
- package/lib/types/solana/generated/mpl-core/types/dataSection.d.ts +20 -0
- package/lib/types/solana/generated/mpl-core/types/dataSectionInitInfo.d.ts +20 -0
- package/lib/types/solana/generated/mpl-core/types/dataSectionUpdateInfo.d.ts +13 -0
- package/lib/types/solana/generated/mpl-core/types/dataState.d.ts +16 -0
- package/lib/types/solana/generated/mpl-core/types/edition.d.ts +15 -0
- package/lib/types/solana/generated/mpl-core/types/externalCheckResult.d.ts +15 -0
- package/lib/types/solana/generated/mpl-core/types/externalPluginAdapter.d.ts +66 -0
- package/lib/types/solana/generated/mpl-core/types/externalPluginAdapterInitInfo.d.ts +66 -0
- package/lib/types/solana/generated/mpl-core/types/externalPluginAdapterKey.d.ts +64 -0
- package/lib/types/solana/generated/mpl-core/types/externalPluginAdapterSchema.d.ts +17 -0
- package/lib/types/solana/generated/mpl-core/types/externalPluginAdapterType.d.ts +21 -0
- package/lib/types/solana/generated/mpl-core/types/externalPluginAdapterUpdateInfo.d.ts +59 -0
- package/lib/types/solana/generated/mpl-core/types/externalRegistryRecord.d.ts +28 -0
- package/lib/types/solana/generated/mpl-core/types/externalValidationResult.d.ts +17 -0
- package/lib/types/solana/generated/mpl-core/types/extraAccount.d.ts +86 -0
- package/lib/types/solana/generated/mpl-core/types/freezeDelegate.d.ts +15 -0
- package/lib/types/solana/generated/mpl-core/types/freezeExecute.d.ts +15 -0
- package/lib/types/solana/generated/mpl-core/types/groups.d.ts +15 -0
- package/lib/types/solana/generated/mpl-core/types/hashablePluginSchema.d.ts +22 -0
- package/lib/types/solana/generated/mpl-core/types/hashedAssetSchema.d.ts +16 -0
- package/lib/types/solana/generated/mpl-core/types/hookableLifecycleEvent.d.ts +19 -0
- package/lib/types/solana/generated/mpl-core/types/immutableMetadata.d.ts +13 -0
- package/lib/types/solana/generated/mpl-core/types/index.d.ts +89 -0
- package/lib/types/solana/generated/mpl-core/types/key.d.ts +21 -0
- package/lib/types/solana/generated/mpl-core/types/lifecycleHook.d.ts +24 -0
- package/lib/types/solana/generated/mpl-core/types/lifecycleHookInitInfo.d.ts +28 -0
- package/lib/types/solana/generated/mpl-core/types/lifecycleHookUpdateInfo.d.ts +22 -0
- package/lib/types/solana/generated/mpl-core/types/linkedAppData.d.ts +20 -0
- package/lib/types/solana/generated/mpl-core/types/linkedAppDataInitInfo.d.ts +22 -0
- package/lib/types/solana/generated/mpl-core/types/linkedAppDataUpdateInfo.d.ts +18 -0
- package/lib/types/solana/generated/mpl-core/types/linkedDataKey.d.ts +31 -0
- package/lib/types/solana/generated/mpl-core/types/linkedLifecycleHook.d.ts +24 -0
- package/lib/types/solana/generated/mpl-core/types/linkedLifecycleHookInitInfo.d.ts +28 -0
- package/lib/types/solana/generated/mpl-core/types/linkedLifecycleHookUpdateInfo.d.ts +22 -0
- package/lib/types/solana/generated/mpl-core/types/masterEdition.d.ts +21 -0
- package/lib/types/solana/generated/mpl-core/types/oracle.d.ts +22 -0
- package/lib/types/solana/generated/mpl-core/types/oracleInitInfo.d.ts +26 -0
- package/lib/types/solana/generated/mpl-core/types/oracleUpdateInfo.d.ts +22 -0
- package/lib/types/solana/generated/mpl-core/types/oracleValidation.d.ts +35 -0
- package/lib/types/solana/generated/mpl-core/types/permanentBurnDelegate.d.ts +13 -0
- package/lib/types/solana/generated/mpl-core/types/permanentFreezeDelegate.d.ts +15 -0
- package/lib/types/solana/generated/mpl-core/types/permanentFreezeExecute.d.ts +15 -0
- package/lib/types/solana/generated/mpl-core/types/permanentTransferDelegate.d.ts +13 -0
- package/lib/types/solana/generated/mpl-core/types/plugin.d.ts +150 -0
- package/lib/types/solana/generated/mpl-core/types/pluginAuthorityPair.d.ts +20 -0
- package/lib/types/solana/generated/mpl-core/types/pluginType.d.ts +33 -0
- package/lib/types/solana/generated/mpl-core/types/registryRecord.d.ts +22 -0
- package/lib/types/solana/generated/mpl-core/types/relationshipKind.d.ts +18 -0
- package/lib/types/solana/generated/mpl-core/types/removeAssetsFromGroupV1Args.d.ts +15 -0
- package/lib/types/solana/generated/mpl-core/types/removeCollectionsFromGroupV1Args.d.ts +15 -0
- package/lib/types/solana/generated/mpl-core/types/removeGroupsFromGroupV1Args.d.ts +15 -0
- package/lib/types/solana/generated/mpl-core/types/royalties.d.ts +22 -0
- package/lib/types/solana/generated/mpl-core/types/ruleSet.d.ts +27 -0
- package/lib/types/solana/generated/mpl-core/types/seed.d.ts +36 -0
- package/lib/types/solana/generated/mpl-core/types/transferDelegate.d.ts +13 -0
- package/lib/types/solana/generated/mpl-core/types/updateAuthority.d.ts +27 -0
- package/lib/types/solana/generated/mpl-core/types/updateDelegate.d.ts +15 -0
- package/lib/types/solana/generated/mpl-core/types/updateGroupV1Args.d.ts +19 -0
- package/lib/types/solana/generated/mpl-core/types/updateType.d.ts +17 -0
- package/lib/types/solana/generated/mpl-core/types/validationResult.d.ts +18 -0
- package/lib/types/solana/generated/mpl-core/types/validationResultsOffset.d.ts +33 -0
- package/lib/types/solana/generated/mpl-core/types/verifiedCreators.d.ts +18 -0
- package/lib/types/solana/generated/mpl-core/types/verifiedCreatorsSignature.d.ts +16 -0
- package/lib/types/solana/index.d.ts +63 -0
- package/lib/types/solana/instruction.d.ts +24 -0
- package/lib/types/solana/io-readable.d.ts +360 -0
- package/lib/types/solana/io-writeable.d.ts +533 -0
- package/lib/types/solana/json-rpc.d.ts +32 -0
- package/lib/types/solana/metadata.d.ts +69 -0
- package/lib/types/solana/mpl-core.d.ts +76 -0
- package/lib/types/solana/pda.d.ts +95 -0
- package/lib/types/solana/send.d.ts +16 -0
- package/lib/types/solana/spawn-ant.d.ts +130 -0
- package/lib/types/solana/types.d.ts +67 -0
- package/lib/types/types/ant-registry.d.ts +39 -0
- package/lib/types/types/ant.d.ts +22 -4
- package/lib/types/types/io.d.ts +56 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +33 -16
- package/lib/cjs/cli/cli.js +0 -822
- package/lib/cjs/cli/commands/antCommands.js +0 -113
- package/lib/cjs/cli/commands/arnsPurchaseCommands.js +0 -212
- package/lib/cjs/cli/commands/gatewayWriteCommands.js +0 -210
- package/lib/cjs/cli/commands/readCommands.js +0 -215
- package/lib/cjs/cli/commands/transfer.js +0 -159
- package/lib/cjs/cli/options.js +0 -470
- package/lib/cjs/cli/types.js +0 -2
- package/lib/cjs/cli/utils.js +0 -639
- package/lib/cjs/common/ant-registry.js +0 -155
- package/lib/cjs/common/ant-versions.js +0 -93
- package/lib/cjs/common/ant.js +0 -1182
- package/lib/cjs/common/arweave.js +0 -27
- package/lib/cjs/common/contracts/ao-process.js +0 -224
- package/lib/cjs/common/error.js +0 -64
- package/lib/cjs/common/faucet.js +0 -150
- package/lib/cjs/common/hyperbeam/hb.js +0 -173
- package/lib/cjs/common/index.js +0 -42
- package/lib/cjs/common/io.js +0 -1423
- package/lib/cjs/common/logger.js +0 -83
- package/lib/cjs/common/loggers/winston.js +0 -68
- package/lib/cjs/common/marketplace.js +0 -731
- package/lib/cjs/common/turbo.js +0 -223
- package/lib/cjs/constants.js +0 -41
- package/lib/cjs/node/index.js +0 -39
- package/lib/cjs/package.json +0 -1
- package/lib/cjs/types/ant-registry.js +0 -2
- package/lib/cjs/types/ant.js +0 -168
- package/lib/cjs/types/common.js +0 -2
- package/lib/cjs/types/faucet.js +0 -2
- package/lib/cjs/types/index.js +0 -37
- package/lib/cjs/types/io.js +0 -51
- package/lib/cjs/types/token.js +0 -116
- package/lib/cjs/utils/ant.js +0 -108
- package/lib/cjs/utils/ao.js +0 -432
- package/lib/cjs/utils/arweave.js +0 -285
- package/lib/cjs/utils/base64.js +0 -62
- package/lib/cjs/utils/hash.js +0 -56
- package/lib/cjs/utils/index.js +0 -38
- package/lib/cjs/utils/json.js +0 -26
- package/lib/cjs/utils/processes.js +0 -173
- package/lib/cjs/utils/random.js +0 -30
- package/lib/cjs/utils/schema.js +0 -15
- package/lib/cjs/utils/url.js +0 -37
- package/lib/cjs/version.js +0 -20
- package/lib/cjs/web/index.js +0 -41
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Solana implementation of the ANT Registry read interface.
|
|
12
|
+
*
|
|
13
|
+
* Backed by the per-user paginated ACL (ADR-012): a head `AclConfig` PDA
|
|
14
|
+
* and N content-addressable `AclPage` PDAs, each holding up to
|
|
15
|
+
* `MAX_ACL_PAGE_ENTRIES` `(asset, role)` tuples. Frontends can fetch a
|
|
16
|
+
* user's ANTs in two RPC calls — one `getAccountInfo` for `AclConfig` plus
|
|
17
|
+
* one `getMultipleAccountsInfo` for every page — instead of a
|
|
18
|
+
* `getProgramAccounts` scan, a DAS provider, or a foundation-hosted
|
|
19
|
+
* indexer.
|
|
20
|
+
*
|
|
21
|
+
* Usage:
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { createSolanaRpc } from '@solana/kit';
|
|
24
|
+
* import { ANTRegistry } from '@ar.io/sdk';
|
|
25
|
+
*
|
|
26
|
+
* const registry = ANTRegistry.init({
|
|
27
|
+
* backend: 'solana',
|
|
28
|
+
* rpc: createSolanaRpc('https://api.mainnet-beta.solana.com'),
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* const { Owned, Controlled } = await registry.accessControlList({
|
|
32
|
+
* address: 'SomeSolanaWalletAddress...',
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* When a user has no on-chain `AclConfig` (never registered / not yet
|
|
37
|
+
* populated), both lists return empty. The write path (SDK ANT write
|
|
38
|
+
* methods + migration tooling) is responsible for keeping the ACL in sync
|
|
39
|
+
* as owners / controllers change.
|
|
40
|
+
*/
|
|
41
|
+
import { type Address, type Commitment } from '@solana/kit';
|
|
42
|
+
import { type ILogger } from '../common/logger.js';
|
|
43
|
+
import type { AoANTRegistryRead } from '../types/ant-registry.js';
|
|
44
|
+
import type { SolanaRpc } from './types.js';
|
|
45
|
+
export type SolanaANTRegistryConfig = {
|
|
46
|
+
rpc: SolanaRpc;
|
|
47
|
+
commitment?: Commitment;
|
|
48
|
+
logger?: ILogger;
|
|
49
|
+
/**
|
|
50
|
+
* Override the ario-ant program ID. Required against any cluster other
|
|
51
|
+
* than mainnet — devnet, localnet, and the Surfpool harness all deploy
|
|
52
|
+
* programs at addresses derived from per-cluster keypair files.
|
|
53
|
+
*/
|
|
54
|
+
antProgramId?: Address;
|
|
55
|
+
};
|
|
56
|
+
export declare class SolanaANTRegistryReadable implements AoANTRegistryRead {
|
|
57
|
+
protected readonly rpc: SolanaRpc;
|
|
58
|
+
protected readonly commitment: Commitment;
|
|
59
|
+
/** Deployed `ario-ant` program id this registry talks to. */
|
|
60
|
+
readonly antProgram: Address;
|
|
61
|
+
protected readonly logger: ILogger;
|
|
62
|
+
constructor(config: SolanaANTRegistryConfig);
|
|
63
|
+
/**
|
|
64
|
+
* Read a user's `AclConfig` head plus every `AclPage` and return owned +
|
|
65
|
+
* controlled ANT mint lists. Returns empty lists if the head PDA does not
|
|
66
|
+
* exist yet.
|
|
67
|
+
*
|
|
68
|
+
* **Note:** This is an eventually-consistent secondary index, not a
|
|
69
|
+
* canonical source of truth. Marketplace transfers update NFT ownership
|
|
70
|
+
* on-chain immediately but the ACL is only updated when someone calls
|
|
71
|
+
* `record_acl_owner` / `remove_acl_owner`. For real-time accuracy on a
|
|
72
|
+
* specific ANT, check the Metaplex Core asset owner directly.
|
|
73
|
+
*/
|
|
74
|
+
accessControlList({ address: addr, }: {
|
|
75
|
+
address: string;
|
|
76
|
+
}): Promise<{
|
|
77
|
+
Owned: string[];
|
|
78
|
+
Controlled: string[];
|
|
79
|
+
}>;
|
|
80
|
+
/**
|
|
81
|
+
* Cleaner alias for `accessControlList` — matches the AO backend so
|
|
82
|
+
* consumers can switch backends without renaming calls.
|
|
83
|
+
*/
|
|
84
|
+
getAntsForAddress({ address, }: {
|
|
85
|
+
address: string;
|
|
86
|
+
}): Promise<{
|
|
87
|
+
Owned: string[];
|
|
88
|
+
Controlled: string[];
|
|
89
|
+
}>;
|
|
90
|
+
}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Solana implementation of the ANT Registry write interface.
|
|
3
|
+
*
|
|
4
|
+
* This class owns the per-user paginated ACL surface (ADR-012). After
|
|
5
|
+
* the on-chain hardening pass, the *primary* contract handlers
|
|
6
|
+
* (`add_controller`, `remove_controller`, `transfer`) write the ACL
|
|
7
|
+
* inline as part of their own instruction — Codama renders the ACL
|
|
8
|
+
* accounts as required, so callers cannot bypass them. The registry's
|
|
9
|
+
* job is therefore split in two:
|
|
10
|
+
*
|
|
11
|
+
* 1. **Preflight resolution.** Pick the right `AclConfig` + `AclPage`
|
|
12
|
+
* to pass for a record / remove operation, and emit the
|
|
13
|
+
* `register_acl_config` / `add_acl_page` ixs needed to bootstrap
|
|
14
|
+
* missing accounts. See `resolveDestinationAclAccounts` and
|
|
15
|
+
* `resolveSourceAclAccountsForEntry`.
|
|
16
|
+
* 2. **Bulk maintenance.** For operations the contract can't bundle
|
|
17
|
+
* atomically (notably the variable-length ex-controller cleanup
|
|
18
|
+
* after a transfer, plus any caller-driven heal flows), expose
|
|
19
|
+
* `planAclMaintenance` + the standalone `record_acl_*` /
|
|
20
|
+
* `remove_acl_*` instruction builders. `SolanaANTWriteable`
|
|
21
|
+
* forwards an `aclOps` array to `sendTransaction` for these.
|
|
22
|
+
*
|
|
23
|
+
* Why the registry, not `SolanaANTWriteable`?
|
|
24
|
+
* The ACL is a per-user structure shared across every ANT a user
|
|
25
|
+
* touches, so the right home for the page-selection / preflight logic
|
|
26
|
+
* is the registry itself. `SolanaANTWriteable` composes a
|
|
27
|
+
* `SolanaANTRegistryWriteable` and delegates ACL planning to it.
|
|
28
|
+
*
|
|
29
|
+
* Per-user ACL layout (recap):
|
|
30
|
+
* - `AclConfig` head at `["acl_config", user]` tracks `page_count` +
|
|
31
|
+
* `total_entries`.
|
|
32
|
+
* - Each `AclPage` is a content-addressable PDA at
|
|
33
|
+
* `["acl_page", user, page_idx_le]` holding up to
|
|
34
|
+
* `MAX_ACL_PAGE_ENTRIES` `(asset, role)` tuples.
|
|
35
|
+
*
|
|
36
|
+
* NOTE: `register_acl_config` and `add_acl_page` are permissionless —
|
|
37
|
+
* anyone can pay rent on behalf of any user. `payer` (the writeable
|
|
38
|
+
* registry's signer) acts as the rent payer for everything bundled here.
|
|
39
|
+
*/
|
|
40
|
+
import { type Address, type Instruction, type TransactionSigner } from '@solana/kit';
|
|
41
|
+
import type { AclMaintenanceOp, AclMaintenanceRole, AoANTRegistryWrite } from '../types/ant-registry.js';
|
|
42
|
+
import type { AoMessageResult } from '../types/common.js';
|
|
43
|
+
import { type SolanaANTRegistryConfig, SolanaANTRegistryReadable } from './ant-registry-readable.js';
|
|
44
|
+
export type SolanaANTRegistryWriteableConfig = SolanaANTRegistryConfig & {
|
|
45
|
+
/** Pays rent on `register_acl_config` / `add_acl_page` and authorises ix bundles. */
|
|
46
|
+
signer: TransactionSigner;
|
|
47
|
+
};
|
|
48
|
+
export declare class SolanaANTRegistryWriteable extends SolanaANTRegistryReadable implements AoANTRegistryWrite {
|
|
49
|
+
protected readonly signer: TransactionSigner;
|
|
50
|
+
constructor(config: SolanaANTRegistryWriteableConfig);
|
|
51
|
+
/**
|
|
52
|
+
* The Solana ANT registry does not have a centralised "register" step —
|
|
53
|
+
* `AclConfig` is created lazily the first time a user becomes an owner
|
|
54
|
+
* or controller (via `register_acl_config`, which `planAclMaintenance`
|
|
55
|
+
* emits automatically). This method exists only to satisfy the
|
|
56
|
+
* cross-backend `AoANTRegistryWrite` interface.
|
|
57
|
+
*/
|
|
58
|
+
register(_params: {
|
|
59
|
+
processId: string;
|
|
60
|
+
}): Promise<AoMessageResult>;
|
|
61
|
+
/**
|
|
62
|
+
* Pure PDA derivation — no RPC. Useful for callers that already
|
|
63
|
+
* resolved the page via `resolveSourceAclAccountsForEntry` and need a
|
|
64
|
+
* fallback PDA (e.g. `removeController` when the entry can't be found
|
|
65
|
+
* but we still need to pass *some* page address to the contract so
|
|
66
|
+
* the on-chain handler returns the right error).
|
|
67
|
+
*/
|
|
68
|
+
deriveAclConfigPda(user: Address): Promise<Address>;
|
|
69
|
+
/** Pure PDA derivation — see {@link deriveAclConfigPda}. */
|
|
70
|
+
deriveAclPagePda(user: Address, pageIdx: bigint): Promise<Address>;
|
|
71
|
+
/**
|
|
72
|
+
* Pick the `AclConfig` + destination `AclPage` to wire into a contract
|
|
73
|
+
* handler that is about to **record** an entry for `user` (e.g.
|
|
74
|
+
* `ario-ant::add_controller`, `ario-ant::transfer`'s new-owner side).
|
|
75
|
+
*
|
|
76
|
+
* Behaviour mirrors the planner's record path:
|
|
77
|
+
* - If `AclConfig(user)` does not exist yet, emit
|
|
78
|
+
* `register_acl_config` so the on-chain handler's seed-binding
|
|
79
|
+
* resolves.
|
|
80
|
+
* - If every existing `AclPage` is at `MAX_ACL_PAGE_ENTRIES`, emit
|
|
81
|
+
* `add_acl_page` for `page_idx == page_count` and use it as the
|
|
82
|
+
* destination.
|
|
83
|
+
* - Otherwise pick the **first non-full page** so density recovers
|
|
84
|
+
* after a `swap_remove` left a mid-life page sparse (see
|
|
85
|
+
* `docs/ACCOUNT_SCALING_PATTERNS.md` § Pattern C).
|
|
86
|
+
*
|
|
87
|
+
* Returns the resolved PDAs plus any prep ixs the caller must
|
|
88
|
+
* **prepend** to the bundle. Idempotent: safe to call again on a
|
|
89
|
+
* partially-bootstrapped ACL — only the missing prep ixs come back.
|
|
90
|
+
*
|
|
91
|
+
* The on-chain handler still validates `acl_config.user == user` and
|
|
92
|
+
* the page seed binding, so a stale resolution simply fails the tx;
|
|
93
|
+
* over-emission is bounded by the current page layout.
|
|
94
|
+
*/
|
|
95
|
+
resolveDestinationAclAccounts(params: {
|
|
96
|
+
user: Address;
|
|
97
|
+
}): Promise<{
|
|
98
|
+
aclConfigPda: Address;
|
|
99
|
+
aclPagePda: Address;
|
|
100
|
+
pageIdx: bigint;
|
|
101
|
+
prepIxs: Instruction[];
|
|
102
|
+
}>;
|
|
103
|
+
/**
|
|
104
|
+
* Locate the `AclPage` that currently holds `(asset, role)` for
|
|
105
|
+
* `user`, so a contract handler that is about to **remove** the entry
|
|
106
|
+
* (`ario-ant::remove_controller`, `ario-ant::transfer`'s old-owner
|
|
107
|
+
* side) can be wired with the right page accounts.
|
|
108
|
+
*
|
|
109
|
+
* Returns `null` if `user` has no `AclConfig` head or no matching
|
|
110
|
+
* entry — callers that want strict semantics should treat that as "no
|
|
111
|
+
* record to remove" and either skip the wrapped ix entirely (when the
|
|
112
|
+
* primary mutation is also unnecessary) or fall back to the standalone
|
|
113
|
+
* `remove_acl_*` heal flow.
|
|
114
|
+
*
|
|
115
|
+
* The on-chain handler does the strict check via `position_of` on
|
|
116
|
+
* the supplied page, so a wrong / stale resolution fails the tx with
|
|
117
|
+
* `AclEntryNotFound` rather than corrupting state.
|
|
118
|
+
*/
|
|
119
|
+
resolveSourceAclAccountsForEntry(params: {
|
|
120
|
+
user: Address;
|
|
121
|
+
asset: Address;
|
|
122
|
+
role: AclMaintenanceRole;
|
|
123
|
+
}): Promise<{
|
|
124
|
+
aclConfigPda: Address;
|
|
125
|
+
aclPagePda: Address;
|
|
126
|
+
pageIdx: bigint;
|
|
127
|
+
} | null>;
|
|
128
|
+
/**
|
|
129
|
+
* Build a `register_acl_config` instruction. Permissionless: any wallet
|
|
130
|
+
* can pay to bootstrap an ACL head for any user.
|
|
131
|
+
*/
|
|
132
|
+
buildRegisterAclConfigIx(params: {
|
|
133
|
+
user: Address;
|
|
134
|
+
}): Promise<Instruction>;
|
|
135
|
+
/**
|
|
136
|
+
* Build an `add_acl_page` instruction that appends the next page (i.e.
|
|
137
|
+
* page `page_count`) to a user's ACL. Caller must derive `pageIdx` from
|
|
138
|
+
* a fresh read of `AclConfig.page_count` to avoid colliding with an
|
|
139
|
+
* existing PDA — `planAclMaintenance` does this for you.
|
|
140
|
+
*/
|
|
141
|
+
buildAddAclPageIx(params: {
|
|
142
|
+
user: Address;
|
|
143
|
+
pageIdx: bigint;
|
|
144
|
+
}): Promise<Instruction>;
|
|
145
|
+
/** Build a `record_acl_*` instruction for the given role. */
|
|
146
|
+
buildRecordIx(params: {
|
|
147
|
+
user: Address;
|
|
148
|
+
asset: Address;
|
|
149
|
+
role: AclMaintenanceRole;
|
|
150
|
+
pageIdx: bigint;
|
|
151
|
+
}): Promise<Instruction>;
|
|
152
|
+
/** Build a `remove_acl_*` instruction for the given role. */
|
|
153
|
+
buildRemoveIx(params: {
|
|
154
|
+
user: Address;
|
|
155
|
+
asset: Address;
|
|
156
|
+
role: AclMaintenanceRole;
|
|
157
|
+
pageIdx: bigint;
|
|
158
|
+
}): Promise<Instruction>;
|
|
159
|
+
/**
|
|
160
|
+
* Close the trailing `AclPage` (must be the last page and empty).
|
|
161
|
+
* Returns rent to `beneficiary`, which the on-chain handler enforces
|
|
162
|
+
* equals `acl_config.user`.
|
|
163
|
+
*/
|
|
164
|
+
buildCloseAclPageIx(params: {
|
|
165
|
+
user: Address;
|
|
166
|
+
pageIdx: bigint;
|
|
167
|
+
beneficiary: Address;
|
|
168
|
+
}): Promise<Instruction>;
|
|
169
|
+
/**
|
|
170
|
+
* Close `AclConfig` once `page_count == 0` and `total_entries == 0`.
|
|
171
|
+
* Returns rent to `beneficiary`, which must equal `acl_config.user`
|
|
172
|
+
* on-chain.
|
|
173
|
+
*/
|
|
174
|
+
buildCloseAclConfigIx(params: {
|
|
175
|
+
user: Address;
|
|
176
|
+
beneficiary: Address;
|
|
177
|
+
}): Promise<Instruction>;
|
|
178
|
+
/**
|
|
179
|
+
* Build the ACL ixs needed to bootstrap a freshly-spawned ANT's
|
|
180
|
+
* paginated owner ACL. The on-chain `initialize` handler seeds
|
|
181
|
+
* `ant_controllers = vec![owner]` (matches the Lua source), so the
|
|
182
|
+
* owner is recorded under **both** roles: `Owner` (for "ANTs I own"
|
|
183
|
+
* lookups) and `Controller` (for "ANTs I can manage" lookups).
|
|
184
|
+
*
|
|
185
|
+
* Returns the instructions in dependency order — `register_acl_config`
|
|
186
|
+
* → `add_acl_page` → `record_acl_owner` → `record_acl_controller`.
|
|
187
|
+
* Caller bundles them into the same tx as the MPL Core create + ANT
|
|
188
|
+
* `initialize` ixs so the ACL is atomic with the spawn.
|
|
189
|
+
*/
|
|
190
|
+
bootstrapOwnerOnSpawn(params: {
|
|
191
|
+
owner: Address;
|
|
192
|
+
asset: Address;
|
|
193
|
+
}): Promise<Instruction[]>;
|
|
194
|
+
/**
|
|
195
|
+
* Build the `remove_acl_controller` ixs needed to clean up an ANT's
|
|
196
|
+
* ex-controller ACL entries after a transfer. The contract handler
|
|
197
|
+
* for `transfer` cannot atomically `swap_remove` each ex-controller
|
|
198
|
+
* (variable-length, no clean Codama representation), so the SDK
|
|
199
|
+
* bundles them via this helper instead.
|
|
200
|
+
*
|
|
201
|
+
* Idempotent (skips controllers whose ACL entry is already absent),
|
|
202
|
+
* so it's safe to call against a stale snapshot of `AntControllers`.
|
|
203
|
+
*/
|
|
204
|
+
bulkRemoveControllerEntries(params: {
|
|
205
|
+
asset: Address;
|
|
206
|
+
controllers: ReadonlyArray<string>;
|
|
207
|
+
}): Promise<Instruction[]>;
|
|
208
|
+
/**
|
|
209
|
+
* Resolve an array of desired ACL mutations into the minimum
|
|
210
|
+
* instruction set needed to make them happen. For each unique user:
|
|
211
|
+
* - reads the `AclConfig` head once (and all `AclPage`s in one
|
|
212
|
+
* `getMultipleAccountsInfo` round trip)
|
|
213
|
+
* - prepends `register_acl_config` if the head is missing AND any
|
|
214
|
+
* `action: 'record'` op targets that user
|
|
215
|
+
* - emits `add_acl_page` whenever the existing pages have no room
|
|
216
|
+
* - drops `action: 'record'` ops where the entry already exists (no-op)
|
|
217
|
+
* - drops `action: 'remove'` ops where the entry is already absent (no-op)
|
|
218
|
+
*
|
|
219
|
+
* Returned instructions preserve the dependency order:
|
|
220
|
+
* `register_acl_config` → `add_acl_page` → record/remove ixs that
|
|
221
|
+
* target the new page.
|
|
222
|
+
*
|
|
223
|
+
* Page selection on append: we fill the **first non-full page** so
|
|
224
|
+
* density recovers naturally after a `swap_remove` made a mid-life
|
|
225
|
+
* page sparse (see `docs/ACCOUNT_SCALING_PATTERNS.md` § Pattern C).
|
|
226
|
+
*
|
|
227
|
+
* `protected` so subclasses (and the workflow helpers above) can call
|
|
228
|
+
* it, but external callers go through `bootstrapOwnerOnSpawn` /
|
|
229
|
+
* `bulkRemoveControllerEntries` instead.
|
|
230
|
+
*/
|
|
231
|
+
protected planAclMaintenance(ops: AclMaintenanceOp[]): Promise<Instruction[]>;
|
|
232
|
+
/** Load the head + every page for `user` in two RPC calls. */
|
|
233
|
+
private loadAclState;
|
|
234
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Solana implementation of ANT (Arweave Name Token) write interface.
|
|
3
|
+
*
|
|
4
|
+
* Extends SolanaANTReadable with write operations that build and send
|
|
5
|
+
* Solana transactions to the ario-ant program.
|
|
6
|
+
*
|
|
7
|
+
* All instruction encoding is delegated to the Codama-generated builders in
|
|
8
|
+
* `./generated/ant/instructions/` — they own the discriminator + Borsh codec
|
|
9
|
+
* + account-meta wiring derived from the on-chain IDL.
|
|
10
|
+
*
|
|
11
|
+
* ACL maintenance (ADR-012, paginated per-user ACL):
|
|
12
|
+
* The on-chain handlers for `add_controller`, `remove_controller`, and
|
|
13
|
+
* `transfer` *require* the controller / new-owner / old-owner ACL
|
|
14
|
+
* accounts as instruction inputs and write the ACL inline as part of
|
|
15
|
+
* the same atomic ix. This SDK's job is therefore reduced to two
|
|
16
|
+
* things:
|
|
17
|
+
* 1. **Preflight resolution** — ask the composed
|
|
18
|
+
* `SolanaANTRegistryWriteable` to pick the right page and emit
|
|
19
|
+
* any `register_acl_config` / `add_acl_page` ixs that need to be
|
|
20
|
+
* prepended so the contract's account validation succeeds.
|
|
21
|
+
* 2. **Ex-controller cleanup on transfer** — a wrapped transfer
|
|
22
|
+
* cannot atomically `swap_remove` every ex-controller's ACL
|
|
23
|
+
* entry (variable cardinality, no clean way to express variadic
|
|
24
|
+
* accounts in Codama). The SDK reads the controllers list and
|
|
25
|
+
* delegates to `registry.bulkRemoveControllerEntries`, which
|
|
26
|
+
* produces the right `remove_acl_controller` ixs to append into
|
|
27
|
+
* the transfer tx. Permissionless heal flows clean up any drift
|
|
28
|
+
* if a marketplace transfer bypasses this SDK entirely.
|
|
29
|
+
*/
|
|
30
|
+
import { type Address, type Commitment, type Instruction } from '@solana/kit';
|
|
31
|
+
import type { ILogger } from '../common/logger.js';
|
|
32
|
+
import type { AoANTRegistryRead } from '../types/ant-registry.js';
|
|
33
|
+
import type { AoANTSetBaseNameRecordParams, AoANTSetUndernameRecordParams } from '../types/ant.js';
|
|
34
|
+
import type { AoMessageResult, WriteOptions } from '../types/common.js';
|
|
35
|
+
import { SolanaANTReadable } from './ant-readable.js';
|
|
36
|
+
import { SolanaANTRegistryWriteable } from './ant-registry-writeable.js';
|
|
37
|
+
import type { SolanaRpc, SolanaRpcSubscriptions, SolanaSigner } from './types.js';
|
|
38
|
+
/**
|
|
39
|
+
* Solana-backed read-write client for a single ANT (Arweave Name Token).
|
|
40
|
+
*
|
|
41
|
+
* Usage:
|
|
42
|
+
* ```ts
|
|
43
|
+
* import { createSolanaRpc, createSolanaRpcSubscriptions, createKeyPairSignerFromBytes } from '@solana/kit';
|
|
44
|
+
* import { SolanaANTWriteable } from '@ar.io/sdk/solana';
|
|
45
|
+
*
|
|
46
|
+
* const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com');
|
|
47
|
+
* const rpcSubscriptions = createSolanaRpcSubscriptions('wss://api.mainnet-beta.solana.com');
|
|
48
|
+
* const signer = await createKeyPairSignerFromBytes(secretKeyBytes);
|
|
49
|
+
* const ant = new SolanaANTWriteable({
|
|
50
|
+
* rpc,
|
|
51
|
+
* rpcSubscriptions,
|
|
52
|
+
* processId: 'MetaplexCoreAssetAddress...',
|
|
53
|
+
* signer,
|
|
54
|
+
* });
|
|
55
|
+
*
|
|
56
|
+
* await ant.setRecord({ undername: 'docs', transactionId: '...', ttlSeconds: 3600 });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare class SolanaANTWriteable extends SolanaANTReadable {
|
|
60
|
+
protected readonly signer: SolanaSigner;
|
|
61
|
+
protected readonly rpcSubscriptions: SolanaRpcSubscriptions;
|
|
62
|
+
/**
|
|
63
|
+
* Override the readable's registry with the writeable variant — gives
|
|
64
|
+
* us the preflight resolvers + the spawn / ex-controller workflow
|
|
65
|
+
* helpers, while preserving `accessControlList` reads from the
|
|
66
|
+
* parent's `AoANTRegistryRead` surface.
|
|
67
|
+
*/
|
|
68
|
+
readonly registry: SolanaANTRegistryWriteable & AoANTRegistryRead;
|
|
69
|
+
constructor(config: {
|
|
70
|
+
rpc: SolanaRpc;
|
|
71
|
+
rpcSubscriptions: SolanaRpcSubscriptions;
|
|
72
|
+
processId: string;
|
|
73
|
+
signer: SolanaSigner;
|
|
74
|
+
commitment?: Commitment;
|
|
75
|
+
logger?: ILogger;
|
|
76
|
+
antProgramId?: Address;
|
|
77
|
+
/**
|
|
78
|
+
* Pre-built writeable registry to compose. When omitted we build one
|
|
79
|
+
* from `rpc` / `signer` / `commitment` / `antProgramId` so the simple
|
|
80
|
+
* single-arg call site keeps working.
|
|
81
|
+
*/
|
|
82
|
+
registry?: SolanaANTRegistryWriteable;
|
|
83
|
+
});
|
|
84
|
+
/**
|
|
85
|
+
* Build, sign, and send a transaction.
|
|
86
|
+
*
|
|
87
|
+
* Plain pass-through to `sendAndConfirm` — every ANT write whose ACL
|
|
88
|
+
* footprint is bounded (controllers add/remove, owner swap on
|
|
89
|
+
* transfer) is handled inline by the contract handlers. Variable-
|
|
90
|
+
* length cleanup (notably ex-controller wipe after transfer) is
|
|
91
|
+
* pre-built by the caller via `registry.bulkRemoveControllerEntries`
|
|
92
|
+
* and appended into the same `instructions` array, so this method
|
|
93
|
+
* doesn't need its own ACL plumbing.
|
|
94
|
+
*/
|
|
95
|
+
protected sendTransaction(instructions: Instruction[]): Promise<string>;
|
|
96
|
+
setRecord(params: AoANTSetUndernameRecordParams, _options?: WriteOptions): Promise<AoMessageResult>;
|
|
97
|
+
setBaseNameRecord(params: AoANTSetBaseNameRecordParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
98
|
+
setUndernameRecord(params: AoANTSetUndernameRecordParams, options?: WriteOptions): Promise<AoMessageResult>;
|
|
99
|
+
removeRecord(params: {
|
|
100
|
+
undername: string;
|
|
101
|
+
}, _options?: WriteOptions): Promise<AoMessageResult>;
|
|
102
|
+
removeUndernameRecord(params: {
|
|
103
|
+
undername: string;
|
|
104
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
105
|
+
transferRecord(params: {
|
|
106
|
+
undername: string;
|
|
107
|
+
recipient: string;
|
|
108
|
+
}, _options?: WriteOptions): Promise<AoMessageResult>;
|
|
109
|
+
addController(params: {
|
|
110
|
+
controller: string;
|
|
111
|
+
}, _options?: WriteOptions): Promise<AoMessageResult>;
|
|
112
|
+
removeController(params: {
|
|
113
|
+
controller: string;
|
|
114
|
+
}, _options?: WriteOptions): Promise<AoMessageResult>;
|
|
115
|
+
setName(params: {
|
|
116
|
+
name: string;
|
|
117
|
+
}, _options?: WriteOptions): Promise<AoMessageResult>;
|
|
118
|
+
setTicker(params: {
|
|
119
|
+
ticker: string;
|
|
120
|
+
}, _options?: WriteOptions): Promise<AoMessageResult>;
|
|
121
|
+
setDescription(params: {
|
|
122
|
+
description: string;
|
|
123
|
+
}, _options?: WriteOptions): Promise<AoMessageResult>;
|
|
124
|
+
setKeywords(params: {
|
|
125
|
+
keywords: string[];
|
|
126
|
+
}, _options?: WriteOptions): Promise<AoMessageResult>;
|
|
127
|
+
setLogo(params: {
|
|
128
|
+
txId: string;
|
|
129
|
+
}, _options?: WriteOptions): Promise<AoMessageResult>;
|
|
130
|
+
transfer(params: {
|
|
131
|
+
target: string;
|
|
132
|
+
}, _options?: WriteOptions): Promise<AoMessageResult>;
|
|
133
|
+
reconcile(_options?: WriteOptions): Promise<AoMessageResult>;
|
|
134
|
+
releaseName(_params: {
|
|
135
|
+
name: string;
|
|
136
|
+
arioProcessId: string;
|
|
137
|
+
}, _options?: WriteOptions): Promise<AoMessageResult>;
|
|
138
|
+
reassignName(_params: {
|
|
139
|
+
name: string;
|
|
140
|
+
arioProcessId: string;
|
|
141
|
+
antProcessId: string;
|
|
142
|
+
}, _options?: WriteOptions): Promise<AoMessageResult>;
|
|
143
|
+
approvePrimaryNameRequest(_params: {
|
|
144
|
+
name: string;
|
|
145
|
+
address: string;
|
|
146
|
+
arioProcessId: string;
|
|
147
|
+
}, _options?: WriteOptions): Promise<AoMessageResult>;
|
|
148
|
+
removePrimaryNames(_params: {
|
|
149
|
+
names: string[];
|
|
150
|
+
arioProcessId: string;
|
|
151
|
+
notifyOwners?: boolean;
|
|
152
|
+
}, _options?: WriteOptions): Promise<AoMessageResult>;
|
|
153
|
+
/**
|
|
154
|
+
* Migrate this ANT's on-chain state to the latest schema version.
|
|
155
|
+
* On Solana, "upgrade" means per-ANT data migration, not process forking.
|
|
156
|
+
* Returns the transaction signature if migration was needed.
|
|
157
|
+
*/
|
|
158
|
+
upgrade(_params?: any): Promise<{
|
|
159
|
+
id: string;
|
|
160
|
+
needsMigration: boolean;
|
|
161
|
+
}>;
|
|
162
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Associated Token Account derivation, kit-native.
|
|
3
|
+
* Mirrors the classic SPL `getAssociatedTokenAddress` function but returns
|
|
4
|
+
* a kit `Address` without the web3.js dependency.
|
|
5
|
+
*
|
|
6
|
+
* TODO(C7): replace with `findAssociatedTokenPda` from `@solana-program/associated-token`
|
|
7
|
+
* once that package is added as a dependency.
|
|
8
|
+
*/
|
|
9
|
+
import { type Address, type Instruction } from '@solana/kit';
|
|
10
|
+
export declare const ATA_PROGRAM_ADDRESS: Address;
|
|
11
|
+
/**
|
|
12
|
+
* Derive the Associated Token Account (ATA) address for a given owner + mint.
|
|
13
|
+
*
|
|
14
|
+
* @param mint — the SPL token mint address
|
|
15
|
+
* @param owner — the owner's wallet address (or a PDA if `allowOwnerOffCurve = true`)
|
|
16
|
+
* @param allowOwnerOffCurve — unused; kit derives regardless of curve. Kept for
|
|
17
|
+
* parity with the old `@solana/spl-token` signature so call sites don't change.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getAssociatedTokenAddressKit(mint: Address, owner: Address, _allowOwnerOffCurve?: boolean): Promise<Address>;
|
|
20
|
+
/**
|
|
21
|
+
* Build an idempotent CreateAssociatedTokenAccount instruction. Safe to
|
|
22
|
+
* include in any tx — if the ATA already exists, the SPL ATA program
|
|
23
|
+
* silently succeeds.
|
|
24
|
+
*
|
|
25
|
+
* Used to pre-create vault / escrow ATAs in the same tx as the program
|
|
26
|
+
* instruction that consumes them. Anchor's `Account<TokenAccount>` constraint
|
|
27
|
+
* does NOT init the account, so the caller is responsible.
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildCreateAtaIdempotentIx(payer: Address, ata: Address, owner: Address, mint: Address): Instruction;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical claim-message helper for `ario-ant-escrow`.
|
|
3
|
+
*
|
|
4
|
+
* Produces the EXACT bytes a recipient signs to release an escrowed
|
|
5
|
+
* ANT. Output MUST be byte-identical to the Rust implementation in
|
|
6
|
+
* `contracts/programs/ario-ant-escrow/src/canonical.rs::build_canonical_message`.
|
|
7
|
+
* Cross-language equivalence is asserted by `canonical-message.test.ts`
|
|
8
|
+
* which spawns the Rust `canonical` example binary and diffs the bytes.
|
|
9
|
+
*
|
|
10
|
+
* Format (UTF-8, line-feed separated, no trailing newline):
|
|
11
|
+
*
|
|
12
|
+
* ```text
|
|
13
|
+
* ar.io ant-escrow claim v1
|
|
14
|
+
* network: <network>
|
|
15
|
+
* ant: <ant_mint_base58>
|
|
16
|
+
* claimant: <claimant_solana_pubkey_base58>
|
|
17
|
+
* nonce: <nonce_hex_lowercase>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Wallets sign these bytes directly:
|
|
21
|
+
* - Arweave: `wallet.signMessage(bytes)` → 512-byte RSA-PSS sig
|
|
22
|
+
* - Ethereum: `wallet.signMessage(bytes)` → 65-byte ECDSA + EIP-191 sig
|
|
23
|
+
* (the wallet applies the EIP-191 prefix; on-chain code re-applies it).
|
|
24
|
+
*/
|
|
25
|
+
import type { Address } from '@solana/kit';
|
|
26
|
+
/** Network bound into the canonical message at compile-time on the Rust
|
|
27
|
+
* side. Frontend / SDK callers pass it explicitly so a single SDK build
|
|
28
|
+
* works against either deployment. */
|
|
29
|
+
export type EscrowNetwork = 'solana-mainnet' | 'solana-devnet';
|
|
30
|
+
export interface CanonicalMessageInput {
|
|
31
|
+
/** Must match the program's compile-time network string. */
|
|
32
|
+
network: EscrowNetwork;
|
|
33
|
+
/** ANT mint pubkey — matches `escrow.ant_mint`. */
|
|
34
|
+
antMint: Address;
|
|
35
|
+
/** Solana pubkey that will receive the ANT on claim. Bound into the
|
|
36
|
+
* signature so front-runners can't redirect. */
|
|
37
|
+
claimant: Address;
|
|
38
|
+
/** 32-byte anti-replay nonce — read from the EscrowAnt account. */
|
|
39
|
+
nonce: Uint8Array;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Build the canonical claim message bytes. UTF-8 encoded, no trailing
|
|
43
|
+
* newline, exactly the format shown in the docstring.
|
|
44
|
+
*
|
|
45
|
+
* @throws if `nonce` isn't exactly 32 bytes — guards against accidentally
|
|
46
|
+
* passing a hex string or a different-sized buffer.
|
|
47
|
+
*/
|
|
48
|
+
export declare function canonicalMessage(input: CanonicalMessageInput): Uint8Array;
|
|
49
|
+
export interface CanonicalMessageV2Input {
|
|
50
|
+
/** Must match the program's compile-time network string. */
|
|
51
|
+
network: EscrowNetwork;
|
|
52
|
+
/** `'token'` for liquid ARIO, `'vault'` for time-locked positions. */
|
|
53
|
+
assetType: 'token' | 'vault';
|
|
54
|
+
/** 32-byte client-supplied unique identifier for the escrowed asset. */
|
|
55
|
+
assetId: Uint8Array;
|
|
56
|
+
/** Amount of ARIO (mARIO) held in escrow. */
|
|
57
|
+
amount: bigint;
|
|
58
|
+
/** Solana pubkey that will receive the tokens on claim. */
|
|
59
|
+
claimant: Address;
|
|
60
|
+
/** 32-byte anti-replay nonce — read from the EscrowToken account. */
|
|
61
|
+
nonce: Uint8Array;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Build the v2 canonical claim message bytes for token/vault escrows.
|
|
65
|
+
* UTF-8 encoded, no trailing newline.
|
|
66
|
+
*
|
|
67
|
+
* Format:
|
|
68
|
+
* ```text
|
|
69
|
+
* ar.io escrow claim v2
|
|
70
|
+
* network: <network>
|
|
71
|
+
* type: <token|vault>
|
|
72
|
+
* asset: <asset_id_hex_lowercase_64chars>
|
|
73
|
+
* amount: <u64_decimal>
|
|
74
|
+
* claimant: <base58>
|
|
75
|
+
* nonce: <hex_lowercase_64chars>
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @throws if `assetId` or `nonce` aren't exactly 32 bytes.
|
|
79
|
+
*/
|
|
80
|
+
export declare function canonicalMessageV2(input: CanonicalMessageV2Input): Uint8Array;
|
|
81
|
+
/** Lowercase-hex encoding. Matches Rust `encode_hex_lowercase`. */
|
|
82
|
+
export declare function bytesToHexLower(bytes: Uint8Array): string;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cluster-specific deployment constants for AR.IO programs.
|
|
3
|
+
*
|
|
4
|
+
* Mainnet IDs are baked into the IDL at codegen time and surfaced via the
|
|
5
|
+
* placeholder constants in `./constants.ts` (e.g. `ARIO_CORE_PROGRAM_ID`).
|
|
6
|
+
* This module exposes the same values for *other* clusters where the
|
|
7
|
+
* programs are deployed at non-default addresses — primarily devnet.
|
|
8
|
+
*
|
|
9
|
+
* Source of truth: `/devnet-config.json` at the repo root. Keep these
|
|
10
|
+
* exports in sync when devnet is redeployed; the bundled drift test
|
|
11
|
+
* (`clusters.test.ts`) will fail CI on mismatch.
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { ARIO } from '@ar.io/sdk';
|
|
16
|
+
* import { DEVNET_PROGRAM_IDS, DEVNET_RPC_URL } from '@ar.io/sdk/solana';
|
|
17
|
+
* import { createSolanaRpc, createSolanaRpcSubscriptions } from '@solana/kit';
|
|
18
|
+
*
|
|
19
|
+
* const rpc = createSolanaRpc(DEVNET_RPC_URL);
|
|
20
|
+
* const rpcSubscriptions = createSolanaRpcSubscriptions(
|
|
21
|
+
* DEVNET_RPC_URL.replace(/^https/, 'wss'),
|
|
22
|
+
* );
|
|
23
|
+
* const ario = ARIO.init({
|
|
24
|
+
* backend: 'solana',
|
|
25
|
+
* rpc,
|
|
26
|
+
* rpcSubscriptions,
|
|
27
|
+
* programIds: DEVNET_PROGRAM_IDS,
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
import { type Address } from '@solana/kit';
|
|
32
|
+
/**
|
|
33
|
+
* Default JSON-RPC URL for the Solana devnet cluster.
|
|
34
|
+
*
|
|
35
|
+
* Public devnet rate-limits aggressively — for high-volume work, swap in
|
|
36
|
+
* a premium RPC (QuickNode / Helius / Triton). Derive the WS URL with
|
|
37
|
+
* `DEVNET_RPC_URL.replace(/^https/, 'wss')`.
|
|
38
|
+
*/
|
|
39
|
+
export declare const DEVNET_RPC_URL = "https://api.devnet.solana.com";
|
|
40
|
+
/**
|
|
41
|
+
* AR.IO program IDs deployed on Solana devnet.
|
|
42
|
+
*
|
|
43
|
+
* Shape matches the `programIds` argument of
|
|
44
|
+
* `ARIO.init({ backend: 'solana', programIds, ... })`.
|
|
45
|
+
*
|
|
46
|
+
* `antEscrow` is `null` because `ario-ant-escrow` is not deployed on
|
|
47
|
+
* devnet — the `sol_big_mod_exp` syscall it depends on is inactive on
|
|
48
|
+
* all public clusters today.
|
|
49
|
+
*/
|
|
50
|
+
export declare const DEVNET_PROGRAM_IDS: {
|
|
51
|
+
readonly core: Address<"83CQLP848zzCgnZ4LTq87g6hvxTooNLX7YXXkUUGv5ig">;
|
|
52
|
+
readonly gar: Address<"AF8QAEaR4hzsqeUDwEdeTXMYtdyFegTENBdnJro6WVLR">;
|
|
53
|
+
readonly arns: Address<"2HgSCKYjcapJPdHRKqkLrGXm7kvBmCP45ZyhWEm87oM1">;
|
|
54
|
+
readonly ant: Address<"8ZMuXhiK7DorjPUg8RB1rzu7CvsABMk38WDJRbM62y2C">;
|
|
55
|
+
readonly antEscrow: Address | null;
|
|
56
|
+
};
|
|
57
|
+
/** ARIO SPL Token mint on devnet. */
|
|
58
|
+
export declare const DEVNET_ARIO_MINT: Address;
|
|
59
|
+
/** Protocol treasury token account on devnet (owner = ArioConfig PDA). */
|
|
60
|
+
export declare const DEVNET_TREASURY_TOKEN_ACCOUNT: Address;
|
|
61
|
+
/** Protocol stake token account on devnet (owner = GatewaySettings PDA). */
|
|
62
|
+
export declare const DEVNET_STAKE_TOKEN_ACCOUNT: Address;
|