@ar.io/sdk 4.0.0-solana.9 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +721 -673
- package/lib/esm/cli/cli.js +28 -152
- package/lib/esm/cli/commands/antCommands.js +5 -66
- package/lib/esm/cli/commands/arnsPurchaseCommands.js +7 -28
- package/lib/esm/cli/commands/escrowCommands.js +23 -4
- package/lib/esm/cli/commands/gatewayWriteCommands.js +15 -8
- package/lib/esm/cli/commands/pruneCommands.js +14 -26
- package/lib/esm/cli/commands/readCommands.js +12 -1
- package/lib/esm/cli/options.js +2 -75
- package/lib/esm/cli/utils.js +96 -209
- package/lib/esm/common/ant-registry.js +12 -160
- package/lib/esm/common/ant.js +40 -1208
- package/lib/esm/common/faucet.js +17 -6
- package/lib/esm/common/index.js +0 -4
- package/lib/esm/common/io.js +13 -1441
- package/lib/esm/constants.js +0 -18
- package/lib/esm/solana/ant-readable.js +391 -54
- package/lib/esm/solana/ant-registry-readable.js +15 -0
- package/lib/esm/solana/ant-registry-writeable.js +19 -4
- package/lib/esm/solana/ant-writeable.js +43 -11
- package/lib/esm/solana/ata.js +15 -0
- package/lib/esm/solana/canonical-message.js +45 -9
- package/lib/esm/solana/clusters.js +69 -22
- package/lib/esm/solana/constants.js +21 -5
- package/lib/esm/solana/delegation-math.js +49 -0
- package/lib/esm/solana/deserialize.js +263 -727
- package/lib/esm/solana/escrow.js +145 -103
- package/lib/esm/solana/events.js +20 -199
- package/lib/esm/solana/funding-plan.js +19 -2
- package/lib/esm/solana/index.js +53 -12
- package/lib/esm/solana/instruction.js +15 -0
- package/lib/esm/solana/io-readable.js +510 -58
- package/lib/esm/solana/io-writeable.js +1179 -183
- package/lib/esm/solana/json-rpc.js +20 -4
- package/lib/esm/solana/metadata.js +15 -0
- package/lib/esm/solana/mpl-core.js +55 -5
- package/lib/esm/solana/pda.js +15 -0
- package/lib/esm/solana/predict-prescribed-observers.js +110 -0
- package/lib/esm/solana/retry.js +117 -0
- package/lib/esm/solana/rpc-circuit-breaker.js +258 -0
- package/lib/esm/solana/send.js +258 -3
- package/lib/esm/solana/spawn-ant.js +16 -2
- package/lib/esm/types/ant.js +8 -8
- package/lib/esm/types/io.js +0 -10
- package/lib/esm/utils/ant.js +0 -64
- package/lib/esm/utils/index.js +0 -3
- package/lib/esm/version.js +1 -1
- package/lib/types/cli/commands/antCommands.d.ts +6 -9
- package/lib/types/cli/commands/arnsPurchaseCommands.d.ts +27 -13
- package/lib/types/cli/commands/escrowCommands.d.ts +6 -0
- package/lib/types/cli/commands/gatewayWriteCommands.d.ts +12 -11
- package/lib/types/cli/commands/pruneCommands.d.ts +11 -11
- package/lib/types/cli/commands/readCommands.d.ts +25 -22
- package/lib/types/cli/commands/transfer.d.ts +9 -9
- package/lib/types/cli/options.d.ts +0 -57
- package/lib/types/cli/types.d.ts +6 -14
- package/lib/types/cli/utils.d.ts +34 -32
- package/lib/types/common/ant-registry.d.ts +35 -74
- package/lib/types/common/ant.d.ts +52 -570
- package/lib/types/common/faucet.d.ts +20 -8
- package/lib/types/common/index.d.ts +0 -3
- package/lib/types/common/io.d.ts +56 -288
- package/lib/types/constants.d.ts +0 -17
- package/lib/types/solana/ant-readable.d.ts +65 -6
- package/lib/types/solana/ant-registry-readable.d.ts +17 -2
- package/lib/types/solana/ant-registry-writeable.d.ts +20 -5
- package/lib/types/solana/ant-writeable.d.ts +39 -24
- package/lib/types/solana/ata.d.ts +15 -0
- package/lib/types/solana/canonical-message.d.ts +44 -5
- package/lib/types/solana/clusters.d.ts +68 -21
- package/lib/types/solana/constants.d.ts +16 -0
- package/lib/types/solana/delegation-math.d.ts +25 -0
- package/lib/types/solana/deserialize.d.ts +28 -198
- package/lib/types/solana/escrow.d.ts +128 -51
- package/lib/types/solana/events.d.ts +26 -144
- package/lib/types/solana/funding-plan.d.ts +15 -0
- package/lib/types/solana/index.d.ts +27 -3
- package/lib/types/solana/instruction.d.ts +15 -0
- package/lib/types/solana/io-readable.d.ts +185 -46
- package/lib/types/solana/io-writeable.d.ts +450 -77
- package/lib/types/solana/json-rpc.d.ts +15 -0
- package/lib/types/solana/metadata.d.ts +15 -0
- package/lib/types/solana/mpl-core.d.ts +44 -0
- package/lib/types/solana/predict-prescribed-observers.d.ts +28 -0
- package/lib/types/solana/retry.d.ts +62 -0
- package/lib/types/solana/rpc-circuit-breaker.d.ts +78 -0
- package/lib/types/solana/send.d.ts +80 -2
- package/lib/types/solana/spawn-ant.d.ts +15 -0
- package/lib/types/solana/types.d.ts +15 -0
- package/lib/types/types/ant-registry.d.ts +4 -4
- package/lib/types/types/ant.d.ts +92 -92
- package/lib/types/types/common.d.ts +18 -74
- package/lib/types/types/faucet.d.ts +2 -2
- package/lib/types/types/io.d.ts +189 -158
- package/lib/types/types/token.d.ts +0 -12
- package/lib/types/utils/ant.d.ts +1 -12
- package/lib/types/utils/index.d.ts +0 -3
- package/lib/types/version.d.ts +1 -1
- package/package.json +23 -37
- package/lib/esm/common/ant-versions.js +0 -87
- package/lib/esm/common/arweave.js +0 -21
- package/lib/esm/common/contracts/ao-process.js +0 -218
- package/lib/esm/common/hyperbeam/hb.js +0 -169
- package/lib/esm/common/marketplace.js +0 -669
- package/lib/esm/common/turbo.js +0 -215
- package/lib/esm/node/index.js +0 -20
- package/lib/esm/solana/generated/ant/events/aclEntryAddedEvent.js +0 -21
- package/lib/esm/solana/generated/ant/events/aclEntryRemovedEvent.js +0 -21
- package/lib/esm/solana/generated/ant/events/antMetadataUpdatedEvent.js +0 -21
- package/lib/esm/solana/generated/ant/events/antReconciledEvent.js +0 -21
- package/lib/esm/solana/generated/ant/events/antTransferredEvent.js +0 -21
- package/lib/esm/solana/generated/ant/events/attributesClearedEvent.js +0 -21
- package/lib/esm/solana/generated/ant/events/attributesSyncedEvent.js +0 -21
- package/lib/esm/solana/generated/ant/events/controllerAddedEvent.js +0 -21
- package/lib/esm/solana/generated/ant/events/controllerRemovedEvent.js +0 -21
- package/lib/esm/solana/generated/ant/events/index.js +0 -16
- package/lib/esm/solana/generated/ant/events/recordMetadataPrunedEvent.js +0 -21
- package/lib/esm/solana/generated/ant/events/recordMetadataRemovedEvent.js +0 -21
- package/lib/esm/solana/generated/ant/events/recordMetadataUpdatedEvent.js +0 -21
- package/lib/esm/solana/generated/ant/events/recordRemovedEvent.js +0 -21
- package/lib/esm/solana/generated/ant/events/recordSetEvent.js +0 -21
- package/lib/esm/solana/generated/ant/events/recordTransferredEvent.js +0 -21
- package/lib/esm/solana/generated/ant-escrow/events/escrowCancelledEvent.js +0 -21
- package/lib/esm/solana/generated/ant-escrow/events/escrowClaimedEvent.js +0 -21
- package/lib/esm/solana/generated/ant-escrow/events/escrowDepositedEvent.js +0 -21
- package/lib/esm/solana/generated/ant-escrow/events/escrowRecipientUpdatedEvent.js +0 -21
- package/lib/esm/solana/generated/ant-escrow/events/index.js +0 -5
- package/lib/esm/solana/generated/arns/events/demandFactorUpdatedEvent.js +0 -21
- package/lib/esm/solana/generated/arns/events/index.js +0 -13
- package/lib/esm/solana/generated/arns/events/leaseExtendedEvent.js +0 -21
- package/lib/esm/solana/generated/arns/events/namePurchasedEvent.js +0 -21
- package/lib/esm/solana/generated/arns/events/nameReassignedEvent.js +0 -21
- package/lib/esm/solana/generated/arns/events/nameReleasedEvent.js +0 -21
- package/lib/esm/solana/generated/arns/events/nameReservedEvent.js +0 -21
- package/lib/esm/solana/generated/arns/events/nameUnreservedEvent.js +0 -21
- package/lib/esm/solana/generated/arns/events/nameUpgradedEvent.js +0 -21
- package/lib/esm/solana/generated/arns/events/namesPrunedEvent.js +0 -21
- package/lib/esm/solana/generated/arns/events/reservedNameClaimedEvent.js +0 -21
- package/lib/esm/solana/generated/arns/events/returnedNamePurchasedEvent.js +0 -21
- package/lib/esm/solana/generated/arns/events/undernameIncreasedEvent.js +0 -21
- package/lib/esm/solana/generated/core/events/configUpdatedEvent.js +0 -21
- package/lib/esm/solana/generated/core/events/coreMigrationFinalizedEvent.js +0 -21
- package/lib/esm/solana/generated/core/events/index.js +0 -14
- package/lib/esm/solana/generated/core/events/primaryNameRemovedEvent.js +0 -21
- package/lib/esm/solana/generated/core/events/primaryNameRequestExpiredEvent.js +0 -21
- package/lib/esm/solana/generated/core/events/primaryNameRequestedEvent.js +0 -21
- package/lib/esm/solana/generated/core/events/primaryNameSetEvent.js +0 -21
- package/lib/esm/solana/generated/core/events/supplyFinalizedEvent.js +0 -21
- package/lib/esm/solana/generated/core/events/transferEvent.js +0 -21
- package/lib/esm/solana/generated/core/events/vaultCreatedEvent.js +0 -21
- package/lib/esm/solana/generated/core/events/vaultExtendedEvent.js +0 -21
- package/lib/esm/solana/generated/core/events/vaultIncreasedEvent.js +0 -21
- package/lib/esm/solana/generated/core/events/vaultReleasedEvent.js +0 -21
- package/lib/esm/solana/generated/core/events/vaultRevokedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/allowlistToggledEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/delegateAllowlistedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/delegationClosedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/delegationDecreasedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/delegationEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/epochClosedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/epochCreatedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/epochDistributedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/epochPrescribedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/epochWeightsTalliedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/epochsToggledEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/fundingPlanAppliedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/garMigrationFinalizedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/gatewayFinalizedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/gatewayJoinedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/gatewayLeavingEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/gatewayPrunedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/gatewaySettingsUpdatedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/index.js +0 -31
- package/lib/esm/solana/generated/gar/events/instantWithdrawalEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/observationSubmittedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/observerAddressUpdatedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/operatorStakeIncreasedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/redelegationEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/residueVaultCreatedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/rewardsCompoundedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/stakePaymentEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/withdrawalCancelledEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/withdrawalClaimedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/withdrawalCreatedEvent.js +0 -21
- package/lib/esm/solana/generated/gar/events/withdrawalPaymentEvent.js +0 -21
- package/lib/esm/solana/generated/mpl-core/accounts/assetV1.js +0 -42
- package/lib/esm/solana/generated/mpl-core/accounts/collectionV1.js +0 -42
- package/lib/esm/solana/generated/mpl-core/accounts/hashedAssetV1.js +0 -45
- package/lib/esm/solana/generated/mpl-core/accounts/index.js +0 -12
- package/lib/esm/solana/generated/mpl-core/accounts/pluginHeaderV1.js +0 -45
- package/lib/esm/solana/generated/mpl-core/accounts/pluginRegistryV1.js +0 -42
- package/lib/esm/solana/generated/mpl-core/errors/index.js +0 -8
- package/lib/esm/solana/generated/mpl-core/errors/mplCore.js +0 -136
- package/lib/esm/solana/generated/mpl-core/index.js +0 -8
- package/lib/esm/solana/generated/mpl-core/instructions/addCollectionExternalPluginAdapterV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/addCollectionPluginV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/addExternalPluginAdapterV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/addPluginV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/approveCollectionPluginAuthorityV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/approvePluginAuthorityV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/burnCollectionV1.js +0 -49
- package/lib/esm/solana/generated/mpl-core/instructions/burnV1.js +0 -49
- package/lib/esm/solana/generated/mpl-core/instructions/collect.js +0 -42
- package/lib/esm/solana/generated/mpl-core/instructions/compressV1.js +0 -50
- package/lib/esm/solana/generated/mpl-core/instructions/createCollectionV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/createCollectionV2.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/createV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/createV2.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/decompressV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/executeV1.js +0 -56
- package/lib/esm/solana/generated/mpl-core/instructions/index.js +0 -40
- package/lib/esm/solana/generated/mpl-core/instructions/removeCollectionExternalPluginAdapterV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/removeCollectionPluginV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/removeExternalPluginAdapterV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/removePluginV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/revokeCollectionPluginAuthorityV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/revokePluginAuthorityV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/transferV1.js +0 -49
- package/lib/esm/solana/generated/mpl-core/instructions/updateCollectionExternalPluginAdapterV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/updateCollectionInfoV1.js +0 -45
- package/lib/esm/solana/generated/mpl-core/instructions/updateCollectionPluginV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/updateCollectionV1.js +0 -52
- package/lib/esm/solana/generated/mpl-core/instructions/updateExternalPluginAdapterV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/updatePluginV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/updateV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/updateV2.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/writeCollectionExternalPluginAdapterDataV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/instructions/writeExternalPluginAdapterDataV1.js +0 -53
- package/lib/esm/solana/generated/mpl-core/program-address.js +0 -1
- package/lib/esm/solana/generated/mpl-core/types/addAssetsToGroupV1Args.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/addBlocker.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/addCollectionsToGroupV1Args.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/addGroupsToGroupV1Args.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/agentIdentity.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/agentIdentityInitInfo.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/agentIdentityUpdateInfo.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/appData.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/appDataInitInfo.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/appDataUpdateInfo.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/attribute.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/attributes.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/authority.js +0 -24
- package/lib/esm/solana/generated/mpl-core/types/autograph.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/autographSignature.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/bubblegumV2.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/burnDelegate.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/closeGroupV1Args.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/compressionProof.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/creator.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/dataSection.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/dataSectionInitInfo.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/dataSectionUpdateInfo.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/dataState.js +0 -23
- package/lib/esm/solana/generated/mpl-core/types/edition.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/externalCheckResult.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/externalPluginAdapter.js +0 -25
- package/lib/esm/solana/generated/mpl-core/types/externalPluginAdapterInitInfo.js +0 -25
- package/lib/esm/solana/generated/mpl-core/types/externalPluginAdapterKey.js +0 -25
- package/lib/esm/solana/generated/mpl-core/types/externalPluginAdapterSchema.js +0 -24
- package/lib/esm/solana/generated/mpl-core/types/externalPluginAdapterType.js +0 -28
- package/lib/esm/solana/generated/mpl-core/types/externalPluginAdapterUpdateInfo.js +0 -25
- package/lib/esm/solana/generated/mpl-core/types/externalRegistryRecord.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/externalValidationResult.js +0 -24
- package/lib/esm/solana/generated/mpl-core/types/extraAccount.js +0 -25
- package/lib/esm/solana/generated/mpl-core/types/freezeDelegate.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/freezeExecute.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/groups.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/hashablePluginSchema.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/hashedAssetSchema.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/hookableLifecycleEvent.js +0 -26
- package/lib/esm/solana/generated/mpl-core/types/immutableMetadata.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/index.js +0 -89
- package/lib/esm/solana/generated/mpl-core/types/key.js +0 -28
- package/lib/esm/solana/generated/mpl-core/types/lifecycleHook.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/lifecycleHookInitInfo.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/lifecycleHookUpdateInfo.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/linkedAppData.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/linkedAppDataInitInfo.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/linkedAppDataUpdateInfo.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/linkedDataKey.js +0 -25
- package/lib/esm/solana/generated/mpl-core/types/linkedLifecycleHook.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/linkedLifecycleHookInitInfo.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/linkedLifecycleHookUpdateInfo.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/masterEdition.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/oracle.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/oracleInitInfo.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/oracleUpdateInfo.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/oracleValidation.js +0 -25
- package/lib/esm/solana/generated/mpl-core/types/permanentBurnDelegate.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/permanentFreezeDelegate.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/permanentFreezeExecute.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/permanentTransferDelegate.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/plugin.js +0 -25
- package/lib/esm/solana/generated/mpl-core/types/pluginAuthorityPair.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/pluginType.js +0 -40
- package/lib/esm/solana/generated/mpl-core/types/registryRecord.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/relationshipKind.js +0 -25
- package/lib/esm/solana/generated/mpl-core/types/removeAssetsFromGroupV1Args.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/removeCollectionsFromGroupV1Args.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/removeGroupsFromGroupV1Args.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/royalties.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/ruleSet.js +0 -24
- package/lib/esm/solana/generated/mpl-core/types/seed.js +0 -24
- package/lib/esm/solana/generated/mpl-core/types/transferDelegate.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/updateAuthority.js +0 -24
- package/lib/esm/solana/generated/mpl-core/types/updateDelegate.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/updateGroupV1Args.js +0 -17
- package/lib/esm/solana/generated/mpl-core/types/updateType.js +0 -24
- package/lib/esm/solana/generated/mpl-core/types/validationResult.js +0 -25
- package/lib/esm/solana/generated/mpl-core/types/validationResultsOffset.js +0 -24
- package/lib/esm/solana/generated/mpl-core/types/verifiedCreators.js +0 -18
- package/lib/esm/solana/generated/mpl-core/types/verifiedCreatorsSignature.js +0 -17
- package/lib/esm/utils/ao.js +0 -421
- package/lib/esm/utils/arweave.js +0 -271
- package/lib/esm/utils/processes.js +0 -167
- package/lib/esm/web/index.js +0 -20
- package/lib/types/common/ant-versions.d.ts +0 -39
- package/lib/types/common/arweave.d.ts +0 -17
- package/lib/types/common/contracts/ao-process.d.ts +0 -33
- package/lib/types/common/hyperbeam/hb.d.ts +0 -88
- package/lib/types/common/marketplace.d.ts +0 -556
- package/lib/types/common/turbo.d.ts +0 -61
- package/lib/types/node/index.d.ts +0 -20
- package/lib/types/solana/generated/ant/events/aclEntryAddedEvent.d.ts +0 -26
- package/lib/types/solana/generated/ant/events/aclEntryRemovedEvent.d.ts +0 -26
- package/lib/types/solana/generated/ant/events/antMetadataUpdatedEvent.d.ts +0 -28
- package/lib/types/solana/generated/ant/events/antReconciledEvent.d.ts +0 -28
- package/lib/types/solana/generated/ant/events/antTransferredEvent.d.ts +0 -26
- package/lib/types/solana/generated/ant/events/attributesClearedEvent.d.ts +0 -26
- package/lib/types/solana/generated/ant/events/attributesSyncedEvent.d.ts +0 -24
- package/lib/types/solana/generated/ant/events/controllerAddedEvent.d.ts +0 -26
- package/lib/types/solana/generated/ant/events/controllerRemovedEvent.d.ts +0 -26
- package/lib/types/solana/generated/ant/events/index.d.ts +0 -15
- package/lib/types/solana/generated/ant/events/recordMetadataPrunedEvent.d.ts +0 -26
- package/lib/types/solana/generated/ant/events/recordMetadataRemovedEvent.d.ts +0 -26
- package/lib/types/solana/generated/ant/events/recordMetadataUpdatedEvent.d.ts +0 -28
- package/lib/types/solana/generated/ant/events/recordRemovedEvent.d.ts +0 -26
- package/lib/types/solana/generated/ant/events/recordSetEvent.d.ts +0 -34
- package/lib/types/solana/generated/ant/events/recordTransferredEvent.d.ts +0 -30
- package/lib/types/solana/generated/ant-escrow/events/escrowCancelledEvent.d.ts +0 -28
- package/lib/types/solana/generated/ant-escrow/events/escrowClaimedEvent.d.ts +0 -32
- package/lib/types/solana/generated/ant-escrow/events/escrowDepositedEvent.d.ts +0 -36
- package/lib/types/solana/generated/ant-escrow/events/escrowRecipientUpdatedEvent.d.ts +0 -26
- package/lib/types/solana/generated/ant-escrow/events/index.d.ts +0 -4
- package/lib/types/solana/generated/arns/events/demandFactorUpdatedEvent.d.ts +0 -28
- package/lib/types/solana/generated/arns/events/index.d.ts +0 -12
- package/lib/types/solana/generated/arns/events/leaseExtendedEvent.d.ts +0 -32
- package/lib/types/solana/generated/arns/events/namePurchasedEvent.d.ts +0 -34
- package/lib/types/solana/generated/arns/events/nameReassignedEvent.d.ts +0 -28
- package/lib/types/solana/generated/arns/events/nameReleasedEvent.d.ts +0 -24
- package/lib/types/solana/generated/arns/events/nameReservedEvent.d.ts +0 -28
- package/lib/types/solana/generated/arns/events/nameUnreservedEvent.d.ts +0 -24
- package/lib/types/solana/generated/arns/events/nameUpgradedEvent.d.ts +0 -28
- package/lib/types/solana/generated/arns/events/namesPrunedEvent.d.ts +0 -26
- package/lib/types/solana/generated/arns/events/reservedNameClaimedEvent.d.ts +0 -24
- package/lib/types/solana/generated/arns/events/returnedNamePurchasedEvent.d.ts +0 -32
- package/lib/types/solana/generated/arns/events/undernameIncreasedEvent.d.ts +0 -32
- package/lib/types/solana/generated/core/events/configUpdatedEvent.d.ts +0 -26
- package/lib/types/solana/generated/core/events/coreMigrationFinalizedEvent.d.ts +0 -26
- package/lib/types/solana/generated/core/events/index.d.ts +0 -13
- package/lib/types/solana/generated/core/events/primaryNameRemovedEvent.d.ts +0 -26
- package/lib/types/solana/generated/core/events/primaryNameRequestExpiredEvent.d.ts +0 -26
- package/lib/types/solana/generated/core/events/primaryNameRequestedEvent.d.ts +0 -30
- package/lib/types/solana/generated/core/events/primaryNameSetEvent.d.ts +0 -24
- package/lib/types/solana/generated/core/events/supplyFinalizedEvent.d.ts +0 -26
- package/lib/types/solana/generated/core/events/transferEvent.d.ts +0 -26
- package/lib/types/solana/generated/core/events/vaultCreatedEvent.d.ts +0 -28
- package/lib/types/solana/generated/core/events/vaultExtendedEvent.d.ts +0 -26
- package/lib/types/solana/generated/core/events/vaultIncreasedEvent.d.ts +0 -28
- package/lib/types/solana/generated/core/events/vaultReleasedEvent.d.ts +0 -26
- package/lib/types/solana/generated/core/events/vaultRevokedEvent.d.ts +0 -28
- package/lib/types/solana/generated/gar/events/allowlistToggledEvent.d.ts +0 -24
- package/lib/types/solana/generated/gar/events/delegateAllowlistedEvent.d.ts +0 -26
- package/lib/types/solana/generated/gar/events/delegationClosedEvent.d.ts +0 -24
- package/lib/types/solana/generated/gar/events/delegationDecreasedEvent.d.ts +0 -28
- package/lib/types/solana/generated/gar/events/delegationEvent.d.ts +0 -28
- package/lib/types/solana/generated/gar/events/epochClosedEvent.d.ts +0 -24
- package/lib/types/solana/generated/gar/events/epochCreatedEvent.d.ts +0 -26
- package/lib/types/solana/generated/gar/events/epochDistributedEvent.d.ts +0 -26
- package/lib/types/solana/generated/gar/events/epochPrescribedEvent.d.ts +0 -28
- package/lib/types/solana/generated/gar/events/epochWeightsTalliedEvent.d.ts +0 -26
- package/lib/types/solana/generated/gar/events/epochsToggledEvent.d.ts +0 -24
- package/lib/types/solana/generated/gar/events/fundingPlanAppliedEvent.d.ts +0 -28
- package/lib/types/solana/generated/gar/events/garMigrationFinalizedEvent.d.ts +0 -26
- package/lib/types/solana/generated/gar/events/gatewayFinalizedEvent.d.ts +0 -24
- package/lib/types/solana/generated/gar/events/gatewayJoinedEvent.d.ts +0 -26
- package/lib/types/solana/generated/gar/events/gatewayLeavingEvent.d.ts +0 -22
- package/lib/types/solana/generated/gar/events/gatewayPrunedEvent.d.ts +0 -26
- package/lib/types/solana/generated/gar/events/gatewaySettingsUpdatedEvent.d.ts +0 -24
- package/lib/types/solana/generated/gar/events/index.d.ts +0 -30
- package/lib/types/solana/generated/gar/events/instantWithdrawalEvent.d.ts +0 -30
- package/lib/types/solana/generated/gar/events/observationSubmittedEvent.d.ts +0 -28
- package/lib/types/solana/generated/gar/events/observerAddressUpdatedEvent.d.ts +0 -24
- package/lib/types/solana/generated/gar/events/operatorStakeIncreasedEvent.d.ts +0 -26
- package/lib/types/solana/generated/gar/events/redelegationEvent.d.ts +0 -30
- package/lib/types/solana/generated/gar/events/residueVaultCreatedEvent.d.ts +0 -30
- package/lib/types/solana/generated/gar/events/rewardsCompoundedEvent.d.ts +0 -26
- package/lib/types/solana/generated/gar/events/stakePaymentEvent.d.ts +0 -28
- package/lib/types/solana/generated/gar/events/withdrawalCancelledEvent.d.ts +0 -30
- package/lib/types/solana/generated/gar/events/withdrawalClaimedEvent.d.ts +0 -26
- package/lib/types/solana/generated/gar/events/withdrawalCreatedEvent.d.ts +0 -28
- package/lib/types/solana/generated/gar/events/withdrawalPaymentEvent.d.ts +0 -28
- package/lib/types/solana/generated/mpl-core/accounts/assetV1.d.ts +0 -37
- package/lib/types/solana/generated/mpl-core/accounts/collectionV1.d.ts +0 -37
- package/lib/types/solana/generated/mpl-core/accounts/hashedAssetV1.d.ts +0 -30
- package/lib/types/solana/generated/mpl-core/accounts/index.d.ts +0 -12
- package/lib/types/solana/generated/mpl-core/accounts/pluginHeaderV1.d.ts +0 -30
- package/lib/types/solana/generated/mpl-core/accounts/pluginRegistryV1.d.ts +0 -31
- package/lib/types/solana/generated/mpl-core/errors/index.d.ts +0 -8
- package/lib/types/solana/generated/mpl-core/errors/mplCore.d.ts +0 -133
- package/lib/types/solana/generated/mpl-core/index.d.ts +0 -8
- package/lib/types/solana/generated/mpl-core/instructions/addCollectionExternalPluginAdapterV1.d.ts +0 -56
- package/lib/types/solana/generated/mpl-core/instructions/addCollectionPluginV1.d.ts +0 -59
- package/lib/types/solana/generated/mpl-core/instructions/addExternalPluginAdapterV1.d.ts +0 -60
- package/lib/types/solana/generated/mpl-core/instructions/addPluginV1.d.ts +0 -63
- package/lib/types/solana/generated/mpl-core/instructions/approveCollectionPluginAuthorityV1.d.ts +0 -59
- package/lib/types/solana/generated/mpl-core/instructions/approvePluginAuthorityV1.d.ts +0 -63
- package/lib/types/solana/generated/mpl-core/instructions/burnCollectionV1.d.ts +0 -52
- package/lib/types/solana/generated/mpl-core/instructions/burnV1.d.ts +0 -60
- package/lib/types/solana/generated/mpl-core/instructions/collect.d.ts +0 -39
- package/lib/types/solana/generated/mpl-core/instructions/compressV1.d.ts +0 -55
- package/lib/types/solana/generated/mpl-core/instructions/createCollectionV1.d.ts +0 -58
- package/lib/types/solana/generated/mpl-core/instructions/createCollectionV2.d.ts +0 -61
- package/lib/types/solana/generated/mpl-core/instructions/createV1.d.ts +0 -77
- package/lib/types/solana/generated/mpl-core/instructions/createV2.d.ts +0 -80
- package/lib/types/solana/generated/mpl-core/instructions/decompressV1.d.ts +0 -60
- package/lib/types/solana/generated/mpl-core/instructions/executeV1.d.ts +0 -63
- package/lib/types/solana/generated/mpl-core/instructions/index.d.ts +0 -40
- package/lib/types/solana/generated/mpl-core/instructions/removeCollectionExternalPluginAdapterV1.d.ts +0 -56
- package/lib/types/solana/generated/mpl-core/instructions/removeCollectionPluginV1.d.ts +0 -56
- package/lib/types/solana/generated/mpl-core/instructions/removeExternalPluginAdapterV1.d.ts +0 -60
- package/lib/types/solana/generated/mpl-core/instructions/removePluginV1.d.ts +0 -60
- package/lib/types/solana/generated/mpl-core/instructions/revokeCollectionPluginAuthorityV1.d.ts +0 -56
- package/lib/types/solana/generated/mpl-core/instructions/revokePluginAuthorityV1.d.ts +0 -60
- package/lib/types/solana/generated/mpl-core/instructions/transferV1.d.ts +0 -64
- package/lib/types/solana/generated/mpl-core/instructions/updateCollectionExternalPluginAdapterV1.d.ts +0 -59
- package/lib/types/solana/generated/mpl-core/instructions/updateCollectionInfoV1.d.ts +0 -47
- package/lib/types/solana/generated/mpl-core/instructions/updateCollectionPluginV1.d.ts +0 -56
- package/lib/types/solana/generated/mpl-core/instructions/updateCollectionV1.d.ts +0 -62
- package/lib/types/solana/generated/mpl-core/instructions/updateExternalPluginAdapterV1.d.ts +0 -63
- package/lib/types/solana/generated/mpl-core/instructions/updatePluginV1.d.ts +0 -60
- package/lib/types/solana/generated/mpl-core/instructions/updateV1.d.ts +0 -66
- package/lib/types/solana/generated/mpl-core/instructions/updateV2.d.ts +0 -70
- package/lib/types/solana/generated/mpl-core/instructions/writeCollectionExternalPluginAdapterDataV1.d.ts +0 -63
- package/lib/types/solana/generated/mpl-core/instructions/writeExternalPluginAdapterDataV1.d.ts +0 -67
- package/lib/types/solana/generated/mpl-core/program-address.d.ts +0 -7
- package/lib/types/solana/generated/mpl-core/types/addAssetsToGroupV1Args.d.ts +0 -13
- package/lib/types/solana/generated/mpl-core/types/addBlocker.d.ts +0 -13
- package/lib/types/solana/generated/mpl-core/types/addCollectionsToGroupV1Args.d.ts +0 -13
- package/lib/types/solana/generated/mpl-core/types/addGroupsToGroupV1Args.d.ts +0 -15
- package/lib/types/solana/generated/mpl-core/types/agentIdentity.d.ts +0 -15
- package/lib/types/solana/generated/mpl-core/types/agentIdentityInitInfo.d.ts +0 -22
- package/lib/types/solana/generated/mpl-core/types/agentIdentityUpdateInfo.d.ts +0 -20
- package/lib/types/solana/generated/mpl-core/types/appData.d.ts +0 -20
- package/lib/types/solana/generated/mpl-core/types/appDataInitInfo.d.ts +0 -22
- package/lib/types/solana/generated/mpl-core/types/appDataUpdateInfo.d.ts +0 -18
- package/lib/types/solana/generated/mpl-core/types/attribute.d.ts +0 -16
- package/lib/types/solana/generated/mpl-core/types/attributes.d.ts +0 -18
- package/lib/types/solana/generated/mpl-core/types/authority.d.ts +0 -29
- package/lib/types/solana/generated/mpl-core/types/autograph.d.ts +0 -18
- package/lib/types/solana/generated/mpl-core/types/autographSignature.d.ts +0 -16
- package/lib/types/solana/generated/mpl-core/types/bubblegumV2.d.ts +0 -13
- package/lib/types/solana/generated/mpl-core/types/burnDelegate.d.ts +0 -13
- package/lib/types/solana/generated/mpl-core/types/closeGroupV1Args.d.ts +0 -13
- package/lib/types/solana/generated/mpl-core/types/compressionProof.d.ts +0 -28
- package/lib/types/solana/generated/mpl-core/types/creator.d.ts +0 -16
- package/lib/types/solana/generated/mpl-core/types/dataSection.d.ts +0 -20
- package/lib/types/solana/generated/mpl-core/types/dataSectionInitInfo.d.ts +0 -20
- package/lib/types/solana/generated/mpl-core/types/dataSectionUpdateInfo.d.ts +0 -13
- package/lib/types/solana/generated/mpl-core/types/dataState.d.ts +0 -16
- package/lib/types/solana/generated/mpl-core/types/edition.d.ts +0 -15
- package/lib/types/solana/generated/mpl-core/types/externalCheckResult.d.ts +0 -15
- package/lib/types/solana/generated/mpl-core/types/externalPluginAdapter.d.ts +0 -66
- package/lib/types/solana/generated/mpl-core/types/externalPluginAdapterInitInfo.d.ts +0 -66
- package/lib/types/solana/generated/mpl-core/types/externalPluginAdapterKey.d.ts +0 -64
- package/lib/types/solana/generated/mpl-core/types/externalPluginAdapterSchema.d.ts +0 -17
- package/lib/types/solana/generated/mpl-core/types/externalPluginAdapterType.d.ts +0 -21
- package/lib/types/solana/generated/mpl-core/types/externalPluginAdapterUpdateInfo.d.ts +0 -59
- package/lib/types/solana/generated/mpl-core/types/externalRegistryRecord.d.ts +0 -28
- package/lib/types/solana/generated/mpl-core/types/externalValidationResult.d.ts +0 -17
- package/lib/types/solana/generated/mpl-core/types/extraAccount.d.ts +0 -86
- package/lib/types/solana/generated/mpl-core/types/freezeDelegate.d.ts +0 -15
- package/lib/types/solana/generated/mpl-core/types/freezeExecute.d.ts +0 -15
- package/lib/types/solana/generated/mpl-core/types/groups.d.ts +0 -15
- package/lib/types/solana/generated/mpl-core/types/hashablePluginSchema.d.ts +0 -22
- package/lib/types/solana/generated/mpl-core/types/hashedAssetSchema.d.ts +0 -16
- package/lib/types/solana/generated/mpl-core/types/hookableLifecycleEvent.d.ts +0 -19
- package/lib/types/solana/generated/mpl-core/types/immutableMetadata.d.ts +0 -13
- package/lib/types/solana/generated/mpl-core/types/index.d.ts +0 -89
- package/lib/types/solana/generated/mpl-core/types/key.d.ts +0 -21
- package/lib/types/solana/generated/mpl-core/types/lifecycleHook.d.ts +0 -24
- package/lib/types/solana/generated/mpl-core/types/lifecycleHookInitInfo.d.ts +0 -28
- package/lib/types/solana/generated/mpl-core/types/lifecycleHookUpdateInfo.d.ts +0 -22
- package/lib/types/solana/generated/mpl-core/types/linkedAppData.d.ts +0 -20
- package/lib/types/solana/generated/mpl-core/types/linkedAppDataInitInfo.d.ts +0 -22
- package/lib/types/solana/generated/mpl-core/types/linkedAppDataUpdateInfo.d.ts +0 -18
- package/lib/types/solana/generated/mpl-core/types/linkedDataKey.d.ts +0 -31
- package/lib/types/solana/generated/mpl-core/types/linkedLifecycleHook.d.ts +0 -24
- package/lib/types/solana/generated/mpl-core/types/linkedLifecycleHookInitInfo.d.ts +0 -28
- package/lib/types/solana/generated/mpl-core/types/linkedLifecycleHookUpdateInfo.d.ts +0 -22
- package/lib/types/solana/generated/mpl-core/types/masterEdition.d.ts +0 -21
- package/lib/types/solana/generated/mpl-core/types/oracle.d.ts +0 -22
- package/lib/types/solana/generated/mpl-core/types/oracleInitInfo.d.ts +0 -26
- package/lib/types/solana/generated/mpl-core/types/oracleUpdateInfo.d.ts +0 -22
- package/lib/types/solana/generated/mpl-core/types/oracleValidation.d.ts +0 -35
- package/lib/types/solana/generated/mpl-core/types/permanentBurnDelegate.d.ts +0 -13
- package/lib/types/solana/generated/mpl-core/types/permanentFreezeDelegate.d.ts +0 -15
- package/lib/types/solana/generated/mpl-core/types/permanentFreezeExecute.d.ts +0 -15
- package/lib/types/solana/generated/mpl-core/types/permanentTransferDelegate.d.ts +0 -13
- package/lib/types/solana/generated/mpl-core/types/plugin.d.ts +0 -150
- package/lib/types/solana/generated/mpl-core/types/pluginAuthorityPair.d.ts +0 -20
- package/lib/types/solana/generated/mpl-core/types/pluginType.d.ts +0 -33
- package/lib/types/solana/generated/mpl-core/types/registryRecord.d.ts +0 -22
- package/lib/types/solana/generated/mpl-core/types/relationshipKind.d.ts +0 -18
- package/lib/types/solana/generated/mpl-core/types/removeAssetsFromGroupV1Args.d.ts +0 -15
- package/lib/types/solana/generated/mpl-core/types/removeCollectionsFromGroupV1Args.d.ts +0 -15
- package/lib/types/solana/generated/mpl-core/types/removeGroupsFromGroupV1Args.d.ts +0 -15
- package/lib/types/solana/generated/mpl-core/types/royalties.d.ts +0 -22
- package/lib/types/solana/generated/mpl-core/types/ruleSet.d.ts +0 -27
- package/lib/types/solana/generated/mpl-core/types/seed.d.ts +0 -36
- package/lib/types/solana/generated/mpl-core/types/transferDelegate.d.ts +0 -13
- package/lib/types/solana/generated/mpl-core/types/updateAuthority.d.ts +0 -27
- package/lib/types/solana/generated/mpl-core/types/updateDelegate.d.ts +0 -15
- package/lib/types/solana/generated/mpl-core/types/updateGroupV1Args.d.ts +0 -19
- package/lib/types/solana/generated/mpl-core/types/updateType.d.ts +0 -17
- package/lib/types/solana/generated/mpl-core/types/validationResult.d.ts +0 -18
- package/lib/types/solana/generated/mpl-core/types/validationResultsOffset.d.ts +0 -33
- package/lib/types/solana/generated/mpl-core/types/verifiedCreators.d.ts +0 -18
- package/lib/types/solana/generated/mpl-core/types/verifiedCreatorsSignature.d.ts +0 -16
- package/lib/types/utils/ao.d.ts +0 -80
- package/lib/types/utils/arweave.d.ts +0 -79
- package/lib/types/utils/processes.d.ts +0 -39
- package/lib/types/web/index.d.ts +0 -20
package/README.md
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://codecov.io/gh/ar-io/ar-io-sdk)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The Solana-native SDK for the AR.IO network. Provides typed
|
|
6
|
+
client classes (`ARIO`, `ANT`, `ANTRegistry`), PDA helpers,
|
|
7
|
+
deserializers, and escrow primitives for the AR.IO protocol on Solana.
|
|
8
|
+
Codama-generated instruction builders and account decoders are
|
|
9
|
+
supplied by [`@ar.io/solana-contracts`](https://www.npmjs.com/package/@ar.io/solana-contracts).
|
|
6
10
|
|
|
7
11
|
## Table of Contents
|
|
8
12
|
|
|
@@ -11,12 +15,22 @@ This is the home of the ar.io SDK. This SDK provides functionality for interacti
|
|
|
11
15
|
- [Table of Contents](#table-of-contents)
|
|
12
16
|
- [Installation](#installation)
|
|
13
17
|
- [Quick Start](#quick-start)
|
|
18
|
+
- [Usage](#usage)
|
|
19
|
+
- [ARIO Contract](#ario-contract)
|
|
20
|
+
- [ANT Contracts](#ant-contracts)
|
|
21
|
+
- [Escrow](#escrow)
|
|
22
|
+
- [Token Conversion](#token-conversion)
|
|
23
|
+
- [Logging](#logging)
|
|
24
|
+
- [Pagination](#pagination)
|
|
25
|
+
- [Advanced](#advanced)
|
|
26
|
+
- [Resources](#resources)
|
|
27
|
+
- [Developers](#developers)
|
|
14
28
|
|
|
15
29
|
<!-- tocstop -->
|
|
16
30
|
|
|
17
31
|
## Installation
|
|
18
32
|
|
|
19
|
-
Requires `node>=v18.0.0
|
|
33
|
+
Requires `node>=v18.0.0`.
|
|
20
34
|
|
|
21
35
|
```shell
|
|
22
36
|
npm install @ar.io/sdk
|
|
@@ -25,36 +39,48 @@ npm install @ar.io/sdk
|
|
|
25
39
|
or
|
|
26
40
|
|
|
27
41
|
```shell
|
|
28
|
-
yarn add @ar.io/sdk
|
|
42
|
+
yarn add @ar.io/sdk
|
|
29
43
|
```
|
|
30
44
|
|
|
31
|
-
> [!NOTE]
|
|
32
|
-
> The `--ignore-engines` flag is required when using yarn, as [permaweb/aoconnect] recommends only the use of npm. Alternatively, you can add a `.yarnrc.yml` file to your project containing `ignore-engines true` to ignore the engines check.
|
|
33
|
-
|
|
34
45
|
## Quick Start
|
|
35
46
|
|
|
36
47
|
```typescript
|
|
37
|
-
import { ARIO } from
|
|
48
|
+
import { ARIO } from '@ar.io/sdk';
|
|
49
|
+
import { createSolanaRpc } from '@solana/kit';
|
|
38
50
|
|
|
39
|
-
const
|
|
51
|
+
const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com');
|
|
52
|
+
const ario = ARIO.init({ rpc });
|
|
40
53
|
const gateways = await ario.getGateways();
|
|
41
54
|
```
|
|
42
55
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
Write operations need a `@solana/kit` signer plus an `rpcSubscriptions`
|
|
57
|
+
client (used by kit's `sendAndConfirmTransaction`):
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
import { ARIO } from '@ar.io/sdk';
|
|
61
|
+
import {
|
|
62
|
+
createSolanaRpc,
|
|
63
|
+
createSolanaRpcSubscriptions,
|
|
64
|
+
createKeyPairSignerFromBytes,
|
|
65
|
+
} from '@solana/kit';
|
|
66
|
+
import { readFileSync } from 'node:fs';
|
|
67
|
+
|
|
68
|
+
const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com');
|
|
69
|
+
const rpcSubscriptions = createSolanaRpcSubscriptions(
|
|
70
|
+
'wss://api.mainnet-beta.solana.com',
|
|
71
|
+
);
|
|
72
|
+
const signer = await createKeyPairSignerFromBytes(
|
|
73
|
+
new Uint8Array(JSON.parse(readFileSync('keypair.json', 'utf8'))),
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
77
|
+
await ario.buyRecord({
|
|
78
|
+
name: 'foo',
|
|
79
|
+
type: 'lease',
|
|
80
|
+
years: 1,
|
|
81
|
+
processId: '<ANT mint pubkey>',
|
|
82
|
+
});
|
|
83
|
+
```
|
|
58
84
|
|
|
59
85
|
<details>
|
|
60
86
|
<summary>Output</summary>
|
|
@@ -66,7 +92,13 @@ const gateways = await ario.getGateways();
|
|
|
66
92
|
"gatewayAddress": "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ",
|
|
67
93
|
"observerAddress": "IPdwa3Mb_9pDD8c2IaJx6aad51Ss-_TfStVwBuhtXMs",
|
|
68
94
|
"operatorStake": 250000000000,
|
|
95
|
+
"totalDelegatedStake": 0,
|
|
69
96
|
"settings": {
|
|
97
|
+
"allowDelegatedStaking": true,
|
|
98
|
+
"allowedDelegates": [],
|
|
99
|
+
"autoStake": false,
|
|
100
|
+
"delegateRewardShareRatio": 10,
|
|
101
|
+
"minDelegatedStake": 100000000,
|
|
70
102
|
"fqdn": "ar-io.dev",
|
|
71
103
|
"label": "ar.io Test",
|
|
72
104
|
"note": "Test Gateway operated by PDS for the ar.io ecosystem.",
|
|
@@ -75,28 +107,33 @@ const gateways = await ario.getGateways();
|
|
|
75
107
|
"protocol": "https"
|
|
76
108
|
},
|
|
77
109
|
"startTimestamp": 1720720621424,
|
|
110
|
+
"endTimestamp": 0,
|
|
78
111
|
"stats": {
|
|
112
|
+
"passedConsecutiveEpochs": 30,
|
|
79
113
|
"failedConsecutiveEpochs": 0,
|
|
80
|
-
"passedEpochCount": 30,
|
|
81
|
-
"submittedEpochCount": 30,
|
|
82
114
|
"totalEpochCount": 31,
|
|
83
|
-
"
|
|
115
|
+
"passedEpochCount": 30,
|
|
116
|
+
"failedEpochCount": 1,
|
|
117
|
+
"observedEpochCount": 30,
|
|
118
|
+
"prescribedEpochCount": 31
|
|
84
119
|
},
|
|
85
120
|
"status": "joined",
|
|
86
|
-
"vaults": {},
|
|
87
121
|
"weights": {
|
|
88
|
-
"
|
|
89
|
-
"gatewayPerformanceRatio": 1,
|
|
122
|
+
"stakeWeight": 5.02400000024,
|
|
90
123
|
"tenureWeight": 0.19444444444444,
|
|
124
|
+
"gatewayPerformanceRatio": 1,
|
|
125
|
+
"observerPerformanceRatio": 1,
|
|
126
|
+
"gatewayRewardRatioWeight": 1,
|
|
91
127
|
"observerRewardRatioWeight": 1,
|
|
92
|
-
"
|
|
93
|
-
"
|
|
128
|
+
"compositeWeight": 0.97688888893556,
|
|
129
|
+
"normalizedCompositeWeight": 0.19247316211083
|
|
94
130
|
}
|
|
95
131
|
}
|
|
96
132
|
],
|
|
97
133
|
"hasMore": true,
|
|
98
134
|
"nextCursor": "-4xgjroXENKYhTWqrBo57HQwvDL51mMdfsdsxJy6Y2Z_sA",
|
|
99
135
|
"totalItems": 316,
|
|
136
|
+
"limit": 100,
|
|
100
137
|
"sortBy": "startTimestamp",
|
|
101
138
|
"sortOrder": "desc"
|
|
102
139
|
}
|
|
@@ -106,75 +143,92 @@ const gateways = await ario.getGateways();
|
|
|
106
143
|
|
|
107
144
|
## Usage
|
|
108
145
|
|
|
109
|
-
The SDK is published as an ES module (`"type": "module"`) and is
|
|
146
|
+
The SDK is published as an ES module (`"type": "module"`) and is
|
|
147
|
+
compatible with modern bundlers such as Webpack, Rollup, ESbuild, and
|
|
148
|
+
Vite. CommonJS consumers should migrate to ESM (Node 18+ supports ESM
|
|
149
|
+
natively). Refer to the [examples] directory to see how to use the SDK
|
|
150
|
+
in various environments.
|
|
151
|
+
|
|
152
|
+
### Subpath exports
|
|
153
|
+
|
|
154
|
+
- `@ar.io/sdk` — main entry. `ARIO`, `ANT`, `ANTRegistry`, Solana
|
|
155
|
+
client classes, PDA helpers, deserializers, escrow primitives.
|
|
156
|
+
- `@ar.io/sdk/solana` — alias of the main entry (kept for one release
|
|
157
|
+
while consumers migrate from the previous subpath layout).
|
|
110
158
|
|
|
111
159
|
### Web
|
|
112
160
|
|
|
113
161
|
> [!WARNING]
|
|
114
|
-
> Polyfills are not provided by default for bundled web projects (Vite,
|
|
115
|
-
|
|
116
|
-
|
|
162
|
+
> Polyfills are not provided by default for bundled web projects (Vite,
|
|
163
|
+
> ESBuild, Webpack, Rollup, etc.). Depending on your bundler config, you
|
|
164
|
+
> will need polyfills for `crypto`, `process` and `buffer`. Refer to
|
|
165
|
+
> [examples/webpack] and [examples/vite] for examples.
|
|
117
166
|
|
|
118
167
|
```javascript
|
|
119
|
-
import { ARIO } from
|
|
168
|
+
import { ARIO } from '@ar.io/sdk';
|
|
169
|
+
import { createSolanaRpc } from '@solana/kit';
|
|
120
170
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
171
|
+
const ario = ARIO.init({
|
|
172
|
+
rpc: createSolanaRpc('https://api.mainnet-beta.solana.com'),
|
|
173
|
+
});
|
|
124
174
|
const gateways = await ario.getGateways();
|
|
125
175
|
```
|
|
126
176
|
|
|
127
|
-
|
|
177
|
+
### Browser bundle
|
|
128
178
|
|
|
129
179
|
```html
|
|
130
180
|
<script type="module">
|
|
131
|
-
// replace <version> with a release version
|
|
132
|
-
import { ARIO } from
|
|
181
|
+
// replace <version> with a release version
|
|
182
|
+
import { ARIO } from 'https://github.com/ar-io/ar-io-sdk/releases/download/v<version>/web.bundle.min.js';
|
|
183
|
+
import { createSolanaRpc } from 'https://esm.sh/@solana/kit@6';
|
|
133
184
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
185
|
+
const ario = ARIO.init({
|
|
186
|
+
rpc: createSolanaRpc('https://api.mainnet-beta.solana.com'),
|
|
187
|
+
});
|
|
137
188
|
const gateways = await ario.getGateways();
|
|
138
189
|
</script>
|
|
139
190
|
```
|
|
140
191
|
|
|
141
|
-
###
|
|
142
|
-
|
|
143
|
-
```javascript
|
|
144
|
-
import { ARIO } from "@ar.io/sdk/node";
|
|
145
|
-
|
|
146
|
-
// set up client
|
|
147
|
-
const ario = ARIO.mainnet();
|
|
148
|
-
// fetch gateways
|
|
149
|
-
const gateways = await ario.getGateways();
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Typescript
|
|
192
|
+
### TypeScript
|
|
153
193
|
|
|
154
|
-
The SDK
|
|
194
|
+
The SDK ships TypeScript types alongside the JS output. Types are
|
|
195
|
+
exported from `./lib/types/solana/index.d.ts` and resolve automatically
|
|
196
|
+
for ESM consumers.
|
|
155
197
|
|
|
156
198
|
> [!NOTE]
|
|
157
|
-
>
|
|
199
|
+
> TypeScript 5.3+ is recommended (the SDK uses `nodenext` module
|
|
200
|
+
> resolution with `.js` extensions in relative imports).
|
|
158
201
|
|
|
159
202
|
## ARIO Contract
|
|
160
203
|
|
|
161
204
|
### General
|
|
162
205
|
|
|
163
|
-
#### `init({ signer })`
|
|
206
|
+
#### `init({ rpc, rpcSubscriptions?, signer? })`
|
|
164
207
|
|
|
165
|
-
Factory function
|
|
208
|
+
Factory function that creates a read-only or writeable ARIO client.
|
|
209
|
+
Providing `signer` plus `rpcSubscriptions` enables write methods
|
|
210
|
+
(`joinNetwork`, `delegateStake`, `buyRecord`, etc.). Without a signer,
|
|
211
|
+
the client is read-only.
|
|
166
212
|
|
|
167
213
|
```typescript
|
|
168
|
-
|
|
169
|
-
|
|
214
|
+
import { ARIO } from '@ar.io/sdk';
|
|
215
|
+
import {
|
|
216
|
+
createSolanaRpc,
|
|
217
|
+
createSolanaRpcSubscriptions,
|
|
218
|
+
createKeyPairSignerFromBytes,
|
|
219
|
+
} from '@solana/kit';
|
|
170
220
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
});
|
|
221
|
+
const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com');
|
|
222
|
+
|
|
223
|
+
// read-only client
|
|
224
|
+
const ario = ARIO.init({ rpc });
|
|
175
225
|
|
|
176
|
-
// read-write client for
|
|
177
|
-
const
|
|
226
|
+
// read-write client (needs rpcSubscriptions for sendAndConfirm)
|
|
227
|
+
const rpcSubscriptions = createSolanaRpcSubscriptions(
|
|
228
|
+
'wss://api.mainnet-beta.solana.com',
|
|
229
|
+
);
|
|
230
|
+
const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */);
|
|
231
|
+
const arioWrite = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
178
232
|
```
|
|
179
233
|
|
|
180
234
|
#### `getInfo()`
|
|
@@ -182,7 +236,7 @@ const ario = ARIO.init({ signer: new ArweaveSigner(JWK) });
|
|
|
182
236
|
Retrieves the information of the ARIO process.
|
|
183
237
|
|
|
184
238
|
```typescript
|
|
185
|
-
const ario = ARIO.
|
|
239
|
+
const ario = ARIO.init({ rpc });
|
|
186
240
|
const info = await ario.getInfo();
|
|
187
241
|
```
|
|
188
242
|
|
|
@@ -191,16 +245,29 @@ const info = await ario.getInfo();
|
|
|
191
245
|
|
|
192
246
|
```json
|
|
193
247
|
{
|
|
194
|
-
"Name": "
|
|
248
|
+
"Name": "AR.IO",
|
|
195
249
|
"Ticker": "ARIO",
|
|
196
|
-
"
|
|
250
|
+
"Logo": "",
|
|
197
251
|
"Denomination": 6,
|
|
198
|
-
"Handlers": [
|
|
199
|
-
"LastCreatedEpochIndex":
|
|
200
|
-
"LastDistributedEpochIndex":
|
|
252
|
+
"Handlers": [],
|
|
253
|
+
"LastCreatedEpochIndex": 0,
|
|
254
|
+
"LastDistributedEpochIndex": 0,
|
|
255
|
+
"totalSupply": 1000000000000000,
|
|
256
|
+
"protocolBalance": 0,
|
|
257
|
+
"epochSettings": {
|
|
258
|
+
"durationMs": 86400000,
|
|
259
|
+
"prescribedNameCount": 25,
|
|
260
|
+
"maxObservers": 50
|
|
261
|
+
}
|
|
201
262
|
}
|
|
202
263
|
```
|
|
203
264
|
|
|
265
|
+
> **Note**: `Handlers`, `LastCreatedEpochIndex`, and `LastDistributedEpochIndex`
|
|
266
|
+
> are placeholders on Solana (returned for backwards-compatible field shape
|
|
267
|
+
> with consumer code). `totalSupply` / `protocolBalance` are live reads from
|
|
268
|
+
> the `ArioConfig` PDA; `epochSettings` is live from the `EpochSettings`
|
|
269
|
+
> PDA. See `src/solana/io-readable.ts` for the exact projection.
|
|
270
|
+
|
|
204
271
|
</details>
|
|
205
272
|
|
|
206
273
|
#### `getTokenSupply()`
|
|
@@ -216,7 +283,7 @@ Retrieves the total supply of tokens, returned in mARIO. The total supply includ
|
|
|
216
283
|
- `protocolBalance` - tokens that are held in the protocol's treasury. This is included in the circulating supply.
|
|
217
284
|
|
|
218
285
|
```typescript
|
|
219
|
-
const ario = ARIO.
|
|
286
|
+
const ario = ARIO.init({ rpc });
|
|
220
287
|
const supply = await ario.getTokenSupply();
|
|
221
288
|
```
|
|
222
289
|
|
|
@@ -242,7 +309,7 @@ const supply = await ario.getTokenSupply();
|
|
|
242
309
|
Retrieves the balance of the specified wallet address.
|
|
243
310
|
|
|
244
311
|
```typescript
|
|
245
|
-
const ario = ARIO.
|
|
312
|
+
const ario = ARIO.init({ rpc });
|
|
246
313
|
// the balance will be returned in mARIO as a value
|
|
247
314
|
const balance = await ario
|
|
248
315
|
.getBalance({
|
|
@@ -265,7 +332,7 @@ const balance = await ario
|
|
|
265
332
|
Retrieves the balances of the ARIO process in `mARIO`, paginated and sorted by the specified criteria. The `cursor` used for pagination is the last wallet address from the previous request.
|
|
266
333
|
|
|
267
334
|
```typescript
|
|
268
|
-
const ario = ARIO.
|
|
335
|
+
const ario = ARIO.init({ rpc });
|
|
269
336
|
const balances = await ario.getBalances({
|
|
270
337
|
cursor: "-4xgjroXENKYhTWqrBo57HQwvDL51mMdfsdsxJy6Y2Z_sA",
|
|
271
338
|
limit: 100,
|
|
@@ -307,59 +374,49 @@ Transfers `mARIO` to the designated `target` recipient address. Requires `signer
|
|
|
307
374
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
308
375
|
|
|
309
376
|
```typescript
|
|
310
|
-
const ario = ARIO.
|
|
311
|
-
|
|
377
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
378
|
+
const { id: txId } = await ario.transfer({
|
|
379
|
+
target: 'RecipientSolanaPubkeyBase58',
|
|
380
|
+
qty: new ARIOToken(1000).toMARIO(),
|
|
312
381
|
});
|
|
313
|
-
const { id: txId } = await ario.transfer(
|
|
314
|
-
{
|
|
315
|
-
target: "-5dV7nk7waR8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5",
|
|
316
|
-
qty: new ARIOToken(1000).toMARIO(),
|
|
317
|
-
},
|
|
318
|
-
// optional additional tags
|
|
319
|
-
{ tags: [{ name: "App-Name", value: "My-Awesome-App" }] },
|
|
320
|
-
);
|
|
321
382
|
```
|
|
322
383
|
|
|
323
384
|
### Networks
|
|
324
385
|
|
|
325
|
-
The SDK
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
- `ARIO_TESTNET_PROCESS_ID` - Testnet ARIO process ID (testing and development)
|
|
329
|
-
- `ARIO_DEVNET_PROCESS_ID` - Devnet ARIO process ID (development)
|
|
330
|
-
|
|
331
|
-
As of `v3.8.1` the SDK defaults all API interactions to **mainnet**. To use the **testnet** or **devnet** provide the appropriate `ARIO_TESTNET_PROCESS_ID` or `ARIO_DEVNET_PROCESS_ID` when initializing the client.
|
|
332
|
-
|
|
333
|
-
#### Mainnet
|
|
334
|
-
|
|
335
|
-
As of `v3.8.1` the SDK defaults all API interactions to **mainnet**. To use the **testnet** or **devnet** provide the appropriate `ARIO_TESTNET_PROCESS_ID` or `ARIO_DEVNET_PROCESS_ID` when initializing the client.
|
|
386
|
+
The SDK talks to whatever cluster your `@solana/kit` RPC client points
|
|
387
|
+
at — mainnet-beta by default. For devnet or a local validator, override
|
|
388
|
+
the RPC URL and (on any non-mainnet cluster) the per-program addresses:
|
|
336
389
|
|
|
337
390
|
```typescript
|
|
338
|
-
import { ARIO } from
|
|
339
|
-
|
|
340
|
-
const ario = ARIO.mainnet(); // or ARIO.init()
|
|
341
|
-
```
|
|
342
|
-
|
|
343
|
-
#### Testnet
|
|
391
|
+
import { ARIO } from '@ar.io/sdk';
|
|
392
|
+
import { createSolanaRpc, address } from '@solana/kit';
|
|
344
393
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
394
|
+
const ario = ARIO.init({
|
|
395
|
+
rpc: createSolanaRpc('https://api.devnet.solana.com'),
|
|
396
|
+
coreProgramId: address('<ARIO_CORE_PROGRAM_ID>'),
|
|
397
|
+
garProgramId: address('<ARIO_GAR_PROGRAM_ID>'),
|
|
398
|
+
arnsProgramId: address('<ARIO_ARNS_PROGRAM_ID>'),
|
|
399
|
+
antProgramId: address('<ARIO_ANT_PROGRAM_ID>'),
|
|
400
|
+
});
|
|
349
401
|
```
|
|
350
402
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
The SDK provides APIs for claiming tokens via a faucet on the ar.io Testnet process (`tARIO`) via the [ar-io-testnet-faucet] service. All token requests require a captcha to be solved, and the faucet is rate limited to prevent abuse.
|
|
403
|
+
On localnet (Surfpool) source program IDs from
|
|
404
|
+
`migration/localnet/out/localnet.env` in the `solana-ar-io` monorepo.
|
|
354
405
|
|
|
355
|
-
|
|
406
|
+
<!-- ##### Faucet
|
|
356
407
|
|
|
357
|
-
|
|
408
|
+
The SDK exposes a `createFaucet` HTTP wrapper around the ar.io faucet
|
|
409
|
+
service ([faucet.ar.io](https://faucet.ar.io)). The faucet backend has
|
|
410
|
+
not yet been ported to issue Solana-mint transfers — the SDK surface is
|
|
411
|
+
documented here for forward-compatibility once it lands:
|
|
358
412
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
413
|
+
- `createFaucet({ arioInstance, processId }).captchaUrl()` — returns
|
|
414
|
+
the captcha URL.
|
|
415
|
+
- `createFaucet({ arioInstance, processId }).claimWithAuthToken({ authToken, recipient, quantity })` —
|
|
416
|
+
claim tokens for `recipient` using an auth token returned by the
|
|
417
|
+
captcha flow.
|
|
418
|
+
- `createFaucet({ arioInstance, processId }).verifyAuthToken({ authToken })` —
|
|
419
|
+
check whether an auth token is still valid.
|
|
363
420
|
|
|
364
421
|
<details>
|
|
365
422
|
<summary><i>Example client-side code for claiming tokens</i></summary>
|
|
@@ -367,7 +424,7 @@ To claim testnet tokens from the testnet token faucet, you can use one of the fo
|
|
|
367
424
|
```typescript
|
|
368
425
|
import { ARIO } from "@ar.io/sdk";
|
|
369
426
|
|
|
370
|
-
const
|
|
427
|
+
const ario = ARIO.init({ rpc });
|
|
371
428
|
const captchaUrl = await ario.faucet.captchaUrl();
|
|
372
429
|
|
|
373
430
|
// open the captcha URL in the browser, and listen for the auth token event
|
|
@@ -419,7 +476,7 @@ if (
|
|
|
419
476
|
}
|
|
420
477
|
```
|
|
421
478
|
|
|
422
|
-
</details>
|
|
479
|
+
</details> -->
|
|
423
480
|
|
|
424
481
|
### Vaults
|
|
425
482
|
|
|
@@ -428,7 +485,7 @@ if (
|
|
|
428
485
|
Retrieves the locked-balance user vault of the ARIO process by the specified wallet address and vault ID.
|
|
429
486
|
|
|
430
487
|
```typescript
|
|
431
|
-
const ario = ARIO.
|
|
488
|
+
const ario = ARIO.init({ rpc });
|
|
432
489
|
const vault = await ario.getVault({
|
|
433
490
|
address: "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ",
|
|
434
491
|
vaultId: "vaultIdOne",
|
|
@@ -453,7 +510,7 @@ const vault = await ario.getVault({
|
|
|
453
510
|
Retrieves all locked-balance user vaults of the ARIO process, paginated and sorted by the specified criteria. The `cursor` used for pagination is the last wallet address from the previous request.
|
|
454
511
|
|
|
455
512
|
```typescript
|
|
456
|
-
const ario = ARIO.
|
|
513
|
+
const ario = ARIO.init({ rpc });
|
|
457
514
|
const vaults = await ario.getVaults({
|
|
458
515
|
cursor: "0",
|
|
459
516
|
limit: 100,
|
|
@@ -501,7 +558,7 @@ Transfers `mARIO` to the designated `recipient` address and locks the balance fo
|
|
|
501
558
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
502
559
|
|
|
503
560
|
```typescript
|
|
504
|
-
const ario = ARIO.
|
|
561
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
505
562
|
const { id: txId } = await ario.vaultedTransfer(
|
|
506
563
|
{
|
|
507
564
|
recipient: "-5dV7nk7waR8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5",
|
|
@@ -521,7 +578,7 @@ Revokes a vaulted transfer by the recipient address and vault ID. Only the sende
|
|
|
521
578
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
522
579
|
|
|
523
580
|
```typescript
|
|
524
|
-
const ario = ARIO.
|
|
581
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
525
582
|
const { id: txId } = await ario.revokeVault({
|
|
526
583
|
recipient: "-5dV7nk7waR8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5",
|
|
527
584
|
vaultId: "IPdwa3Mb_9pDD8c2IaJx6aad51Ss-_TfStVwBuhtXMs",
|
|
@@ -533,7 +590,7 @@ const { id: txId } = await ario.revokeVault({
|
|
|
533
590
|
Creates a vault for the specified `quantity` of mARIO from the signer's balance and locks it for the specified `lockLengthMs` milliseconds.
|
|
534
591
|
|
|
535
592
|
```typescript
|
|
536
|
-
const ario = ARIO.
|
|
593
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
537
594
|
|
|
538
595
|
const { id: txId } = await ario.createVault({
|
|
539
596
|
lockLengthMs: 1000 * 60 * 60 * 24 * 365, // 1 year
|
|
@@ -546,7 +603,7 @@ const { id: txId } = await ario.createVault({
|
|
|
546
603
|
Extends the lock length of a signer's vault by the specified `extendLengthMs` milliseconds.
|
|
547
604
|
|
|
548
605
|
```typescript
|
|
549
|
-
const ario = ARIO.
|
|
606
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
550
607
|
|
|
551
608
|
const { id: txId } = await ario.extendVault({
|
|
552
609
|
vaultId: "vaultIdOne",
|
|
@@ -559,7 +616,7 @@ const { id: txId } = await ario.extendVault({
|
|
|
559
616
|
Increases the balance of a signer's vault by the specified `quantity` of mARIO.
|
|
560
617
|
|
|
561
618
|
```typescript
|
|
562
|
-
const ario = ARIO.
|
|
619
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
563
620
|
const { id: txId } = await ario.increaseVault({
|
|
564
621
|
vaultId: "vaultIdOne",
|
|
565
622
|
quantity: new ARIOToken(1000).toMARIO(),
|
|
@@ -573,7 +630,7 @@ const { id: txId } = await ario.increaseVault({
|
|
|
573
630
|
Retrieves a gateway's info by its staking wallet address.
|
|
574
631
|
|
|
575
632
|
```typescript
|
|
576
|
-
const ario = ARIO.
|
|
633
|
+
const ario = ARIO.init({ rpc });
|
|
577
634
|
const gateway = await ario.getGateway({
|
|
578
635
|
address: "-7vXsQZQDk8TMDlpiSLy3CnLi5PDPlAaN2DaynORpck",
|
|
579
636
|
});
|
|
@@ -586,7 +643,13 @@ const gateway = await ario.getGateway({
|
|
|
586
643
|
{
|
|
587
644
|
"observerAddress": "IPdwa3Mb_9pDD8c2IaJx6aad51Ss-_TfStVwBuhtXMs",
|
|
588
645
|
"operatorStake": 250000000000,
|
|
646
|
+
"totalDelegatedStake": 0,
|
|
589
647
|
"settings": {
|
|
648
|
+
"allowDelegatedStaking": true,
|
|
649
|
+
"allowedDelegates": [],
|
|
650
|
+
"autoStake": false,
|
|
651
|
+
"delegateRewardShareRatio": 10,
|
|
652
|
+
"minDelegatedStake": 100000000,
|
|
590
653
|
"fqdn": "ar-io.dev",
|
|
591
654
|
"label": "ar.io Test",
|
|
592
655
|
"note": "Test Gateway operated by PDS for the ar.io ecosystem.",
|
|
@@ -595,22 +658,26 @@ const gateway = await ario.getGateway({
|
|
|
595
658
|
"protocol": "https"
|
|
596
659
|
},
|
|
597
660
|
"startTimestamp": 1720720620813,
|
|
661
|
+
"endTimestamp": 0,
|
|
598
662
|
"stats": {
|
|
663
|
+
"passedConsecutiveEpochs": 30,
|
|
599
664
|
"failedConsecutiveEpochs": 0,
|
|
600
|
-
"passedEpochCount": 30,
|
|
601
|
-
"submittedEpochCount": 30,
|
|
602
665
|
"totalEpochCount": 31,
|
|
603
|
-
"
|
|
666
|
+
"passedEpochCount": 30,
|
|
667
|
+
"failedEpochCount": 1,
|
|
668
|
+
"observedEpochCount": 30,
|
|
669
|
+
"prescribedEpochCount": 31
|
|
604
670
|
},
|
|
605
671
|
"status": "joined",
|
|
606
|
-
"vaults": {},
|
|
607
672
|
"weights": {
|
|
608
|
-
"
|
|
609
|
-
"gatewayPerformanceRatio": 1,
|
|
673
|
+
"stakeWeight": 5.02400000024,
|
|
610
674
|
"tenureWeight": 0.19444444444444,
|
|
675
|
+
"gatewayPerformanceRatio": 1,
|
|
676
|
+
"observerPerformanceRatio": 1,
|
|
677
|
+
"gatewayRewardRatioWeight": 1,
|
|
611
678
|
"observerRewardRatioWeight": 1,
|
|
612
|
-
"
|
|
613
|
-
"
|
|
679
|
+
"compositeWeight": 0.97688888893556,
|
|
680
|
+
"normalizedCompositeWeight": 0.19247316211083
|
|
614
681
|
}
|
|
615
682
|
}
|
|
616
683
|
```
|
|
@@ -622,7 +689,7 @@ const gateway = await ario.getGateway({
|
|
|
622
689
|
Retrieves registered gateways of the ARIO process, using pagination and sorting by the specified criteria. The `cursor` used for pagination is the last gateway address from the previous request.
|
|
623
690
|
|
|
624
691
|
```typescript
|
|
625
|
-
const ario = ARIO.
|
|
692
|
+
const ario = ARIO.init({ rpc });
|
|
626
693
|
const gateways = await ario.getGateways({
|
|
627
694
|
limit: 100,
|
|
628
695
|
sortOrder: "desc",
|
|
@@ -642,7 +709,13 @@ Available `sortBy` options are any of the keys on the gateway object, e.g. `oper
|
|
|
642
709
|
"gatewayAddress": "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ",
|
|
643
710
|
"observerAddress": "IPdwa3Mb_9pDD8c2IaJx6aad51Ss-_TfStVwBuhtXMs",
|
|
644
711
|
"operatorStake": 250000000000,
|
|
712
|
+
"totalDelegatedStake": 0,
|
|
645
713
|
"settings": {
|
|
714
|
+
"allowDelegatedStaking": true,
|
|
715
|
+
"allowedDelegates": [],
|
|
716
|
+
"autoStake": false,
|
|
717
|
+
"delegateRewardShareRatio": 10,
|
|
718
|
+
"minDelegatedStake": 100000000,
|
|
646
719
|
"fqdn": "ar-io.dev",
|
|
647
720
|
"label": "ar.io Test",
|
|
648
721
|
"note": "Test Gateway operated by PDS for the ar.io ecosystem.",
|
|
@@ -651,28 +724,33 @@ Available `sortBy` options are any of the keys on the gateway object, e.g. `oper
|
|
|
651
724
|
"protocol": "https"
|
|
652
725
|
},
|
|
653
726
|
"startTimestamp": 1720720620813,
|
|
727
|
+
"endTimestamp": 0,
|
|
654
728
|
"stats": {
|
|
729
|
+
"passedConsecutiveEpochs": 30,
|
|
655
730
|
"failedConsecutiveEpochs": 0,
|
|
656
|
-
"passedEpochCount": 30,
|
|
657
|
-
"submittedEpochCount": 30,
|
|
658
731
|
"totalEpochCount": 31,
|
|
659
|
-
"
|
|
732
|
+
"passedEpochCount": 30,
|
|
733
|
+
"failedEpochCount": 1,
|
|
734
|
+
"observedEpochCount": 30,
|
|
735
|
+
"prescribedEpochCount": 31
|
|
660
736
|
},
|
|
661
737
|
"status": "joined",
|
|
662
|
-
"vaults": {},
|
|
663
738
|
"weights": {
|
|
664
|
-
"
|
|
665
|
-
"gatewayPerformanceRatio": 1,
|
|
739
|
+
"stakeWeight": 5.02400000024,
|
|
666
740
|
"tenureWeight": 0.19444444444444,
|
|
741
|
+
"gatewayPerformanceRatio": 1,
|
|
742
|
+
"observerPerformanceRatio": 1,
|
|
743
|
+
"gatewayRewardRatioWeight": 1,
|
|
667
744
|
"observerRewardRatioWeight": 1,
|
|
668
|
-
"
|
|
669
|
-
"
|
|
745
|
+
"compositeWeight": 0.97688888893556,
|
|
746
|
+
"normalizedCompositeWeight": 0.19247316211083
|
|
670
747
|
}
|
|
671
748
|
}
|
|
672
749
|
],
|
|
673
750
|
"hasMore": true,
|
|
674
751
|
"nextCursor": "-4xgjroXENKYhTWqrBo57HQwvDL51mMdfsdsxJy6Y2Z_sA",
|
|
675
752
|
"totalItems": 316,
|
|
753
|
+
"limit": 100,
|
|
676
754
|
"sortBy": "operatorStake",
|
|
677
755
|
"sortOrder": "desc"
|
|
678
756
|
}
|
|
@@ -685,7 +763,7 @@ Available `sortBy` options are any of the keys on the gateway object, e.g. `oper
|
|
|
685
763
|
Retrieves all delegates for a specific gateway, paginated and sorted by the specified criteria. The `cursor` used for pagination is the last delegate address from the previous request.
|
|
686
764
|
|
|
687
765
|
```typescript
|
|
688
|
-
const ario = ARIO.
|
|
766
|
+
const ario = ARIO.init({ rpc });
|
|
689
767
|
const delegates = await ario.getGatewayDelegates({
|
|
690
768
|
address: "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ",
|
|
691
769
|
limit: 3,
|
|
@@ -734,7 +812,7 @@ Joins a gateway to the ar.io network via its associated wallet.
|
|
|
734
812
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
735
813
|
|
|
736
814
|
```typescript
|
|
737
|
-
const ario = ARIO.
|
|
815
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
738
816
|
const { id: txId } = await ario.joinNetwork(
|
|
739
817
|
{
|
|
740
818
|
qty: new ARIOToken(10_000).toMARIO(), // minimum operator stake allowed
|
|
@@ -762,7 +840,7 @@ Sets the gateway as `leaving` on the ar.io network. Requires `signer` to be prov
|
|
|
762
840
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
763
841
|
|
|
764
842
|
```typescript
|
|
765
|
-
const ario = ARIO.
|
|
843
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
766
844
|
|
|
767
845
|
const { id: txId } = await ario.leaveNetwork(
|
|
768
846
|
// optional additional tags
|
|
@@ -777,7 +855,7 @@ Writes new gateway settings to the callers gateway configuration.
|
|
|
777
855
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
778
856
|
|
|
779
857
|
```typescript
|
|
780
|
-
const ario = ARIO.
|
|
858
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
781
859
|
const { id: txId } = await ario.updateGatewaySettings(
|
|
782
860
|
{
|
|
783
861
|
// any other settings you want to update
|
|
@@ -795,7 +873,7 @@ Increases the callers stake on the target gateway.
|
|
|
795
873
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
796
874
|
|
|
797
875
|
```typescript
|
|
798
|
-
const ario = ARIO.
|
|
876
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
799
877
|
const { id: txId } = await ario.increaseDelegateStake(
|
|
800
878
|
{
|
|
801
879
|
target: "t4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3",
|
|
@@ -813,7 +891,7 @@ Decreases the callers stake on the target gateway. Can instantly decrease stake
|
|
|
813
891
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
814
892
|
|
|
815
893
|
```typescript
|
|
816
|
-
const ario = ARIO.
|
|
894
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
817
895
|
const { id: txId } = await ario.decreaseDelegateStake(
|
|
818
896
|
{
|
|
819
897
|
target: "t4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3",
|
|
@@ -828,7 +906,7 @@ const { id: txId } = await ario.decreaseDelegateStake(
|
|
|
828
906
|
Pay the early withdrawal fee and withdraw instantly.
|
|
829
907
|
|
|
830
908
|
```typescript
|
|
831
|
-
const ario = ARIO.
|
|
909
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
832
910
|
const { id: txId } = await ario.decreaseDelegateStake({
|
|
833
911
|
target: "t4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3",
|
|
834
912
|
qty: new ARIOToken(100).toMARIO(),
|
|
@@ -841,7 +919,7 @@ const { id: txId } = await ario.decreaseDelegateStake({
|
|
|
841
919
|
Retrieves all active and vaulted stakes across all gateways for a specific address, paginated and sorted by the specified criteria. The `cursor` used for pagination is the last delegationId (concatenated gateway and startTimestamp of the delgation) from the previous request.
|
|
842
920
|
|
|
843
921
|
```typescript
|
|
844
|
-
const ario = ARIO.
|
|
922
|
+
const ario = ARIO.init({ rpc });
|
|
845
923
|
const vaults = await ario.getDelegations({
|
|
846
924
|
address: "t4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3",
|
|
847
925
|
cursor: "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ_123456789",
|
|
@@ -892,7 +970,7 @@ Instantly withdraws an existing vault on a gateway. If no `gatewayAddress` is pr
|
|
|
892
970
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
893
971
|
|
|
894
972
|
```typescript
|
|
895
|
-
const ario = ARIO.
|
|
973
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
896
974
|
// removes a delegated vault from a gateway
|
|
897
975
|
const { id: txId } = await ario.instantWithdrawal(
|
|
898
976
|
{
|
|
@@ -919,7 +997,7 @@ Cancels an existing vault on a gateway. The vaulted stake will be returned to th
|
|
|
919
997
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
920
998
|
|
|
921
999
|
```typescript
|
|
922
|
-
const ario = ARIO.
|
|
1000
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
923
1001
|
// cancels a delegated vault from a gateway
|
|
924
1002
|
const { id: txId } = await ario.cancelWithdrawal(
|
|
925
1003
|
{
|
|
@@ -943,7 +1021,7 @@ const { id: txId } = await ario.cancelWithdrawal({
|
|
|
943
1021
|
Retrieves all allowed delegates for a specific address. The `cursor` used for pagination is the last address from the previous request.
|
|
944
1022
|
|
|
945
1023
|
```typescript
|
|
946
|
-
const ario = ARIO.
|
|
1024
|
+
const ario = ARIO.init({ rpc });
|
|
947
1025
|
const allowedDelegates = await ario.getAllowedDelegates({
|
|
948
1026
|
address: "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ",
|
|
949
1027
|
});
|
|
@@ -974,7 +1052,7 @@ const allowedDelegates = await ario.getAllowedDelegates({
|
|
|
974
1052
|
Retrieves all vaults across all gateways for a specific address, paginated and sorted by the specified criteria. The `cursor` used for pagination is the last vaultId from the previous request.
|
|
975
1053
|
|
|
976
1054
|
```typescript
|
|
977
|
-
const ario = ARIO.
|
|
1055
|
+
const ario = ARIO.init({ rpc });
|
|
978
1056
|
const vaults = await ario.getGatewayVaults({
|
|
979
1057
|
address: '"PZ5vIhHf8VY969TxBPQN-rYY9CNFP9ggNsMBqlWUzWM',
|
|
980
1058
|
});
|
|
@@ -1009,7 +1087,7 @@ const vaults = await ario.getGatewayVaults({
|
|
|
1009
1087
|
Retrieves all vaults across all gateways, paginated and sorted by the specified criteria. The `cursor` used for pagination is the last vaultId from the previous request.
|
|
1010
1088
|
|
|
1011
1089
|
```typescript
|
|
1012
|
-
const ario = ARIO.
|
|
1090
|
+
const ario = ARIO.init({ rpc });
|
|
1013
1091
|
const vaults = await ario.getAllGatewayVaults({
|
|
1014
1092
|
limit: 1,
|
|
1015
1093
|
sortBy: "endTimestamp",
|
|
@@ -1043,6 +1121,57 @@ const vaults = await ario.getAllGatewayVaults({
|
|
|
1043
1121
|
|
|
1044
1122
|
</details>
|
|
1045
1123
|
|
|
1124
|
+
#### `getWithdrawals({ address, cursor, limit, sortBy, sortOrder })`
|
|
1125
|
+
|
|
1126
|
+
Returns every pending stake withdrawal owned by `address` — covering both operator-stake decreases (`isDelegate: false`) and delegate-stake decreases (`isDelegate: true`). A withdrawal is claimable when `Date.now() >= endTimestamp`; call `claimWithdrawal({ withdrawalId: item.vaultId })` to release the tokens.
|
|
1127
|
+
|
|
1128
|
+
This is the per-owner read needed to drive "you have X claimable withdrawals" UIs without fanning out across every gateway the wallet has interacted with.
|
|
1129
|
+
|
|
1130
|
+
```typescript
|
|
1131
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
1132
|
+
|
|
1133
|
+
const withdrawals = await ario.getWithdrawals({
|
|
1134
|
+
address: "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin",
|
|
1135
|
+
});
|
|
1136
|
+
|
|
1137
|
+
const claimable = withdrawals.items.filter(
|
|
1138
|
+
(w) => Date.now() >= w.endTimestamp,
|
|
1139
|
+
);
|
|
1140
|
+
```
|
|
1141
|
+
|
|
1142
|
+
<details>
|
|
1143
|
+
<summary>Output</summary>
|
|
1144
|
+
|
|
1145
|
+
```json
|
|
1146
|
+
{
|
|
1147
|
+
"hasMore": false,
|
|
1148
|
+
"totalItems": 2,
|
|
1149
|
+
"limit": 100,
|
|
1150
|
+
"items": [
|
|
1151
|
+
{
|
|
1152
|
+
"cursorId": "8CSdSjf7gXqQ5p1U2qfdwHzVw9sZRYHJpDpV87dnvb4d",
|
|
1153
|
+
"vaultId": "0",
|
|
1154
|
+
"gatewayAddress": "Bxz7Q2tWfqr9Q5T6cZjUnVxRk9CnHwShfgUaW5fY1Mvr",
|
|
1155
|
+
"balance": 50000000000,
|
|
1156
|
+
"startTimestamp": 1735843635857,
|
|
1157
|
+
"endTimestamp": 1738435635857,
|
|
1158
|
+
"isDelegate": true
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
"cursorId": "FmWUz4w7vSdLcz1nN8H1n2KkjJgrQQXR1n4kV3WqJ7Hf",
|
|
1162
|
+
"vaultId": "1",
|
|
1163
|
+
"gatewayAddress": "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin",
|
|
1164
|
+
"balance": 10000000000,
|
|
1165
|
+
"startTimestamp": 1735843835857,
|
|
1166
|
+
"endTimestamp": 1738435835857,
|
|
1167
|
+
"isDelegate": false
|
|
1168
|
+
}
|
|
1169
|
+
]
|
|
1170
|
+
}
|
|
1171
|
+
```
|
|
1172
|
+
|
|
1173
|
+
</details>
|
|
1174
|
+
|
|
1046
1175
|
#### `increaseOperatorStake({ qty })`
|
|
1047
1176
|
|
|
1048
1177
|
Increases the callers operator stake. Must be executed with a wallet registered as a gateway operator.
|
|
@@ -1050,7 +1179,7 @@ Increases the callers operator stake. Must be executed with a wallet registered
|
|
|
1050
1179
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
1051
1180
|
|
|
1052
1181
|
```typescript
|
|
1053
|
-
const ario = ARIO.
|
|
1182
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
1054
1183
|
const { id: txId } = await ario.increaseOperatorStake(
|
|
1055
1184
|
{
|
|
1056
1185
|
qty: new ARIOToken(100).toMARIO(),
|
|
@@ -1068,7 +1197,7 @@ Decreases the callers operator stake. Must be executed with a wallet registered
|
|
|
1068
1197
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
1069
1198
|
|
|
1070
1199
|
```typescript
|
|
1071
|
-
const ario = ARIO.
|
|
1200
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
1072
1201
|
const { id: txId } = await ario.decreaseOperatorStake(
|
|
1073
1202
|
{
|
|
1074
1203
|
qty: new ARIOToken(100).toMARIO(),
|
|
@@ -1086,7 +1215,7 @@ Redelegates the stake of a specific address to a new gateway. Vault ID may be op
|
|
|
1086
1215
|
e.g: If 1000 mARIO is redelegated and the fee rate is 10%, the fee will be 100 mARIO. Resulting in 900 mARIO being redelegated to the new gateway and 100 mARIO being deducted back to the protocol balance.
|
|
1087
1216
|
|
|
1088
1217
|
```typescript
|
|
1089
|
-
const ario = ARIO.
|
|
1218
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
1090
1219
|
|
|
1091
1220
|
const { id: txId } = await ario.redelegateStake({
|
|
1092
1221
|
target: "t4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3",
|
|
@@ -1101,7 +1230,7 @@ const { id: txId } = await ario.redelegateStake({
|
|
|
1101
1230
|
Retrieves the fee rate as percentage required to redelegate the stake of a specific address. Fee rate ranges from 0% to 60% based on the number of redelegations since the last fee reset.
|
|
1102
1231
|
|
|
1103
1232
|
```typescript
|
|
1104
|
-
const ario = ARIO.
|
|
1233
|
+
const ario = ARIO.init({ rpc });
|
|
1105
1234
|
|
|
1106
1235
|
const fee = await ario.getRedelegationFee({
|
|
1107
1236
|
address: "t4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3",
|
|
@@ -1125,7 +1254,7 @@ const fee = await ario.getRedelegationFee({
|
|
|
1125
1254
|
Retrieves all delegates across all gateways, paginated and sorted by the specified criteria. The `cursor` used for pagination is a `cursorId` derived from delegate address and the gatewayAddress from the previous request. e.g `address_gatewayAddress`.
|
|
1126
1255
|
|
|
1127
1256
|
```typescript
|
|
1128
|
-
const ario = ARIO.
|
|
1257
|
+
const ario = ARIO.init({ rpc });
|
|
1129
1258
|
const delegates = await ario.getAllDelegates({
|
|
1130
1259
|
limit: 2,
|
|
1131
1260
|
sortBy: "startTimestamp",
|
|
@@ -1176,7 +1305,7 @@ Resolves an ArNS name to the underlying data id stored on the names correspondin
|
|
|
1176
1305
|
##### Resolving a base name
|
|
1177
1306
|
|
|
1178
1307
|
```typescript
|
|
1179
|
-
const ario = ARIO.
|
|
1308
|
+
const ario = ARIO.init({ rpc });
|
|
1180
1309
|
const record = await ario.resolveArNSName({ name: "ardrive" });
|
|
1181
1310
|
```
|
|
1182
1311
|
|
|
@@ -1185,13 +1314,12 @@ const record = await ario.resolveArNSName({ name: "ardrive" });
|
|
|
1185
1314
|
|
|
1186
1315
|
```json
|
|
1187
1316
|
{
|
|
1317
|
+
"name": "ardrive",
|
|
1188
1318
|
"processId": "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM",
|
|
1189
1319
|
"txId": "kvhEUsIY5bXe0Wu2-YUFz20O078uYFzmQIO-7brv8qw",
|
|
1190
1320
|
"type": "lease",
|
|
1191
|
-
"
|
|
1192
|
-
"undernameLimit": 100
|
|
1193
|
-
"owner": "t4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3",
|
|
1194
|
-
"name": "ardrive"
|
|
1321
|
+
"ttlSeconds": 3600,
|
|
1322
|
+
"undernameLimit": 100
|
|
1195
1323
|
}
|
|
1196
1324
|
```
|
|
1197
1325
|
|
|
@@ -1200,7 +1328,7 @@ const record = await ario.resolveArNSName({ name: "ardrive" });
|
|
|
1200
1328
|
##### Resolving an undername
|
|
1201
1329
|
|
|
1202
1330
|
```typescript
|
|
1203
|
-
const ario = ARIO.
|
|
1331
|
+
const ario = ARIO.init({ rpc });
|
|
1204
1332
|
const record = await ario.resolveArNSName({ name: "logo_ardrive" });
|
|
1205
1333
|
```
|
|
1206
1334
|
|
|
@@ -1209,13 +1337,12 @@ const record = await ario.resolveArNSName({ name: "logo_ardrive" });
|
|
|
1209
1337
|
|
|
1210
1338
|
```json
|
|
1211
1339
|
{
|
|
1340
|
+
"name": "ardrive",
|
|
1212
1341
|
"processId": "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM",
|
|
1213
1342
|
"txId": "kvhEUsIY5bXe0Wu2-YUFz20O078uYFzmQIO-7brv8qw",
|
|
1214
1343
|
"type": "lease",
|
|
1215
|
-
"
|
|
1216
|
-
"undernameLimit": 100
|
|
1217
|
-
"owner": "t4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3",
|
|
1218
|
-
"name": "ardrive"
|
|
1344
|
+
"ttlSeconds": 3600,
|
|
1345
|
+
"undernameLimit": 100
|
|
1219
1346
|
}
|
|
1220
1347
|
```
|
|
1221
1348
|
|
|
@@ -1236,7 +1363,7 @@ _Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
|
1236
1363
|
- `referrer` - _optional_: track purchase referrals for analytics (e.g. `my-app.com`)
|
|
1237
1364
|
|
|
1238
1365
|
```typescript
|
|
1239
|
-
const ario = ARIO.
|
|
1366
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
1240
1367
|
const record = await ario.buyRecord(
|
|
1241
1368
|
{
|
|
1242
1369
|
name: "ardrive",
|
|
@@ -1274,7 +1401,7 @@ Upgrades an existing leased ArNS record to a permanent ownership. The record mus
|
|
|
1274
1401
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
1275
1402
|
|
|
1276
1403
|
```typescript
|
|
1277
|
-
const ario = ARIO.
|
|
1404
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
1278
1405
|
const record = await ario.upgradeRecord(
|
|
1279
1406
|
{
|
|
1280
1407
|
name: "ardrive",
|
|
@@ -1292,7 +1419,7 @@ const record = await ario.upgradeRecord(
|
|
|
1292
1419
|
Retrieves the record info of the specified ArNS name.
|
|
1293
1420
|
|
|
1294
1421
|
```typescript
|
|
1295
|
-
const ario = ARIO.
|
|
1422
|
+
const ario = ARIO.init({ rpc });
|
|
1296
1423
|
const record = await ario.getArNSRecord({ name: "ardrive" });
|
|
1297
1424
|
```
|
|
1298
1425
|
|
|
@@ -1302,10 +1429,11 @@ const record = await ario.getArNSRecord({ name: "ardrive" });
|
|
|
1302
1429
|
```json
|
|
1303
1430
|
{
|
|
1304
1431
|
"processId": "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM",
|
|
1305
|
-
"endTimestamp": 1752256702026,
|
|
1306
1432
|
"startTimestamp": 1720720819969,
|
|
1433
|
+
"endTimestamp": 1752256702026,
|
|
1307
1434
|
"type": "lease",
|
|
1308
|
-
"undernameLimit": 100
|
|
1435
|
+
"undernameLimit": 100,
|
|
1436
|
+
"purchasePrice": 75541282285
|
|
1309
1437
|
}
|
|
1310
1438
|
```
|
|
1311
1439
|
|
|
@@ -1316,7 +1444,7 @@ const record = await ario.getArNSRecord({ name: "ardrive" });
|
|
|
1316
1444
|
Retrieves all registered ArNS records of the ARIO process, paginated and sorted by the specified criteria. The `cursor` used for pagination is the last ArNS name from the previous request.
|
|
1317
1445
|
|
|
1318
1446
|
```typescript
|
|
1319
|
-
const ario = ARIO.
|
|
1447
|
+
const ario = ARIO.init({ rpc });
|
|
1320
1448
|
// get the newest 100 names
|
|
1321
1449
|
const records = await ario.getArNSRecords({
|
|
1322
1450
|
limit: 100,
|
|
@@ -1390,12 +1518,12 @@ Available `sortBy` options are any of the keys on the record object, e.g. `name`
|
|
|
1390
1518
|
|
|
1391
1519
|
</details>
|
|
1392
1520
|
|
|
1393
|
-
#### `getArNSRecordsForAddress({ address,
|
|
1521
|
+
#### `getArNSRecordsForAddress({ address, cursor, limit, sortBy, sortOrder })`
|
|
1394
1522
|
|
|
1395
1523
|
Retrieves all registered ArNS records of the specified address according to the `ANTRegistry` access control list, paginated and sorted by the specified criteria. The `cursor` used for pagination is the last ArNS name from the previous request.
|
|
1396
1524
|
|
|
1397
1525
|
```typescript
|
|
1398
|
-
const ario = ARIO.
|
|
1526
|
+
const ario = ARIO.init({ rpc });
|
|
1399
1527
|
const records = await ario.getArNSRecordsForAddress({
|
|
1400
1528
|
address: "t4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3",
|
|
1401
1529
|
limit: 100,
|
|
@@ -1440,7 +1568,7 @@ Increases the undername support of a domain up to a maximum of 10k. Domains, by
|
|
|
1440
1568
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
1441
1569
|
|
|
1442
1570
|
```typescript
|
|
1443
|
-
const ario = ARIO.
|
|
1571
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
1444
1572
|
const { id: txId } = await ario.increaseUndernameLimit(
|
|
1445
1573
|
{
|
|
1446
1574
|
name: "ar-io",
|
|
@@ -1457,7 +1585,7 @@ const { id: txId } = await ario.increaseUndernameLimit(
|
|
|
1457
1585
|
Extends the lease of a registered ArNS domain, with an extension of 1-5 years depending on grace period status. Permanently registered domains cannot be extended.
|
|
1458
1586
|
|
|
1459
1587
|
```typescript
|
|
1460
|
-
const ario = ARIO.
|
|
1588
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
1461
1589
|
const { id: txId } = await ario.extendLease(
|
|
1462
1590
|
{
|
|
1463
1591
|
name: "ar-io",
|
|
@@ -1511,19 +1639,14 @@ const costDetails = await ario.getCostDetails({
|
|
|
1511
1639
|
|
|
1512
1640
|
```json
|
|
1513
1641
|
{
|
|
1514
|
-
"tokenCost":
|
|
1515
|
-
"
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
"
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
}
|
|
1523
|
-
},
|
|
1524
|
-
"shortfall": 0
|
|
1525
|
-
},
|
|
1526
|
-
"discounts": []
|
|
1642
|
+
"tokenCost": 1907401818,
|
|
1643
|
+
"discounts": [
|
|
1644
|
+
{
|
|
1645
|
+
"name": "Gateway Operator",
|
|
1646
|
+
"discountTotal": 476850455,
|
|
1647
|
+
"multiplier": 0.8
|
|
1648
|
+
}
|
|
1649
|
+
]
|
|
1527
1650
|
}
|
|
1528
1651
|
```
|
|
1529
1652
|
|
|
@@ -1534,7 +1657,7 @@ const costDetails = await ario.getCostDetails({
|
|
|
1534
1657
|
Retrieves the current demand factor of the network. The demand factor is a multiplier applied to the cost of ArNS interactions based on the current network demand.
|
|
1535
1658
|
|
|
1536
1659
|
```typescript
|
|
1537
|
-
const ario = ARIO.
|
|
1660
|
+
const ario = ARIO.init({ rpc });
|
|
1538
1661
|
const demandFactor = await ario.getDemandFactor();
|
|
1539
1662
|
```
|
|
1540
1663
|
|
|
@@ -1552,7 +1675,7 @@ const demandFactor = await ario.getDemandFactor();
|
|
|
1552
1675
|
Retrieves all active returned names of the ARIO process, paginated and sorted by the specified criteria. The `cursor` used for pagination is the last returned name from the previous request.
|
|
1553
1676
|
|
|
1554
1677
|
```typescript
|
|
1555
|
-
const ario = ARIO.
|
|
1678
|
+
const ario = ARIO.init({ rpc });
|
|
1556
1679
|
const returnedNames = await ario.getArNSReturnedNames({
|
|
1557
1680
|
limit: 100,
|
|
1558
1681
|
sortBy: "endTimestamp",
|
|
@@ -1568,21 +1691,15 @@ const returnedNames = await ario.getArNSReturnedNames({
|
|
|
1568
1691
|
"items": [
|
|
1569
1692
|
{
|
|
1570
1693
|
"name": "permalink",
|
|
1571
|
-
"endTimestamp": 1730985241349,
|
|
1572
1694
|
"startTimestamp": 1729775641349,
|
|
1573
|
-
"
|
|
1574
|
-
"demandFactor": 1.05256,
|
|
1695
|
+
"endTimestamp": 1730985241349,
|
|
1575
1696
|
"initiator": "GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc",
|
|
1576
|
-
"
|
|
1577
|
-
"durationMs": 1209600000,
|
|
1578
|
-
"decayRate": 0.000000000016847809193121693,
|
|
1579
|
-
"scalingExponent": 190,
|
|
1580
|
-
"startPriceMultiplier": 50
|
|
1581
|
-
}
|
|
1697
|
+
"premiumMultiplier": 50
|
|
1582
1698
|
}
|
|
1583
1699
|
],
|
|
1584
1700
|
"hasMore": false,
|
|
1585
1701
|
"totalItems": 1,
|
|
1702
|
+
"limit": 100,
|
|
1586
1703
|
"sortBy": "endTimestamp",
|
|
1587
1704
|
"sortOrder": "asc"
|
|
1588
1705
|
}
|
|
@@ -1595,7 +1712,7 @@ const returnedNames = await ario.getArNSReturnedNames({
|
|
|
1595
1712
|
Retrieves the returned name data for the specified returned name.
|
|
1596
1713
|
|
|
1597
1714
|
```typescript
|
|
1598
|
-
const ario = ARIO.
|
|
1715
|
+
const ario = ARIO.init({ rpc });
|
|
1599
1716
|
const returnedName = await ario.getArNSReturnedName({ name: "permalink" });
|
|
1600
1717
|
```
|
|
1601
1718
|
|
|
@@ -1605,17 +1722,10 @@ const returnedName = await ario.getArNSReturnedName({ name: "permalink" });
|
|
|
1605
1722
|
```json
|
|
1606
1723
|
{
|
|
1607
1724
|
"name": "permalink",
|
|
1608
|
-
"endTimestamp": 1730985241349,
|
|
1609
1725
|
"startTimestamp": 1729775641349,
|
|
1610
|
-
"
|
|
1611
|
-
"demandFactor": 1.05256,
|
|
1726
|
+
"endTimestamp": 1730985241349,
|
|
1612
1727
|
"initiator": "GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc",
|
|
1613
|
-
"
|
|
1614
|
-
"durationMs": 1209600000,
|
|
1615
|
-
"decayRate": 0.000000000016847809193121693,
|
|
1616
|
-
"scalingExponent": 190,
|
|
1617
|
-
"startPriceMultiplier": 50
|
|
1618
|
-
}
|
|
1728
|
+
"premiumMultiplier": 50
|
|
1619
1729
|
}
|
|
1620
1730
|
```
|
|
1621
1731
|
|
|
@@ -1628,7 +1738,7 @@ const returnedName = await ario.getArNSReturnedName({ name: "permalink" });
|
|
|
1628
1738
|
Returns the current epoch data.
|
|
1629
1739
|
|
|
1630
1740
|
```typescript
|
|
1631
|
-
const ario = ARIO.
|
|
1741
|
+
const ario = ARIO.init({ rpc });
|
|
1632
1742
|
const epoch = await ario.getCurrentEpoch();
|
|
1633
1743
|
```
|
|
1634
1744
|
|
|
@@ -1638,10 +1748,10 @@ const epoch = await ario.getCurrentEpoch();
|
|
|
1638
1748
|
```json
|
|
1639
1749
|
{
|
|
1640
1750
|
"epochIndex": 0,
|
|
1751
|
+
"startHeight": 0,
|
|
1641
1752
|
"startTimestamp": 1720720621424,
|
|
1642
1753
|
"endTimestamp": 1752256702026,
|
|
1643
|
-
"
|
|
1644
|
-
"distributionTimestamp": 1711122739,
|
|
1754
|
+
"distributionTimestamp": 1752256702026,
|
|
1645
1755
|
"observations": {
|
|
1646
1756
|
"failureSummaries": {
|
|
1647
1757
|
"-Tk2DDk8k4zkwtppp_XFKKI5oUgh6IEHygAoN7mD-w8": [
|
|
@@ -1658,21 +1768,28 @@ const epoch = await ario.getCurrentEpoch();
|
|
|
1658
1768
|
"gatewayAddress": "2Fk8lCmDegPg6jjprl57-UCpKmNgYiKwyhkU4vMNDnE",
|
|
1659
1769
|
"observerAddress": "2Fk8lCmDegPg6jjprl57-UCpKmNgYiKwyhkU4vMNDnE",
|
|
1660
1770
|
"stake": 10000000000,
|
|
1661
|
-
"
|
|
1771
|
+
"startTimestamp": 1720720621424,
|
|
1662
1772
|
"stakeWeight": 1,
|
|
1663
1773
|
"tenureWeight": 0.4494598765432099,
|
|
1664
1774
|
"gatewayPerformanceRatio": 1,
|
|
1775
|
+
"observerPerformanceRatio": 1,
|
|
1776
|
+
"gatewayRewardRatioWeight": 1,
|
|
1665
1777
|
"observerRewardRatioWeight": 1,
|
|
1666
1778
|
"compositeWeight": 0.4494598765432099,
|
|
1667
1779
|
"normalizedCompositeWeight": 0.002057032496835938
|
|
1668
1780
|
}
|
|
1669
1781
|
],
|
|
1670
1782
|
"distributions": {
|
|
1671
|
-
"
|
|
1783
|
+
"totalEligibleGateways": 1,
|
|
1672
1784
|
"totalEligibleRewards": 100000000,
|
|
1673
|
-
"
|
|
1674
|
-
|
|
1675
|
-
|
|
1785
|
+
"totalEligibleObserverReward": 100000000,
|
|
1786
|
+
"totalEligibleGatewayReward": 100000000
|
|
1787
|
+
},
|
|
1788
|
+
"arnsStats": {
|
|
1789
|
+
"totalReturnedNames": 0,
|
|
1790
|
+
"totalActiveNames": 0,
|
|
1791
|
+
"totalGracePeriodNames": 0,
|
|
1792
|
+
"totalReservedNames": 0
|
|
1676
1793
|
}
|
|
1677
1794
|
}
|
|
1678
1795
|
```
|
|
@@ -1684,7 +1801,7 @@ const epoch = await ario.getCurrentEpoch();
|
|
|
1684
1801
|
Returns the epoch data for the specified block height. If no epoch index is provided, the current epoch is used.
|
|
1685
1802
|
|
|
1686
1803
|
```typescript
|
|
1687
|
-
const ario = ARIO.
|
|
1804
|
+
const ario = ARIO.init({ rpc });
|
|
1688
1805
|
const epoch = await ario.getEpoch({ epochIndex: 0 });
|
|
1689
1806
|
```
|
|
1690
1807
|
|
|
@@ -1694,9 +1811,9 @@ const epoch = await ario.getEpoch({ epochIndex: 0 });
|
|
|
1694
1811
|
```json
|
|
1695
1812
|
{
|
|
1696
1813
|
"epochIndex": 0,
|
|
1814
|
+
"startHeight": 0,
|
|
1697
1815
|
"startTimestamp": 1720720620813,
|
|
1698
1816
|
"endTimestamp": 1752256702026,
|
|
1699
|
-
"startHeight": 1350700,
|
|
1700
1817
|
"distributionTimestamp": 1752256702026,
|
|
1701
1818
|
"observations": {
|
|
1702
1819
|
"failureSummaries": {
|
|
@@ -1713,11 +1830,13 @@ const epoch = await ario.getEpoch({ epochIndex: 0 });
|
|
|
1713
1830
|
{
|
|
1714
1831
|
"gatewayAddress": "2Fk8lCmDegPg6jjprl57-UCpKmNgYiKwyhkU4vMNDnE",
|
|
1715
1832
|
"observerAddress": "2Fk8lCmDegPg6jjprl57-UCpKmNgYiKwyhkU4vMNDnE",
|
|
1716
|
-
"stake": 10000000000,
|
|
1833
|
+
"stake": 10000000000,
|
|
1717
1834
|
"startTimestamp": 1720720620813,
|
|
1718
1835
|
"stakeWeight": 1,
|
|
1719
1836
|
"tenureWeight": 0.4494598765432099,
|
|
1720
1837
|
"gatewayPerformanceRatio": 1,
|
|
1838
|
+
"observerPerformanceRatio": 1,
|
|
1839
|
+
"gatewayRewardRatioWeight": 1,
|
|
1721
1840
|
"observerRewardRatioWeight": 1,
|
|
1722
1841
|
"compositeWeight": 0.4494598765432099,
|
|
1723
1842
|
"normalizedCompositeWeight": 0.002057032496835938
|
|
@@ -1727,14 +1846,13 @@ const epoch = await ario.getEpoch({ epochIndex: 0 });
|
|
|
1727
1846
|
"totalEligibleGateways": 1,
|
|
1728
1847
|
"totalEligibleRewards": 100000000,
|
|
1729
1848
|
"totalEligibleObserverReward": 100000000,
|
|
1730
|
-
"totalEligibleGatewayReward": 100000000
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
"
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
}
|
|
1849
|
+
"totalEligibleGatewayReward": 100000000
|
|
1850
|
+
},
|
|
1851
|
+
"arnsStats": {
|
|
1852
|
+
"totalReturnedNames": 0,
|
|
1853
|
+
"totalActiveNames": 0,
|
|
1854
|
+
"totalGracePeriodNames": 0,
|
|
1855
|
+
"totalReservedNames": 0
|
|
1738
1856
|
}
|
|
1739
1857
|
}
|
|
1740
1858
|
```
|
|
@@ -1746,7 +1864,7 @@ const epoch = await ario.getEpoch({ epochIndex: 0 });
|
|
|
1746
1864
|
Returns the eligible epoch rewards for the specified block height. If no epoch index is provided, the current epoch is used.
|
|
1747
1865
|
|
|
1748
1866
|
```typescript
|
|
1749
|
-
const ario = ARIO.
|
|
1867
|
+
const ario = ARIO.init({ rpc });
|
|
1750
1868
|
const rewards = await ario.getEligibleEpochRewards({ epochIndex: 0 });
|
|
1751
1869
|
```
|
|
1752
1870
|
|
|
@@ -1779,7 +1897,7 @@ const rewards = await ario.getEligibleEpochRewards({ epochIndex: 0 });
|
|
|
1779
1897
|
Returns the epoch-indexed observation list. If no epoch index is provided, the current epoch is used.
|
|
1780
1898
|
|
|
1781
1899
|
```typescript
|
|
1782
|
-
const ario = ARIO.
|
|
1900
|
+
const ario = ARIO.init({ rpc });
|
|
1783
1901
|
const observations = await ario.getObservations();
|
|
1784
1902
|
```
|
|
1785
1903
|
|
|
@@ -1788,19 +1906,16 @@ const observations = await ario.getObservations();
|
|
|
1788
1906
|
|
|
1789
1907
|
```json
|
|
1790
1908
|
{
|
|
1791
|
-
"
|
|
1792
|
-
"
|
|
1793
|
-
"
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
"
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
"osZP4D9cqeDvbVFBaEfjIxwc1QLIvRxUBRAxDIX9je8": "aatgznEvC_UPcxp1v0uw_RqydhIfKm4wtt1KCpONBB0",
|
|
1802
|
-
"qZ90I67XG68BYIAFVNfm9PUdM7v1XtFTn7u-EOZFAtk": "Bd8SmFK9-ktJRmwIungS8ur6JM-JtpxrvMtjt5JkB1M"
|
|
1803
|
-
}
|
|
1909
|
+
"failureSummaries": {
|
|
1910
|
+
"-Tk2DDk8k4zkwtppp_XFKKI5oUgh6IEHygAoN7mD-w8": [
|
|
1911
|
+
"Ie2wEEUDKoU26c7IuckHNn3vMFdNQnMvfPBrFzAb3NA"
|
|
1912
|
+
]
|
|
1913
|
+
},
|
|
1914
|
+
"reports": {
|
|
1915
|
+
"IPdwa3Mb_9pDD8c2IaJx6aad51Ss-_TfStVwBuhtXMs": "B6UUjKWjjEWDBvDSMXWNmymfwvgR9EN27z5FTkEVlX4",
|
|
1916
|
+
"Ie2wEEUDKoU26c7IuckHNn3vMFdNQnMvfPBrFzAb3NA": "7tKsiQ2fxv0D8ZVN_QEv29fZ8hwFIgHoEDrpeEG0DIs",
|
|
1917
|
+
"osZP4D9cqeDvbVFBaEfjIxwc1QLIvRxUBRAxDIX9je8": "aatgznEvC_UPcxp1v0uw_RqydhIfKm4wtt1KCpONBB0",
|
|
1918
|
+
"qZ90I67XG68BYIAFVNfm9PUdM7v1XtFTn7u-EOZFAtk": "Bd8SmFK9-ktJRmwIungS8ur6JM-JtpxrvMtjt5JkB1M"
|
|
1804
1919
|
}
|
|
1805
1920
|
}
|
|
1806
1921
|
```
|
|
@@ -1812,7 +1927,7 @@ const observations = await ario.getObservations();
|
|
|
1812
1927
|
Returns the current rewards distribution information. If no epoch index is provided, the current epoch is used.
|
|
1813
1928
|
|
|
1814
1929
|
```typescript
|
|
1815
|
-
const ario = ARIO.
|
|
1930
|
+
const ario = ARIO.init({ rpc });
|
|
1816
1931
|
const distributions = await ario.getDistributions({ epochIndex: 0 });
|
|
1817
1932
|
```
|
|
1818
1933
|
|
|
@@ -1824,20 +1939,7 @@ const distributions = await ario.getDistributions({ epochIndex: 0 });
|
|
|
1824
1939
|
"totalEligibleGateways": 1,
|
|
1825
1940
|
"totalEligibleRewards": 100000000,
|
|
1826
1941
|
"totalEligibleObserverReward": 100000000,
|
|
1827
|
-
"totalEligibleGatewayReward": 100000000
|
|
1828
|
-
"totalDistributedRewards": 100000000,
|
|
1829
|
-
"distributedTimestamp": 1720720621424,
|
|
1830
|
-
"rewards": {
|
|
1831
|
-
"eligible": {
|
|
1832
|
-
"IPdwa3Mb_9pDD8c2IaJx6aad51Ss-_TfStVwBuhtXMs": {
|
|
1833
|
-
"operatorReward": 100000000,
|
|
1834
|
-
"delegateRewards": {}
|
|
1835
|
-
}
|
|
1836
|
-
},
|
|
1837
|
-
"distributed": {
|
|
1838
|
-
"IPdwa3Mb_9pDD8c2IaJx6aad51Ss-_TfStVwBuhtXMs": 100000000
|
|
1839
|
-
}
|
|
1840
|
-
}
|
|
1942
|
+
"totalEligibleGatewayReward": 100000000
|
|
1841
1943
|
}
|
|
1842
1944
|
```
|
|
1843
1945
|
|
|
@@ -1848,7 +1950,7 @@ Saves the observations of the current epoch. Requires `signer` to be provided on
|
|
|
1848
1950
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
1849
1951
|
|
|
1850
1952
|
```typescript
|
|
1851
|
-
const ario = ARIO.
|
|
1953
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
1852
1954
|
const { id: txId } = await ario.saveObservations(
|
|
1853
1955
|
{
|
|
1854
1956
|
reportTxId: "fDrr0_J4Iurt7caNST02cMotaz2FIbWQ4Kcj616RHl3",
|
|
@@ -1867,7 +1969,7 @@ const { id: txId } = await ario.saveObservations(
|
|
|
1867
1969
|
Retrieves the prescribed observers of the ARIO process. To fetch prescribed observers for a previous epoch set the `epochIndex` to the desired epoch index.
|
|
1868
1970
|
|
|
1869
1971
|
```typescript
|
|
1870
|
-
const ario = ARIO.
|
|
1972
|
+
const ario = ARIO.init({ rpc });
|
|
1871
1973
|
const observers = await ario.getPrescribedObservers({ epochIndex: 0 });
|
|
1872
1974
|
```
|
|
1873
1975
|
|
|
@@ -1879,11 +1981,13 @@ const observers = await ario.getPrescribedObservers({ epochIndex: 0 });
|
|
|
1879
1981
|
{
|
|
1880
1982
|
"gatewayAddress": "BpQlyhREz4lNGS-y3rSS1WxADfxPpAuing9Lgfdrj2U",
|
|
1881
1983
|
"observerAddress": "2Fk8lCmDegPg6jjprl57-UCpKmNgYiKwyhkU4vMNDnE",
|
|
1882
|
-
"stake": 10000000000,
|
|
1883
|
-
"
|
|
1984
|
+
"stake": 10000000000,
|
|
1985
|
+
"startTimestamp": 1720720620813,
|
|
1884
1986
|
"stakeWeight": 1,
|
|
1885
1987
|
"tenureWeight": 0.41453703703703704,
|
|
1886
1988
|
"gatewayPerformanceRatio": 1,
|
|
1989
|
+
"observerPerformanceRatio": 1,
|
|
1990
|
+
"gatewayRewardRatioWeight": 1,
|
|
1887
1991
|
"observerRewardRatioWeight": 1,
|
|
1888
1992
|
"compositeWeight": 0.41453703703703704,
|
|
1889
1993
|
"normalizedCompositeWeight": 0.0018972019546783507
|
|
@@ -1893,6 +1997,40 @@ const observers = await ario.getPrescribedObservers({ epochIndex: 0 });
|
|
|
1893
1997
|
|
|
1894
1998
|
</details>
|
|
1895
1999
|
|
|
2000
|
+
#### `crankEpochStep(options?)`
|
|
2001
|
+
|
|
2002
|
+
High-level, permissionless epoch crank. Advances the epoch lifecycle by **one
|
|
2003
|
+
step per call** and returns the action it took — run it on a loop (this is what
|
|
2004
|
+
the standalone cranker and the observer-embedded cranker do). It owns the whole
|
|
2005
|
+
sequence so you don't orchestrate the individual instructions yourself:
|
|
2006
|
+
|
|
2007
|
+
`create` → `tally` → `prescribe` → `distribute` → `close` — closing an epoch's
|
|
2008
|
+
observation PDAs first (`close_observation`) so `close_epoch` doesn't revert —
|
|
2009
|
+
plus an idle-tail of permissionless maintenance: `compound` delegate rewards,
|
|
2010
|
+
`update_demand_factor`, and `prune_returned_names`. The close path is
|
|
2011
|
+
non-wedging: a cleanup failure never blocks creation of the next epoch.
|
|
2012
|
+
|
|
2013
|
+
```typescript
|
|
2014
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
2015
|
+
|
|
2016
|
+
// one step
|
|
2017
|
+
const result = await ario.crankEpochStep();
|
|
2018
|
+
// → { action, epochIndex?, txId?, progress? }
|
|
2019
|
+
// action ∈ create | tally | prescribe | distribute | close
|
|
2020
|
+
// | close_observation | compound | update_demand_factor
|
|
2021
|
+
// | prune_returned_names | idle
|
|
2022
|
+
|
|
2023
|
+
// or drive it on an interval
|
|
2024
|
+
setInterval(async () => {
|
|
2025
|
+
const r = await ario.crankEpochStep();
|
|
2026
|
+
if (r.action !== 'idle') console.log(r.action, r.epochIndex, r.txId);
|
|
2027
|
+
}, 60_000);
|
|
2028
|
+
```
|
|
2029
|
+
|
|
2030
|
+
All options are optional: `batchSize`, `enableClose`, `epochRetention`,
|
|
2031
|
+
`enableCompound`, `compoundMinPendingRewards`, `enableDemandFactorRoll`,
|
|
2032
|
+
`enablePrune`, `pruneBatchSize`, `nameRegistryAccount`.
|
|
2033
|
+
|
|
1896
2034
|
### Primary Names
|
|
1897
2035
|
|
|
1898
2036
|
#### `getPrimaryNames({ cursor, limit, sortBy, sortOrder })`
|
|
@@ -1900,7 +2038,7 @@ const observers = await ario.getPrescribedObservers({ epochIndex: 0 });
|
|
|
1900
2038
|
Retrieves all primary names paginated and sorted by the specified criteria. The `cursor` used for pagination is the last name from the previous request.
|
|
1901
2039
|
|
|
1902
2040
|
```typescript
|
|
1903
|
-
const ario = ARIO.
|
|
2041
|
+
const ario = ARIO.init({ rpc });
|
|
1904
2042
|
const names = await ario.getPrimaryNames({
|
|
1905
2043
|
cursor: "ao", // this is the last name from the previous request
|
|
1906
2044
|
limit: 1,
|
|
@@ -1919,12 +2057,13 @@ const names = await ario.getPrimaryNames({
|
|
|
1919
2057
|
"totalItems": 100,
|
|
1920
2058
|
"limit": 1,
|
|
1921
2059
|
"sortBy": "startTimestamp",
|
|
1922
|
-
"
|
|
2060
|
+
"nextCursor": "arns",
|
|
1923
2061
|
"items": [
|
|
1924
2062
|
{
|
|
2063
|
+
"name": "arns",
|
|
1925
2064
|
"owner": "HwFceQaMQnOBgKDpnFqCqgwKwEU5LBme1oXRuQOWSRA",
|
|
1926
|
-
"
|
|
1927
|
-
"
|
|
2065
|
+
"processId": "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM",
|
|
2066
|
+
"startTimestamp": 1719356032297
|
|
1928
2067
|
}
|
|
1929
2068
|
]
|
|
1930
2069
|
}
|
|
@@ -1937,7 +2076,7 @@ const names = await ario.getPrimaryNames({
|
|
|
1937
2076
|
Retrieves the primary name for a given name or address.
|
|
1938
2077
|
|
|
1939
2078
|
```typescript
|
|
1940
|
-
const ario = ARIO.
|
|
2079
|
+
const ario = ARIO.init({ rpc });
|
|
1941
2080
|
const name = await ario.getPrimaryName({
|
|
1942
2081
|
name: "arns",
|
|
1943
2082
|
});
|
|
@@ -1952,9 +2091,10 @@ const name = await ario.getPrimaryName({
|
|
|
1952
2091
|
|
|
1953
2092
|
```json
|
|
1954
2093
|
{
|
|
2094
|
+
"name": "arns",
|
|
1955
2095
|
"owner": "HwFceQaMQnOBgKDpnFqCqgwKwEU5LBme1oXRuQOWSRA",
|
|
1956
|
-
"
|
|
1957
|
-
"
|
|
2096
|
+
"processId": "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM",
|
|
2097
|
+
"startTimestamp": 1719356032297
|
|
1958
2098
|
}
|
|
1959
2099
|
```
|
|
1960
2100
|
|
|
@@ -1967,9 +2107,8 @@ Sets an ArNS name already owned by the `signer` as their primary name. Note: `si
|
|
|
1967
2107
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
1968
2108
|
|
|
1969
2109
|
```typescript
|
|
1970
|
-
const
|
|
1971
|
-
|
|
1972
|
-
await ario.setPrimaryName({ name: "my-arns-name" }); // the caller must already have purchased the name my-arns-name and be assigned as the owner of the processId that is assigned to the name
|
|
2110
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
2111
|
+
await ario.setPrimaryName({ name: 'my-arns-name' });
|
|
1973
2112
|
```
|
|
1974
2113
|
|
|
1975
2114
|
#### `requestPrimaryName({ name })`
|
|
@@ -1979,7 +2118,7 @@ Requests a primary name for the `signer`'s address. The request must be approved
|
|
|
1979
2118
|
_Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
|
|
1980
2119
|
|
|
1981
2120
|
```typescript
|
|
1982
|
-
const ario = ARIO.
|
|
2121
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
1983
2122
|
const { id: txId } = await ario.requestPrimaryName({
|
|
1984
2123
|
name: "arns",
|
|
1985
2124
|
});
|
|
@@ -1990,7 +2129,7 @@ const { id: txId } = await ario.requestPrimaryName({
|
|
|
1990
2129
|
Retrieves the primary name request for a a wallet address.
|
|
1991
2130
|
|
|
1992
2131
|
```typescript
|
|
1993
|
-
const ario = ARIO.
|
|
2132
|
+
const ario = ARIO.init({ rpc });
|
|
1994
2133
|
const request = await ario.getPrimaryNameRequest({
|
|
1995
2134
|
initiator: "t4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3",
|
|
1996
2135
|
});
|
|
@@ -2012,80 +2151,71 @@ const request = await ario.getPrimaryNameRequest({
|
|
|
2012
2151
|
|
|
2013
2152
|
### Configuration
|
|
2014
2153
|
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
import { ARIO , AOProcess } from '@ar.io/sdk';
|
|
2019
|
-
import { connect } from '@permaweb/aoconnect';
|
|
2020
|
-
|
|
2021
|
-
// provide a custom ao infrastructure and process id
|
|
2022
|
-
const ario = ARIO.mainnet({
|
|
2023
|
-
process: new AOProcess({
|
|
2024
|
-
processId: 'ARIO_PROCESS_ID'
|
|
2025
|
-
ao: connect({
|
|
2026
|
-
MODE: 'legacy',
|
|
2027
|
-
MU_URL: 'https://mu-testnet.xyz',
|
|
2028
|
-
CU_URL: 'https://cu-testnet.xyz',
|
|
2029
|
-
GRAPHQL_URL: 'https://arweave.net/graphql',
|
|
2030
|
-
GATEWAY_URL: 'https://arweave.net',
|
|
2031
|
-
})
|
|
2032
|
-
})
|
|
2033
|
-
});
|
|
2034
|
-
```
|
|
2154
|
+
`ARIO.init` accepts a `@solana/kit` RPC client plus optional program ID
|
|
2155
|
+
overrides for non-mainnet clusters. See [Networks](#networks) above for
|
|
2156
|
+
the full shape.
|
|
2035
2157
|
|
|
2036
2158
|
## ANT Contracts
|
|
2037
2159
|
|
|
2038
|
-
The ANT client class exposes APIs
|
|
2160
|
+
The ANT client class exposes APIs for Arweave Name Tokens. On Solana an
|
|
2161
|
+
ANT is a Metaplex Core asset; its `processId` is the asset's mint
|
|
2162
|
+
pubkey. The `ario-ant` program owns the on-chain records / controllers
|
|
2163
|
+
state attached to the asset.
|
|
2039
2164
|
|
|
2040
2165
|
### Initialize
|
|
2041
2166
|
|
|
2042
|
-
#### `init({ processId, signer })`
|
|
2167
|
+
#### `init({ processId, rpc, rpcSubscriptions?, signer? })`
|
|
2043
2168
|
|
|
2044
|
-
Factory
|
|
2169
|
+
Factory that creates a read-only or writeable ANT client. Providing
|
|
2170
|
+
`signer` and `rpcSubscriptions` enables write methods (`setRecord`,
|
|
2171
|
+
`transfer`, `addController`, etc.).
|
|
2045
2172
|
|
|
2046
2173
|
```typescript
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2174
|
+
import { ANT } from '@ar.io/sdk';
|
|
2175
|
+
import {
|
|
2176
|
+
createSolanaRpc,
|
|
2177
|
+
createSolanaRpcSubscriptions,
|
|
2178
|
+
} from '@solana/kit';
|
|
2179
|
+
|
|
2180
|
+
const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com');
|
|
2181
|
+
|
|
2182
|
+
// Read-only
|
|
2183
|
+
const ant = await ANT.init({
|
|
2184
|
+
processId: '<MPL Core asset pubkey>',
|
|
2185
|
+
rpc,
|
|
2051
2186
|
});
|
|
2052
2187
|
|
|
2053
|
-
//
|
|
2054
|
-
const
|
|
2055
|
-
|
|
2056
|
-
|
|
2188
|
+
// Read + write
|
|
2189
|
+
const antWrite = await ANT.init({
|
|
2190
|
+
processId: '<MPL Core asset pubkey>',
|
|
2191
|
+
rpc,
|
|
2192
|
+
rpcSubscriptions: createSolanaRpcSubscriptions(
|
|
2193
|
+
'wss://api.mainnet-beta.solana.com',
|
|
2194
|
+
),
|
|
2195
|
+
signer,
|
|
2057
2196
|
});
|
|
2058
2197
|
```
|
|
2059
2198
|
|
|
2060
2199
|
### Spawn
|
|
2061
2200
|
|
|
2062
|
-
#### `spawn({
|
|
2063
|
-
|
|
2064
|
-
Spawns a new ANT (Arweave Name Token) process. This static function creates a new ANT process on the AO network and returns the process ID.
|
|
2201
|
+
#### `ANT.spawn({ rpc, rpcSubscriptions, signer, state })`
|
|
2065
2202
|
|
|
2066
|
-
|
|
2203
|
+
Static factory that mints a new MPL Core asset and initializes the
|
|
2204
|
+
`ario-ant` PDAs in a single transaction. Returns
|
|
2205
|
+
`{ processId, mint, signature }`.
|
|
2067
2206
|
|
|
2068
2207
|
```typescript
|
|
2069
|
-
import { ANT } from
|
|
2070
|
-
import { ArweaveSigner } from "@ar.io/sdk/node";
|
|
2208
|
+
import { ANT } from '@ar.io/sdk';
|
|
2071
2209
|
|
|
2072
|
-
const processId = await ANT.spawn({
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
ticker: "MYANT",
|
|
2077
|
-
description: "My custom ANT token",
|
|
2078
|
-
},
|
|
2079
|
-
});
|
|
2080
|
-
|
|
2081
|
-
// Using a custom module ID
|
|
2082
|
-
const processId = await ANT.spawn({
|
|
2083
|
-
signer: new ArweaveSigner(jwk),
|
|
2084
|
-
module: "FKtQtOOtlcWCW2pXrwWFiCSlnuewMZOHCzhulVkyqBE", // Custom module ID
|
|
2210
|
+
const { processId, signature } = await ANT.spawn({
|
|
2211
|
+
rpc,
|
|
2212
|
+
rpcSubscriptions,
|
|
2213
|
+
signer,
|
|
2085
2214
|
state: {
|
|
2086
|
-
name:
|
|
2087
|
-
ticker:
|
|
2088
|
-
description:
|
|
2215
|
+
name: 'My ANT',
|
|
2216
|
+
ticker: 'MYANT',
|
|
2217
|
+
description: 'My ANT token',
|
|
2218
|
+
uri: 'ar://<metadata-tx-id>',
|
|
2089
2219
|
},
|
|
2090
2220
|
});
|
|
2091
2221
|
```
|
|
@@ -2093,25 +2223,34 @@ const processId = await ANT.spawn({
|
|
|
2093
2223
|
**CLI Usage:**
|
|
2094
2224
|
|
|
2095
2225
|
```bash
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2226
|
+
ar.io spawn-ant \
|
|
2227
|
+
--wallet-file wallet.json \
|
|
2228
|
+
--name "My ANT" \
|
|
2229
|
+
--ticker "MYANT" \
|
|
2230
|
+
--metadata-uri "ar://<metadata-tx-id>"
|
|
2101
2231
|
```
|
|
2102
2232
|
|
|
2103
2233
|
**Parameters:**
|
|
2104
2234
|
|
|
2105
|
-
- `
|
|
2106
|
-
- `
|
|
2107
|
-
- `
|
|
2108
|
-
- `
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
- `
|
|
2112
|
-
- `
|
|
2235
|
+
- `state.name: string` — display name of the ANT
|
|
2236
|
+
- `state.ticker?: string` — ticker symbol
|
|
2237
|
+
- `state.description?: string` — short description
|
|
2238
|
+
- `state.uri: string` — `ar://` URI of the Metaplex Core asset's JSON
|
|
2239
|
+
metadata. Build via `buildAntMetadata` from `@ar.io/sdk` and upload
|
|
2240
|
+
to Arweave (e.g. via `@ardrive/turbo-sdk`).
|
|
2241
|
+
- `state.keywords?: string[]`
|
|
2242
|
+
- `state.logo?: string` — Arweave TX ID of the logo
|
|
2243
|
+
- `state.transactionId?: string` — initial `@` record target
|
|
2113
2244
|
|
|
2114
|
-
**Returns:**
|
|
2245
|
+
**Returns:**
|
|
2246
|
+
|
|
2247
|
+
```ts
|
|
2248
|
+
{
|
|
2249
|
+
processId: string; // the MPL Core asset mint pubkey
|
|
2250
|
+
mint: Address;
|
|
2251
|
+
signature: string; // the Solana tx signature
|
|
2252
|
+
}
|
|
2253
|
+
```
|
|
2115
2254
|
|
|
2116
2255
|
### Versions
|
|
2117
2256
|
|
|
@@ -2125,7 +2264,7 @@ console.log(`ANT was spawned with module: ${moduleId}`);
|
|
|
2125
2264
|
|
|
2126
2265
|
// With custom GraphQL URL and retries
|
|
2127
2266
|
const moduleId = await ant.getModuleId({
|
|
2128
|
-
graphqlUrl: "https://
|
|
2267
|
+
graphqlUrl: "https://turbo-gateway.com/graphql",
|
|
2129
2268
|
retries: 5,
|
|
2130
2269
|
});
|
|
2131
2270
|
```
|
|
@@ -2182,61 +2321,6 @@ true
|
|
|
2182
2321
|
|
|
2183
2322
|
</details>
|
|
2184
2323
|
|
|
2185
|
-
#### `getANTVersions`
|
|
2186
|
-
|
|
2187
|
-
Static method that returns the full array of available ANT versions and the latest version from the ANT registry.
|
|
2188
|
-
|
|
2189
|
-
```typescript
|
|
2190
|
-
import { ANT } from "@ar.io/sdk";
|
|
2191
|
-
|
|
2192
|
-
// Get all available ANT versions
|
|
2193
|
-
const antVersions = ANT.versions;
|
|
2194
|
-
const versions = await antVersions.getANTVersions();
|
|
2195
|
-
```
|
|
2196
|
-
|
|
2197
|
-
Result:
|
|
2198
|
-
|
|
2199
|
-
```json
|
|
2200
|
-
{
|
|
2201
|
-
[
|
|
2202
|
-
{
|
|
2203
|
-
"moduleId": "FKtQtOOtlcWCW2pXrwWFiCSlnuewMZOHCzhulVkyqBE",
|
|
2204
|
-
"version": "23",
|
|
2205
|
-
"releaseNotes": "Initial release of the ANT module.",
|
|
2206
|
-
"releaseDate": 1700000000000
|
|
2207
|
-
}
|
|
2208
|
-
// ...other versions
|
|
2209
|
-
],
|
|
2210
|
-
}
|
|
2211
|
-
```
|
|
2212
|
-
|
|
2213
|
-
#### `getLatestANTVersion()`
|
|
2214
|
-
|
|
2215
|
-
Static method that returns the latest ANT version from the ANT registry.
|
|
2216
|
-
|
|
2217
|
-
```typescript
|
|
2218
|
-
import { ANT } from "@ar.io/sdk";
|
|
2219
|
-
|
|
2220
|
-
// Get the latest ANT version
|
|
2221
|
-
import { ANT } from "@ar.io/sdk";
|
|
2222
|
-
|
|
2223
|
-
// Get all available ANT versions
|
|
2224
|
-
const antVersions = ANT.versions;
|
|
2225
|
-
const versions = await antVersions.getANTVersions();
|
|
2226
|
-
const latestVersion = await antVersions.getLatestANTVersion();
|
|
2227
|
-
```
|
|
2228
|
-
|
|
2229
|
-
Result:
|
|
2230
|
-
|
|
2231
|
-
```json
|
|
2232
|
-
{
|
|
2233
|
-
"moduleId": "FKtQtOOtlcWCW2pXrwWFiCSlnuewMZOHCzhulVkyqBE",
|
|
2234
|
-
"version": "23",
|
|
2235
|
-
"releaseNotes": "Initial release of the ANT module.",
|
|
2236
|
-
"releaseDate": 1700000000000
|
|
2237
|
-
}
|
|
2238
|
-
```
|
|
2239
|
-
|
|
2240
2324
|
### State
|
|
2241
2325
|
|
|
2242
2326
|
#### `getInfo()`
|
|
@@ -2252,11 +2336,42 @@ const info = await ant.getInfo();
|
|
|
2252
2336
|
|
|
2253
2337
|
```json
|
|
2254
2338
|
{
|
|
2255
|
-
"
|
|
2256
|
-
"
|
|
2257
|
-
"
|
|
2258
|
-
"
|
|
2259
|
-
"
|
|
2339
|
+
"Name": "ArDrive",
|
|
2340
|
+
"Owner": "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ",
|
|
2341
|
+
"Ticker": "ANT-ARDRIVE",
|
|
2342
|
+
"Total-Supply": "1",
|
|
2343
|
+
"Description": "This is the ANT for the ArDrive decentralized web app.",
|
|
2344
|
+
"Keywords": ["File-sharing", "Publishing", "dApp"],
|
|
2345
|
+
"Logo": "Sie_26dvgyok0PZD_-iQAFOhOd5YxDTkczOLoqTTL_A",
|
|
2346
|
+
"Denomination": "0",
|
|
2347
|
+
"Handlers": [
|
|
2348
|
+
"balance",
|
|
2349
|
+
"balances",
|
|
2350
|
+
"totalSupply",
|
|
2351
|
+
"info",
|
|
2352
|
+
"controllers",
|
|
2353
|
+
"record",
|
|
2354
|
+
"records",
|
|
2355
|
+
"state",
|
|
2356
|
+
"transfer",
|
|
2357
|
+
"addController",
|
|
2358
|
+
"removeController",
|
|
2359
|
+
"setRecord",
|
|
2360
|
+
"removeRecord",
|
|
2361
|
+
"setName",
|
|
2362
|
+
"setTicker",
|
|
2363
|
+
"setDescription",
|
|
2364
|
+
"setKeywords",
|
|
2365
|
+
"setLogo",
|
|
2366
|
+
"initializeState",
|
|
2367
|
+
"releaseName",
|
|
2368
|
+
"reassignName",
|
|
2369
|
+
"approvePrimaryName",
|
|
2370
|
+
"removePrimaryNames",
|
|
2371
|
+
"transferRecordOwnership",
|
|
2372
|
+
"_eval",
|
|
2373
|
+
"_default"
|
|
2374
|
+
]
|
|
2260
2375
|
}
|
|
2261
2376
|
```
|
|
2262
2377
|
|
|
@@ -2275,24 +2390,32 @@ const handlers = await ant.getHandlers();
|
|
|
2275
2390
|
|
|
2276
2391
|
```json
|
|
2277
2392
|
[
|
|
2278
|
-
"_eval",
|
|
2279
|
-
"_default",
|
|
2280
|
-
"transfer",
|
|
2281
2393
|
"balance",
|
|
2282
2394
|
"balances",
|
|
2283
2395
|
"totalSupply",
|
|
2284
2396
|
"info",
|
|
2397
|
+
"controllers",
|
|
2398
|
+
"record",
|
|
2399
|
+
"records",
|
|
2400
|
+
"state",
|
|
2401
|
+
"transfer",
|
|
2285
2402
|
"addController",
|
|
2286
2403
|
"removeController",
|
|
2287
|
-
"controllers",
|
|
2288
2404
|
"setRecord",
|
|
2289
2405
|
"removeRecord",
|
|
2290
|
-
"record",
|
|
2291
|
-
"records",
|
|
2292
2406
|
"setName",
|
|
2293
2407
|
"setTicker",
|
|
2408
|
+
"setDescription",
|
|
2409
|
+
"setKeywords",
|
|
2410
|
+
"setLogo",
|
|
2294
2411
|
"initializeState",
|
|
2295
|
-
"
|
|
2412
|
+
"releaseName",
|
|
2413
|
+
"reassignName",
|
|
2414
|
+
"approvePrimaryName",
|
|
2415
|
+
"removePrimaryNames",
|
|
2416
|
+
"transferRecordOwnership",
|
|
2417
|
+
"_eval",
|
|
2418
|
+
"_default"
|
|
2296
2419
|
]
|
|
2297
2420
|
```
|
|
2298
2421
|
|
|
@@ -2311,23 +2434,28 @@ const state = await ant.getState();
|
|
|
2311
2434
|
|
|
2312
2435
|
```json
|
|
2313
2436
|
{
|
|
2314
|
-
"
|
|
2315
|
-
"
|
|
2316
|
-
|
|
2317
|
-
|
|
2437
|
+
"Name": "ar.io Foundation",
|
|
2438
|
+
"Ticker": "ANT-AR-IO",
|
|
2439
|
+
"Description": "A friendly description for this ANT.",
|
|
2440
|
+
"Keywords": ["keyword1", "keyword2", "keyword3"],
|
|
2441
|
+
"Denomination": 0,
|
|
2442
|
+
"Owner": "98O1_xqDLrBKRfQPWjF5p7xZ4Jx6GM8P5PeJn26xwUY",
|
|
2318
2443
|
"Controllers": [],
|
|
2319
2444
|
"Records": {
|
|
2320
2445
|
"v1-0-0_whitepaper": {
|
|
2321
2446
|
"transactionId": "lNjWn3LpyhKC95Kqe-x8X2qgju0j98MhucdDKK85vc4",
|
|
2322
|
-
"ttlSeconds": 900
|
|
2447
|
+
"ttlSeconds": 900,
|
|
2448
|
+
"targetProtocol": 0
|
|
2323
2449
|
},
|
|
2324
2450
|
"@": {
|
|
2325
2451
|
"transactionId": "2rMLb2uHAyEt7jSu6bXtKx8e-jOfIf7E-DOgQnm8EtU",
|
|
2326
|
-
"ttlSeconds": 3600
|
|
2452
|
+
"ttlSeconds": 3600,
|
|
2453
|
+
"targetProtocol": 0
|
|
2327
2454
|
},
|
|
2328
2455
|
"alice": {
|
|
2329
2456
|
"transactionId": "kMk95k_3R8x_7d3wB9tEOiL5v6n8QhR_VnFCh3aeE3f",
|
|
2330
2457
|
"ttlSeconds": 900,
|
|
2458
|
+
"targetProtocol": 0,
|
|
2331
2459
|
"owner": "alice-wallet-address-123...",
|
|
2332
2460
|
"displayName": "Alice's Portfolio",
|
|
2333
2461
|
"logo": "avatar-tx-id-456...",
|
|
@@ -2336,17 +2464,16 @@ const state = await ant.getState();
|
|
|
2336
2464
|
},
|
|
2337
2465
|
"whitepaper": {
|
|
2338
2466
|
"transactionId": "lNjWn3LpyhKC95Kqe-x8X2qgju0j98MhucdDKK85vc4",
|
|
2339
|
-
"ttlSeconds": 900
|
|
2467
|
+
"ttlSeconds": 900,
|
|
2468
|
+
"targetProtocol": 0
|
|
2340
2469
|
}
|
|
2341
2470
|
},
|
|
2342
|
-
"
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
"Keywords": ["keyword1", "keyword2", "keyword3"],
|
|
2471
|
+
"Balances": {
|
|
2472
|
+
"98O1_xqDLrBKRfQPWjF5p7xZ4Jx6GM8P5PeJn26xwUY": 1
|
|
2473
|
+
},
|
|
2346
2474
|
"Logo": "Sie_26dvgyok0PZD_-iQAFOhOd5YxDTkczOLoqTTL_A",
|
|
2347
|
-
"
|
|
2348
|
-
"
|
|
2349
|
-
"Owner": "98O1_xqDLrBKRfQPWjF5p7xZ4Jx6GM8P5PeJn26xwUY"
|
|
2475
|
+
"TotalSupply": 1,
|
|
2476
|
+
"Initialized": true
|
|
2350
2477
|
}
|
|
2351
2478
|
```
|
|
2352
2479
|
|
|
@@ -2435,24 +2562,32 @@ const records = await ant.getRecords();
|
|
|
2435
2562
|
{
|
|
2436
2563
|
"@": {
|
|
2437
2564
|
"transactionId": "UyC5P5qKPZaltMmmZAWdakhlDXsBF6qmyrbWYFchRTk",
|
|
2438
|
-
"ttlSeconds": 3600
|
|
2565
|
+
"ttlSeconds": 3600,
|
|
2566
|
+
"targetProtocol": 0,
|
|
2567
|
+
"index": 0
|
|
2439
2568
|
},
|
|
2440
2569
|
"alice": {
|
|
2441
2570
|
"transactionId": "kMk95k_3R8x_7d3wB9tEOiL5v6n8QhR_VnFCh3aeE3f",
|
|
2442
2571
|
"ttlSeconds": 900,
|
|
2572
|
+
"targetProtocol": 0,
|
|
2443
2573
|
"owner": "alice-wallet-address-123...",
|
|
2444
2574
|
"displayName": "Alice's Portfolio",
|
|
2445
2575
|
"logo": "avatar-tx-id-456...",
|
|
2446
2576
|
"description": "Personal portfolio and blog",
|
|
2447
|
-
"keywords": ["portfolio", "personal", "blog"]
|
|
2577
|
+
"keywords": ["portfolio", "personal", "blog"],
|
|
2578
|
+
"index": 1
|
|
2448
2579
|
},
|
|
2449
2580
|
"zed": {
|
|
2450
2581
|
"transactionId": "-k7t8xMoB8hW482609Z9F4bTFMC3MnuW8bTvTyT8pFI",
|
|
2451
|
-
"ttlSeconds": 900
|
|
2582
|
+
"ttlSeconds": 900,
|
|
2583
|
+
"targetProtocol": 0,
|
|
2584
|
+
"index": 2
|
|
2452
2585
|
},
|
|
2453
2586
|
"ardrive": {
|
|
2454
2587
|
"transactionId": "-cucucachoodwedwedoiwepodiwpodiwpoidpwoiedp",
|
|
2455
|
-
"ttlSeconds": 900
|
|
2588
|
+
"ttlSeconds": 900,
|
|
2589
|
+
"targetProtocol": 0,
|
|
2590
|
+
"index": 3
|
|
2456
2591
|
}
|
|
2457
2592
|
}
|
|
2458
2593
|
```
|
|
@@ -2474,6 +2609,7 @@ const record = await ant.getRecord({ undername: "dapp" });
|
|
|
2474
2609
|
{
|
|
2475
2610
|
"transactionId": "432l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM",
|
|
2476
2611
|
"ttlSeconds": 900,
|
|
2612
|
+
"targetProtocol": 0,
|
|
2477
2613
|
"owner": "alice-wallet-address-123...",
|
|
2478
2614
|
"displayName": "Alice's Site",
|
|
2479
2615
|
"logo": "avatar-tx-id-456...",
|
|
@@ -2529,7 +2665,7 @@ const balance = await ant.getBalance({
|
|
|
2529
2665
|
|
|
2530
2666
|
#### `transfer({ target })`
|
|
2531
2667
|
|
|
2532
|
-
Transfers ownership of the ANT to a new target address. Target
|
|
2668
|
+
Transfers ownership of the ANT to a new target address. Target must be a Solana address. ANT transfers are standard Metaplex Core NFT transfers.
|
|
2533
2669
|
|
|
2534
2670
|
_Note: Requires `signer` to be provided on `ANT.init` to sign the transaction._
|
|
2535
2671
|
|
|
@@ -2788,115 +2924,28 @@ const { id: txId } = await ant.setLogo(
|
|
|
2788
2924
|
|
|
2789
2925
|
### ARIO Integrations
|
|
2790
2926
|
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
```typescript
|
|
2798
|
-
const { id: txId } = await ant.releaseName({
|
|
2799
|
-
name: "permalink",
|
|
2800
|
-
arioProcessId: ARIO_MAINNET_PROCESS_ID, // releases the name owned by the ANT and sends it to recently returned names on the ARIO contract
|
|
2801
|
-
});
|
|
2802
|
-
```
|
|
2803
|
-
|
|
2804
|
-
#### `reassignName({ name, arioProcessId, antProcessId })`
|
|
2805
|
-
|
|
2806
|
-
Reassigns a name to a new ANT. This can only be done by the current owner of the ANT.
|
|
2807
|
-
|
|
2808
|
-
_Note: Requires `signer` to be provided on `ANT.init` to sign the transaction._
|
|
2809
|
-
|
|
2810
|
-
```typescript
|
|
2811
|
-
const { id: txId } = await ant.reassignName({
|
|
2812
|
-
name: "ardrive",
|
|
2813
|
-
arioProcessId: ARIO_MAINNET_PROCESS_ID,
|
|
2814
|
-
antProcessId: NEW_ANT_PROCESS_ID, // the new ANT process id that will take over ownership of the name
|
|
2815
|
-
});
|
|
2816
|
-
```
|
|
2817
|
-
|
|
2818
|
-
#### `approvePrimaryNameRequest({ name, address, arioProcessId })`
|
|
2819
|
-
|
|
2820
|
-
Approves a primary name request for a given name or address.
|
|
2821
|
-
|
|
2822
|
-
_Note: Requires `signer` to be provided on `ANT.init` to sign the transaction._
|
|
2823
|
-
|
|
2824
|
-
```typescript
|
|
2825
|
-
const { id: txId } = await ant.approvePrimaryNameRequest({
|
|
2826
|
-
name: "arns",
|
|
2827
|
-
address: "t4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3", // must match the request initiator address
|
|
2828
|
-
arioProcessId: ARIO_MAINNET_PROCESS_ID, // the ARIO process id to use for the request
|
|
2829
|
-
});
|
|
2830
|
-
```
|
|
2831
|
-
|
|
2832
|
-
#### `removePrimaryNames({ names, arioProcessId, notifyOwners })`
|
|
2833
|
-
|
|
2834
|
-
Removes primary names from the ANT process.
|
|
2835
|
-
|
|
2836
|
-
_Note: Requires `signer` to be provided on `ANT.init` to sign the transaction._
|
|
2837
|
-
|
|
2838
|
-
```typescript
|
|
2839
|
-
const { id: txId } = await ant.removePrimaryNames({
|
|
2840
|
-
names: ["arns", "test_arns"], // any primary names associated with a base name controlled by this ANT will be removed
|
|
2841
|
-
arioProcessId: ARIO_MAINNET_PROCESS_ID,
|
|
2842
|
-
notifyOwners: true, // if true, the owners of the removed names will be send AO messages to notify them of the removal
|
|
2843
|
-
});
|
|
2844
|
-
```
|
|
2927
|
+
`releaseName`, `reassignName`, `approvePrimaryNameRequest`, and
|
|
2928
|
+
`removePrimaryNames` were AO-only orchestration helpers and have been
|
|
2929
|
+
removed. Their on-chain equivalents on Solana live on the `ario-arns`
|
|
2930
|
+
program and are exposed through the `ARIO` write client
|
|
2931
|
+
(`upgradeRecord`, `setPrimaryName`, etc.) or — for permissionless
|
|
2932
|
+
maintenance — through `SolanaARIOWriteable`'s prune helpers.
|
|
2845
2933
|
|
|
2846
2934
|
### Upgrade
|
|
2847
2935
|
|
|
2848
|
-
#### `upgrade(
|
|
2849
|
-
|
|
2850
|
-
Upgrades an ANT by forking it to the latest version from the ANT registry and optionally reassigning ArNS names to the new process. This function first checks the version of the existing ANT, creates a new ANT using `.fork()` to the latest version, and then reassigns the ArNS names affiliated with this process to the new process.
|
|
2936
|
+
#### `upgrade()`
|
|
2851
2937
|
|
|
2852
|
-
|
|
2938
|
+
Migrates this ANT's on-chain state to the latest schema version (per-
|
|
2939
|
+
ANT data migration on Solana — no process forking, no name
|
|
2940
|
+
reassignment). Returns `{ id, needsMigration }`.
|
|
2853
2941
|
|
|
2854
2942
|
```typescript
|
|
2855
|
-
// Upgrade ANT and reassign all affiliated ArNS names to the new process
|
|
2856
2943
|
const result = await ant.upgrade();
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
names: ["ardrive", "example"],
|
|
2861
|
-
});
|
|
2862
|
-
|
|
2863
|
-
// with callbacks
|
|
2864
|
-
const result = await ant.upgrade({
|
|
2865
|
-
names: ["ardrive", "example"],
|
|
2866
|
-
onSigningProgress: (event, payload) => {
|
|
2867
|
-
console.log(`${event}:`, payload);
|
|
2868
|
-
if (event === "checking-version") {
|
|
2869
|
-
console.log(`Checking version: ${payload.antProcessId}`);
|
|
2870
|
-
}
|
|
2871
|
-
if (event === "fetching-affiliated-names") {
|
|
2872
|
-
console.log(`Fetching affiliated names: ${payload.arioProcessId}`);
|
|
2873
|
-
}
|
|
2874
|
-
if (event === "reassigning-name") {
|
|
2875
|
-
console.log(`Reassigning name: ${payload.name}`);
|
|
2876
|
-
}
|
|
2877
|
-
if (event === "validating-names") {
|
|
2878
|
-
console.log(`Validating names: ${payload.names}`);
|
|
2879
|
-
}
|
|
2880
|
-
// other callback events...
|
|
2881
|
-
},
|
|
2882
|
-
});
|
|
2883
|
-
|
|
2884
|
-
console.log(`Upgraded to process: ${result.forkedProcessId}`);
|
|
2885
|
-
console.log(`Successfully reassigned names: ${result.reassignedNames}`);
|
|
2886
|
-
console.log(`Failed to reassign names: ${result.failedReassignedNames}`);
|
|
2944
|
+
if (result.needsMigration) {
|
|
2945
|
+
console.log(`Migrated: ${result.id}`);
|
|
2946
|
+
}
|
|
2887
2947
|
```
|
|
2888
2948
|
|
|
2889
|
-
**Parameters:**
|
|
2890
|
-
|
|
2891
|
-
- `reassignAffiliatedNames?: boolean` - If true, reassigns all names associated with this process to the new forked process (defaults to true when names is empty)
|
|
2892
|
-
- `names?: string[]` - Optional array of specific names to reassign (cannot be used with `reassignAffiliatedNames: true`). These names must be affiliated with this ANT on the provided ARIO process.
|
|
2893
|
-
- `arioProcessId?: string` - Optional ARIO process ID (defaults to mainnet)
|
|
2894
|
-
- `antRegistryId?: string` - Optional ANT registry process ID used to resolve the latest version (defaults to mainnet registry)
|
|
2895
|
-
- `skipVersionCheck?: boolean` - Skip checking if ANT is already latest version (defaults to false)
|
|
2896
|
-
- `onSigningProgress?: Function` - Optional progress callback for tracking upgrade steps
|
|
2897
|
-
|
|
2898
|
-
**Returns:** `Promise<{ forkedProcessId: string, reassignedNames: Record<string, AoMessageResult>, failedReassignedNames: Record<string, { id?: string; error: Error }> }>`
|
|
2899
|
-
|
|
2900
2949
|
### Undername Ownership
|
|
2901
2950
|
|
|
2902
2951
|
NTs support ownership of undernames:
|
|
@@ -2949,9 +2998,11 @@ console.log(`Transaction ID: ${record.transactionId}`);
|
|
|
2949
2998
|
|
|
2950
2999
|
```typescript
|
|
2951
3000
|
// Alice (record owner) updating her own record
|
|
2952
|
-
const aliceAnt = ANT.init({
|
|
2953
|
-
processId:
|
|
2954
|
-
|
|
3001
|
+
const aliceAnt = await ANT.init({
|
|
3002
|
+
processId: 'ANT_MINT_PUBKEY',
|
|
3003
|
+
rpc,
|
|
3004
|
+
rpcSubscriptions,
|
|
3005
|
+
signer: aliceSigner, // Alice's @solana/kit signer
|
|
2955
3006
|
});
|
|
2956
3007
|
|
|
2957
3008
|
// ✅ CORRECT: Alice includes her own address as owner
|
|
@@ -3005,55 +3056,62 @@ console.log(recordAfter.owner); // undefined (controlled by ANT owner again)
|
|
|
3005
3056
|
|
|
3006
3057
|
### Static Methods
|
|
3007
3058
|
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3059
|
+
`ANT.fork()` and the static `ANT.upgrade()` were AO-only (process
|
|
3060
|
+
forking + name reassignment). On Solana, schema migration is a
|
|
3061
|
+
per-asset CPI exposed as the instance method `ant.upgrade()` documented
|
|
3062
|
+
above; new ANTs are created with `ANT.spawn()`.
|
|
3011
3063
|
|
|
3012
|
-
|
|
3013
|
-
const newProcessId = await ANT.fork({
|
|
3014
|
-
signer: new ArweaveSigner(jwk),
|
|
3015
|
-
antProcessId: "existing-ant-process-id",
|
|
3016
|
-
// Optional: specify a specific module ID, defaults to latest from registry
|
|
3017
|
-
module: "new-module-id",
|
|
3018
|
-
onSigningProgress: (event, payload) => {
|
|
3019
|
-
console.log(`Fork progress: ${event}`);
|
|
3020
|
-
},
|
|
3021
|
-
});
|
|
3064
|
+
## Escrow
|
|
3022
3065
|
|
|
3023
|
-
|
|
3024
|
-
|
|
3066
|
+
Trustless, multi-protocol escrow for handing an asset to a recipient identified by
|
|
3067
|
+
an **Arweave** or **Ethereum** address, claimable once they hold a Solana wallet.
|
|
3068
|
+
Backed by the `ario-ant-escrow` program. Two clients:
|
|
3025
3069
|
|
|
3026
|
-
|
|
3070
|
+
- `TokenEscrow` — escrow liquid **ARIO** (SPL) or a **time-locked vault**.
|
|
3071
|
+
- `ANTEscrow` — escrow an **ANT** (Metaplex Core NFT).
|
|
3027
3072
|
|
|
3028
|
-
|
|
3073
|
+
Each supports **deposit → claim → cancel/refund → update-recipient**. Claims work
|
|
3074
|
+
three ways: **Arweave-attested** (an off-chain attestor re-signs the canonical
|
|
3075
|
+
claim with Ed25519, verified on-chain), **Ethereum** (on-chain `secp256k1_recover`
|
|
3076
|
+
+ EIP-191), and **vault** (instruction introspection that preserves the remaining
|
|
3077
|
+
lock).
|
|
3029
3078
|
|
|
3030
3079
|
```typescript
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3080
|
+
import { TokenEscrow, canonicalMessageV2 } from '@ar.io/sdk';
|
|
3081
|
+
|
|
3082
|
+
const escrow = new TokenEscrow({
|
|
3083
|
+
rpc,
|
|
3084
|
+
rpcSubscriptions,
|
|
3085
|
+
signer,
|
|
3086
|
+
programId,
|
|
3087
|
+
coreProgram,
|
|
3037
3088
|
});
|
|
3038
3089
|
|
|
3039
|
-
//
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3090
|
+
// deposit 50 ARIO to an Ethereum recipient
|
|
3091
|
+
await escrow.depositTokens({
|
|
3092
|
+
assetId, // 32-byte client-supplied id
|
|
3093
|
+
amount: 50_000_000n,
|
|
3094
|
+
arioMint,
|
|
3095
|
+
depositorTokenAccount,
|
|
3096
|
+
recipient: { protocol: 'ethereum', publicKey: ethAddress20 },
|
|
3046
3097
|
});
|
|
3047
3098
|
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3099
|
+
// the recipient claims (Ethereum path) once they have a Solana wallet
|
|
3100
|
+
await escrow.claimTokensEthereum({
|
|
3101
|
+
depositor,
|
|
3102
|
+
assetId,
|
|
3103
|
+
claimant,
|
|
3104
|
+
claimantTokenAccount,
|
|
3105
|
+
escrowTokenAccount,
|
|
3106
|
+
signature, // recipient's EIP-191 signature over canonicalMessageV2(...)
|
|
3107
|
+
});
|
|
3055
3108
|
```
|
|
3056
3109
|
|
|
3110
|
+
Build the exact bytes a recipient signs with `canonicalMessage` /
|
|
3111
|
+
`canonicalMessageV2` — byte-identical to the on-chain program (and the off-chain
|
|
3112
|
+
attestor). See the contracts repo's escrow design + protocol spec for the full
|
|
3113
|
+
flow and the cross-language canonical-message vectors.
|
|
3114
|
+
|
|
3057
3115
|
## Token Conversion
|
|
3058
3116
|
|
|
3059
3117
|
The ARIO process stores all values as mARIO (micro-ARIO) to avoid floating-point arithmetic issues. The SDK provides an `ARIOToken` and `mARIOToken` classes to handle the conversion between ARIO and mARIO, along with rounding logic for precision.
|
|
@@ -3106,10 +3164,9 @@ const customLogger: ILogger = {
|
|
|
3106
3164
|
},
|
|
3107
3165
|
};
|
|
3108
3166
|
|
|
3109
|
-
//
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
// or set it as the default logger in the entire SDK
|
|
3167
|
+
// Set it as the default logger across the entire SDK — every class
|
|
3168
|
+
// (ARIO, ANT, ANTRegistry, etc.) will route logs through it. `ARIO.init`
|
|
3169
|
+
// does not accept a per-instance logger.
|
|
3113
3170
|
Logger.default = customLogger;
|
|
3114
3171
|
```
|
|
3115
3172
|
|
|
@@ -3165,125 +3222,129 @@ In the example above, the query will return ArNS records where:
|
|
|
3165
3222
|
- The type is "lease" AND
|
|
3166
3223
|
- The processId is EITHER "ZkgLfyHALs5koxzojpcsEFAKA8fbpzP7l-tbM7wmQNM" OR "r61rbOjyXx3u644nGl9bkwLWlWmArMEzQgxBo2R-Vu0"
|
|
3167
3224
|
|
|
3168
|
-
##
|
|
3225
|
+
## Advanced
|
|
3226
|
+
|
|
3227
|
+
### RPC Configuration
|
|
3228
|
+
|
|
3229
|
+
The SDK accepts any `@solana/kit` RPC client. For read-only usage, only
|
|
3230
|
+
`rpc` is required. Write operations additionally need `rpcSubscriptions`
|
|
3231
|
+
(WebSocket) for transaction confirmation and a `signer`.
|
|
3232
|
+
|
|
3233
|
+
#### Basic (read-only)
|
|
3169
3234
|
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3235
|
+
```ts
|
|
3236
|
+
import { ARIO } from '@ar.io/sdk';
|
|
3237
|
+
import { createSolanaRpc } from '@solana/kit';
|
|
3238
|
+
|
|
3239
|
+
const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com');
|
|
3240
|
+
const ario = ARIO.init({ rpc });
|
|
3241
|
+
```
|
|
3173
3242
|
|
|
3174
|
-
|
|
3243
|
+
#### With writes (signer + WebSocket subscriptions)
|
|
3175
3244
|
|
|
3176
3245
|
```ts
|
|
3177
|
-
import { ARIO
|
|
3246
|
+
import { ARIO } from '@ar.io/sdk';
|
|
3178
3247
|
import {
|
|
3179
3248
|
createSolanaRpc,
|
|
3180
3249
|
createSolanaRpcSubscriptions,
|
|
3181
3250
|
createKeyPairSignerFromBytes,
|
|
3182
3251
|
} from '@solana/kit';
|
|
3183
|
-
import { readFileSync } from 'node:fs';
|
|
3184
3252
|
|
|
3185
|
-
// Read-only client (RPC only)
|
|
3186
3253
|
const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com');
|
|
3187
|
-
const
|
|
3188
|
-
|
|
3189
|
-
const record = await ario.getArNSRecord({ name: 'ardrive' });
|
|
3190
|
-
// record.processId === '<the ANT mint pubkey>'
|
|
3191
|
-
|
|
3192
|
-
// Write client — pair an RPC + a signer
|
|
3193
|
-
const signerBytes = new Uint8Array(
|
|
3194
|
-
JSON.parse(readFileSync('/path/to/keypair.json', 'utf8')),
|
|
3195
|
-
);
|
|
3196
|
-
const signer = await createKeyPairSignerFromBytes(signerBytes);
|
|
3197
|
-
const rpcSubs = createSolanaRpcSubscriptions(
|
|
3254
|
+
const rpcSubscriptions = createSolanaRpcSubscriptions(
|
|
3198
3255
|
'wss://api.mainnet-beta.solana.com',
|
|
3199
3256
|
);
|
|
3257
|
+
const signer = await createKeyPairSignerFromBytes(/* ... */);
|
|
3200
3258
|
|
|
3201
|
-
const
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3259
|
+
const ario = ARIO.init({ rpc, rpcSubscriptions, signer });
|
|
3260
|
+
```
|
|
3261
|
+
|
|
3262
|
+
> **Note:** `rpcSubscriptions` opens a WebSocket connection and is only
|
|
3263
|
+
> needed for writes. If your RPC provider doesn't expose a WebSocket
|
|
3264
|
+
> endpoint, omit it and use the SDK in read-only mode.
|
|
3265
|
+
|
|
3266
|
+
### Circuit Breaker
|
|
3267
|
+
|
|
3268
|
+
The SDK ships an [opossum]-backed circuit breaker that wraps the RPC
|
|
3269
|
+
transport. When the primary endpoint starts failing (429 rate-limits,
|
|
3270
|
+
5xx errors, network timeouts) the circuit opens and subsequent calls
|
|
3271
|
+
route transparently to a fallback RPC until the primary recovers.
|
|
3272
|
+
|
|
3273
|
+
```ts
|
|
3274
|
+
import { ARIO, createCircuitBreakerRpc } from '@ar.io/sdk';
|
|
3275
|
+
|
|
3276
|
+
const rpc = createCircuitBreakerRpc({
|
|
3277
|
+
primaryUrl: 'https://my-premium-rpc.example.com',
|
|
3278
|
+
fallbackUrl: 'https://api.mainnet-beta.solana.com',
|
|
3206
3279
|
});
|
|
3207
3280
|
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3281
|
+
const ario = ARIO.init({ rpc });
|
|
3282
|
+
```
|
|
3283
|
+
|
|
3284
|
+
Use `defaultFallbackUrl()` to auto-pick mainnet or devnet based on the
|
|
3285
|
+
primary URL:
|
|
3286
|
+
|
|
3287
|
+
```ts
|
|
3288
|
+
import {
|
|
3289
|
+
createCircuitBreakerRpc,
|
|
3290
|
+
defaultFallbackUrl,
|
|
3291
|
+
} from '@ar.io/sdk';
|
|
3292
|
+
|
|
3293
|
+
const primaryUrl = 'https://my-premium-rpc.example.com';
|
|
3294
|
+
const rpc = createCircuitBreakerRpc({
|
|
3295
|
+
primaryUrl,
|
|
3296
|
+
fallbackUrl: defaultFallbackUrl(primaryUrl), // → mainnet public RPC
|
|
3213
3297
|
});
|
|
3214
3298
|
```
|
|
3215
3299
|
|
|
3216
|
-
|
|
3300
|
+
Tuning knobs (all optional):
|
|
3217
3301
|
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
`
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
on-chain AR.IO programs deployed on Solana.
|
|
3302
|
+
| Option | Default | Description |
|
|
3303
|
+
|---|---|---|
|
|
3304
|
+
| `timeout` | `10000` | ms before a single request is timed out (`false` to disable) |
|
|
3305
|
+
| `errorThresholdPercentage` | `50` | error % at which to open the circuit |
|
|
3306
|
+
| `resetTimeout` | `30000` | ms to wait before probing the primary again (half-open) |
|
|
3307
|
+
| `volumeThreshold` | `5` | minimum requests in the rolling window before the circuit can trip |
|
|
3225
3308
|
|
|
3226
|
-
|
|
3227
|
-
pass `fundFrom: 'any'` and the SDK composes a plan across balance,
|
|
3228
|
-
matured withdrawal vaults, excess delegated stake, and minimum stake
|
|
3229
|
-
across multiple gateways. See the planner at
|
|
3230
|
-
`src/solana/funding-plan.ts` for the Lua-faithful drawdown order.
|
|
3309
|
+
### Automatic Retries
|
|
3231
3310
|
|
|
3232
|
-
|
|
3311
|
+
All RPC **read** calls (account fetches, `getProgramAccounts`, etc.)
|
|
3312
|
+
automatically retry on transient transport errors with exponential
|
|
3313
|
+
back-off. Writes are **not** retried (to avoid double-sends).
|
|
3233
3314
|
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3315
|
+
Retried errors: HTTP 429/5xx, `fetch failed`, `ECONNRESET`,
|
|
3316
|
+
`ETIMEDOUT`, `AbortError` / timeouts. Non-retryable errors (account
|
|
3317
|
+
not found, invalid params, deserialization) throw immediately.
|
|
3237
3318
|
|
|
3238
|
-
|
|
3239
|
-
|
|
3319
|
+
Defaults: **6 attempts**, 500 ms base delay, 5 s max delay. Override
|
|
3320
|
+
per-call with the exported `withRetry` helper:
|
|
3240
3321
|
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
state: {
|
|
3244
|
-
name: 'My ANT',
|
|
3245
|
-
ticker: 'MYANT',
|
|
3246
|
-
description: 'whatever',
|
|
3247
|
-
uri: 'ar://placeholder-metadata',
|
|
3248
|
-
},
|
|
3249
|
-
});
|
|
3322
|
+
```ts
|
|
3323
|
+
import { withRetry } from '@ar.io/sdk';
|
|
3250
3324
|
|
|
3251
|
-
const
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
rpc, rpcSubscriptions: rpcSubs, signer,
|
|
3325
|
+
const result = await withRetry(() => rpc.getAccountInfo(addr).send(), {
|
|
3326
|
+
maxAttempts: 3,
|
|
3327
|
+
baseDelayMs: 1000,
|
|
3255
3328
|
});
|
|
3256
|
-
await ant.setBaseNameRecord({ transactionId: '...', ttlSeconds: 3600 });
|
|
3257
|
-
await ant.addController({ controller: '<some-pubkey>' });
|
|
3258
3329
|
```
|
|
3259
3330
|
|
|
3260
|
-
|
|
3261
|
-
`ARIO_ANT_PROGRAM_ID` or a third-party-conformant program — see
|
|
3262
|
-
ADR-016) holds the records. The SDK reads the plugin to derive the
|
|
3263
|
-
correct `AntRecord` PDA on every record lookup.
|
|
3264
|
-
|
|
3265
|
-
### Conditional imports
|
|
3331
|
+
### Generated instruction builders
|
|
3266
3332
|
|
|
3267
|
-
|
|
3268
|
-
`@solana-
|
|
3269
|
-
`@ar.io/sdk/node` / `@ar.io/sdk/web` entries stay AO-only — bundle size
|
|
3270
|
-
is unchanged for AO-only consumers.
|
|
3271
|
-
|
|
3272
|
-
You can also import the codama-emitted typed clients directly for
|
|
3273
|
-
custom transaction building:
|
|
3333
|
+
For custom transaction building, import Codama-generated typed clients
|
|
3334
|
+
from [`@ar.io/solana-contracts`](https://www.npmjs.com/package/@ar.io/solana-contracts):
|
|
3274
3335
|
|
|
3275
3336
|
```ts
|
|
3276
3337
|
import {
|
|
3277
3338
|
getBuyNameInstructionAsync,
|
|
3278
3339
|
ARIO_ARNS_PROGRAM_ADDRESS,
|
|
3279
|
-
} from '@ar.io/
|
|
3340
|
+
} from '@ar.io/solana-contracts/arns';
|
|
3280
3341
|
```
|
|
3281
3342
|
|
|
3282
3343
|
### Networks
|
|
3283
3344
|
|
|
3284
3345
|
| Network | RPC | Programs |
|
|
3285
3346
|
|---|---|---|
|
|
3286
|
-
| Mainnet |
|
|
3347
|
+
| Mainnet | `https://api.mainnet-beta.solana.com` (mainnet-beta, default) | Not yet deployed — placeholder IDs in `src/solana/constants.ts` |
|
|
3287
3348
|
| Devnet | `https://api.devnet.solana.com` | See `src/solana/constants.ts` for current devnet program IDs |
|
|
3288
3349
|
| Localnet | Surfpool — `https://github.com/solana-foundation/surfpool` | Localnet harness in `solana-ar-io` monorepo |
|
|
3289
3350
|
|
|
@@ -3308,12 +3369,6 @@ To run your own ar.io gateway, you can refer to the following resources:
|
|
|
3308
3369
|
|
|
3309
3370
|
Running your own gateway allows you to participate in the ar.io network, serve Arweave data, and potentially earn rewards. Make sure to follow the official documentation for the most up-to-date and accurate information on gateway operation.
|
|
3310
3371
|
|
|
3311
|
-
### AO
|
|
3312
|
-
|
|
3313
|
-
This library integrates with [AO], a decentralized compute platform built on Arweave. We utilize [AO Connect] to interact with AO processes and messages. This integration allows for seamless communication with the AO network, enabling developers to leverage decentralized computation and storage capabilities in their applications.
|
|
3314
|
-
|
|
3315
|
-
For more information on how to use AO and AO Connect within this library, please refer to our documentation and examples.
|
|
3316
|
-
|
|
3317
3372
|
## Developers
|
|
3318
3373
|
|
|
3319
3374
|
### Requirements
|
|
@@ -3356,22 +3411,15 @@ For more information on how to contribute, please see [CONTRIBUTING.md].
|
|
|
3356
3411
|
<!-- ADD ALL LINK REFERENCES BELOW -->
|
|
3357
3412
|
|
|
3358
3413
|
[ar.io]: https://ar.io
|
|
3359
|
-
[permaweb/aoconnect]: https://github.com/permaweb/aoconnect
|
|
3360
|
-
[package.json]: ./package.json
|
|
3361
3414
|
[examples]: ./examples
|
|
3362
3415
|
[examples/webpack]: ./examples/webpack
|
|
3363
3416
|
[examples/vite]: ./examples/vite
|
|
3364
3417
|
[CONTRIBUTING.md]: ./CONTRIBUTING.md
|
|
3365
|
-
[AO Connect]: https://github.com/permaweb/ao/tree/main/connect
|
|
3366
|
-
[ARIO Testnet Process]: https://www.ao.link/#/entity/agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA
|
|
3367
|
-
[ARIO Network Spec]: https://github.com/ar-io/ar-io-network-process?tab=readme-ov-file#contract-spec
|
|
3368
|
-
[Winston]: https://www.npmjs.com/package/winston
|
|
3369
|
-
[AO]: https://github.com/permaweb/ao
|
|
3370
3418
|
[ar-io-node repository]: https://github.com/ar-io/ar-io-node
|
|
3371
3419
|
[ar.io Gateway Documentation]: https://docs.ar.io/gateways/ar-io-node/overview/
|
|
3372
3420
|
[ANS-104]: https://github.com/ArweaveTeam/arweave-standards/blob/master/ans/ANS-104.md
|
|
3373
|
-
[
|
|
3421
|
+
[opossum]: https://nodeshift.dev/opossum/
|
|
3374
3422
|
|
|
3375
3423
|
```
|
|
3376
3424
|
|
|
3377
|
-
```
|
|
3425
|
+
```
|