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
6 changes: 5 additions & 1 deletion .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: build-check

on: [push, pull_request]
on:
pull_request:
push:
branches:
- main

jobs:
build-check:
Expand Down
45 changes: 8 additions & 37 deletions docs/integrations/accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ sidebar_label: Accounts
description: "Learn about NEAR account management for exchanges and integrations, including account creation, key management, and balance tracking."
---

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

This document provides relevant information about NEAR accounts for exchanges looking forward to integrate the NEAR token

Please see the [documentation for accounts](/protocol/account-model) for basic information.
Expand Down Expand Up @@ -37,43 +34,17 @@ Below we include examples from the contracts that are likely to be used to perfo

A contract `evgeny.lockup.near` is deployed and we can check its owner by

<Tabs groupId="cli-tabs">
<TabItem value="short" label="Short">

```bash
near view evgeny.lockup.near get_owner_account_id
# View call: evgeny.lockup.near.get_owner_account_id()
# 'evgeny.near'
```
</TabItem>

<TabItem value="full" label="Full">

```bash
near contract call-function as-read-only evgeny.lockup.near get_owner_account_id json-args '{}' network-config testnet now
# View call: evgeny.lockup.near.get_owner_account_id()
# 'evgeny.near'
```
</TabItem>
</Tabs>
```bash
near contract call-function as-read-only evgeny.lockup.near get_owner_account_id json-args '{}' network-config testnet now
# View call: evgeny.lockup.near.get_owner_account_id()
# 'evgeny.near'
```

Now we want to transfer some unlocked tokens (1 NEAR) with the following call

<Tabs groupId="cli-tabs">
<TabItem value="short" label="Short">

```bash
near call evgeny.lockup.near transfer '{"amount":"1000000000000000000000000", "receiver_id": "evgeny.near"}' --accountId=evgeny.near
```
</TabItem>

<TabItem value="full" label="Full">

```bash
near contract call-function as-transaction evgeny.lockup.near transfer json-args '{"amount":"1000000000000000000000000", "receiver_id": "evgeny.near"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' sign-as evgeny.near network-config testnet sign-with-keychain send
```
</TabItem>
</Tabs>
```bash
near contract call-function as-transaction evgeny.lockup.near transfer json-args '{"amount":"1000000000000000000000000", "receiver_id": "evgeny.near"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' sign-as evgeny.near network-config testnet sign-with-keychain send
```

**Note**: the response below can be obtained by hitting the RPC with the transaction hash and NEAR account like this:

Expand Down
22 changes: 3 additions & 19 deletions docs/integrations/balance.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ sidebar_label: Balance Changes
description: "Learn how to query and track account balances in NEAR protocol, including native NEAR tokens, fungible tokens, and balance management for integrations."
---

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

This document provides an overview of how to track balance changes on NEAR accounts, including sending tokens and viewing balance changes using the NEAR CLI and RPC endpoints.

- [NEAR Account](https://testnet.mynearwallet.com/create)
Expand All @@ -22,22 +19,9 @@ This document provides an overview of how to track balance changes on NEAR accou

- Send tokens using [`near send`](../tools/cli.md#send-near)

<Tabs groupId="cli-tabs">

<TabItem value="short" label="Short">

```bash
near send sender.testnet receiver.testnet 1
```
</TabItem>

<TabItem value="full" label="Full">

```bash
near tokens sender.testnet send-near receiver.testnet '1 NEAR' network-config testnet sign-with-keychain send
```
</TabItem>
</Tabs>
```bash
near tokens sender.testnet send-near receiver.testnet '1 NEAR' network-config testnet sign-with-keychain send
```

- You should see a result in your terminal that looks something like this:

Expand Down
41 changes: 6 additions & 35 deletions docs/integrations/implicit-accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ sidebar_label: Implicit Accounts
description: "Learn about implicit accounts in NEAR, how they work with Ethereum-style addresses, and their role in chain abstraction and multi-chain integration."
---

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

This document provides an overview of implicit accounts in the NEAR Protocol, including how to create them, use them for transactions, and manage them effectively. Implicit accounts are particularly useful for exchanges and other services that need to facilitate transactions without requiring user interaction.

## Background {#background}
Expand Down Expand Up @@ -55,43 +52,17 @@ export ACCOUNT="8bca86065be487de45e795b2c3154fe834d53ffa07e0a44f29e76a2a5f075df8

Assuming you've received tokens on your new account, you can transfer from it using the following command:

<Tabs groupId="cli-tabs">

<TabItem value="short" label="Short">

```bash
near send $ACCOUNT <receiver> <amount>
```
</TabItem>

<TabItem value="full" label="Full">

```bash
near tokens $ACCOUNT send-near <receiver> '<amount> NEAR' network-config testnet sign-with-keychain send
```
</TabItem>
</Tabs>
```bash
near tokens $ACCOUNT send-near <receiver> '<amount> NEAR' network-config testnet sign-with-keychain send
```

## Transferring to the implicit account {#transferring-to-the-implicit-account}

Let's say someone gives you their account ID `0861ea8ddd696525696ccf3148dd706c4fda981c64d8a597490472594400c223`. You can just transfer to it by running:

<Tabs groupId="cli-tabs">

<TabItem value="short" label="Short">

```bash
near send <your_account_id> 0861ea8ddd696525696ccf3148dd706c4fda981c64d8a597490472594400c223 <amount>
```
</TabItem>

<TabItem value="full" label="Full">

```bash
near tokens<your_account_id> send-near 0861ea8ddd696525696ccf3148dd706c4fda981c64d8a597490472594400c223 '<amount> NEAR' network-config testnet sign-with-keychain send
```
</TabItem>
</Tabs>
```bash
near tokens<your_account_id> send-near 0861ea8ddd696525696ccf3148dd706c4fda981c64d8a597490472594400c223 '<amount> NEAR' network-config testnet sign-with-keychain send
```

## BONUS: Converting public key using python (for learning purposes) {#bonus-converting-public-key-using-python-for-learning-purposes}

Expand Down
93 changes: 15 additions & 78 deletions docs/integrations/tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ sidebar_label: Fungible Tokens
description: "Learn how to integrate NEAR tokens (NEAR, FT, and NFT) into your application, including balance queries, transfers, and token metadata."
---

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

This document provides an overview of the NEAR fungible token standard, including how to check balances, get metadata, and perform transfers. It also covers the storage requirements for fungible tokens and how to manage storage deposits.

## Introduction {#introduction}
Expand Down Expand Up @@ -272,21 +269,9 @@ If there is not enough deposit for the storage or returned value is `null` - you
- using NEAR CLI, don't forget to convert from yoctoⓃ to Ⓝ:


<Tabs groupId="cli-tabs">
<TabItem value="short" label="Short">

```bash
near call <contract_account_id> storage_deposit '{"account_id": "<user_account_id>"}' --accountId <sender_account_id> --deposit <deposit in Ⓝ>
```
</TabItem>

<TabItem value="full" label="Full">

```bash
near contract call-function as-transaction <contract_account_id> storage_deposit json-args '{"account_id": "<user_account_id>"}' prepaid-gas '100.0 Tgas' attached-deposit '<deposit in Ⓝ> NEAR' sign-as <sender_account_id> network-config testnet sign-with-keychain send
```
</TabItem>
</Tabs>
```bash
near contract call-function as-transaction <contract_account_id> storage_deposit json-args '{"account_id": "<user_account_id>"}' prepaid-gas '100.0 Tgas' attached-deposit '<deposit in Ⓝ> NEAR' sign-as <sender_account_id> network-config testnet sign-with-keychain send
```

Result example:

Expand Down Expand Up @@ -549,21 +534,9 @@ http post https://rpc.testnet.near.org jsonrpc=2.0 id=dontcare method=broadcast_
Transfer the tokens:
- using NEAR CLI:

<Tabs groupId="cli-tabs">
<TabItem value="short" label="Short">

```bash
near call <contract_account_id> ft_transfer '{"receiver_id": "<receiver_account_id>", "amount": "1"}' --accountId <sender_account_id> --amount 0.000000000000000000000001
```
</TabItem>

<TabItem value="full" label="Full">

```bash
near contract call-function as-transaction <contract_account_id> ft_transfer json-args '{"receiver_id": "<receiver_account_id>", "amount": "1"}' prepaid-gas '100.0 Tgas' attached-deposit '1 yoctoNEAR' sign-as <sender_account_id> network-config testnet sign-with-keychain send
```
</TabItem>
</Tabs>
```bash
near contract call-function as-transaction <contract_account_id> ft_transfer json-args '{"receiver_id": "<receiver_account_id>", "amount": "1"}' prepaid-gas '100.0 Tgas' attached-deposit '1 yoctoNEAR' sign-as <sender_account_id> network-config testnet sign-with-keychain send
```

Result example:

Expand Down Expand Up @@ -807,21 +780,9 @@ near tx-status <transaction_hash> --accountId <transaction_signer>
Let's create test transaction that should fail and investigate the response. We will try to send more tokens that are available on this account:
- using NEAR CLI:

<Tabs groupId="cli-tabs">
<TabItem value="short" label="Short">

```bash
near call <contract_account_id> ft_transfer '{"receiver_id": "<user_account_id>", "amount": "10000000000"}' --accountId <sender_account_id> --amount 0.000000000000000000000001
```
</TabItem>

<TabItem value="full" label="Full">

```bash
near contract call-function as-transaction <contract_account_id> ft_transfer json-args '{"receiver_id": "<user_account_id>", "amount": "1"}' prepaid-gas '100.0 Tgas' attached-deposit '1 yoctoNEAR' sign-as <sender_account_id> network-config testnet sign-with-keychain send
```
</TabItem>
</Tabs>
```bash
near contract call-function as-transaction <contract_account_id> ft_transfer json-args '{"receiver_id": "<user_account_id>", "amount": "1"}' prepaid-gas '100.0 Tgas' attached-deposit '1 yoctoNEAR' sign-as <sender_account_id> network-config testnet sign-with-keychain send
```

- with JSON RPC call:

Expand Down Expand Up @@ -1114,21 +1075,9 @@ Let's call `ft_transfer_call` function on `ft` contract (receiver) and examine s

- using NEAR CLI

<Tabs groupId="cli-tabs">
<TabItem value="short" label="Short">

```bash
near call <ft_contract_id> ft_transfer_call '{"receiver_id": "<defi_contract_id>", "amount": "10", "msg": "take-my-money"}' --accountId <user_account_id> --amount 0.000000000000000000000001
```
</TabItem>

<TabItem value="full" label="Full">

```bash
near contract call-function as-transaction <ft_contract_id> ft_transfer_call json-args '{"receiver_id": "<defi_contract_id>", "amount": "10", "msg": "take-my-money"}' prepaid-gas '100.0 Tgas' attached-deposit '1 yoctoNEAR' sign-as <user_account_id> network-config testnet sign-with-keychain send
```
</TabItem>
</Tabs>
```bash
near contract call-function as-transaction <ft_contract_id> ft_transfer_call json-args '{"receiver_id": "<defi_contract_id>", "amount": "10", "msg": "take-my-money"}' prepaid-gas '100.0 Tgas' attached-deposit '1 yoctoNEAR' sign-as <user_account_id> network-config testnet sign-with-keychain send
```

- with JSON RPC call

Expand Down Expand Up @@ -1514,21 +1463,9 @@ Let's try to send more tokens than the account has:

- using NEAR CLI

<Tabs groupId="cli-tabs">
<TabItem value="short" label="Short">

```bash
near call <ft_contract_id> ft_transfer_call '{"receiver_id": "<defi_contract_id>", "amount": "1000000000", "msg": "take-my-money"}' --accountId <user_account_id> --amount 0.000000000000000000000001
```
</TabItem>

<TabItem value="full" label="Full">

```bash
near contract call-function as-transaction <ft_contract_id> ft_transfer_call json-args '{"receiver_id": "<defi_contract_id>", "amount": "1000000000", "msg": "take-my-money"}' prepaid-gas '100.0 Tgas' attached-deposit '1 yoctoNEAR' sign-as <user_account_id> network-config testnet sign-with-keychain send
```
</TabItem>
</Tabs>
```bash
near contract call-function as-transaction <ft_contract_id> ft_transfer_call json-args '{"receiver_id": "<defi_contract_id>", "amount": "1000000000", "msg": "take-my-money"}' prepaid-gas '100.0 Tgas' attached-deposit '1 yoctoNEAR' sign-as <user_account_id> network-config testnet sign-with-keychain send
```

Transaction representation:

Expand Down
Loading
Loading