Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add transfer NFT docs #2782

Merged
merged 2 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/_admonitions/_deep_link.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
5 changes: 4 additions & 1 deletion docs/docs/products/nft/how-to/bulk-purchase.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ tags:

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import DeepLink from '../../../_admonitions/_deep_link.md'

<Tabs>
<TabItem value="otr" label="OTR">
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
```

<DeepLink/>
</TabItem>
<TabItem value="https" label="HTTPS">
To bulk purchase NFTs, you must call `bulkPurchase` on `dataset(Dataset.NFT)`.
Expand Down
31 changes: 31 additions & 0 deletions docs/docs/products/nft/how-to/transfer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Transfer NFTs
tags:
- how-to
- transfer
- nft
- bulk
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import DeepLink from '../../../_admonitions/_deep_link.md'

<Tabs>
<TabItem value="otr" label="OTR">
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
```

<DeepLink/>
</TabItem>
<TabItem value="https" label="HTTPS">
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
```
</TabItem>
</Tabs>
1 change: 1 addition & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -34,7 +34,7 @@ async function main() {
},
});

console.log(respose);
console.log(response);
} catch (e) {
console.log(e);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Loading