-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore: sprinter react docs + updates #60
Conversation
haochizzle
commented
Sep 25, 2024
•
edited
Loading
edited
- add sprinter-react docs
- update sprinter-sdk class reference docs
- update API documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have some big issues, but I will approve not block it, and will update later
:::tip | ||
`FetchOptions` is an object that contains settings for configuring how the fetch requests are made by the SDK. There are two parameters that can be adjusted including `signal`, which hides the request, and `baseURL`, which sets the target for either mainnet or testnet. | ||
`AggregateBalances` represents the user's token balances across multiple blockchains. It maps a token symbol to the balance information, which includes the total balance and an array of token balances for each chain. | ||
::: | ||
|
||
## Methods | ||
|
||
### `constructor(fetchOptions: Omit<FetchOptions, "signal">)` | ||
|
||
Initializes the SDK with the given Ethereum provider. | ||
Initializes the SDK with the given fetch options. The `signal` property is explicitly excluded from the fetch options because it is meant to be provided dynamically when individual requests are made, allowing developers to abort those requests if necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the signal is not a part of the constructor method, used for special cases in methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so as i understand it (very roughly), the constructor is "initialized" with the fetchOption of "signal" being omitted from this method. i guess i was trying to communicate this but this is more confusing?
apologies if this is not clear
|
||
// For contract call solution | ||
const contractSolutionSettings = { | ||
contractCall: true, | ||
// Other contract call-specific options... | ||
}; | ||
|
||
sprinter.getSolution(contractSolutionSettings).then(contractSolution => { | ||
console.log('Contract call solution:', contractSolution); | ||
}); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is misleading
const settings = {
account: "0x3e101ec02e7a48d16dade204c96bff842e7e2519",
destinationChain: 11155111,
token: "USDC",
amount: "100000000",
contractCall: {
callData: "0xabcdef", // encoded contract call data
contractAddress: "0x1234567890abcdef",
gasLimit: 21000,
recipient: "0xRecipientAddress" // for native contract call (usually is contract that will receive tokens)
},
this one is more precise for exampling data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated, @BeroBurny can you verify again?