Skip to content

Commit

Permalink
refactor: remove @stacks/rpc-client, deprecated package
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Nov 19, 2024
1 parent 10b876f commit 3dc1d21
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 162 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
},
"devDependencies": {
"@babel/runtime": "7.26.0",
"@commitlint/cli": "19.5.0",
"@commitlint/config-conventional": "19.5.0",
"@commitlint/cli": "19.6.0",
"@commitlint/config-conventional": "19.6.0",
"@leather.io/eslint-config": "workspace:*",
"@leather.io/prettier-config": "workspace:*",
"@leather.io/tsconfig-config": "workspace:*",
Expand Down
1 change: 0 additions & 1 deletion packages/query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"@stacks/common": "6.13.0",
"@stacks/connect": "7.4.0",
"@stacks/network": "6.13.0",
"@stacks/rpc-client": "1.0.3",
"@stacks/stacks-blockchain-api-types": "7.8.2",
"@stacks/transactions": "6.17.0",
"@tanstack/react-query": "5.59.16",
Expand Down
2 changes: 1 addition & 1 deletion packages/query/src/stacks/contract/contract.hooks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { TransactionPayload } from '@stacks/connect';
import { ContractInterfaceFunction } from '@stacks/rpc-client';
import { useQuery } from '@tanstack/react-query';

import { ContractInterfaceFunction } from '../hiro-api-types';
import { useStacksClient } from '../stacks-client';
import { createGetContractInterfaceQueryOptions } from './contract.query';

Expand Down
21 changes: 20 additions & 1 deletion packages/query/src/stacks/hiro-api-types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ContractInterfaceFunction } from '@stacks/rpc-client';
import { ContractInterfaceResponse } from '@stacks/stacks-blockchain-api-types';
import type { AddressTokenOfferingLocked } from '@stacks/stacks-blockchain-api-types/generated';

Expand Down Expand Up @@ -86,3 +85,23 @@ export interface NonFungibleTokenHoldingListResult {
repr: string;
};
}

// These types copied from `@stacks/rpc-client` package that is no longer
// maintained. We define them here only to remove the package.
/** @deprecated */
interface BufferArg {
buffer: {
length: number;
};
}
/** @deprecated */
export interface ContractInterfaceFunctionArg {
name: string;
type: string | BufferArg;

Check warning on line 100 in packages/query/src/stacks/hiro-api-types.ts

View workflow job for this annotation

GitHub Actions / lint-eslint

'BufferArg' is deprecated.

Check warning on line 100 in packages/query/src/stacks/hiro-api-types.ts

View workflow job for this annotation

GitHub Actions / lint-eslint

'BufferArg' is deprecated.
}
/** @deprecated */
export interface ContractInterfaceFunction {
name: string;
access: 'public' | 'private' | 'read_only';
args: ContractInterfaceFunctionArg[];

Check warning on line 106 in packages/query/src/stacks/hiro-api-types.ts

View workflow job for this annotation

GitHub Actions / lint-eslint

'ContractInterfaceFunctionArg' is deprecated.

Check warning on line 106 in packages/query/src/stacks/hiro-api-types.ts

View workflow job for this annotation

GitHub Actions / lint-eslint

'ContractInterfaceFunctionArg' is deprecated.
}
Loading

0 comments on commit 3dc1d21

Please sign in to comment.