curl --request GET \
--url 'https://api.sprinter.tech/credit/earn/unwrap?owner=0xUSER&receiver=0xRECEIVER&amount=1000000&asset=0xeE8F4eC5672F09119b96Ab6fB59C27E1b7e44b61&chain=eip155:8453'
import requests
response = requests.get(
"https://api.sprinter.tech/credit/earn/unwrap",
params={
"owner": "0xUSER",
"receiver": "0xRECEIVER",
"amount": "1000000",
"asset": "0xeE8F4eC5672F09119b96Ab6fB59C27E1b7e44b61",
"chain": "eip155:8453"
}
)
print(response.json())
const response = await fetch(
"https://api.sprinter.tech/credit/earn/unwrap?owner=0xUSER&receiver=0xRECEIVER&amount=1000000&asset=0xeE8F4eC5672F09119b96Ab6fB59C27E1b7e44b61&chain=eip155:8453"
);
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://api.sprinter.tech/credit/earn/unwrap?owner=0xUSER&receiver=0xRECEIVER&amount=1000000&asset=0xeE8F4eC5672F09119b96Ab6fB59C27E1b7e44b61&chain=eip155:8453")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"amountOut": "1000000",
"calls": [
{
"chain": "8453",
"to": "0x1234567890abcdef1234567890abcdef12345678",
"data": "0xa9059cbb000000000000000000000000000000000000000000000000000000000005f5e100",
"value": "0"
}
],
"minAmountOut": "997000",
"tokenOut": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
Credit Advanced
Unwrap from Earn Vault
Creates list of contract calls to unwrap a position from an earn vault, converting vault shares back to the underlying asset.
GET
/
credit
/
earn
/
unwrap
curl --request GET \
--url 'https://api.sprinter.tech/credit/earn/unwrap?owner=0xUSER&receiver=0xRECEIVER&amount=1000000&asset=0xeE8F4eC5672F09119b96Ab6fB59C27E1b7e44b61&chain=eip155:8453'
import requests
response = requests.get(
"https://api.sprinter.tech/credit/earn/unwrap",
params={
"owner": "0xUSER",
"receiver": "0xRECEIVER",
"amount": "1000000",
"asset": "0xeE8F4eC5672F09119b96Ab6fB59C27E1b7e44b61",
"chain": "eip155:8453"
}
)
print(response.json())
const response = await fetch(
"https://api.sprinter.tech/credit/earn/unwrap?owner=0xUSER&receiver=0xRECEIVER&amount=1000000&asset=0xeE8F4eC5672F09119b96Ab6fB59C27E1b7e44b61&chain=eip155:8453"
);
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://api.sprinter.tech/credit/earn/unwrap?owner=0xUSER&receiver=0xRECEIVER&amount=1000000&asset=0xeE8F4eC5672F09119b96Ab6fB59C27E1b7e44b61&chain=eip155:8453")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"amountOut": "1000000",
"calls": [
{
"chain": "8453",
"to": "0x1234567890abcdef1234567890abcdef12345678",
"data": "0xa9059cbb000000000000000000000000000000000000000000000000000000000005f5e100",
"value": "0"
}
],
"minAmountOut": "997000",
"tokenOut": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
The
chain parameter uses CAIP-2 format: eip155:<chainId>. For example, eip155:8453 for Base. See Supported Chains for the full list.curl --request GET \
--url 'https://api.sprinter.tech/credit/earn/unwrap?owner=0xUSER&receiver=0xRECEIVER&amount=1000000&asset=0xeE8F4eC5672F09119b96Ab6fB59C27E1b7e44b61&chain=eip155:8453'
import requests
response = requests.get(
"https://api.sprinter.tech/credit/earn/unwrap",
params={
"owner": "0xUSER",
"receiver": "0xRECEIVER",
"amount": "1000000",
"asset": "0xeE8F4eC5672F09119b96Ab6fB59C27E1b7e44b61",
"chain": "eip155:8453"
}
)
print(response.json())
const response = await fetch(
"https://api.sprinter.tech/credit/earn/unwrap?owner=0xUSER&receiver=0xRECEIVER&amount=1000000&asset=0xeE8F4eC5672F09119b96Ab6fB59C27E1b7e44b61&chain=eip155:8453"
);
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://api.sprinter.tech/credit/earn/unwrap?owner=0xUSER&receiver=0xRECEIVER&amount=1000000&asset=0xeE8F4eC5672F09119b96Ab6fB59C27E1b7e44b61&chain=eip155:8453")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"amountOut": "1000000",
"calls": [
{
"chain": "8453",
"to": "0x1234567890abcdef1234567890abcdef12345678",
"data": "0xa9059cbb000000000000000000000000000000000000000000000000000000000005f5e100",
"value": "0"
}
],
"minAmountOut": "997000",
"tokenOut": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
Machine-readable API spec: OpenAPI JSON | Swagger UI
Query Parameters
Owner address that holds the vault shares
Address that will receive the unwrapped underlying tokens
Amount of shares to unwrap
Vault shares token address
Slippage tolerance in percent (e.g. 0.5 = 0.5%)
Chain ID in CAIP format
Response
OK
Estimated amount of tokens to receive
Example:
"1000000"
List of contract calls to execute the unwrap
Show child attributes
Show child attributes
Minimum amount of tokens to receive (after slippage)
Example:
"997000"
Token address that will be received after unwrapping
Example:
"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"