Integration

Creating a Gas Manager Policy

Note: A policiy can be linked to one App only. However, one app can have multiple policies

Follow the steps below to create a Gas Manager Policy

  1. Login to the Byzanlink Dashboard

  2. To create a Gas Manager Policy, an app is required. If you don’t have one yet, navigate to the Apps section and create an app first.

  3. Once your app is set up, go to the Gas Manager under the Services section.

  4. Click on Create Policy and complete the steps below to create a policy.

    1. Policy Details: Enter Policy Name, select specific app to which the policy should be applied and select the network

    2. Configure Spending Rules: Spending rules are optional. If you prefer not to set any, simply check both boxes and move forward. If needed, you can enter the appropriate values in the provided input fields.

    3. Configure Access Controls: By default, all addresses are permitted to use the policy. If you need to whitelist or blacklist specific addresses, you can update the values in the provided text box accordingly.

    4. Expiry & Duration: Sponsorship expiry determines how long each sponsorship should last after the signature is generated, minimum is 2 minutes. If no end date is set for the policy, it will remain active indefinitely. Otherwise, the policy will expire on the specified end date.

After successfully creating the policy, click on the Eye icon in the table to view the Policy Details. Copy both the Policy ID and the App's API Key, as you'll need these when initializing the SDK to manage gas fees within your application.

Instantiating SDK with Policy ID

const byzanlinkAASdk = new ByzanlinkAASdk(
  { privateKey: privateKey },
  {
    chainId: Number(chainId),
    policyId: policyId, // Policy ID from Dashboard
    apiKey: apiKey // API Key from Policy Details page in Dashboard
  })

Once the SDK is instantiated, refer Smart Account section to know more about the list of supported methods

Last updated