機能
ヘルパー
Last updated January 31, 2026
JSヘルパー関数
以下のヘルパー関数はJSクライアント用です。
フェッチヘルパー
新しいフェッチヘルパーでは、各ヘルパーメソッドからプラグインを継承するかどうかのオプションを選択できます。
fetchAsset()
単一のAssetを取得します。
const asset = await fetchAsset(umi, assetAddress.publicKey, {
skipDerivePlugins: false,
})
fetchAssetsByOwner()
指定された所有者アドレスのすべてのAssetを取得します。
const assetsByOwner = await fetchAssetsByOwner(umi, owner, {
skipDerivePlugins: false,
})
fetchAssetsByCollection()
指定されたCollectionアドレスのすべてのAssetを取得します。
const assetsByCollection = await fetchAssetsByCollection(umi, collection, {
skipDerivePlugins: false,
})
fetchAssetsByUpdateAuthority()
指定されたCollectionアドレスのすべてのAssetを取得します。
const assetsByUpdateAuthority = await fetchAssetsByUpdateAuthority(
umi,
updateAuthority,
{ skipDerivePlugins: false }
)
Authorityヘルパー
Authorityヘルパーでは、publicKeyを渡して、そのアドレスがCoreエコシステムの特定の側面(Asset、Collection、プラグイン)に対する権限を持っているかどうかを確認できます。
hasPluginAddressAuthority()
hasPluginAddressAuthority()は、渡されたプラグインの権限がAddressタイプに設定されており、pubkeyが一致するかどうかに基づいてboolean値を返します。
export function hasPluginAddressAuthority(
pubkey: PublicKey | string,
authority: BasePluginAuthority
)
hasPluginOwnerAuthority()
hasPluginOwnerAuthority()は、渡されたプラグインの権限がOwnerタイプに設定されており、pubkeyが一致するかどうかに基づいてboolean値を返します。
export function hasPluginOwnerAuthority(
pubkey: PublicKey | string,
authority: BasePluginAuthority,
asset: AssetV1
)
hasPluginUpdateAuthority()
hasPluginUpdateAuthority()は、渡されたプラグインの権限がUpdateAuthorityタイプに設定されており、pubkeyが一致するかどうかに基づいてboolean値を返します。
export function hasPluginUpdateAuthority(
pubkey: PublicKey | string,
authority: BasePluginAuthority,
asset: AssetV1,
collection?: CollectionV1
)
hasAssetUpdateAuthority()
hasAssetUpdateAuthority()は、渡されたpubkeyがAssetに対するUpdate Authorityを持っているかどうかに基づいてboolean値を返します。
export function hasAssetUpdateAuthority(
pubkey: string | PublicKey,
asset: AssetV1,
collection?: CollectionV1
)
hasCollectionUpdateAuthority()
hasCollectionUpdateAuthority()は、渡されたpubkeyがCollectionに対するUpdate Authorityを持っているかどうかに基づいてboolean値を返します。
export function hasCollectionUpdateAuthority(
pubkey: string | PublicKey,
collection: CollectionV1
)
ライフサイクルヘルパー
ライフサイクルヘルパーは、アドレスが特定のライフサイクルイベントを実行できるかどうかを素早く効率的に確認する方法を提供します。
validateTransfer()
publicKeyがAssetを転送する資格があるかどうかについてboolean値を返します。
export async function validateTransfer(
umi,
{ authority, asset, collection, recipient }
)
validateBurn
publicKeyがAssetをバーンできるかどうかについてboolean値を返します。
export async function validateBurn(umi, { authority, asset, collection })
canUpdate()
publicKeyがAssetを更新する資格があるかどうかについてboolean値を返します。
export async function validateUpdate(
umi,
{ authority, asset, collection }
)
プラグインヘルパー
assetPluginKeyFromType()
プラグインタイプをAssetプラグイン用のキーに変換します。
export function assetPluginKeyFromType(pluginType: PluginType)
pluginTypeFromAssetPluginKey()
プラグインキーをタイプに変換します。
export function pluginTypeFromAssetPluginKey(key: AssetPluginKey)
checkPluginAuthorities()
Asset上の指定されたプラグインタイプの権限を確認します。
export function checkPluginAuthorities({
authority,
pluginTypes,
asset,
collection,
})
ステートヘルパー
collectionAddress()
AssetがCollectionの一部である場合、そのCollectionアドレスを検索します。 publicKey | undefinedを返します。
export function collectionAddress(asset: AssetV1)
deriveAssetPlugins()
AssetとCollectionからAssetプラグインを継承します。Asset上のプラグインはCollection上のプラグインより優先されます。
export function deriveAssetPlugins(asset: AssetV1, collection?: CollectionV1)
isFrozen()
Assetがフリーズされているかどうかについてbooleanを返します。
export function isFrozen(asset: AssetV1, collection?: CollectionV1)
