Skip to content

sdk #14

Description

@Zergity
  1. derion = new DerionSDK(...)
    load config trên github vào object
  2. pool = derion.loadPool(địa chỉ pool derion)
    load pool config
  3. pool.loadState()
    load state contrsct hiện tại
  4. pool.swap(sideIn, sideOut, ...)
  5. pool.getAmountOut(...)
  6. position = derion.loadPosition(id)
  7. position.loadState()
sdk = new DerionSdk(ProfileConfigs)
stateLoader = sdk.createStateLoader(rpcURL)
poolAddresses = ['...', '...']
pools = sdk.createPools([address, address]) // load pools configs from addresses
pools = sdk.createPoolsFromLogs(logs) // this load pool configs from logs
stateLoader.loadPools(pools) // mass update state for multiple pools
account = sdk.createAccount(address | Signer) // with Signer to send transaction
account.processLogs(logs) // load position and history from logs
account.importPositions(ids) // import no-data position from ids
stateLoader.loadPositions(account.positions) // mass load state for multiple positions
{ amountOut, gasUsed } = account.simulate(tokenIn, tokenOut, amount)
account.swap(tokenIn, tokenOut, amount)

API require scan api key: (low priority, can be added later)

  1. derion.searchIndex
  2. derion.scanWalletAssets

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions