Skip to content
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

Merged
merged 10 commits into from
Oct 2, 2024
Merged

chore: sprinter react docs + updates #60

merged 10 commits into from
Oct 2, 2024

Conversation

haochizzle
Copy link
Collaborator

@haochizzle haochizzle commented Sep 25, 2024

  • add sprinter-react docs
  • update sprinter-sdk class reference docs
  • update API documentation

Copy link
Collaborator

@BeroBurny BeroBurny left a 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

Comment on lines 9 to 18
:::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.
Copy link
Collaborator

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

Copy link
Collaborator Author

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

Comment on lines 125 to 135

// For contract call solution
const contractSolutionSettings = {
contractCall: true,
// Other contract call-specific options...
};

sprinter.getSolution(contractSolutionSettings).then(contractSolution => {
console.log('Contract call solution:', contractSolution);
});
```
Copy link
Collaborator

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

Copy link
Collaborator Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants