# Developer references & glossary

If you have questions about calling Open API, this document provides full request body params and response body.

#### [OpenOcean API Document](https://apis.openocean.finance/developer/apis) <a href="#openocean-api-document" id="openocean-api-document"></a>

### Files and modules needed for API users <a href="#files-and-modules-needed-for-api-users" id="files-and-modules-needed-for-api-users"></a>

Here are some modules you need to import in addition to the open API:

```shell
npm install bignumber.js
npm install web3
```

The web3.js library is a collection of modules that contain functionality for the Ethereum ecosystem. Meanwhile, bignumber is the module used to operate the multiple-precision floating-point number, which is used in all smart contract's number running.

#### [web3.js ](https://web3js.readthedocs.io/en/v1.7.0/getting-started.html#adding-web3-js) <a href="#web3-js" id="web3-js"></a>

#### [bignumber.js ](https://mikemcl.github.io/bignumber.js/) <a href="#bignumber-js" id="bignumber-js"></a>

* Table of chainId you need for directing your wallet plugin to the blockchain you select.

|     Chain\_Name     |  Chain\_ID |  main-pair  |
| :-----------------: | :--------: | :---------: |
|   Ethereum Mainnet  |      1     |   eth-usdt  |
| Binance Smart Chain |     56     |   bnb-busd  |
|    Solana Mainnet   |     --     |   eth-usdt  |
|   Polygon Mainnet   |     137    |  matic-usdt |
|      Avalanche      |    43114   | avax-usdt.e |
|        Fantom       |     250    |   ftm-usdc  |
|       Arbitrum      |    42161   |   uni-usdc  |
|    Terra Mainnet    | columbus-5 |   luna-ust  |
|    Gnosis Mainnet   |     100    |  xdai-usdt  |
|     Boba Mainnet    |     288    |  weth-usdt  |
|   Ontology Mainnet  |     --     |  wing-ontd  |
|     Tron Mainnet    |     --     |   trx-usdt  |
|     Heco Mainnet    |     128    |   ht-usdc   |
|     OEC Mainnet     |     66     |   okt-usdt  |
|       Optimism      |     10     |   uni-usdc  |
|      Moonriver      |    1285    |   eth-usdt  |

* Erc20 Abi: Contains the abi you need to approve your token.

```javascript
[{
	"constant": true,
	"inputs": [],
	"name": "name",
	"outputs": [{
		"name": "",
		"type": "string"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_spender",
		"type": "address"
	}, {
		"name": "_value",
		"type": "uint256"
	}],
	"name": "approve",
	"outputs": [{
		"name": "",
		"type": "bool"
	}],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": true,
	"inputs": [],
	"name": "totalSupply",
	"outputs": [{
		"name": "",
		"type": "uint256"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_from",
		"type": "address"
	}, {
		"name": "_to",
		"type": "address"
	}, {
		"name": "_value",
		"type": "uint256"
	}],
	"name": "transferFrom",
	"outputs": [{
		"name": "",
		"type": "bool"
	}],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": true,
	"inputs": [],
	"name": "decimals",
	"outputs": [{
		"name": "",
		"type": "uint8"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_owner",
		"type": "address"
	}],
	"name": "balanceOf",
	"outputs": [{
		"name": "balance",
		"type": "uint256"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": true,
	"inputs": [],
	"name": "symbol",
	"outputs": [{
		"name": "",
		"type": "string"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_to",
		"type": "address"
	}, {
		"name": "_value",
		"type": "uint256"
	}],
	"name": "transfer",
	"outputs": [{
		"name": "",
		"type": "bool"
	}],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_owner",
		"type": "address"
	}, {
		"name": "_spender",
		"type": "address"
	}],
	"name": "allowance",
	"outputs": [{
		"name": "",
		"type": "uint256"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"payable": true,
	"stateMutability": "payable",
	"type": "fallback"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"name": "owner",
		"type": "address"
	}, {
		"indexed": true,
		"name": "spender",
		"type": "address"
	}, {
		"indexed": false,
		"name": "value",
		"type": "uint256"
	}],
	"name": "Approval",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"name": "from",
		"type": "address"
	}, {
		"indexed": true,
		"name": "to",
		"type": "address"
	}, {
		"indexed": false,
		"name": "value",
		"type": "uint256"
	}],
	"name": "Transfer",
	"type": "event"
}];
```

### Glossary <a href="#glossary" id="glossary"></a>

Below we explain several terms that will help you start programming.

#### API <a href="#api" id="api"></a>

An application programming interface (API) is a set of protocols and codes that determine how different software platforms communicate and share information. APIs define different types of requests and calls that can be made, the data types that can be used, and how to make these requests. It serves as an intermediary between different software systems. A developer can use an API to incorporate features of an external application into their own software. By allowing different platforms to communicate, APIs enhance interoperability across the web.

* via [Gemini(opens new window)](https://www.gemini.com/cryptopedia/glossary)

#### SDK <a href="#sdk" id="sdk"></a>

A software development kit (SDK) is a collection of software development tools in one installable package.They ease creation of applications by having compiler, debugger and perhaps a software framework.They are normally specific to a hardware platform and operating system combination.

* via [Binah(opens new window)](https://support.binah.ai/hc/en-us/articles/360007663478-Introduction-to-Software-Development-Kits)

#### Wallet <a href="#wallet" id="wallet"></a>

In the Crypto Defi world, wallets are software that can be used to view cryptocurrency balances and make transactions. Each wallet type is a little bit different, but in general, any given wallet will work with one or more cryptocurrencies and will be able to store one or more cryptocurrency-specific “public addresses. Cryptocurrency itself is not actually “stored” in a wallet, it is stored on a coin’s blockchain. Your wallet is simply software designed to interact with the blockchain. That is the magic part of Defi application, you can finish you trade business on the customer side!

* via [crypto(opens new window)](https://crypto.com/university/crypto-wallets)

#### Contract <a href="#contract" id="contract"></a>

Smart contracts are simply programs stored on a blockchain that run when predetermined conditions are met. They typically are used to automate the execution of an agreement so that all participants can be immediately certain of the outcome, without any intermediary's involvement or time loss.

* via [IBM(opens new window)](https://www.ibm.com/topics/smart-contracts)

#### OOP <a href="#oop" id="oop"></a>

As a developer, you should know the Defi project programing is a good case for Object Oriented Programming (OOP). OOP is a popular programming paradigm based on the concept of "Object", which can contain data and code: data in the form of fields (often known as attributes or properties), and code, in the form of procedures (often known as methods). In Defi programming, you have the two most important "Objects" to work with, wallet object and contract object. They are the tools you need to interact with blockchain, and these two objects have all the medhods you need for your transaction.

* via [TechTarget(opens new window)](https://www.techtarget.com/searchapparchitecture/definition/object-oriented-programming-OOP)

#### Arbitrage <a href="#arbitrage" id="arbitrage"></a>

To arbitrage is to get benefit from the price difference of an asset or security between two markets for profit. We can make an example in the crypto case, some token is selling in market A in $3 but selling in market B with $5. So there is $2 per token's profit if someone sold the tokens he/she get from market A to market B. Arbitrage is a necessary financial mechanism that keeps prices consistent between different exchanges and wider markets.

* via [Gemini(opens new window)](https://www.gemini.com/cryptopedia/glossary)

#### GasPrice <a href="#gasprice" id="gasprice"></a>

Gas refers to the fee, or pricing value, required to successfully conduct a transaction or execute a contract on the Ethereum blockchain platform. Priced in small fractions of the cryptocurrency ether (ETH), commonly referred to as gwei and sometimes also called nanoeth, the gas is used to allocate resources of the Ethereum virtual machine (EVM) so that decentralized applications such as smart contracts can self-execute in a secured but decentralized fashion.

* via [investopedia(opens new window)](https://www.investopedia.com/terms/g/gas-ethereum.asp)

#### Slippage <a href="#slippage" id="slippage"></a>

Slippage happens when traders have to settle for a different price than what they initially requested due to a movement in price between the time the order (say for Bitcoin) enters the market and the execution of a trade. This phenomenon can occur in all markets, like forex and stocks. However, it is more frequent, and a lot worse, in crypto markets (especially on decentralized exchanges like Uniswap) due to the high levels of price volatility.

* via [coinmarketcap](https://coinmarketcap.com/alexandria/glossary/slippage)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apis.openocean.finance/developer/developer-resources/developer-references-and-glossary.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
