create static method

Future<PjUriBuilder> create({
  1. required String address,
  2. required FfiUrl pj,
  3. FfiOhttpKeys? ohttpKeys,
  4. BigInt? expiry,
})

Create a new PjUriBuilder with required parameters. Parameters address: Represents a bitcoin address. ohttpKeys: Optional OHTTP keys for v2. expiry: Optional non-default duration_since epoch expiry for the payjoin session.

Implementation

static Future<PjUriBuilder> create(
    {required String address,
    required FfiUrl pj,
    FfiOhttpKeys? ohttpKeys,
    BigInt? expiry}) async {
  try {
    await PConfig.initializeApp();
    final res = await FfiPjUriBuilder.create(
        address: address, pj: pj, ohttpKeys: ohttpKeys, expiry: expiry);
    return PjUriBuilder(internal: res.internal);
  } on error.PayjoinError catch (e) {
    throw mapPayjoinError(e);
  }
}