Skip to content

Commit 0b5aa4d

Browse files
committed
fix: contract interface query response type
1 parent 729695f commit 0b5aa4d

File tree

2 files changed

+2
-30
lines changed

2 files changed

+2
-30
lines changed

packages/query/src/stacks/hiro-api-types.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ContractInterfaceResponse } from '@stacks/stacks-blockchain-api-types';
21
import type { AddressTokenOfferingLocked } from '@stacks/stacks-blockchain-api-types/generated';
32

43
export type SelectedKeys =
@@ -56,13 +55,6 @@ export interface AddressBalanceResponse {
5655
token_offering_locked?: AddressTokenOfferingLocked;
5756
}
5857

59-
export type ContractInterfaceResponseWithFunctions = Omit<
60-
ContractInterfaceResponse,
61-
'functions'
62-
> & {
63-
functions: ContractInterfaceFunction[];
64-
};
65-
6658
export interface FeeEstimation {
6759
fee: number;
6860
fee_rate: number;
@@ -85,23 +77,3 @@ export interface NonFungibleTokenHoldingListResult {
8577
repr: string;
8678
};
8779
}
88-
89-
// These types copied from `@stacks/rpc-client` package that is no longer
90-
// maintained. We define them here only to remove the package.
91-
/** @deprecated */
92-
interface BufferArg {
93-
buffer: {
94-
length: number;
95-
};
96-
}
97-
/** @deprecated */
98-
export interface ContractInterfaceFunctionArg {
99-
name: string;
100-
type: string | BufferArg;
101-
}
102-
/** @deprecated */
103-
export interface ContractInterfaceFunction {
104-
name: string;
105-
access: 'public' | 'private' | 'read_only';
106-
args: ContractInterfaceFunctionArg[];
107-
}

packages/query/src/stacks/stacks-client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type {
1212
ReadOnlyFunctionSuccessResponse,
1313
Transaction,
1414
} from '@stacks/stacks-blockchain-api-types';
15+
import { ClarityAbi } from '@stacks/transactions';
1516
import axios from 'axios';
1617

1718
import { DEFAULT_LIST_LIMIT } from '@leather.io/constants';
@@ -21,7 +22,6 @@ import { Paginated } from '../../types/api-types';
2122
import { getHiroApiRateLimiter } from '../rate-limiter/hiro-rate-limiter';
2223
import type {
2324
AddressBalanceResponse,
24-
ContractInterfaceResponseWithFunctions,
2525
NonFungibleTokenHoldingListResult,
2626
StacksTxFeeEstimation,
2727
} from './hiro-api-types';
@@ -245,7 +245,7 @@ export function stacksClient(basePath: string) {
245245
) {
246246
const resp = await rateLimiter.add(
247247
() =>
248-
axios.get<ContractInterfaceResponseWithFunctions>(
248+
axios.get<ClarityAbi>(
249249
`${basePath}/v2/contracts/interface/${contractAddress}/${contractName}`,
250250
{ signal }
251251
),

0 commit comments

Comments
 (0)