From b8558543cba841bbca610d8270d4e283ac612e01 Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Sat, 17 Feb 2024 20:28:47 +0100 Subject: [PATCH 1/2] Split how-to --- docs/docs/how-to/nft/purchase.md | 6 ++++-- docs/docs/how-to/track-otrs.md | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 docs/docs/how-to/track-otrs.md diff --git a/docs/docs/how-to/nft/purchase.md b/docs/docs/how-to/nft/purchase.md index 35c3eda2dd..7c850e475a 100644 --- a/docs/docs/how-to/nft/purchase.md +++ b/docs/docs/how-to/nft/purchase.md @@ -13,13 +13,15 @@ import DeepLink from '../../_admonitions/_deep_link.md' - To purchase NFT, you must call [`purchase`](../../reference-api/classes/NftOtrDataset.md#purchase) on `dataset(Dataset.NFT)`. + To purchase an NFT, you must call [`purchase`](../../reference-api/classes/NftOtrDataset.md#purchase) on `dataset(Dataset.NFT)`. [`purchase`](../../reference-api/classes/NftOtrDataset.md#purchase) takes an object of type [`NftPurchaseTangleRequest`](../../reference-api/interfaces/NftPurchaseTangleRequest.md) as parameter. - ```tsx file=../../../../packages/sdk/examples/nft/otr/purchase.ts#L4-L27 + ```tsx file=../../../../packages/sdk/examples/nft/otr/purchase.ts#L12-L14 ``` + + If you want to track the purchase you can use the [track](../track-otrs.md) how-to. TODO diff --git a/docs/docs/how-to/track-otrs.md b/docs/docs/how-to/track-otrs.md new file mode 100644 index 0000000000..a452e14a5e --- /dev/null +++ b/docs/docs/how-to/track-otrs.md @@ -0,0 +1,20 @@ +--- +title: Track OTRs +tags: + - how-to + - track +--- + +Sometimes you want to track your OTR for example to check if a purchase was successful. +You can do that by using the tag of the request. + +To do that call [`getTag`](../reference-api/classes/DatasetClassOtr.OtrRequest.md#gettag) on `OtrRequest`. +[`getTag`](../reference-api/classes/DatasetClassOtr.OtrRequest.md#gettag) takes a firefly deeplink as parameter. + +```tsx file=../../../packages/sdk/examples/nft/otr/purchase.ts#L24 +``` + +You can use the tag to get an observable object by calling [`trackByTag`](../reference-api/classes/ProjectWrapper#trackbytag) on `ProjectWrapper`. + +```tsx file=../../../packages/sdk/examples/nft/otr/purchase.ts#L25-L27 +``` From 0b3b1b06d698b9bd3702736655f82a12ae46799f Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Sat, 17 Feb 2024 20:38:01 +0100 Subject: [PATCH 2/2] Ups, forgot this --- docs/sidebars.js | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/sidebars.js b/docs/sidebars.js index c96aec5e6d..ba385a6d23 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -106,6 +106,7 @@ const sidebars = { { 'Token Distribution API': ['how-to/token-distribution/overview'], }, + 'how-to/track-otrs', ], }, {