插件

Transfer Delegate 插件

Last updated January 31, 2026

Transfer Delegate 插件允许指定的权限方代表所有者转移 Core Asset。对于无托管市场销售、游戏机制和订阅服务至关重要。

您将学到

  • 向 Asset 添加 Transfer Delegate 插件
  • 将转移权限委托给市场或程序
  • 作为委托方执行转移
  • 转移时的权限行为

摘要

Transfer Delegate 是一个所有者管理的插件,允许委托方转移 Asset。一旦委托,权限方可以在无需所有者批准的情况下将 Asset 转移到任何地址。

  • 启用无托管市场挂单
  • 转移后权限被撤销(一次性使用)
  • 使用 Permanent Transfer Delegate 获得持久权限
  • 无需额外参数

范围外

永久转移权限(参见 Permanent Transfer Delegate)、Collection 级别转移和 Token Metadata 转移权限(不同系统)不在范围内。

快速开始

跳转到: 添加插件 · 委托权限 · 作为委托方转移

  1. 使用委托地址添加 Transfer Delegate 插件
  2. 委托方现在可以转移 Asset 一次
  3. 转移后,权限自动撤销

概述

Transfer Delegate 插件是一个所有者管理的插件,允许 Transfer Delegate 插件的权限方随时转移 Asset。 Transfer 插件适用于以下领域:

  • Asset 的无托管销售:无需托管账户直接将 NFT 转移给买家
  • 用户根据事件交换/失去资产的游戏场景:游戏事件发生时自动转移资产
  • 订阅服务:作为订阅服务的一部分转移 NFT

何时使用 Transfer vs Permanent Transfer Delegate

用例Transfer DelegatePermanent Transfer Delegate
市场挂单✅ 最佳选择❌ 风险太大
一次性转移✅ 最佳选择❌ 过度
租赁归还❌ 一次性✅ 最佳选择
游戏资产交换✅ 最佳选择✅ 也可以
转移时权限保持❌ 撤销✅ 保持
选择 Transfer Delegate 用于一次性无托管销售(转移后权限撤销)。
选择 Permanent Transfer Delegate 当权限必须永久保持时。

警告!

Transfer delegate 权限是临时的,在资产转移时会被重置。

兼容性

MPL Core Asset
MPL Core Collection

参数

Transfer 插件不包含任何参数。

函数

向 Asset 添加 Transfer Delegate 插件

addPlugin 命令将 Transfer Delegate 插件添加到 Asset。此插件允许委托方随时转移 Asset。

向 MPL Core Asset 添加 Transfer 插件

import { publicKey } from '@metaplex-foundation/umi'
import { addPlugin } from '@metaplex-foundation/mpl-core'
const assetAddress = publicKey('11111111111111111111111111111111')
const delegate = publicKey('22222222222222222222222222222222')
await addPlugin(umi, {
asset: assetAddress,
plugin: {
type: 'TransferDelegate',
authority: { type: 'Address', address: delegate },
},
}).sendAndConfirm(umi)

委托转移权限

approvePluginAuthority 命令将转移权限委托给不同的地址。这允许另一个地址在保持所有权的同时转移 Asset。

委托转移权限

import { publicKey } from '@metaplex-foundation/umi'
import { approvePluginAuthority } from '@metaplex-foundation/mpl-core'
const asset = publicKey("11111111111111111111111111111111");
const collection = publicKey("22222222222222222222222222222222");
const delegateAddress = publicKey("33333333333333333333333333333333");
await approvePluginAuthority(umi, {
asset: asset,
collection: collection,
plugin: { type: "TransferDelegate" },
newAuthority: { type: "Address", address: delegateAddress },
}).sendAndConfirm(umi);

作为委托方转移 Asset

transfer 指令使用 transfer delegate 权限将 Asset 转移到另一个地址。

转移 MPL Core Asset

import {
fetchAsset,
fetchCollection,
transfer,
} from "@metaplex-foundation/mpl-core";
import { publicKey } from "@metaplex-foundation/umi";
// 要转移的 Asset ID
const assetId = publicKey("11111111111111111111111111111111");
// 获取 Asset
const assetItem = await fetchAsset(umi, assetId);
// 如果 Asset 是 Collection 的一部分,获取 Collection
const collectionItem =
assetItem.updateAuthority.type == "Collection" &&
assetItem.updateAuthority.address
? await fetchCollection(umi, assetItem.updateAuthority.address)
: undefined;
// 转移 Core NFT Asset
const { signature } = await transfer(umi, {
asset: assetItem,
newOwner: publicKey("22222222222222222222222222222222"),
collection: collectionItem,
})
.sendAndConfirm(umi);

更新 Transfer Delegate 权限

由于 Transfer Delegate 插件不包含要更新的插件数据(它是一个空对象 {}),主要的"更新"操作是更改插件权限。这允许您将转移权限委托给不同的地址。

更改 Transfer Delegate 权限

您可以使用 approvePluginAuthority 函数更改谁拥有转移权限:

更新 Transfer Delegate 权限

import { publicKey } from '@metaplex-foundation/umi'
import { approvePluginAuthority } from '@metaplex-foundation/mpl-core'
(async () => {
const assetAddress = publicKey('11111111111111111111111111111111')
const newDelegate = publicKey('44444444444444444444444444444444')
// 将 transfer delegate 更改为新地址
await approvePluginAuthority(umi, {
asset: assetAddress,
plugin: { type: 'TransferDelegate' },
newAuthority: { type: 'Address', address: newDelegate },
}).sendAndConfirm(umi)
})();

撤销 Transfer Delegate 权限

可以使用 revokePluginAuthority 函数撤销转移权限,将转移控制权返还给资产所有者。

撤销 Transfer Delegate 权限

import { publicKey } from '@metaplex-foundation/umi'
import { revokePluginAuthority } from '@metaplex-foundation/mpl-core'
const assetAddress = publicKey('11111111111111111111111111111111')
await revokePluginAuthority(umi, {
asset: assetAddress,
plugin: { type: 'TransferDelegate' },
}).sendAndConfirm(umi)

常见错误

Authority mismatch

只有 transfer delegate 权限可以转移 Asset。请验证您使用正确的密钥对进行签名。

Asset is frozen

冻结的 Asset 无法转移。冻结权限必须先解冻 Asset。

Transfer delegate not found

Asset 没有 Transfer Delegate 插件,或者权限在之前的转移后已被撤销。

注意事项

  • 所有者管理:需要所有者签名才能添加
  • 转移后权限自动撤销
  • 每次转移都需要新所有者重新委托
  • 冻结的 Asset 无法被委托方转移
  • 对于持久权限使用 Permanent Transfer Delegate

快速参考

权限生命周期

事件权限状态
插件添加活跃
Asset 已转移已撤销
新所有者添加插件活跃(新委托方)

谁可以转移?

权限可以转移?
Asset 所有者是(始终)
Transfer Delegate是(一次)
Permanent Transfer Delegate是(始终)
更新权限

常见问题

为什么我的转移权限被撤销了?

Transfer Delegate 权限在任何转移后会自动撤销。这是为市场安全而设计的 - 委托方只能转移一次。

如何实现无托管挂单?

  1. 卖家添加 Transfer Delegate 并将市场作为权限方
  2. 当买家付款时,市场将 Asset 转移给买家
  3. 权限被撤销;卖家无法重复挂单

Transfer Delegate 和 Permanent Transfer Delegate 有什么区别?

Transfer Delegate 在一次转移后被撤销。Permanent Transfer Delegate 永久保持,只能在 Asset 创建时添加。

作为委托方可以转移冻结的 Asset 吗?

不可以。冻结的 Asset 会阻止所有转移,包括委托转移。对于复杂的托管场景,请将 Permanent Transfer Delegate 与 Permanent Freeze Delegate 配合使用。

所有者需要批准每次转移吗?

不需要。一旦设置了 Transfer Delegate,委托方无需所有者批准即可转移。但是,他们只能在权限撤销前进行一次转移。

相关插件

术语表

术语定义
Transfer Delegate允许一次性转移权限的所有者管理插件
所有者管理需要所有者签名才能添加的插件类型
无托管不转移到持有账户即可销售
Permanent Transfer Delegate在创建时添加的不可撤销版本