Withdraw to Stellar with cede.store
Learn more about Stellar (opens in a new tab)
The Stellar network is an open-source, decentralized blockchain designed for fast, low-cost payments and remittances worldwide. It is maintained by the non-profit Stellar Development Foundation (opens in a new tab), which empowers builders to unlock human and economic potential by connecting digital assets to the global financial system. Stellar is widely used for payments, remittances, and digital asset issuance, offering a robust ecosystem and developer tools.
With the cede.store Extension, users can easily transfer funds from centralized exchanges (CEXs) directly to the Stellar network in just a few clicks. DApps integrating this extension can enable users to trigger withdrawals from their CEX accounts to their own Stellar addresses, streamlining the on-ramp process for Stellar-based applications.
Estimated feature integration time: ~2 hours*
Prerequisites
Before proceeding, ensure you have completed the steps in the prerequisites guide:
- Extension detection and connection logic
- Vaults & accounts selection logic
- Subscribed to cede.store events
1. Retrieve Withdrawable Tokens
Fetch the list of tokens that can be withdrawn from the user's account:
const withdrawableTokens = await provider.request({
method: "withdrawableTokens",
params: {
accountId: "stellar-125805-530845-212023-888168",
},
});
2. Get Stellar as a Withdrawal Network
After the user selects a token, fetch available withdrawal networks (chains). Ensure "stellar" is available:
const withdrawableChains = await provider.request({
method: "getNetworks",
params: {
accountId: "stellar-125805-530845-212023-888168",
tokenSymbol: "USDC", // or other supported token
opts: {
toWithdraw: true,
},
},
});
// Look for a network with id or name 'stellar'
3. Prepare the Stellar Withdrawal
Once the user selects Stellar, prepare the withdrawal specifying the Stellar network:
const result = await provider.request({
method: "prepareWithdrawal",
params: {
accountId: "stellar-125805-530845-212023-888168",
tokenSymbol: "USDC",
network: "stellar",
amount: "100.5",
},
});
4. Initiate Withdrawal to Stellar Address
Initiate the withdrawal to the user's Stellar address. If a memo is required, include it in the params:
await provider.request({
method: "withdrawToDefi",
params: {
accountId: "stellar-125805-530845-212023-888168",
tokenSymbol: "USDC",
network: "stellar",
amount: "100.5",
address: "GABCD...XYZ", // User's Stellar public key
memo: "123456", // Optional: include if required by recipient
},
});
5. Retrieve Withdrawal Status by ID
Fetch withdrawal status and details by withdrawal ID:
await provider.request({
method: "getWithdrawalById",
params: {
accountId: "stellar-125805-530845-212023-888168",
withdrawalId: "9876543210",
tokenSymbol: "USDC",
},
});
Ensure the Stellar address is correct and, if required, the memo is provided. Incorrect details may result in loss of funds.
* The estimated integration time assumes you have existing UI components for similar withdrawal features.