瀏覽代碼

added missing execute

tonyboylehub 10 月之前
父節點
當前提交
cf32a009cb
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      src/pages/core/execute-asset-signing.md

+ 10 - 1
src/pages/core/execute-asset-signing.md

@@ -218,7 +218,7 @@ const destinationAssetSignerPda = findAssetSignerPda(umi, {
   asset: destinationAssetId,
 })
 
-const res = await transfer(umi, {
+const transferAssetTx = transfer(umi, {
   // Asset object via `fetchAsset()`.
   asset,
   // Optional - Collection object via `fetchCollection()`
@@ -227,5 +227,14 @@ const res = await transfer(umi, {
   newOwner: destinationAssetSignerPda,
 }).sendAndConfirm(umi)
 
+const res = await execute(umi, {
+  // Execute transaction/instruction(s) with this asset
+  asset,
+  // If Asset is part of collection pass in collection object via `fetchCollection()`
+  collection,
+  // The transactionBuilder/instruction[] to execute
+  instructions: transferAssetTx,
+}).sendAndConfirm(umi)
+
 console.log({ res })
 ```