import { PublicKey, SignatureScheme } from '@mysten/sui.js/cryptography'; import { StreamTransactionType } from './stream'; export type SuiAddress = string; export type MessageType = 'TransactionBlock' | 'Personal'; export enum UserMSafeStatus { active = 'ACTIVE', pending = 'PENDING', ignored = 'IGNORED', } export interface IOwnerWithWeight { address: string; weight: number; } export type IOwnerWithWeightPK = IOwnerWithWeight & { publicKey: PublicKey; }; export interface PublicKeyWithWeight { publicKey: PublicKey; weight: number; } export interface PublicKeyWithSchema { publicKeyEncoded: string; schema: SignatureScheme; } export interface MSafeConfig extends MultiSigConfig { name: string; description?: string; } export interface MultiSigConfig { threshold: number; ownersWithWeight: PublicKeyWithWeight[]; creationNonce: number | undefined; } export interface CoinTransferIntention { recipient: SuiAddress; coinType: string; amount: string; } export interface ObjectTransferIntention { receiver: SuiAddress; objectType: string; objectId: string; } export interface PlainPayloadIntention { payload: string; } export interface RejectIntention { txType: 'Reject'; } export interface CoinTransferPayload { coinType: string; to: string; amount: bigint; } export interface ObjectTransferPayload { objectId: string; objectVersion: string; objectType: string; to: string; } export const TransactionDefaultApplication = 'msafe-core'; export enum TransactionType { Assets = 'Assets', NFT = 'NFT', Account = 'Account', Swap = 'Swap', Staking = 'Staking', Bridge = 'Bridge', Ending = 'Ending', Stream = 'Stream', Other = 'Other', } export const TransactionSubTypes = { assets: { coin: { send: 'SendCoin', receive: 'ReceiveCoin', }, object: { send: 'SendObject', receive: 'ReceiveObject', }, }, account: { creation: 'CreateAccount', }, others: { plain: 'PlainTransaction', }, stream: { create: StreamTransactionType.CREATE_STREAM, claim: StreamTransactionType.CLAIM, claimByProxy: StreamTransactionType.CLAIM_BY_PROXY, setAutoClaim: StreamTransactionType.SET_AUTO_CLAIM, cancel: StreamTransactionType.CANCEL, }, }; export enum OpAddressBookType { Delete = 'delete', Upsert = 'upsert', } export type UpdateAddressBookEntry = DeleteAddressBookEntry | UpsertAddressBookEntry; export interface DeleteAddressBookEntry { opType: OpAddressBookType.Delete; address: string; } export interface UpsertAddressBookEntry { opType: OpAddressBookType.Upsert; address: string; addressName: string; remark?: string; } export type JWTToken = string; export enum IntentionBuildStatus { Success = 'SUCCESS', Failed = 'FAILED', New = 'NEW', } export interface IMSafeConfig { address: string; name: string; description?: string; owners: IOwnerWithWeightPK[]; threshold: number; creationNonce: number; } export type TxIntention = CoinTransferIntention | ObjectTransferIntention | PlainPayloadIntention | any; export interface AggregatedAssets { coinType: string; sum: bigint; isReceive: boolean; }