> ## Documentation Index
> Fetch the complete documentation index at: https://docs.datafdn.org/llms.txt
> Use this file to discover all available pages before exploring further.

# License

> LicenseClient를 사용하면 DATA Foundation 내에서 라이선스 조건과 토큰을 관리할 수 있습니다.

## LicenseClient

### 메서드

* attachLicenseTerms
* mintLicenseTokens
* registerPILTerms
* registerPilTermsAndAttach
* registerNonComSocialRemixingPIL
* registerCommercialUsePIL
* registerCommercialRemixPIL
* registerCreativeCommonsAttributionPIL
* getLicenseTerms
* predictMintingLicenseFee
* setLicensingConfig
* getLicensingConfig
* setMaxLicenseTokens

### attachLicenseTerms

IP에 라이선스 조건을 첨부합니다.

| Method               | Type                                                                 |
| -------------------- | -------------------------------------------------------------------- |
| `attachLicenseTerms` | `(request: AttachLicenseTermsRequest) => AttachLicenseTermsResponse` |

매개변수:

* `request.ipId`: 라이선스 조건이 첨부될 IP의 주소.
* `request.licenseTermsId`: 라이선스 조건의 ID.
* `request.licenseTemplate`: \[선택] 라이선스 템플릿의 주소.

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await client.license.attachLicenseTerms({
    licenseTermsId: "1",
    ipId: "0x4c1f8c1035a8cE379dd4ed666758Fb29696CF721",
  });

  if (response.success) {
    console.log(
      `Attached License Terms to IPA at transaction hash ${response.txHash}.`
    );
  } else {
    console.log(`License Terms already attached to this IPA.`);
  }
  ```

  ```typescript Request Type theme={null}
  export type AttachLicenseTermsRequest = {
    ipId: Address;
    licenseTermsId: string | number | bigint;
    licenseTemplate?: Address;
  };
  ```

  ```typescript Response Type theme={null}
  export type AttachLicenseTermsResponse = {
    txHash?: Hex;
    encodedTxData?: EncodedTxData;
    success?: boolean;
  };
  ```
</CodeGroup>

### mintLicenseTokens

[License Terms](/concepts/licensing-module/license-terms)를 기반으로 IP Asset을 사용할 수 있는 권한을 부여하는 [License Tokens](/concepts/licensing-module/license-token)를 민팅합니다. 라이선스 토큰은 `receiver`에게 민팅됩니다.

라이선스 토큰은 `licenseTermsId`가 이미 IP Asset에 첨부되어 있는 경우에만 민팅될 수 있어, 이를 공개적으로 사용 가능한 라이선스로 만든다는 점에 유의하세요. 그러나 IP 소유자는 IP Asset에 첨부되지 않은 `licenseTermsId`로 라이선스 토큰을 민팅함으로써 [private license](/concepts/licensing-module/license-token#private-licenses)를 민팅할 수 있습니다.

<Warning>
  호출자가 민팅 수수료를 지불해야 할 수도 있습니다. 이는 라이선스 조건이나 IP 소유자에 의해 구성됩니다. 민팅 수수료는 라이선스 조건에 지정되거나 IP 소유자가 구성한 민팅 수수료 토큰으로 지불됩니다. IP 소유자는 자신의 IP의 민팅 수수료를 구성하거나 민팅 수수료를 결정하는 민팅 수수료 모듈을 구성할 수 있습니다.
</Warning>

<Frame>
  <img src="https://mintcdn.com/story/Ci-RgMKFKns3XzFq/images/concepts/private-licenses.png?fit=max&auto=format&n=Ci-RgMKFKns3XzFq&q=85&s=41fbeab6460274071950c739ed5cbd75" alt="A diagram showing how private licenses are minted." width="2026" height="1312" data-path="images/concepts/private-licenses.png" />
</Frame>

| Method              | Type                                                                        |
| ------------------- | --------------------------------------------------------------------------- |
| `mintLicenseTokens` | `(request: MintLicenseTokensRequest) => Promise<MintLicenseTokensResponse>` |

매개변수:

* `request.licensorIpId`: 라이선서 IP ID.
* `request.licenseTermsId`: 라이선스 템플릿 내 라이선스 조건의 ID.
* `request.maxMintingFee`: \[선택] 라이선스 민팅 시 지불할 최대 민팅 수수료.
* `request.maxRevenueShare`: \[선택] 라이선스 민팅 시 지불할 최대 수익 지분.
* `request.amount`: \[선택] 민팅할 라이선스 토큰의 양.
* `request.receiver`: \[선택] 수신자의 주소.
* `request.licenseTemplate`: \[선택] 라이선스 템플릿의 주소.

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await client.license.mintLicenseTokens({
    licenseTermsId: "1",
    licensorIpId: "0xC92EC2f4c86458AFee7DD9EB5d8c57920BfCD0Ba",
    receiver: "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955", // optional
    amount: 1,
  });

  console.log(
    `License Token minted at transaction hash ${response.txHash}, License IDs: ${response.licenseTokenIds}`
  );
  ```

  ```typescript Request Type theme={null}
  export type MintLicenseTokensRequest = {
    licensorIpId: Address;
    licenseTermsId: string | number | bigint;
    licenseTemplate?: Address;
    maxMintingFee: bigint | string | number;
    maxRevenueShare: number | string;
    amount?: number | string | bigint;
    receiver?: Address;
  } & WithWipOptions;
  ```

  ```typescript Response Type theme={null}
  export type MintLicenseTokensResponse = {
    licenseTokenIds?: bigint[];
    receipt?: TransactionReceipt;
    txHash?: Hex;
    encodedTxData?: EncodedTxData;
  };
  ```
</CodeGroup>

### registerPILTerms

새 라이선스 조건을 등록하고 새로 등록된 라이선스 조건의 ID를 반환합니다.

| Method             | Type                                                                 |
| ------------------ | -------------------------------------------------------------------- |
| `registerPILTerms` | `(request: RegisterPILTermsRequest) => Promise<RegisterPILResponse>` |

매개변수:

* 예상 매개변수: 여기에 모든 예상 매개변수를 나열하는 대신, [이 파일](https://github.com/thedatafoundation/sdk/blob/main/packages/core-sdk/src/types/resources/license.ts)에서 `LicenseTerms` 타입을 참조하세요. 이들은 모두 [PIL Terms](/concepts/programmable-ip-license/pil-terms)에서 가져옵니다.

<CodeGroup>
  ```typescript TypeScript theme={null}
  import {
    LicenseTerms,
    PILFlavor,
    WIP_TOKEN_ADDRESS,
  } from "@story-protocol/core-sdk";
  import { zeroAddress, parseEther } from "viem";

  // OPTION 1. If you want to specify all the terms

  const licenseTerms: LicenseTerms = {
    transferable: false,
    royaltyPolicy: "0xBe54FB168b3c982b7AaE60dB6CF75Bd8447b390E", // RoyaltyPolicyLAP address from https://docs.datafdn.org/docs/deployed-smart-contracts
    defaultMintingFee: 0n,
    expiration: 0n,
    commercialUse: false,
    commercialAttribution: false,
    commercializerChecker: zeroAddress,
    commercializerCheckerData: "0x",
    commercialRevShare: 10, // 10%
    commercialRevCeiling: 0n,
    derivativesAllowed: true,
    derivativesAttribution: false,
    derivativesApproval: false,
    derivativesReciprocal: false,
    derivativeRevCeiling: 0n,
    currency: "0x1514000000000000000000000000000000000000", // $WIP address from https://docs.datafdn.org/docs/deployed-smart-contracts
    uri: "",
  };

  const response = await client.license.registerPILTerms({
    ...licenseTerms,
  });

  console.log(
    `PIL Terms registered at transaction hash ${response.txHash}, License Terms ID: ${response.licenseTermsId}`
  );

  // OPTION 2. If you want to use a PIL flavor for convenience

  const response = await client.license.registerPILTerms(
    PILFlavor.commercialRemix({
      commercialRevShare: 5,
      defaultMintingFee: parseEther("1"), // 1 $DATA
      currency: WIP_TOKEN_ADDRESS,
    })
  );

  console.log(
    `PIL Terms registered at transaction hash ${response.txHash}, License Terms ID: ${response.licenseTermsId}`
  );
  ```

  ```typescript Request Type theme={null}
  export type RegisterPILTermsRequest = Omit<
    LicenseTerms,
    | "defaultMintingFee"
    | "expiration"
    | "commercialRevCeiling"
    | "derivativeRevCeiling"
  > & {
    defaultMintingFee: bigint | string | number;
    expiration: bigint | string | number;
    commercialRevCeiling: bigint | string | number;
    derivativeRevCeiling: bigint | string | number;
  };

  export type LicenseTerms = {
    /*Indicates whether the license is transferable or not.*/
    transferable: boolean;
    /*The address of the royalty policy contract which required to DATA Foundation in advance.*/
    royaltyPolicy: Address;
    /*The default minting fee to be paid when minting a license.*/
    defaultMintingFee: bigint;
    /*The expiration period of the license.*/
    expiration: bigint;
    /*Indicates whether the work can be used commercially or not.*/
    commercialUse: boolean;
    /*Whether attribution is required when reproducing the work commercially or not.*/
    commercialAttribution: boolean;
    /*Commercializers that are allowed to commercially exploit the work. If zero address, then no restrictions is enforced.*/
    commercializerChecker: Address;
    /*The data to be passed to the commercializer checker contract.*/
    commercializerCheckerData: Address;
    /**Percentage of revenue that must be shared with the licensor. Must be from 0-100.*/
    commercialRevShare: number;
    /*The maximum revenue that can be generated from the commercial use of the work.*/
    commercialRevCeiling: bigint;
    /*Indicates whether the licensee can create derivatives of his work or not.*/
    derivativesAllowed: boolean;
    /*Indicates whether attribution is required for derivatives of the work or not.*/
    derivativesAttribution: boolean;
    /*Indicates whether the licensor must approve derivatives of the work before they can be linked to the licensor IP ID or not.*/
    derivativesApproval: boolean;
    /*Indicates whether the licensee must license derivatives of the work under the same terms or not.*/
    derivativesReciprocal: boolean;
    /*The maximum revenue that can be generated from the derivative use of the work.*/
    derivativeRevCeiling: bigint;
    /*The ERC20 token to be used to pay the minting fee. the token must be registered in story protocol.*/
    currency: Address;
    /*The URI of the license terms, which can be used to fetch the offchain license terms.*/
    uri: string;
  };
  ```

  ```typescript Response Type theme={null}
  export type RegisterPILResponse = {
    licenseTermsId?: bigint;
    txHash?: Hex;
    encodedTxData?: EncodedTxData;
  };
  ```
</CodeGroup>

### registerPilTermsAndAttach

Programmable IP License Terms을 등록하고(아직 등록되지 않은 경우) IP에 첨부합니다.

| Method                      | Type                                                                                        |
| --------------------------- | ------------------------------------------------------------------------------------------- |
| `registerPilTermsAndAttach` | `(request: RegisterPilTermsAndAttachRequest) => Promise<RegisterPilTermsAndAttachResponse>` |

매개변수:

* `request.ipId`: IP의 ID.
* `request.licenseTermsData[]`: 첨부할 라이선스 조건 배열.
  * `request.licenseTermsData.terms`: [LicenseTerms type](https://github.com/thedatafoundation/sdk/blob/main/packages/core-sdk/src/types/resources/license.ts#L26)을 참조하세요.
  * `request.licenseTermsData.licensingConfig`: \[선택] [LicensingConfig type](https://github.com/thedatafoundation/sdk/blob/main/packages/core-sdk/src/types/common.ts#L15)을 참조하세요. 제공되지 않으면 [여기](https://github.com/thedatafoundation/sdk/blob/main/packages/core-sdk/src/utils/validateLicenseConfig.ts)에 표시된 기본값으로 설정됩니다.
* `request.deadline`: \[선택] 서명의 마감 시간(밀리초). **기본값은 1000**.

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { PILFlavor, WIP_TOKEN_ADDRESS } from "@story-protocol/core-sdk";
  import { parseEther } from "viem";

  const response = await client.license.registerPilTermsAndAttach({
    ipId: "0x4c1f8c1035a8cE379dd4ed666758Fb29696CF721",
    licenseTermsData: [
      {
        terms: PILFlavor.commercialRemix({
          commercialRevShare: 5,
          defaultMintingFee: parseEther("1"), // 1 $DATA
          currency: WIP_TOKEN_ADDRESS,
        }),
      },
    ],
  });
  console.log(`License Terms ${response.licenseTermsId} attached to IP Asset.`);
  ```

  ```typescript Request Type theme={null}
  export type RegisterPilTermsAndAttachRequest = {
    ipId: Address;
    licenseTermsData: LicenseTermsData<
      RegisterPILTermsRequest,
      LicensingConfig
    >[];
    deadline?: string | number | bigint;
  };
  ```

  ```typescript Response Type theme={null}
  export type RegisterPilTermsAndAttachResponse = {
    txHash?: Hex;
    encodedTxData?: EncodedTxData;
    licenseTermsIds?: bigint[];
  };
  ```
</CodeGroup>

### registerNonComSocialRemixingPIL

레지스트리에 PIL 비상업적 소셜 리믹스 라이선스를 등록하기 위한 편리한 함수.

<Warning>
  이 함수를 호출할 이유가 없습니다. Non-Commercial Social Remixing 조건은 이미 우리 프로토콜의 `licenseTermdId = 1`로 등록되어 있습니다. 다시 등록할 이유가 없습니다.
</Warning>

| Method                            | Type                                                                                 |
| --------------------------------- | ------------------------------------------------------------------------------------ |
| `registerNonComSocialRemixingPIL` | `(request?: RegisterNonComSocialRemixingPILRequest) => Promise<RegisterPILResponse>` |

매개변수:

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await client.license.registerNonComSocialRemixingPIL({});

  console.log(
    `PIL Terms registered at transaction hash ${response.txHash}, License Terms ID: ${response.licenseTermsId}`
  );
  ```

  ```typescript Request Type theme={null}
  export type RegisterNonComSocialRemixingPILRequest = {};
  ```

  ```typescript Response Type theme={null}
  export type RegisterPILResponse = {
    licenseTermsId?: bigint;
    txHash?: Hex;
    encodedTxData?: EncodedTxData;
  };
  ```
</CodeGroup>

### registerCommercialUsePIL

레지스트리에 PIL 상업적 사용 라이선스를 등록하기 위한 편리한 함수.

| Method                     | Type                                                                         |
| -------------------------- | ---------------------------------------------------------------------------- |
| `registerCommercialUsePIL` | `(request: RegisterCommercialUsePILRequest) => Promise<RegisterPILResponse>` |

매개변수:

* `request.defaultMintingFee`: 라이선스 민팅 시 지불할 수수료.
* `request.currency`: 민팅 수수료를 지불하는 데 사용되는 ERC20 토큰이며 토큰은 DATA Foundation의 프로토콜에 등록되어 있어야 합니다.
* `request.royaltyPolicyAddress`: \[선택] 로열티 정책 컨트랙트의 주소, 기본값은 LAP입니다.

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { parseEther } from "viem";

  const commercialUseParams = {
    currency: "0x1514000000000000000000000000000000000000", // $WIP address from https://docs.datafdn.org/docs/deployed-smart-contracts
    defaultMintingFee: parseEther("1"), // 1 $WIP
    royaltyPolicyAddress: "0xBe54FB168b3c982b7AaE60dB6CF75Bd8447b390E", // RoyaltyPolicyLAP address from https://docs.datafdn.org/docs/deployed-smart-contracts
  };

  const response = await client.license.registerCommercialUsePIL({
    ...commercialUseParams,
  });

  console.log(
    `PIL Terms registered at transaction hash ${response.txHash}, License Terms ID: ${response.licenseTermsId}`
  );
  ```

  ```typescript Request Type theme={null}
  export type RegisterCommercialUsePILRequest = {
    defaultMintingFee: string | number | bigint;
    currency: Address;
    royaltyPolicyAddress?: Address;
  };
  ```

  ```typescript Response Type theme={null}
  export type RegisterPILResponse = {
    licenseTermsId?: bigint;
    txHash?: Hex;
    encodedTxData?: EncodedTxData;
  };
  ```
</CodeGroup>

### registerCommercialRemixPIL

레지스트리에 PIL 상업적 리믹스 라이선스를 등록하기 위한 편리한 함수.

| Method                       | Type                                                                           |
| ---------------------------- | ------------------------------------------------------------------------------ |
| `registerCommercialRemixPIL` | `(request: RegisterCommercialRemixPILRequest) => Promise<RegisterPILResponse>` |

매개변수:

* `request.defaultMintingFee`: 라이선스 민팅 시 지불할 수수료.
* `request.commercialRevShare`: 라이선서와 공유해야 하는 수익의 백분율.
* `request.currency`: 민팅 수수료를 지불하는 데 사용되는 ERC20 토큰이며 토큰은 DATA Foundation의 프로토콜에 등록되어 있어야 합니다.
* `request.royaltyPolicyAddress`: \[선택] 로열티 정책 컨트랙트의 주소, 기본값은 LAP입니다.

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { parseEther } from "viem";

  const commercialRemixParams = {
    currency: "0x1514000000000000000000000000000000000000", // $WIP address from https://docs.datafdn.org/docs/deployed-smart-contracts
    defaultMintingFee: parseEther("1"), // 1 $WIP
    royaltyPolicyAddress: "0xBe54FB168b3c982b7AaE60dB6CF75Bd8447b390E", // RoyaltyPolicyLAP address from https://docs.datafdn.org/docs/deployed-smart-contracts
    commercialRevShare: 10, // 10%
  };

  const response = await client.license.registerCommercialRemixPIL({
    ...commercialRemixParams,
  });

  console.log(
    `PIL Terms registered at transaction hash ${response.txHash}, License Terms ID: ${response.licenseTermsId}`
  );
  ```

  ```typescript Request Type theme={null}
  export type RegisterCommercialRemixPILRequest = {
    defaultMintingFee: string | number | bigint;
    commercialRevShare: number;
    currency: Address;
    royaltyPolicyAddress?: Address;
  };
  ```

  ```typescript Response Type theme={null}
  export type RegisterPILResponse = {
    licenseTermsId?: bigint;
    txHash?: Hex;
    encodedTxData?: EncodedTxData;
  };
  ```
</CodeGroup>

### registerCreativeCommonsAttributionPIL

레지스트리에 PIL 크리에이티브 커먼즈 저작자 표시 라이선스를 등록하기 위한 편리한 함수.

| Method                                  | Type                                                                                      |
| --------------------------------------- | ----------------------------------------------------------------------------------------- |
| `registerCreativeCommonsAttributionPIL` | `(request: RegisterCreativeCommonsAttributionPILRequest) => Promise<RegisterPILResponse>` |

매개변수:

* `request.currency`: 민팅 수수료를 지불하는 데 사용되는 ERC20 토큰이며 토큰은 DATA Foundation의 프로토콜에 등록되어 있어야 합니다.
* `request.royaltyPolicyAddress`: \[선택] 로열티 정책 컨트랙트의 주소, 기본값은 LAP입니다.

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await client.license.registerCreativeCommonsAttributionPIL({
    currency: "0x1514000000000000000000000000000000000000", // $WIP address from https://docs.datafdn.org/docs/deployed-smart-contracts
    royaltyPolicyAddress: "0xBe54FB168b3c982b7AaE60dB6CF75Bd8447b390E", // RoyaltyPolicyLAP address from https://docs.datafdn.org/docs/deployed-smart-contracts
  });

  console.log(
    `PIL Terms registered at transaction hash ${response.txHash}, License Terms ID: ${response.licenseTermsId}`
  );
  ```

  ```typescript Request Type theme={null}
  export type RegisterCreativeCommonsAttributionPILRequest = {
    currency: Address;
    royaltyPolicyAddress?: Address;
  };
  ```

  ```typescript Response Type theme={null}
  export type RegisterPILResponse = {
    licenseTermsId?: bigint;
    txHash?: Hex;
    encodedTxData?: EncodedTxData;
  };
  ```
</CodeGroup>

### getLicenseTerms

주어진 ID의 라이선스 조건을 가져옵니다.

| Method            | Type                                                                                               |
| :---------------- | :------------------------------------------------------------------------------------------------- |
| `getLicenseTerms` | `(selectedLicenseTermsId: string \| number \| bigint) => PiLicenseTemplateGetLicenseTermsResponse` |

매개변수:

* `selectedLicenseTermsId`: 라이선스 조건의 ID.

```typescript Response Type theme={null}
export type PiLicenseTemplateGetLicenseTermsResponse = {
  terms: {
    transferable: boolean;
    royaltyPolicy: Address;
    defaultMintingFee: bigint;
    expiration: bigint;
    commercialUse: boolean;
    commercialAttribution: boolean;
    commercializerChecker: Address;
    commercializerCheckerData: Hex;
    commercialRevShare: number;
    commercialRevCeiling: bigint;
    derivativesAllowed: boolean;
    derivativesAttribution: boolean;
    derivativesApproval: boolean;
    derivativesReciprocal: boolean;
    derivativeRevCeiling: bigint;
    currency: Address;
    uri: string;
  };
};
```

### predictMintingLicenseFee

주어진 IP와 라이선스 조건에 대한 라이선스 민팅 수수료를 사전 계산합니다. 이 함수는 라이선스 토큰을 민팅하기 전에 라이선스 민팅 수수료를 계산하는 데 사용할 수 있습니다.

| Method                     | Type                                                                                            |
| -------------------------- | ----------------------------------------------------------------------------------------------- |
| `predictMintingLicenseFee` | `(request: PredictMintingLicenseFeeRequest) => LicensingModulePredictMintingLicenseFeeResponse` |

매개변수:

* `request.licensorIpId`: 라이선서의 IP ID.
* `request.licenseTermsId`: 라이선스 조건의 ID.
* `request.amount`: 민팅할 라이선스 토큰의 양.
* `request.licenseTemplate`: \[선택] 라이선스 템플릿의 주소, 기본값은 Programmable IP License입니다.
* `request.receiver`: \[선택] 수신자의 주소, 기본값은 지갑 주소입니다.

```typescript Response Type theme={null}
export type LicensingModulePredictMintingLicenseFeeResponse = {
  currencyToken: Address;
  tokenAmount: bigint;
};
```

### setLicensingConfig

IP의 특정 라이선스 조건에 대한 라이선싱 구성을 설정합니다.

| Method               | Type                                                                 |
| -------------------- | -------------------------------------------------------------------- |
| `setLicensingConfig` | `(request: SetLicensingConfigRequest) => SetLicensingConfigResponse` |

매개변수:

* `request.ipId`: 구성이 설정되는 IP의 주소.
* `request.licenseTermsId`: 라이선스 템플릿 내 라이선스 조건의 ID.
* `request.licenseTemplate`: \[선택] 사용된 라이선스 템플릿의 주소. 지정되지 않으면, 구성은 모든 라이선스에 적용됩니다.
* `request.licensingConfig`: 라이선스에 대한 라이선싱 구성.
  * `request.licensingConfig.isSet`: 구성이 설정되었는지 여부.
  * `request.licensingConfig.mintingFee`: 라이선스 토큰을 민팅할 때 지불할 민팅 수수료.
  * `request.licensingConfig.hookData`: 라이선싱 훅에 의해 사용될 데이터.
  * `request.licensingConfig.licensingHook`: 라이선싱 모듈의 훅 컨트랙트 주소, 또는 없는 경우 address(0).
  * `request.licensingConfig.commercialRevShare`: 상업적 수익 지분 백분율 (0에서 100까지).
  * `request.licensingConfig.disabled`: 라이선싱이 비활성화되었는지 여부. true이면 라이선스를 민팅할 수 없으며 더 이상 파생물을 첨부할 수 없습니다.
  * `request.licensingConfig.expectMinimumGroupRewardShare`: 그룹의 보상 지분의 최소 백분율 (0에서 100까지).
  * `request.licensingConfig.expectGroupRewardPool`: 예상되는 그룹 보상 풀의 주소. IP는 이 지정된 보상 풀 주소를 가진 그룹에만 추가될 수 있으며, IP가 어떤 그룹에도 추가되기를 원하지 않으면 zero address입니다.

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { parseEther, zeroAddress } from "viem";

  const response = await client.license.setLicensingConfig({
    ipId: "0x4c1f8c1035a8cE379dd4ed666758Fb29696CF721",
    licenseTermsId: 1,
    licensingConfig: {
      isSet: true,
      mintingFee: parseEther("1"),
      licensingHook: "0xaBAD364Bfa41230272b08f171E0Ca939bD600478",
      hookData: "0x",
      commercialRevShare: 10,
      disabled: false,
      expectMinimumGroupRewardShare: 0,
      expectGroupRewardPool: zeroAddress,
    },
  });
  ```

  ```typescript Request Type theme={null}
  export type SetLicensingConfigRequest = GetLicensingConfigRequest & {
    /** The licensing configuration for the license. */
    licensingConfig: LicensingConfigInput;
  };

  export type GetLicensingConfigRequest = {
    /** The address of the IP for which the configuration is being set. */
    ipId: Address;
    /** The ID of the license terms within the license template. */
    licenseTermsId: number | bigint;
    /**
     * The address of the license template.
     * Defaults to {@link https://docs.datafdn.org/docs/programmable-ip-license | PIL} address if not provided.
     */
    licenseTemplate?: Address;
  };

  export type LicensingConfigInput = {
    /** Whether the licensing configuration is active. If false, the configuration is ignored. */
    isSet: boolean;
    /** The minting fee to be paid when minting license tokens. */
    mintingFee: bigint | string | number;
    /**
     * The licensingHook is an address to a smart contract that implements the `ILicensingHook` interface.
     * This contract's `beforeMintLicenseTokens` function is executed before a user mints a License Token,
     * allowing for custom validation or business logic to be enforced during the minting process.
     * For detailed documentation on licensing hook, visit {@link https://docs.datafdn.org/concepts/hooks#licensing-hooks}
     */
    licensingHook: Address;
    /**
     * The data to be used by the licensing hook.
     * Set to a zero hash if no data is provided.
     */
    hookData: Hex;
    /** The commercial revenue share percentage (from 0 to 100%, represented as 100_000_000). */
    commercialRevShare: number | string;
    /** Whether the licensing is disabled or not. If this is true, then no licenses can be minted and no more derivatives can be attached at all. */
    disabled: boolean;
    /** The minimum percentage of the group’s reward share (from 0 to 100%, represented as 100_000_000) that can be allocated to the IP when it is added to the group. */
    expectMinimumGroupRewardShare: number | string;
    /** The address of the expected group reward pool. The IP can only be added to a group with this specified reward pool address, or zero address if the IP does not want to be added to any group. */
    expectGroupRewardPool: Address;
  };
  ```

  ```typescript Response Type theme={null}
  export type SetLicensingConfigResponse = {
    txHash?: Hex;
    encodedTxData?: EncodedTxData;
    success?: boolean;
  };
  ```
</CodeGroup>

### getLicensingConfig

IP의 특정 라이선스 조건에 대한 라이선싱 구성을 가져옵니다.

| Method               | Type                                                      |
| -------------------- | --------------------------------------------------------- |
| `getLicensingConfig` | `(request: GetLicensingConfigRequest) => LicensingConfig` |

매개변수:

* `request.ipId`: 구성이 조회되는 IP의 주소.
* `request.licenseTermsId`: 라이선스 템플릿 내 라이선스 조건의 ID.
* `request.licenseTemplate`: \[선택] 사용된 라이선스 템플릿의 주소.

<CodeGroup>
  ```typescript TypeScript theme={null}
  const licensingConfig = await client.license.getLicensingConfig({
    ipId: "0x4c1f8c1035a8cE379dd4ed666758Fb29696CF721",
    licenseTermsId: 1,
  });
  ```

  ```typescript Request Type theme={null}
  export type GetLicensingConfigRequest = {
    /** The address of the IP for which the configuration is being set. */
    ipId: Address;
    /** The ID of the license terms within the license template. */
    licenseTermsId: number | bigint;
    /**
     * The address of the license template.
     * Defaults to {@link https://docs.datafdn.org/docs/programmable-ip-license | PIL} address if not provided.
     */
    licenseTemplate?: Address;
  };
  ```

  ```typescript Response Type theme={null}
  export type LicensingConfig = {
    /** Whether the licensing configuration is active. If false, the configuration is ignored. */
    isSet: boolean;
    /** The minting fee to be paid when minting license tokens. */
    mintingFee: bigint;
    /**
     * The licensingHook is an address to a smart contract that implements the `ILicensingHook` interface.
     * This contract's `beforeMintLicenseTokens` function is executed before a user mints a License Token,
     * allowing for custom validation or business logic to be enforced during the minting process.
     * For detailed documentation on licensing hook, visit {@link https://docs.datafdn.org/concepts/hooks#licensing-hooks}
     */
    licensingHook: Address;
    /**
     * The data to be used by the licensing hook.
     * Set to a zero hash if no data is provided.
     */
    hookData: Hex;
    /** The commercial revenue share percentage (from 0 to 100%, represented as 100_000_000). */
    commercialRevShare: number;
    /** Whether the licensing is disabled or not. If this is true, then no licenses can be minted and no more derivatives can be attached at all. */
    disabled: boolean;
    /** The minimum percentage of the group's reward share (from 0 to 100%, represented as 100_000_000) that can be allocated to the IP when it is added to the group. */
    expectMinimumGroupRewardShare: number;
    /** The address of the expected group reward pool. The IP can only be added to a group with this specified reward pool address, or zero address if the IP does not want to be added to any group. */
    expectGroupRewardPool: Address;
  };
  ```
</CodeGroup>

### setMaxLicenseTokens

특정 라이선스에 대한 최대 라이선스 토큰 제한을 설정합니다.

이 메서드는 현재 라이선싱 훅이 `TotalLicenseTokenLimitHook`로 설정되어 있지 않은 경우 [TotalLicenseTokenLimitHook](https://github.com/thedatafoundation/protocol-periphery-v1/blob/release/1.3/contracts/hooks/TotalLicenseTokenLimitHook.sol) 컨트랙트를 사용하도록 라이선싱 훅을 자동으로 구성하고, 지정된 제한으로 최대 라이선스 토큰을 설정합니다.

| Method                | Type                                                                    |
| --------------------- | ----------------------------------------------------------------------- |
| `setMaxLicenseTokens` | `(request: SetMaxLicenseTokensRequest) => Promise<TransactionResponse>` |

매개변수:

* `request.ipId`: 구성이 설정되는 IP의 주소.
* `request.licenseTermsId`: 라이선스 템플릿 내 라이선스 조건의 ID.
* `request.maxLicenseTokens`: 총 라이선스 토큰 제한, 0은 제한 없음을 의미합니다.
* `request.licenseTemplate`: \[선택] 사용된 라이선스 템플릿의 주소.

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await client.license.setMaxLicenseTokens({
    ipId: "0x4c1f8c1035a8cE379dd4ed666758Fb29696CF721",
    licenseTermsId: 1,
    maxLicenseTokens: 1000,
  });

  console.log(`Max license tokens set at transaction hash ${response.txHash}`);
  ```

  ```typescript Request Type theme={null}
  export type SetMaxLicenseTokensRequest = GetLicensingConfigRequest & {
    /** The total license token limit, 0 means no limit */
    maxLicenseTokens: bigint | number;
  };

  export type GetLicensingConfigRequest = {
    /** The address of the IP for which the configuration is being set. */
    ipId: Address;
    /** The ID of the license terms within the license template. */
    licenseTermsId: number | bigint;
    /**
     * The address of the license template.
     * Defaults to {@link https://docs.datafdn.org/docs/programmable-ip-license | PIL} address if not provided.
     */
    licenseTemplate?: Address;
  };
  ```

  ```typescript Response Type theme={null}
  export type TransactionResponse = {
    txHash?: Hex;
    encodedTxData?: EncodedTxData;
    success?: boolean;
  };
  ```
</CodeGroup>
