/** * Internal wallet type helpers for near-kit. * * Defines lightweight structural types for external wallet libraries * (e.g. NEAR Connect) without taking a hard dependency on their packages. * * @internal */ import type { FinalExecutionOutcome, SignedMessage } from "../core/types.js"; /** * NEAR Connect action types, mirroring `@hot-labs/near-connect`'s * `types/transactions.ts` definitions. */ export type NearConnectCreateAccountAction = { type: "CreateAccount"; }; export type NearConnectDeployContractAction = { type: "DeployContract"; params: { code: Uint8Array; }; }; export type NearConnectFunctionCallAction = { type: "FunctionCall"; params: { methodName: string; args: Record; gas: string; deposit: string; }; }; export type NearConnectTransferAction = { type: "Transfer"; params: { deposit: string; }; }; export type NearConnectStakeAction = { type: "Stake"; params: { stake: string; publicKey: string; }; }; export type NearConnectAddKeyPermission = "FullAccess" | { receiverId: string; allowance?: string; methodNames?: string[]; }; export type NearConnectAddKeyAction = { type: "AddKey"; params: { publicKey: string; accessKey: { nonce?: number; permission: NearConnectAddKeyPermission; }; }; }; export type NearConnectDeleteKeyAction = { type: "DeleteKey"; params: { publicKey: string; }; }; export type NearConnectDeleteAccountAction = { type: "DeleteAccount"; params: { beneficiaryId: string; }; }; export type NearConnectUseGlobalContractAction = { type: "UseGlobalContract"; params: { contractIdentifier: { accountId: string; } | { codeHash: string; }; }; }; export type NearConnectDeployGlobalContractAction = { type: "DeployGlobalContract"; params: { code: Uint8Array; deployMode: "CodeHash" | "AccountId"; }; }; export type NearConnectAction = NearConnectCreateAccountAction | NearConnectDeployContractAction | NearConnectFunctionCallAction | NearConnectTransferAction | NearConnectStakeAction | NearConnectAddKeyAction | NearConnectDeleteKeyAction | NearConnectDeleteAccountAction | NearConnectUseGlobalContractAction | NearConnectDeployGlobalContractAction; /** * NEAR Connect wallet + connector interfaces (structural). */ /** * NEAR Connect's params for signDelegateActions (v0.9.0+). * Uses NearConnectAction[] instead of our Action[]. * @internal */ export type NearConnectSignDelegateActionsParams = { network?: string; signerId?: string; delegateActions: Array<{ actions: NearConnectAction[]; receiverId: string; }>; }; /** * NEAR Connect's response for signDelegateActions (v0.9.0+). * Returns base64-encoded signed delegate actions. * @internal */ export type NearConnectSignDelegateActionsResponse = { signedDelegateActions: string[]; }; export type NearConnectWallet = { manifest: { features?: { signDelegateActions?: boolean; }; }; getAccounts(data?: { network?: string; }): Promise>; signAndSendTransaction(params: { signerId?: string; receiverId: string; actions: NearConnectAction[]; network?: string; }): Promise; signMessage(params: { message: string; recipient: string; nonce: Uint8Array; network?: string; }): Promise; signDelegateActions(params: NearConnectSignDelegateActionsParams): Promise; }; export type NearConnectConnector = { wallet(): Promise; }; /** @deprecated Use {@link NearConnectCreateAccountAction} instead */ export type HotConnectCreateAccountAction = NearConnectCreateAccountAction; /** @deprecated Use {@link NearConnectDeployContractAction} instead */ export type HotConnectDeployContractAction = NearConnectDeployContractAction; /** @deprecated Use {@link NearConnectFunctionCallAction} instead */ export type HotConnectFunctionCallAction = NearConnectFunctionCallAction; /** @deprecated Use {@link NearConnectTransferAction} instead */ export type HotConnectTransferAction = NearConnectTransferAction; /** @deprecated Use {@link NearConnectStakeAction} instead */ export type HotConnectStakeAction = NearConnectStakeAction; /** @deprecated Use {@link NearConnectAddKeyPermission} instead */ export type HotConnectAddKeyPermission = NearConnectAddKeyPermission; /** @deprecated Use {@link NearConnectAddKeyAction} instead */ export type HotConnectAddKeyAction = NearConnectAddKeyAction; /** @deprecated Use {@link NearConnectDeleteKeyAction} instead */ export type HotConnectDeleteKeyAction = NearConnectDeleteKeyAction; /** @deprecated Use {@link NearConnectDeleteAccountAction} instead */ export type HotConnectDeleteAccountAction = NearConnectDeleteAccountAction; /** @deprecated Use {@link NearConnectAction} instead */ export type HotConnectAction = NearConnectAction; /** @deprecated Use {@link NearConnectSignDelegateActionsParams} instead */ export type HotConnectSignDelegateActionsParams = NearConnectSignDelegateActionsParams; /** @deprecated Use {@link NearConnectSignDelegateActionsResponse} instead */ export type HotConnectSignDelegateActionsResponse = NearConnectSignDelegateActionsResponse; /** @deprecated Use {@link NearConnectWallet} instead */ export type HotConnectWallet = NearConnectWallet; /** @deprecated Use {@link NearConnectConnector} instead */ export type HotConnectConnector = NearConnectConnector; //# sourceMappingURL=types.d.ts.map