dotbit-sdk-allin
Version:
A complete .bit SDK and utilities in TypeScript
81 lines (80 loc) • 2.25 kB
TypeScript
import { MessageTypes, TypedMessage } from '@metamask/eth-sig-util';
import { ChainType, CoinType, EvmChainId, PaymentMethodIDs } from '../const';
import { KeyInfo } from './BitIndexer.type';
export interface SignList {
sign_type: number;
sign_msg: string;
}
export interface TxsWithMMJsonSignedOrUnSigned {
sign_key: string;
sign_list: SignList[];
mm_json: TypedMessage<MessageTypes>;
}
export interface OwnerRawParam {
receiver_chain_type: number;
receiver_address: string;
}
export interface ManagerRawParam {
manager_address: string;
manager_chain_type: number;
}
export interface EditAccountParams<T> {
chain_type: ChainType;
evm_chain_id: EvmChainId;
address: string;
account: string;
raw_param: T;
}
export interface EditAccountRecord {
type: string;
key: string;
label: string;
value: string;
ttl: string;
}
export interface RecordsRawParam {
records: EditAccountRecord[];
}
export interface SubmitRegisterAccountOrderParam {
account: string;
keyInfo: KeyInfo;
registerYears: number;
paymentMethodID: PaymentMethodIDs;
crossTo?: CoinType;
inviterAccount?: string;
channelAccount?: string;
}
export interface SubmitRegisterAccountOrderRes {
order_id: string;
receipt_address: string;
amount: string;
token_id: string;
}
export interface SubmitRenewAccountOrderParam {
account: string;
keyInfo: KeyInfo;
paymentMethodID: PaymentMethodIDs;
payAddress: string;
renewYears: number;
}
export interface SubmitRenewAccountOrderRes {
order_id: string;
chain_type?: number;
receipt_address: string;
amount: string;
token_id: string;
}
export interface PayWithDotbitBalanceParam {
keyInfo: KeyInfo;
orderId: string;
evmChainId: EvmChainId;
}
export interface ReturnTrxHashToServiceParam {
account: string;
keyInfo: KeyInfo;
orderId: string;
txHash: string;
}
export type EditAccountManagerParam = EditAccountParams<ManagerRawParam>;
export type EditAccountOwnerParam = EditAccountParams<OwnerRawParam>;
export type EditAccountRecordsParam = EditAccountParams<RecordsRawParam>;