Skip to content

Simplify new plan creation in the SDK #688

Closed as not planned
Closed as not planned
@eruizgar91

Description

@eruizgar91

Is your feature request related to a problem? Please describe.

Currently is a bit complex for a developer create a simple subscription, because the user has to create an assetPrice that pick the fee and other data.

Describe the solution you'd like

We could simplify this process for the final user, so they only need to pass the price that the want to set up and the token address.

      const assetRewardsMap = new Map([[address, BigInt(asset.price)]])

      const feeReceiver = await nvmApp.sdk.keeper.nvmConfig.getFeeReceiver()
      const assetPrice = new AssetPrice(assetRewardsMap).adjustToIncludeNetworkFees(
        feeReceiver,
        NETWORK_FEE_DENOMINATOR,
      )
      assetPrice.setTokenAddress(asset.token.address)

This code can be executed directly in the sdk, so the final user don't need to know how is happening internally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions