Web3App constructor

Web3App({
  1. required ICore core,
  2. required PairingMetadata metadata,
})

Implementation

Web3App({
  required this.core,
  required this.metadata,
}) {
  signEngine = SignEngine(
    core: core,
    metadata: metadata,
    proposals: GenericStore(
      storage: core.storage,
      context: StoreVersions.CONTEXT_PROPOSALS,
      version: StoreVersions.VERSION_PROPOSALS,
      fromJson: (dynamic value) {
        return ProposalData.fromJson(value);
      },
    ),
    sessions: Sessions(
      storage: core.storage,
      context: StoreVersions.CONTEXT_SESSIONS,
      version: StoreVersions.VERSION_SESSIONS,
      fromJson: (dynamic value) {
        return SessionData.fromJson(value);
      },
    ),
    pendingRequests: GenericStore(
      storage: core.storage,
      context: StoreVersions.CONTEXT_PENDING_REQUESTS,
      version: StoreVersions.VERSION_PENDING_REQUESTS,
      fromJson: (dynamic value) {
        return SessionRequest.fromJson(value);
      },
    ),
    authKeys: GenericStore(
      storage: core.storage,
      context: StoreVersions.CONTEXT_AUTH_KEYS,
      version: StoreVersions.VERSION_AUTH_KEYS,
      fromJson: (dynamic value) {
        return AuthPublicKey.fromJson(value);
      },
    ),
    pairingTopics: GenericStore(
      storage: core.storage,
      context: StoreVersions.CONTEXT_PAIRING_TOPICS,
      version: StoreVersions.VERSION_PAIRING_TOPICS,
      fromJson: (dynamic value) {
        return value;
      },
    ),
    authRequests: GenericStore(
      storage: core.storage,
      context: StoreVersions.CONTEXT_AUTH_REQUESTS,
      version: StoreVersions.VERSION_AUTH_REQUESTS,
      fromJson: (dynamic value) {
        return PendingAuthRequest.fromJson(value);
      },
    ),
    completeRequests: GenericStore(
      storage: core.storage,
      context: StoreVersions.CONTEXT_COMPLETE_REQUESTS,
      version: StoreVersions.VERSION_COMPLETE_REQUESTS,
      fromJson: (dynamic value) {
        return StoredCacao.fromJson(value);
      },
    ),
    sessionAuthRequests: GenericStore(
      storage: core.storage,
      context: StoreVersions.CONTEXT_AUTH_REQUESTS,
      version: StoreVersions.VERSION_AUTH_REQUESTS,
      fromJson: (dynamic value) {
        return PendingSessionAuthRequest.fromJson(value);
      },
    ),
  );

  authEngine = AuthEngine(
    core: core,
    metadata: metadata,
    authKeys: signEngine.authKeys,
    pairingTopics: signEngine.pairingTopics,
    authRequests: signEngine.authRequests,
    completeRequests: signEngine.completeRequests,
  );
}