From 5084a978813611202a8f6ee723bea71653089e96 Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Sat, 27 Jan 2024 21:57:04 +0100 Subject: [PATCH 1/2] Add transfer NFT docs --- .../docs/products/nft/how-to/bulk-purchase.md | 2 +- docs/docs/products/nft/how-to/transfer.md | 28 +++++++++++++++++++ .../nft.transfer.ts => https/transfer.ts} | 4 +-- .../nft.otr.transfer.ts => otr/transfer.ts} | 8 +++--- 4 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 docs/docs/products/nft/how-to/transfer.md rename packages/sdk/examples/nft/{transfer.ts/nft.transfer.ts => https/transfer.ts} (93%) rename packages/sdk/examples/nft/{transfer.ts/nft.otr.transfer.ts => otr/transfer.ts} (73%) diff --git a/docs/docs/products/nft/how-to/bulk-purchase.md b/docs/docs/products/nft/how-to/bulk-purchase.md index a562c3eed9..a33d068faf 100644 --- a/docs/docs/products/nft/how-to/bulk-purchase.md +++ b/docs/docs/products/nft/how-to/bulk-purchase.md @@ -15,7 +15,7 @@ import TabItem from '@theme/TabItem'; To bulk purchase NFTs, you must call `bulkPurchase` on `dataset(Dataset.NFT)`. `bulkPurchase` takes an object of type [`NftPurchaseBulkTangleRequest`](../../../reference-api/interfaces/NftPurchaseBulkTangleRequest.md) as parameter. - ```tsx file=../../../../../packages/sdk/examples/nft/otr/bulk_purchase.ts#L11-L13 + ```tsx file=../../../../../packages/sdk/examples/nft/otr/bulk_purchase.ts#L12-L14 ``` diff --git a/docs/docs/products/nft/how-to/transfer.md b/docs/docs/products/nft/how-to/transfer.md new file mode 100644 index 0000000000..c0db0801d2 --- /dev/null +++ b/docs/docs/products/nft/how-to/transfer.md @@ -0,0 +1,28 @@ +--- +title: Transfer NFTs +tags: + - how-to + - transfer + - nft + - bulk +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + To transfer NFTs, you must call `transfer` on `dataset(Dataset.NFT)`. + `transfer` takes an object of type [`NftTransferTangleRequest`](../../../reference-api/interfaces/NftTransferTangleRequest.md) as parameter. + + ```tsx file=../../../../../packages/sdk/examples/nft/otr/transfer.ts#L9-L16 + ``` + + + To transfer NFTs, you must call `transfer` on `dataset(Dataset.NFT)`. + `transfer` takes an object of type [`NftTransferRequest`](../../../reference-api/interfaces/NftTransferRequest.md) as parameter. + + ```tsx file=../../../../../packages/sdk/examples/nft/https/transfer.ts#L19-L35 + ``` + + diff --git a/packages/sdk/examples/nft/transfer.ts/nft.transfer.ts b/packages/sdk/examples/nft/https/transfer.ts similarity index 93% rename from packages/sdk/examples/nft/transfer.ts/nft.transfer.ts rename to packages/sdk/examples/nft/https/transfer.ts index 8ebebfd718..d751c97fa4 100644 --- a/packages/sdk/examples/nft/transfer.ts/nft.transfer.ts +++ b/packages/sdk/examples/nft/https/transfer.ts @@ -16,7 +16,7 @@ async function main() { try { const signature = await walletSign(member.uid, address); - const respose = await https(origin) + const response = await https(origin) .project(SoonaverseApiKey[origin]) .dataset(Dataset.NFT) .transfer({ @@ -34,7 +34,7 @@ async function main() { }, }); - console.log(respose); + console.log(response); } catch (e) { console.log(e); return; diff --git a/packages/sdk/examples/nft/transfer.ts/nft.otr.transfer.ts b/packages/sdk/examples/nft/otr/transfer.ts similarity index 73% rename from packages/sdk/examples/nft/transfer.ts/nft.otr.transfer.ts rename to packages/sdk/examples/nft/otr/transfer.ts index 04844a5345..b655ab34aa 100644 --- a/packages/sdk/examples/nft/transfer.ts/nft.otr.transfer.ts +++ b/packages/sdk/examples/nft/otr/transfer.ts @@ -6,17 +6,17 @@ const origin = Build5.TEST; const otrAddress = Build5OtrAddress[origin]; async function main() { - const fireflyDeepling = otr(otrAddress) + const otrRequest = otr(otrAddress) .dataset(Dataset.NFT) .transfer({ transfers: [ { nft: 'build5nftid', target: 'build5memberid' }, { nft: 'build5nftid', target: 'tangleaddress' }, ], - }) - .getFireflyDeepLink(); + }); + const fireflyDeeplink = otrRequest.getFireflyDeepLink(); - console.log('Sent amount with ', fireflyDeepling); + console.log('Sent amount with ', fireflyDeeplink); } main().then(() => process.exit()); From e165fda9b905a8f8170373d6e66d64bd2841cf83 Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Sat, 27 Jan 2024 22:04:36 +0100 Subject: [PATCH 2/2] Add deeplink admonition --- docs/docs/_admonitions/_deep_link.md | 2 +- docs/docs/products/nft/how-to/bulk-purchase.md | 3 +++ docs/docs/products/nft/how-to/transfer.md | 3 +++ docs/sidebars.js | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/docs/_admonitions/_deep_link.md b/docs/docs/_admonitions/_deep_link.md index e25e7dd90a..3f07e62a23 100644 --- a/docs/docs/_admonitions/_deep_link.md +++ b/docs/docs/_admonitions/_deep_link.md @@ -1,4 +1,4 @@ -:::warning OTR Request Deep Link +:::info OTR Request Deep Link The SDK provides the helper functions `getFireflyDeepLink()` and `getBloomDeepLink()` to generate deep links for OTR requests. diff --git a/docs/docs/products/nft/how-to/bulk-purchase.md b/docs/docs/products/nft/how-to/bulk-purchase.md index a33d068faf..73ad5dab2c 100644 --- a/docs/docs/products/nft/how-to/bulk-purchase.md +++ b/docs/docs/products/nft/how-to/bulk-purchase.md @@ -9,6 +9,7 @@ tags: import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; +import DeepLink from '../../../_admonitions/_deep_link.md' @@ -17,6 +18,8 @@ import TabItem from '@theme/TabItem'; ```tsx file=../../../../../packages/sdk/examples/nft/otr/bulk_purchase.ts#L12-L14 ``` + + To bulk purchase NFTs, you must call `bulkPurchase` on `dataset(Dataset.NFT)`. diff --git a/docs/docs/products/nft/how-to/transfer.md b/docs/docs/products/nft/how-to/transfer.md index c0db0801d2..01e1f23725 100644 --- a/docs/docs/products/nft/how-to/transfer.md +++ b/docs/docs/products/nft/how-to/transfer.md @@ -9,6 +9,7 @@ tags: import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; +import DeepLink from '../../../_admonitions/_deep_link.md' @@ -17,6 +18,8 @@ import TabItem from '@theme/TabItem'; ```tsx file=../../../../../packages/sdk/examples/nft/otr/transfer.ts#L9-L16 ``` + + To transfer NFTs, you must call `transfer` on `dataset(Dataset.NFT)`. diff --git a/docs/sidebars.js b/docs/sidebars.js index c58777adc6..b791566a79 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -75,6 +75,7 @@ const sidebars = { 'How To': [ 'products/nft/how-to/create-collection', 'products/nft/how-to/bulk-purchase', + 'products/nft/how-to/transfer', ], } ],