bcnmy / docs

Biconomy official documentation
https://docs.biconomy.io/
MIT License
15 stars 28 forks source link

Bundler API docs update #205

Closed himanshugarg06 closed 5 months ago

himanshugarg06 commented 6 months ago

Bundler Documentation

https://docs.biconomy.io/Bundler/

Bundler can be used in the following ways:

  1. In integration with Biconomy smart account SDK [package](https://www.npmjs.com/package/@biconomy/account)

    import { createSmartAccountClient, createBundler } from "**@biconomy/account**";
    
    const userOpReceiptMaxDurationIntervals: { [key in number]?: number } = {
    };
    
    const bundler = await createBundler({
      bundlerUrl: "", // <-- Read about this at https://docs.biconomy.io/dashboard#bundler-url
      userOpReceiptMaxDurationIntervals,
    });
  2. Using the [Bundler package](https://www.npmjs.com/package/@biconomy/bundler) https://bcnmy.github.io/biconomy-client-sdk/classes/Bundler.html#create

    import { create } from "**@biconomy/bundler**";
    
    const userOpReceiptMaxDurationIntervals: { [key in number]?: number } = {
    };
    
    const bundler = await create({
      bundlerUrl: "", // <-- Read about this at https://docs.biconomy.io/dashboard#bundler-url
      userOpReceiptMaxDurationIntervals,
    });
  3. Via the APIs (platform independent) - can exist as it is but to get exact request and response structure, API documentation like postman or swagger can be used.

Open Question

ToDos

@joepegler can you help me with following

@arcticfloyd1984

@himanshugarg06

joepegler commented 6 months ago

Hey Himanshu. I wouldn't mention anything regarding the accounts package here, as it is out of scope of the Bundler and it exists elsewhere in the docs.

So, in the context of the SDK here, the only code worth mentioning is:

import { createBundler } from "@biconomy/bundler";

const bundler = await createBundler({
  bundlerUrl: "" // <-- Read about this at https://docs.biconomy.io/dashboard#bundler-url
});

Here are the options you can pass in. I have not yet had the chance to document them in tsdoc compatible comments yet:
image

himanshugarg06 commented 6 months ago

but for sdk there is a method already existing in the accounts package as mentioned above. we would want sdk users to use this method? import { createSmartAccountClient, createBundler } from "@biconomy/account";

joepegler commented 6 months ago

Yeah they can for sure, it's just not relevant to this part of the documentation

image

himanshugarg06 commented 6 months ago

https://github.com/bcnmy/docs/pull/221

himanshugarg06 commented 6 months ago

@joepegler StateOverrideSet in https://bcnmy.github.io/biconomy-client-sdk/classes/Bundler.html#estimateUserOpGas

himanshugarg06 commented 6 months ago

@arcticfloyd1984