Skip to content

Commit

Permalink
feat: wrap all utxo xpub methods in MaybeRpcResponse<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre committed Sep 19, 2023
1 parent 5637f03 commit 0b776a6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/adapter/src/utxo/bitcoincash/bitcoincash.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { PublicKey } from '@shapeshiftoss/hdwallet-core'
import type {
BitcoinCashBroadcastTransactionAdapterParams,
BitcoinCashBroadcastTransactionResponse,
BitcoinCashGetAddressAdapterParams,
BitcoinCashGetAddressResponse,
BitcoinCashGetPublicKeysResponse,
BitcoinCashSignTransactionAdapterParams,
BitcoinCashSignTransactionResponse,
} from '@shapeshiftoss/metamask-snaps-types'
Expand Down Expand Up @@ -35,7 +35,7 @@ export const BCHGetAddress = async (

export const BCHGetPublicKeys = async (
params: BitcoinCashGetAddressAdapterParams,
): Promise<(PublicKey | null)[]> => {
): Promise<BitcoinCashGetPublicKeysResponse> => {
const { addressParams, snapId } = params
try {
return await sendFlaskRPCRequest(
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter/src/utxo/dogecoin/dogecoin.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { PublicKey } from '@shapeshiftoss/hdwallet-core'
import type {
DogecoinBroadcastTransactionAdapterParams,
DogecoinBroadcastTransactionResponse,
DogecoinGetAddressAdapterParams,
DogecoinGetAddressResponse,
DogecoinGetPublicKeysResponse,
DogecoinSignTransactionAdapterParams,
DogecoinSignTransactionResponse,
} from '@shapeshiftoss/metamask-snaps-types'
Expand Down Expand Up @@ -33,7 +33,7 @@ export const dogecoinGetAddress = async (

export const dogecoinGetPublicKeys = async (
params: DogecoinGetAddressAdapterParams,
): Promise<(PublicKey | null)[]> => {
): Promise<DogecoinGetPublicKeysResponse> => {
const { addressParams, snapId } = params
try {
return await sendFlaskRPCRequest(
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter/src/utxo/litecoin/litecoin.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { PublicKey } from '@shapeshiftoss/hdwallet-core'
import type {
LitecoinBroadcastTransactionAdapterParams,
LitecoinBroadcastTransactionResponse,
LitecoinGetAddressAdapterParams,
LitecoinGetAddressResponse,
LitecoinGetPublicKeysResponse,
LitecoinSignTransactionAdapterParams,
LitecoinSignTransactionResponse,
} from '@shapeshiftoss/metamask-snaps-types'
Expand Down Expand Up @@ -33,7 +33,7 @@ export const LTCGetAddress = async (

export const LTCGetPublicKeys = async (
params: LitecoinGetAddressAdapterParams,
): Promise<(PublicKey | null)[]> => {
): Promise<LitecoinGetPublicKeysResponse> => {
const { addressParams, snapId } = params
try {
return await sendFlaskRPCRequest(
Expand Down
3 changes: 3 additions & 0 deletions packages/types/src/snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ export type BinanceGetAddressResponse = MaybeRpcResponse<BinanceAddress>
export type BitcoinCashGetAddressResponse = MaybeRpcResponse<BitcoinCashAddress>
export type BitcoinGetAddressResponse = MaybeRpcResponse<BitcoinAddress>
export type BitcoinGetPublicKeysResponse = MaybeRpcResponse<PublicKeys>
export type BitcoinCashGetPublicKeysResponse = MaybeRpcResponse<PublicKeys>
export type DogecoinGetPublicKeysResponse = MaybeRpcResponse<PublicKeys>
export type LitecoinGetPublicKeysResponse = MaybeRpcResponse<PublicKeys>
export type CosmosGetAddressResponse = MaybeRpcResponse<CosmosAddress>
export type DogecoinGetAddressResponse = MaybeRpcResponse<DogecoinAddress>
export type EthereumGetAddressResponse = MaybeRpcResponse<EthereumAddress>
Expand Down

0 comments on commit 0b776a6

Please sign in to comment.