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

docs: document explaining the workflow of cross chain transfer from near #466

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
50 changes: 50 additions & 0 deletions doc/near/bts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
## Requirements

* **NEAR CLI**
The NEAR [Command Line Interface (CLI)](https://github.com/near/near-cli) is a tool that enables to interact with the NEAR network directly from the shell. Under the hood, NEAR CLI utilizes the NEAR [JavaScript API](https://github.com/near/near-api-js)


#### Installation
```console
npm install -g near-cli
```
* **NEAR Wallet**
- Testnet: https://wallet.testnet.near.org/
- Mainnet: https://wallet.near.org/

* **Authorize CLI**
```console
near login
```
## API
*Path to BTS Rust ReadMe*

## Usage

**Transfer NEAR**
- Deposit
```console
NEAR_ENV=testnet near call <BTS> deposit --amount <AMOUNT in NEAR> --accountId <ACCOUNT ID>
```
- Transfer
```console
NEAR_ENV=testnet near call <BTS> transfer '{"coin_name": "<Registered Coin Name>", "destination": "btp://<Network>/<Address>", "amount": "<Amount in lowest Denomination, For NEAR in yoctoNEAR ie 1 NEAR = 1^24 yoctoNEAR>"}' --gas 300000000000000 --accountId <ACCOUNT ID>
```

**Receiving Cross-Chain Native Coins**
- Withdraw
```console
NEAR_ENV=testnet near call <BTS> withdraw '{"coin_name": "<Registered Coin Name>", "amount":"<Amount in lowest Denomination>"}' --amount 0.000000000000000000000001 --gas 300000000000000 --accountId <ACCOUNT ID>
```

**Reclaiming Failed Transfer**
- Reclaim
```console
NEAR_ENV=testnet near call <BTS> reclaim '{"coin_name": "<Registered Coin Name>", "amount":"<Amount in lowest Denomination>"}' --amount 0.000000000000000000000001 --gas 300000000000000 --accountId <ACCOUNT ID>
```

## Environment

- [Testnet](./testnet.md)


10 changes: 10 additions & 0 deletions doc/near/testnet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Testnet

### BTS
bts.iconbridge.testnet
### Registered Tokens

| Coin/Token|Coin Name| Network| Denomination| NEP141 Contract |
|:---------|:--------|:--------|:------------|:----------|
| NEAR | btp-0x1.near-NEAR | 0x1.near | 24 | N/A |
| ICX | btp-0x2.icon-ICX | 0x2.icon | 18 | btp-icx.bts.iconbridge.testnet |