-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BOB Gateway v3 SDK #314
Comments
Cancelling a Transfer@gregdhill, how does the server currently handle letting quotes expire? I couldn't find it in Do you think something like Fetching Transaction HistoryWe already have getOrders and use it on our UI. Straightforward to extend later if partners ask. Dom's Open Questions
interface Contract {
id: string; // Unique Swing Identifier
type: 'deposit' | 'withdraw';
address: string; // Deployed contract address
method: string; // Contract method (eg. deposit, withdraw)
chain: string;
inputToken: Token; // Token you send to the contract
outputToken: Token | null; // Token you receive from the contract
// Swing's integration provider
integration: {
type: 'staking';
slug: string;
name: string;
logo: string;
monetization: boolean;
};
}
swingSDK.on('TRANSFER', (transferStep, transferResults) => {
switch (transferStep.status) {
case 'PENDING':
// Let the user know the step is pending: `transferStep.step`
break;
case 'WALLET_CONNECTION_REQUIRED':
// Handle connecting wallets using your favorite library like Wagmi
// or alert the user to do it manually.
// Example: await connectWallet(transferStep.chain);
break;
case 'CHAIN_SWITCH_REQUIRED':
// Handle switching chains using your favorite library like Wagmi
// or alert the user to do it manually
// Example: await switchNetwork(transferStep.chain.chainId);
break;
case 'ACTION_REQUIRED':
// Let the user know they need to take action within their wallet, such as signing a transaction
break;
case 'CONFIRMING':
// Let the user know the transaction is waiting for confirmations
break;
case 'SUCCESS':
// The transaction was successful, yay!
break;
case 'FAILED':
// Alert the user there was an error. Check the message in `transferStep.error`
break;
}
}); |
Is your feature request related to a problem? Please describe.
BOB Gateway is a Bitcoin intent bridge that unlocks Bitcoin liquidity by reducing the number of steps to onboard users, saving time and money. Users can go from BTC on Bitcoin to staked BTC with a single Bitcoin transaction.
Describe the solution you'd like
From a high level, I think we want:
Why separate these two? They will need to account for some of the details under the hood:
There might be some other differences between the two.
For the APIs themselves, I suggest to stick close to swing:
Swap
Types:
Flow:
const transferoute = (await get_quote(transferparameters))[0];
opReturnData
.Stake
Types:
Flow:
const transferoute = (await get_quote(transferparameters))[0];
opReturnData
.Comments
For sending the BTC (step 4/5): We should show examples of how to create the Bitcoin transaction with:
Open questions
@nakul1010 could you have a look at that?Derrek found it; see below.The text was updated successfully, but these errors were encountered: