Skip to content

Commit

Permalink
ft primitives structure
Browse files Browse the repository at this point in the history
  • Loading branch information
garikbesson committed Oct 27, 2023
1 parent 94a3a14 commit 5aa9164
Show file tree
Hide file tree
Showing 7 changed files with 915 additions and 10 deletions.
10 changes: 10 additions & 0 deletions docs/7.primitives/ft/additional-resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
id: additional-resources
title: Additional Resources
hide_table_of_contents: false
---

import {FeatureList, Column, Feature} from "@site/components/featurelist"
import ContactUs from '@site/components/ContactUs.mdx';

1.
75 changes: 75 additions & 0 deletions docs/7.primitives/ft/interacting/bos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
id: bos
title: NEAR Component
hide_table_of_contents: false
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

This section shows how to interact with FTs directly from a [NEAR Component](../../../bos/components.md)

---

## Check token balance

<Tabs>

<TabItem value="RPC" label="RPC">

```js
```

</TabItem>

<TabItem value="Ref Finance API" label="Ref Finance API">

```js
const tokenContract = "token.v2.ref-finance.near";
const tokenPrice = fetch(
"https://indexer.ref.finance/get-token-price?token_id=token.v2.ref-finance.near"
).body;

console.log("refPrice: ", JSON.parse(tokenPrice));
```

<details>
<summary>Example response</summary>
<p>

```json
{
"token_contract_id": "token.v2.ref-finance.near",
"price": "0.05732698"
}
```

</p>
</details>

</TabItem>

<TabItem value="Smart Contract" label="Smart Contract">

```js

```

</TabItem>

</Tabs>

## Send tokens
## Get prices (?)

Ref Finance API

List of prices
https://indexer.ref.finance/list-token-price

Get token price
https://indexer.ref.finance/get-token-price?token_id=token.v2.ref-finance.near

## Swap tokens (?)
## Attaching FTs to a Call (? already exist [here](https://docs.near.org/develop/relevant-contracts/ft))
## Minting FTs (? already exist [here](https://docs.near.org/tutorials/fts/simple-fts))
14 changes: 14 additions & 0 deletions docs/7.primitives/ft/interacting/near-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
id: near-cli
title: NEAR CLI
hide_table_of_contents: false
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

This section shows how to interact with FTs from your shell using [`near-cli`](../../../4.tools/cli.md).

---

##
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ title: Smart Contract
hide_table_of_contents: false
---

How to check account balance on smart-contract (example).
This section will explain how a smart contract can ...
Loading

0 comments on commit 5aa9164

Please sign in to comment.