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

Refactoring nft primitives #1682

Closed
wants to merge 7 commits into from
Closed
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
59 changes: 59 additions & 0 deletions docs/7.primitives/nft/interacting/bos/buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs groupId="nft-contract-tabs" className="file-tabs">
<TabItem value="Paras" label="Paras" default>

```js
const tokenData = Near.call(
"x.paras.near",
"nft_buy",
{
token_series_id: "299102",
receiver_id: "bob.near",
},
undefined,
205740000000000000000000 // NFT price + storage cost
);
```

**Example response:**

```json
"299102:1"
```


</TabItem>

<TabItem value="Mintbase" label="Mintbase">

```js
const tokenData = Near.call(
"simple.market.mintbase1.near",
"buy",
{
nft_contract_id: "rubennnnnnnn.mintbase1.near",
token_id: "38",
referrer_id: null,
},
undefined,
1000000000000000000000 // NFT price + storage cost (optional, depends on a contract)
);
```

**Example response:**

```json
{
"payout": {
"rub3n.near": "889200000000000000000",
"rubenm4rcus.near": "85800000000000000000"
}
}
```


</TabItem>

</Tabs>
66 changes: 66 additions & 0 deletions docs/7.primitives/nft/interacting/bos/list-for-sale.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs groupId="nft-contract-tabs" className="file-tabs">
<TabItem value="Paras" label="Paras">

```js
Near.call(
"marketplace.paras.near",
"storage_deposit",
{
receiver_id: "bob.near"
},
undefined,
9390000000000000000
);

Near.call(
"nft.primitives.near",
"nft_approve",
{
token_id: "1e95238d266e5497d735eb30",
account_id: "marketplace.paras.near",
msg: {
price: "200000000000000000000000",
market_type: "sale",
ft_token_id: "near"
}
}
);
```

The method `nft_approve` will call `nft_on_approve` in `marketplace.paras.near`.

</TabItem>

<TabItem value="Mintbase" label="Mintbase">

```js
Near.call(
"simple.market.mintbase1.near",
"deposit_storage",
{
autotransfer: true
},
undefined,
9390000000000000000
);

Near.call(
"nft.primitives.near",
"nft_approve",
{
token_id: "3c46b76cbd48e65f2fc88473",
account_id: "simple.market.mintbase1.near",
msg: {
price: "200000000000000000000000"
}
}
);
```

The method `nft_approve` will call `nft_on_approve` in `simple.market.mintbase1.near`.

</TabItem>
</Tabs>
70 changes: 70 additions & 0 deletions docs/7.primitives/nft/interacting/bos/mint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs groupId="nft-contract-tabs" className="file-tabs">
<TabItem value="NFT Primitive" label="NFT Primitive" default>

```js
const tokenData = Near.call(
"nft.primitives.near",
"nft_mint",
{
token_id: "1",
receiver_id: "bob.near",
token_metadata: {
title: "NFT Primitive Token",
description: "Awesome NFT Primitive Token",
media: "string", // URL to associated media, preferably to decentralized, content-addressed storage
}
},
undefined,
10000000000000000000000, // Depends on your NFT metadata
);
```

</TabItem>

<TabItem value="Paras" label="Paras">

```js
const tokenData = Near.call(
"x.paras.near",
"nft_mint",
{
token_series_id: "490641",
receiver_id: "bob.near",
},
undefined,
10000000000000000000000 // Depends on your NFT metadata
);
```

:::note
In order to use `nft_mint` method of the `x.paras.near` contract you have to be a creator of a particular token series.
:::

</TabItem>

<TabItem value="Mintbase" label="Mintbase">

```js
const tokenData = Near.call(
"thomasettorreiv.mintbase1.near",
"nft_batch_mint",
{
num_to_mint: 1,
owner_id: "bob.near",
metadata: {},
},
undefined,
10000000000000000000000
);
```

:::note
In order to use `nft_batch_mint` method of Mintbase store contract your account have to be a in the contract minters list.
:::

</TabItem>

</Tabs>
Loading
Loading