Skip to content

Commit

Permalink
Remove useless type in ipAsset
Browse files Browse the repository at this point in the history
  • Loading branch information
bonnie57 committed Apr 3, 2024
1 parent ff8275e commit 9a0fcee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 35 deletions.
7 changes: 1 addition & 6 deletions packages/core-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ export { DisputeClient } from "./resources/dispute";
export type { StoryConfig } from "./types/config";
export type { Hex, TypedData } from "./types/common";

export type {
RegisterRootIpRequest,
RegisterRootIpResponse,
RegisterDerivativeIpRequest,
RegisterDerivativeIpResponse,
} from "./types/resources/ipAsset";
export type { RegisterIpResponse, RegisterRequest } from "./types/resources/ipAsset";

export type {
MintLicenseRequest,
Expand Down
4 changes: 2 additions & 2 deletions packages/core-sdk/src/resources/ipAsset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { chain, parseToBigInt, waitTxAndFilterLog } from "../utils/utils";
import { getIPAssetRegistryConfig } from "../abi/config";
import { SupportedChainIds } from "../types/config";
import { handleError } from "../utils/errors";
import { RegisterRequest } from "../types/resources/ipAsset";
import { RegisterIpResponse, RegisterRequest } from "../types/resources/ipAsset";

export class IPAssetClient {
private readonly wallet: WalletClient;
Expand Down Expand Up @@ -41,7 +41,7 @@ export class IPAssetClient {
* @returns A Promise that resolves to an object containing the transaction hash and optional IP ID if waitForTxn is set to true.
* @emits IPRegistered (ipId, chainId, tokenContract, tokenId, resolverAddr, metadataProviderAddress, metadata)
*/
public async register(request: RegisterRequest) {
public async register(request: RegisterRequest): Promise<RegisterIpResponse> {
const tokenId = parseToBigInt(request.tokenId);
try {
const ipId = await this.isNFTRegistered(request.tokenContract, tokenId);
Expand Down
28 changes: 1 addition & 27 deletions packages/core-sdk/src/types/resources/ipAsset.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,7 @@
import { Hex } from "viem";

import { TxOptions } from "../options";

export type RegisterRootIpRequest = {
tokenContractAddress: Hex;
tokenId: string;
policyId?: string;
ipName?: string;
contentHash?: Hex;
uri?: string;
txOptions?: TxOptions;
};

export type RegisterRootIpResponse = {
txHash?: string;
ipId?: string;
};

export type RegisterDerivativeIpRequest = {
licenseIds: string[];
tokenContractAddress: Hex;
tokenId: string;
ipName?: string;
contentHash?: Hex;
uri?: string;
txOptions?: TxOptions;
};

export type RegisterDerivativeIpResponse = {
export type RegisterIpResponse = {
txHash?: string;
ipId?: string;
};
Expand Down

0 comments on commit 9a0fcee

Please sign in to comment.