Skip to content

Commit

Permalink
Implementing NFT Primitives on Docs (#1528)
Browse files Browse the repository at this point in the history
* basis for primitives

* the structure of nft primitive page

* basic navigation structure example

* editing nft primitives

* added the list of additional nft sources

* basic FT structure

* a new structure of nft primitive section

* Added how to buy NFT section in NFT primitives

* Changed the way how to use near-api-js (NFT primitives)

* Added code example of near-wallet.js file (NFT primitives)

* how to interact with nft from smart contract section

* editing structure of the nft primitive section

* general review

* editing NFT primitive section

* small fixes

* minor editorial changes (nft primitives)

* ft primitives structure

* minor fixes

---------

Co-authored-by: garikbesson <[email protected]>
  • Loading branch information
gagdiez and garikbesson authored Oct 31, 2023
1 parent 8f92053 commit 657f18d
Show file tree
Hide file tree
Showing 18 changed files with 3,396 additions and 1 deletion.
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.
11 changes: 11 additions & 0 deletions docs/7.primitives/ft/bos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
id: bos
title: BOS
hide_table_of_contents: false
---

There are some components related with FT functionality on BOS that might be useful.

1. [FungibleTokenBalance](https://near.org/near/widget/ComponentDetailsPage?src=ahnff.near/widget/FungibleTokenBalance) - shows balances of a current user.
2. [Claim Fungible Tokens from Lockup](https://near.org/near/widget/ComponentDetailsPage?src=whtt.near/widget/Draft-0) - the example how to claim locked tokens from the `lockup.burrow.near` contract.
3. [BSC Dex Collection](https://near.org/near/widget/ComponentDetailsPage?src=bluebiu.near/widget/Bsc.Swap.Dex) - the example of how to build simple swap page for a DEX.
373 changes: 373 additions & 0 deletions docs/7.primitives/ft/dex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,373 @@
---
id: dex
title: DEX
hide_table_of_contents: false
---

## List of token prices from Ref Finance

```bash
curl -k -L -s --compressed \
https://indexer.ref.finance/list-token-price
```

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

```json
{
"wrap.near": {
"price": "1.011",
"decimal": 24,
"symbol": "near"
},
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near": {
"price": "1.0",
"decimal": 6,
"symbol": "nUSDC"
},
"dac17f958d2ee523a2206206994597c13d831ec7.factory.bridge.near": {
"price": "1.001",
"decimal": 6,
"symbol": "nUSDT"
},
"6b175474e89094c44da98b954eedeac495271d0f.factory.bridge.near": {
"price": "0.999695",
"decimal": 18,
"symbol": "nDAI"
},
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.factory.bridge.near": {
"price": "1572.51",
"decimal": 18,
"symbol": "nWETH"
},
"111111111117dc0aa78b770fa6a738034120c302.factory.bridge.near": {
"price": "0.250491",
"decimal": 18,
"symbol": "n1INCH"
},
"c944e90c64b2c07662a292be6244bdf05cda44a7.factory.bridge.near": {
"price": "0.080141",
"decimal": 18,
"symbol": "nGRT"
},
"token.skyward.near": {
"price": "0.12269762",
"decimal": 18,
"symbol": "SKYWARD"
},
"token.v2.ref-finance.near": {
"price": "0.04921385",
"decimal": 18,
"symbol": "REF"
},
"berryclub.ek.near": {
"price": "0.00026663",
"decimal": 18,
"symbol": "BANANA"
},
"6f259637dcd74c767781e37bc6133cd6a68aa161.factory.bridge.near": {
"price": "2.35",
"decimal": 18,
"symbol": "nHT"
},
"de30da39c46104798bb5aa3fe8b9e0e1f348163f.factory.bridge.near": {
"price": "0.841444",
"decimal": 18,
"symbol": "nGTC"
},
"1f9840a85d5af5bf1d1762f925bdaddc4201f984.factory.bridge.near": {
"price": "3.93",
"decimal": 18,
"symbol": "nUNI"
},
"2260fac5e5542a773aa44fbcfedf7c193bc2c599.factory.bridge.near": {
"price": "28349",
"decimal": 8,
"symbol": "nWBTC"
},
"514910771af9ca656af840dff83e8264ecf986ca.factory.bridge.near": {
"price": "7.37",
"decimal": 18,
"symbol": "nLINK"
},
"token.paras.near": {
"price": "0.00601845",
"decimal": 18,
"symbol": "PARAS"
},
"meta-pool.near": {
"price": "1.24785231",
"decimal": 24,
"symbol": "STNEAR"
},
"marmaj.tkn.near": {
"price": "1.14664312",
"decimal": 18,
"symbol": "marmaj"
},
"52a047ee205701895ee06a375492490ec9c597ce.factory.bridge.near": {
"price": "0.00898478",
"decimal": 18,
"symbol": "PULSE"
},
"aurora": {
"price": "1573.81",
"decimal": 18,
"symbol": "ETH"
},
"aaaaaa20d9e0e2461697782ef11675f668207961.factory.bridge.near": {
"price": "0.04886864",
"decimal": 18,
"symbol": "AURORA"
},
"dbio.near": {
"price": "0.00044179",
"decimal": 18,
"symbol": "DBIO"
},
"f5cfbc74057c610c8ef151a439252680ac68c6dc.factory.bridge.near": {
"price": "0.09152023",
"decimal": 18,
"symbol": "OCT"
},
"d9c2d319cd7e6177336b0a9c93c21cb48d84fb54.factory.bridge.near": {
"price": "7.43262412",
"decimal": 18,
"symbol": "HAPI"
},
"meta-token.near": {
"price": "0.00216632",
"decimal": 24,
"symbol": "META"
},
"v3.oin_finance.near": {
"price": "0.02673488",
"decimal": 8,
"symbol": "nUSDO"
},
"3ea8ea4237344c9931214796d9417af1a1180770.factory.bridge.near": {
"price": "0.01986850",
"decimal": 18,
"symbol": "FLX"
},
"pixeltoken.near": {
"price": "0.00061222",
"decimal": 6,
"symbol": "PXT"
},
"myriadcore.near": {
"price": "0.00008448",
"decimal": 18,
"symbol": "MYRIA"
},
"celo.token.a11bd.near": {
"price": "0.413032",
"decimal": 24,
"symbol": "CELO"
},
"cusd.token.a11bd.near": {
"price": "0.996913",
"decimal": 24,
"symbol": "cUSD"
},
"abr.a11bd.near": {
"price": "0.082354",
"decimal": 24,
"symbol": "ABR"
},
"sol.token.a11bd.near": {
"price": "23.72",
"decimal": 24,
"symbol": "SOL"
},
"utopia.secretskelliessociety.near": {
"price": "0.00009794",
"decimal": 8,
"symbol": "UTO"
},
"4691937a7508860f876c9c0a2a617e7d9e945d4b.factory.bridge.near": {
"price": "0.171255",
"decimal": 18,
"symbol": "WOO"
},
"linear-protocol.near": {
"price": "1.17190405",
"decimal": 24,
"symbol": "LINEAR"
},
"0316eb71485b0ab14103307bf65a021042c6d380.factory.bridge.near": {
"price": "29758",
"decimal": 18,
"symbol": "HBTC"
},
"token.cheddar.near": {
"price": "0.00080216",
"decimal": 24,
"symbol": "Cheddar"
},
"token.pembrock.near": {
"price": "0.00599021",
"decimal": 18,
"symbol": "PEM"
},
"token.burrow.near": {
"price": "0.00017675",
"decimal": 18,
"symbol": "BRRR"
},
"atocha-token.near": {
"price": "0.00015148",
"decimal": 18,
"symbol": "ATO"
},
"nearx.stader-labs.near": {
"price": "1.03190420",
"decimal": 24,
"symbol": "NearX"
},
"30d20208d987713f46dfd34ef128bb16c404d10f.factory.bridge.near": {
"price": "0.573246",
"decimal": 18,
"symbol": "SD"
},
"xtoken.ref-finance.near": {
"price": "0.06854020",
"decimal": 18,
"symbol": "xREF"
},
"token.sweat": {
"price": "0.00913548",
"decimal": 18,
"symbol": "SWEAT"
},
"v2-nearx.stader-labs.near": {
"price": "1.16228622",
"decimal": 24,
"symbol": "NearX"
},
"token.stlb.near": {
"price": "0.00186631",
"decimal": 5,
"symbol": "SEAT"
},
"ftv2.nekotoken.near": {
"price": "0.00001100",
"decimal": 24,
"symbol": "NEKO"
},
"e99de844ef3ef72806cf006224ef3b813e82662f.factory.bridge.near": {
"price": "0.00923146",
"decimal": 18,
"symbol": "UMINT"
},
"phoenix-bonds.near": {
"price": "1.77543121",
"decimal": 24,
"symbol": "pNEAR"
},
"a4ef4b0b23c1fc81d3f9ecf93510e64f58a4a016.factory.bridge.near": {
"price": "0.08832548",
"decimal": 18,
"symbol": "1MIL"
},
"farm.berryclub.ek.near": {
"price": "0.00028640",
"decimal": 18,
"symbol": "CUCUMBER"
},
"v1.dacha-finance.near": {
"price": "0.00000162",
"decimal": 18,
"symbol": "POTATO"
},
"9aeb50f542050172359a0e1a25a9933bc8c01259.factory.bridge.near": {
"price": "0.00212776",
"decimal": 8,
"symbol": "OIN"
},
"ust.token.a11bd.near": {
"price": "0.09496213",
"decimal": 24,
"symbol": "UST"
},
"luna.token.a11bd.near": {
"price": "0.406404",
"decimal": 24,
"symbol": "LUNA"
},
"deip-token.near": {
"price": "0.00000388",
"decimal": 18,
"symbol": "DEIP"
},
"059a1f1dea1020297588c316ffc30a58a1a0d4a2.factory.bridge.near": {
"price": "0.00012627",
"decimal": 18,
"symbol": "BSTN"
},
"fusotao-token.near": {
"price": "0.00464067",
"decimal": 18,
"symbol": "TAO"
},
"discovol-token.near": {
"price": "0.00014885",
"decimal": 14,
"symbol": "DISC"
},
"apys.token.a11bd.near": {
"price": "0.00660365",
"decimal": 24,
"symbol": "APYS"
},
"usdt.tether-token.near": {
"price": "1.001",
"decimal": 6,
"symbol": "USDt"
},
"usn": {
"price": "0.97411628",
"decimal": 18,
"symbol": "USN"
},
"17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1": {
"price": "1.0",
"decimal": 6,
"symbol": "USDC"
}
}
```

</p>
</details>

## Ref SDK

[Ref Finance](https://www.ref.finance/) provides a SDK with the main functions: swapping tokens, getting tokens metadata, fetching pools details, getting swap estimates.

:::info
[Detailed Ref SDK documentation](https://guide.ref.finance/developers-1/ref-sdk)
:::

---

## Ref Swap Widget
[Ref Finance](https://www.ref.finance/) provides the Ref Swap Widget in order to allow any service to access Ref's liquidity. For example, you can allow user swap other tokens (including stablecoins) for your project's token just using the Ref Swap Widget.

:::info
[Detailed Ref Swap Widget documentation](https://github.com/ref-finance/ref-sdk#ref-swap-widget)
:::

---

## Bridge Tokens

If a project already has a token on Ethereum, there is an opportunity to bridge such token to NEAR using [Rainbow Bridge](https://rainbowbridge.app/).

:::note
Before the bridging a token it needs to deploy that token on NEAR. You can do it by [Rainbow Bridge a tool](https://rainbowbridge.app/deploy).
:::

---
Loading

0 comments on commit 657f18d

Please sign in to comment.