Skip to content
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
30 changes: 15 additions & 15 deletions docs/primitives/dao.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ You can create a DAO by interacting with the `sputnik-dao` contract:
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const DAO_FACTORY_CONTRACT_ADDRESS = 'sputnik-dao.near';

const { callMethod } = useWalletSelector();
const { callFunction } = useNearWallet();

await callMethod({
await callFunction({
contractId: DAO_FACTORY_CONTRACT_ADDRESS,
method: 'create',
args: {
Expand Down Expand Up @@ -197,12 +197,12 @@ Query the list of DAOs existing in Sputnik Dao.
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const DAO_FACTORY_CONTRACT_ADDRESS = 'sputnik-dao.near';
const { viewMethod } = useWalletSelector();
const { viewFunction } = useNearWallet();

await viewMethod({
await viewFunction({
method: 'get_dao_list',
args: {},
contractId: DAO_FACTORY_CONTRACT_ADDRESS,
Expand Down Expand Up @@ -257,12 +257,12 @@ These snippets will enable you to query the proposals existing in a particular D
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const DAO_CONTRACT_ADDRESS = 'nearweek-news-contribution.sputnik-dao.near';
const { viewMethod } = useWalletSelector();
const { viewFunction } = useNearWallet();

await viewMethod({
await viewFunction({
method: 'get_proposals',
args: { from_index: 9262, limit: 2 },
contractId: DAO_CONTRACT_ADDRESS,
Expand Down Expand Up @@ -388,13 +388,13 @@ Create a proposal so other users can vote in favor or against it.
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const DAO_CONTRACT_ADDRESS = 'primitives.sputnik-dao.near';

const { callMethod } = useWalletSelector();
const { callFunction } = useNearWallet();

await callMethod({
await callFunction({
contractId: DAO_CONTRACT_ADDRESS,
method: 'add_proposal',
args: {
Expand Down Expand Up @@ -716,13 +716,13 @@ These snippet will enable your users to cast a vote for proposal of a particular
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const DAO_CONTRACT_ADDRESS = 'primitives.sputnik-dao.near';

const { callMethod } = useWalletSelector();
const { callFunction } = useNearWallet();

await callMethod({
await callFunction({
contractId: DAO_CONTRACT_ADDRESS,
method: 'act_proposal',
args: { id: 0, action: 'VoteApprove' },
Expand Down
18 changes: 9 additions & 9 deletions docs/primitives/dex.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ Query your deposit balances by calling the `get_deposits` method:
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const AMM_CONTRACT_ADDRESS = 'v2.ref-finance.near';

const { viewMethod } = useWalletSelector();
const { viewFunction } = useNearWallet();

await viewMethod({
await viewFunction({
method: 'get_deposits',
args: {
account_id: 'bob.near',
Expand Down Expand Up @@ -290,13 +290,13 @@ DEXs work by having multiple pools of token pairs (e.g. NEAR-USDC) that users ca
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const AMM_CONTRACT_ADDRESS = 'v2.ref-finance.near';

const { viewMethod } = useWalletSelector();
const { viewFunction } = useNearWallet();

await viewMethod({
await viewFunction({
method: 'get_pools',
args: {
from_index: 0,
Expand Down Expand Up @@ -473,13 +473,13 @@ In order to swap a token for another, you need to [have funds](#deposit-funds),
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const AMM_CONTRACT_ADDRESS = 'v2.ref-finance.near';

const { callMethod } = useWalletSelector();
const { callFunction } = useNearWallet();

await callMethod({
await callFunction({
contractId: AMM_CONTRACT_ADDRESS,
method: 'swap',
args: {
Expand Down
42 changes: 21 additions & 21 deletions docs/primitives/ft/ft.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ Here is how to directly interact with the factory contract through your applicat
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const TOKEN_FACTORY_ADDRESS = 'token.primitives.near';

const { callMethod } = useWalletSelector();
const { callFunction } = useNearWallet();

const args = {
args: {
Expand All @@ -59,7 +59,7 @@ Here is how to directly interact with the factory contract through your applicat
account_id: 'bob.near',
};

await callMethod({
await callFunction({
contractId: TOKEN_FACTORY_ADDRESS,
method: 'create_token',
args,
Expand Down Expand Up @@ -172,13 +172,13 @@ You can query the FT's metadata by calling the `ft_metadata`.
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const TOKEN_CONTRACT_ADDRESS = 'token.v2.ref-finance.near';

const { viewMethod } = useWalletSelector();
const { viewFunction } = useNearWallet();

await viewMethod({
await viewFunction({
method: 'ft_metadata',
args: {},
contractId: TOKEN_CONTRACT_ADDRESS,
Expand Down Expand Up @@ -249,13 +249,13 @@ To know how many coins a user has you will need to query the method `ft_balance_
:::

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const TOKEN_CONTRACT_ADDRESS = 'token.v2.ref-finance.near';

const { viewMethod } = useWalletSelector();
const { viewFunction } = useNearWallet();

await viewMethod({
await viewFunction({
method: 'ft_balance_of',
args: {
account_id: 'bob.near',
Expand Down Expand Up @@ -310,13 +310,13 @@ By calling this `storage_deposit` the user can register themselves or **register
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const TOKEN_CONTRACT_ADDRESS = 'token.v2.ref-finance.near';

const { callMethod } = useWalletSelector();
const { callFunction } = useNearWallet();

await callMethod({
await callFunction({
contractId: TOKEN_CONTRACT_ADDRESS,
method: 'storage_deposit',
args: {
Expand Down Expand Up @@ -357,13 +357,13 @@ To send FT to another account you will use the `ft_transfer` method, indicating
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const TOKEN_CONTRACT_ADDRESS = 'token.v2.ref-finance.near';

const { callMethod } = useWalletSelector();
const { callFunction } = useNearWallet();

await callMethod({
await callFunction({
contractId: TOKEN_CONTRACT_ADDRESS,
method: 'ft_transfer',
args: {
Expand Down Expand Up @@ -434,13 +434,13 @@ Let's assume that you need to deposit FTs on [Ref Finance](https://rhea.finance/
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const TOKEN_CONTRACT_ADDRESS = 'token.v2.ref-finance.near';

const { callMethod } = useWalletSelector();
const { callFunction } = useNearWallet();

await callMethod({
await callFunction({
contractId: TOKEN_CONTRACT_ADDRESS,
method: 'ft_transfer_call',
args: {
Expand Down Expand Up @@ -549,11 +549,11 @@ While the FT standard does not define a `burn` method, you can simply transfer t
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const { callMethod } = useWalletSelector();
const { callFunction } = useNearWallet();

await callMethod({
await callFunction({
contractId: 'token.v2.ref-finance.near',
method: 'ft_transfer',
args: {
Expand Down
36 changes: 18 additions & 18 deletions docs/primitives/linkdrop/linkdrop.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ The contract will create a drop and **return the numerical ID** that identifies
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const KEYPOM_CONTRACT_ADDRESS = "v2.keypom.near";
const DROP_AMOUNT = "10000000000000000000000"; // 0.1 NEAR

const { callMethod } = useWalletSelector();
const { callFunction } = useNearWallet();

await callMethod({
await callFunction({
contractId: KEYPOM_CONTRACT_ADDRESS,
method: "create_drop",
args: {
Expand Down Expand Up @@ -129,15 +129,15 @@ The contract will then create a drop and **return the numerical ID** that identi
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const KEYPOM_CONTRACT_ADDRESS = "v2.keypom.near";
const NFT_CONTRACT_ADDRESS = "nft.primitives.near";
const DROP_AMOUNT = "10000000000000000000000";

const { callMethod, accountId } = useWalletSelector();
const { callFunction, accountId } = useNearWallet();

await callMethod({
await callFunction({
contractId: KEYPOM_CONTRACT_ADDRESS,
method: "create_drop",
args: {
Expand Down Expand Up @@ -179,15 +179,15 @@ Having the Drop ID, you now need to transfer the NFT to the linkdrop contract, s
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const KEYPOM_CONTRACT_ADDRESS = "v2.keypom.near";
const NFT_CONTRACT_ADDRESS = "nft.primitives.near";
const NFT_TOKEN_ID = "1";

const { callMethod } = useWalletSelector();
const { callFunction } = useNearWallet();

await callMethod({
await callFunction({
contractId: NFT_CONTRACT_ADDRESS,
method: "nft_transfer_call",
args: {
Expand Down Expand Up @@ -242,15 +242,15 @@ The contract will then create a drop and **return the numerical ID** that identi
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const KEYPOM_CONTRACT_ADDRESS = "v2.keypom.near";
const FT_CONTRACT_ADDRESS = "ft.primitives.near";
const DROP_AMOUNT = "10000000000000000000000";

const { callMethod, accountId } = useWalletSelector();
const { callFunction, accountId } = useNearWallet();

await callMethod({
await callFunction({
contractId: KEYPOM_CONTRACT_ADDRESS,
method: "create_drop",
args: {
Expand Down Expand Up @@ -298,14 +298,14 @@ To transfer FTs to an account, you need to first [register](./ft#registering-a-u
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const KEYPOM_CONTRACT_ADDRESS = "v2.keypom.near";
const FT_CONTRACT_ADDRESS = "ft.primitives.near";

const { callMethod } = useWalletSelector();
const { callFunction } = useNearWallet();

await callMethod({
await callFunction({
contractId: FT_CONTRACT_ADDRESS,
method: "ft_transfer",
args: {
Expand Down Expand Up @@ -352,16 +352,16 @@ Function call drops can be thought as the abstract version of other drops: you c
<TabItem value="🌐 WebApp" label="🌐 WebApp">

```js
import { useWalletSelector } from "@near-wallet-selector/react-hook";
import { useNearWallet } from "near-connect-hooks";

const KEYPOM_CONTRACT_ADDRESS = "v2.keypom.near";
const NFT_CONTRACT_ADDRESS = "nft.primitives.near";
const NFT_TOKEN_ID = "1";
const DROP_AMOUNT = "10000000000000000000000";

const { callMethod } = useWalletSelector();
const { callFunction } = useNearWallet();

await callMethod({
await callFunction({
contractId: KEYPOM_CONTRACT_ADDRESS,
method: "create_drop",
args: {
Expand Down
Loading