bitaccess / coinlib

A unified nodejs API for sending and receiving crypto payments
MIT License
70 stars 27 forks source link

add getSpecificPayments to CoinPayments #346

Closed caleb-bitaccess closed 2 years ago

caleb-bitaccess commented 2 years ago

Problem

The old way to get AnyPayments instance is to build it in CoinPayments constructor and store them in the CoinPayments object and later use forNetwork method to get the pre-defined payments config combined with the overriding config and build another one. The first build in the CoinPayments constructor is unnecessary for our GringottsSeedSignerClient.

Description of the change

This pr adds a method getSpecificPayments to allow users to get any payment instance directly from an 'empty' CoinPayments(aka seedCoinPayments) without pre-building anyPayments in CoinPayments constructor.