@iexec/dataprotector
Version:
This product enables users to confidentially store data–such as mail address, documents, personal information ...
16 lines (14 loc) • 649 B
text/typescript
import { Contract } from 'ethers';
import type { IExecModule } from 'iexec';
import { ABI } from '../../../../generated/abis/sharing/DataProtectorSharing.sol/DataProtectorSharing.js';
import type { DataProtectorSharing } from '../../../../generated/typechain/sharing/DataProtectorSharing.js';
import { Address } from '../../types/commonTypes.js';
export async function getSharingContract(
iexec: IExecModule,
sharingContractAddress: Address
): Promise<DataProtectorSharing> {
const { signer } = await iexec.config.resolveContractsClient();
return new Contract(sharingContractAddress, ABI).connect(
signer
) as DataProtectorSharing;
}