import { ILogger } from "../onchain/types/logger.js";
import { OnchainSDK } from "../onchain/OnchainSDK.js";
import "../onchain/index.js";
import { AnvilClient } from "./createAnvilClient.js";
import { Address } from "viem";
//#region src/dev/kycUtils.d.ts
export interface RegisterSecuritizeInvestorProps {
anvil: AnvilClient;
/**
* Wallet to register in the Securitize DS registry
*/
investor: Address;
/**
* DSToken address
*/
token: Address;
logger?: ILogger;
}
/**
* DS trust-service master of `token`: Ownable owner at storage slot 0 of the
* trust service, same as periphery-v3 SecuritizeAttachHelper. MockDSToken
* returns itself as the trust service, so `admin()` is used instead.
*/
export declare function getSecuritizeAdmin(anvil: AnvilClient, token: Address, logger?: ILogger): Promise
;
/**
* Registers a wallet as a Securitize investor (fake KYC) in the DS registry
* service of a DSToken.
* Works both for MockDSToken and real DSToken connected by securitize-deploy script
*/
export declare function registerSecuritizeInvestor(props: RegisterSecuritizeInvestorProps): Promise;
export interface RegisterMidasInvestorProps {
anvil: AnvilClient;
/**
* Investor EOA to greenlist
*/
investor: Address;
/**
* Midas access control admin, impersonated on the fork
* (MIDAS_ACL_ADMIN in periphery-v3/router-v3 foundry tests)
*/
admin: Address;
/**
* mToken address, the gateway is resolved from it
*/
token: Address;
/**
* Attached SDK, created from `anvil` when omitted
*/
sdk?: OnchainSDK;
marketConfigurators?: Address[];
logger?: ILogger;
}
/**
* Greenlists an investor in Midas access control (fake KYC) on an anvil fork.
*
* Replicates the `_grantGreenlistAdmin` / `_grantGreenlist` logic from the
* foundry tests (periphery-v3's WithdrawalCompressorMidasRWA.t.sol and
* router-v3's RouterLiveTestMidas.sol) by impersonating the Midas access
* control admin instead of pranking it.
*/
export declare function registerMidasInvestor(props: RegisterMidasInvestorProps): Promise;
export interface GreenlistMidasGatewayProps {
anvil: AnvilClient;
/**
* Investor EOA to greenlist
*/
investor: Address;
/**
* Midas access control admin, impersonated on the fork
* (MIDAS_ACL_ADMIN in periphery-v3/router-v3 foundry tests)
*/
admin: Address;
/**
* Midas gateway address
*/
gateway: Address;
logger?: ILogger;
}
/**
* Greenlists an investor in the access control of a single Midas gateway
*/
export declare function greenlistMidasGateway(props: GreenlistMidasGatewayProps): Promise;
/**
* Midas access control admin on mainnet. Holds the admin role of the greenlist
* operator role.
*/
export declare const DEFAULT_MIDAS_ADMIN: Address;
export interface RegisterRWAInvestorProps {
anvil: AnvilClient;
/**
* Attached SDK, markets and RWA factories are read from it
*/
sdk: OnchainSDK;
/**
* Wallet to pass the KYC of every RWA token
*/
investor: Address;
/**
* Midas access control admin, impersonated on the fork.
* Defaults to {@link DEFAULT_MIDAS_ADMIN}.
*/
midasAdmin?: Address;
logger?: ILogger;
}
export interface RWAKycFailure {
/**
* DSToken or Midas gateway that failed
*/
target: Address;
error: unknown;
}
export interface RegisterRWAInvestorResult {
/**
* DSTokens the investor was registered in
*/
securitizeTokens: Address[];
/**
* Midas gateways the investor was greenlisted in
*/
midasGateways: Address[];
failed: RWAKycFailure[];
}
/**
* Registers a wallet as an investor (fake KYC) in every Securitize DSToken and
* every Midas gateway of the markets loaded by `sdk`.
*
* Failures of a single token or gateway are collected and reported in the
* result instead of aborting the whole run.
*/
export declare function registerRWAInvestor(props: RegisterRWAInvestorProps): Promise;
//#endregion