curl -X POST "https://starknet.api.avnu.fi/staking/v3/pools/0x123abc/members/0x0456def/initiate-withdraw" \
-H "Content-Type: application/json" \
-d '{
"userAddress": "0x0456def...",
"amount": "0xde0b6b3a7640000"
}'
async function initiateWithdraw(
poolAddress: string,
amount: string,
account: Account
) {
const response = await fetch(
`https://starknet.api.avnu.fi/staking/v3/pools/${poolAddress}/members/${account.address}/initiate-withdraw`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
userAddress: account.address,
amount
})
}
);
const { calls } = await response.json();
const tx = await account.execute(calls);
return tx.transaction_hash;
}
{
"chainId": "0x534e5f4d41494e",
"calls": [
{
"contractAddress": "0x123abc",
"entrypoint": "initiate_withdraw",
"calldata": ["0xde0b6b3a7640000", "0"]
}
]
}
Earn
Initiate Withdraw
Start unstaking process (21-day unbonding)
POST
/
staking
/
v3
/
pools
/
{poolAddress}
/
members
/
{userAddress}
/
initiate-withdraw
curl -X POST "https://starknet.api.avnu.fi/staking/v3/pools/0x123abc/members/0x0456def/initiate-withdraw" \
-H "Content-Type: application/json" \
-d '{
"userAddress": "0x0456def...",
"amount": "0xde0b6b3a7640000"
}'
async function initiateWithdraw(
poolAddress: string,
amount: string,
account: Account
) {
const response = await fetch(
`https://starknet.api.avnu.fi/staking/v3/pools/${poolAddress}/members/${account.address}/initiate-withdraw`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
userAddress: account.address,
amount
})
}
);
const { calls } = await response.json();
const tx = await account.execute(calls);
return tx.transaction_hash;
}
{
"chainId": "0x534e5f4d41494e",
"calls": [
{
"contractAddress": "0x123abc",
"entrypoint": "initiate_withdraw",
"calldata": ["0xde0b6b3a7640000", "0"]
}
]
}
Overview
Initiates withdrawal of staked STRK. After execution, tokens enter a 21-day unbonding period. During unbonding, tokens don’t earn rewards. After 21 days, use/claim-withdraw to retrieve tokens.
Tokens don’t earn rewards during the 21-day unbonding period.
Path Parameters
string
required
Pool contract address
string
required
User’s wallet address
Request
string
required
User’s wallet address
string
required
Amount to unstake (hex format)
Response
string
required
Network identifier
array
required
Transaction calls to execute
curl -X POST "https://starknet.api.avnu.fi/staking/v3/pools/0x123abc/members/0x0456def/initiate-withdraw" \
-H "Content-Type: application/json" \
-d '{
"userAddress": "0x0456def...",
"amount": "0xde0b6b3a7640000"
}'
async function initiateWithdraw(
poolAddress: string,
amount: string,
account: Account
) {
const response = await fetch(
`https://starknet.api.avnu.fi/staking/v3/pools/${poolAddress}/members/${account.address}/initiate-withdraw`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
userAddress: account.address,
amount
})
}
);
const { calls } = await response.json();
const tx = await account.execute(calls);
return tx.transaction_hash;
}
{
"chainId": "0x534e5f4d41494e",
"calls": [
{
"contractAddress": "0x123abc",
"entrypoint": "initiate_withdraw",
"calldata": ["0xde0b6b3a7640000", "0"]
}
]
}
Was this page helpful?