@test-org122/hypernet-core
Version:
Hypernet Core. Represents the SDK for running the Hypernet Protocol.
35 lines • 2.83 kB
TypeScript
import { IMerchantConnectorRepository } from "@interfaces/data";
import { PublicKey, HypernetContext } from "@interfaces/objects";
import { CoreUninitializedError, MerchantConnectorError, MerchantValidationError, PersistenceError } from "@interfaces/objects/errors";
import { ResultAsync } from "neverthrow";
import { IAjaxUtils } from "@test-org122/utils";
import { IBlockchainProvider, IBlockchainUtils, IConfigProvider, IContextProvider, ILocalStorageUtils, IMerchantConnectorProxy, IVectorUtils } from "@interfaces/utilities";
import { ethers } from "ethers";
import { TypedDataDomain, TypedDataField } from "@ethersproject/abstract-signer";
import { IMerchantConnectorProxyFactory } from "@interfaces/utilities/factory";
export declare class MerchantConnectorRepository implements IMerchantConnectorRepository {
protected blockchainProvider: IBlockchainProvider;
protected ajaxUtils: IAjaxUtils;
protected configProvider: IConfigProvider;
protected contextProvider: IContextProvider;
protected vectorUtils: IVectorUtils;
protected localStorageUtils: ILocalStorageUtils;
protected merchantConnectorProxyFactory: IMerchantConnectorProxyFactory;
protected blockchainUtils: IBlockchainUtils;
protected activatedMerchants: Map<string, IMerchantConnectorProxy>;
protected domain: TypedDataDomain;
protected types: Record<string, TypedDataField[]>;
constructor(blockchainProvider: IBlockchainProvider, ajaxUtils: IAjaxUtils, configProvider: IConfigProvider, contextProvider: IContextProvider, vectorUtils: IVectorUtils, localStorageUtils: ILocalStorageUtils, merchantConnectorProxyFactory: IMerchantConnectorProxyFactory, blockchainUtils: IBlockchainUtils);
getMerchantPublicKeys(merchantUrls: string[]): ResultAsync<Map<string, PublicKey>, Error>;
addAuthorizedMerchant(merchantUrl: string): ResultAsync<void, PersistenceError>;
/**
* Returns a map of merchant URLs with their authorization signatures.
*/
getAuthorizedMerchants(): ResultAsync<Map<string, string>, PersistenceError>;
resolveChallenge(merchantUrl: string, paymentId: string, transferId: string): ResultAsync<void, MerchantConnectorError | MerchantValidationError | CoreUninitializedError>;
protected _setAuthorizedMerchants(authorizedMerchantMap: Map<string, string>): void;
protected _getAuthorizedMerchants(): Map<string, string>;
activateAuthorizedMerchants(): ResultAsync<void, MerchantConnectorError | MerchantValidationError | CoreUninitializedError>;
protected _activateAuthorizedMerchant(accountAddress: string, merchantUrl: string, authorizationSignature: string, context: HypernetContext, signer: ethers.providers.JsonRpcSigner): ResultAsync<void, MerchantConnectorError | MerchantValidationError>;
}
//# sourceMappingURL=MerchantConnectorRepository.d.ts.map