Skip to main content
POST
/
contracts
/
exchanger
/
exchangeFromCredits
Exchange Based Credits to the supported stablecoin
curl --request POST \
  --url https://mainnet.base.org/contracts/exchanger/exchangeFromCredits \
  --header 'Content-Type: application/json' \
  --data '{
  "amount": "1000000000000000000",
  "recipient": "0x0000000000000000000000000000000000000000"
}'
{
  "transactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
  "blockNumber": 12345678,
  "gasUsed": "21000",
  "events": [
    {
      "name": "<string>",
      "args": {}
    }
  ]
}
This is a smart contract write function. The curl example shown is for illustration. To call this function, use web3 libraries (ethers.js, viem, web3.py) or JSON-RPC directly.

Body

application/json
amount
string
required

Amount of Based Credits to exchange (in wei/smallest unit)

Example:

"1000000000000000000"

recipient
string
required

Address to receive the supported stablecoin

Example:

"0x0000000000000000000000000000000000000000"

Response

Exchange successful

transactionHash
string

Transaction hash

Example:

"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"

blockNumber
integer

Block number where transaction was mined

Example:

12345678

gasUsed
string

Gas used for the transaction

Example:

"21000"

events
object[]
I