diff --git a/packages/rpc/src/methods/get-addresses.ts b/packages/rpc/src/methods/get-addresses.ts index 95caf47e7..5b8d58305 100644 --- a/packages/rpc/src/methods/get-addresses.ts +++ b/packages/rpc/src/methods/get-addresses.ts @@ -4,13 +4,35 @@ import { DefineRpcMethod, RpcRequest, RpcResponse } from '../rpc'; export type PaymentTypes = 'p2pkh' | 'p2sh' | 'p2wpkh-p2sh' | 'p2wpkh' | 'p2tr'; -export interface BtcAddress extends AllowAdditionalProperties { +export interface BtcAddressBase extends AllowAdditionalProperties { + symbol: 'BTC'; type: PaymentTypes; address: string; + publicKey: string; + derivationPath: string; } +export interface NativeSegwitAddress extends BtcAddressBase { + type: 'p2wpkh'; +} + +export interface TaprootAddress extends BtcAddressBase { + type: 'p2tr'; + tweakedPublicKey: string; +} + +export type BtcAddress = NativeSegwitAddress | TaprootAddress; + +export interface StxAddress extends AllowAdditionalProperties { + symbol: 'STX'; + address: string; + publicKey: string; +} + +export type Address = BtcAddress | StxAddress; + export interface AddressResponseBody extends AllowAdditionalProperties { - addresses: BtcAddress[]; + addresses: Address[]; } export type GetAddressesRequest = RpcRequest<'getAddresses'>;