createSpace function

Future<SpaceDTO?> createSpace({
  1. String? account,
  2. Signer? signer,
  3. required String spaceName,
  4. required String spaceDescription,
  5. String? spaceImage,
  6. required List<String> listeners,
  7. required List<String> speakers,
  8. bool isPublic = true,
  9. String? contractAddressNFT,
  10. int? numberOfNFTs,
  11. String? contractAddressERC20,
  12. int? numberOfERC20,
  13. String? pgpPrivateKey,
  14. String? meta,
  15. required DateTime scheduleAt,
  16. DateTime? scheduleEnd,
})

Implementation

Future<SpaceDTO?> createSpace({
  String? account,
  Signer? signer,
  required String spaceName,
  required String spaceDescription,
  String? spaceImage,
  required List<String> listeners,
  required List<String> speakers,
  bool isPublic = true,
  String? contractAddressNFT,
  int? numberOfNFTs,
  String? contractAddressERC20,
  int? numberOfERC20,
  String? pgpPrivateKey,
  String? meta,
  required DateTime scheduleAt,
  DateTime? scheduleEnd,
}) async {
  try {
    final result = await push.createGroup(
      signer: signer,
      account: account,
      groupName: spaceName,
      groupDescription: spaceDescription,
      groupImage: spaceImage,
      members: listeners,
      admins: speakers,
      isPublic: isPublic,
      contractAddressNFT: contractAddressNFT,
      numberOfNFTs: numberOfNFTs,
      contractAddressERC20: contractAddressERC20,
      numberOfERC20: numberOfERC20,
      pgpPrivateKey: pgpPrivateKey,
      meta: meta,
      groupType: 'spaces',
      scheduleAt: scheduleAt,
      scheduleEnd: scheduleEnd,
    );

    return groupDtoToSpaceDto(result!);
  } catch (e) {
    log("[Push SDK] - API  - Error - API createSpace -: $e ");
    rethrow;
  }
}