Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement multicall #314

Merged
merged 16 commits into from
Nov 13, 2024
Merged
458 changes: 458 additions & 0 deletions packages/core-sdk/src/abi/generated.ts

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion packages/core-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export type {
RegisterIpAndAttachPilTermsRequest,
RegisterIpAndAttachPilTermsResponse,
MintAndRegisterIpAndMakeDerivativeRequest,
MintAndRegisterIpAndMakeDerivativeResponse,
GenerateCreatorMetadataParam,
IpCreator,
GenerateIpMetadataParam,
Expand All @@ -41,6 +42,14 @@ export type {
RegisterPilTermsAndAttachResponse,
MintAndRegisterIpAndMakeDerivativeWithLicenseTokensRequest,
RegisterIpAndMakeDerivativeWithLicenseTokensRequest,
BatchMintAndRegisterIpAssetWithPilTermsRequest,
BatchMintAndRegisterIpAssetWithPilTermsResponse,
BatchMintAndRegisterIpAndMakeDerivativeRequest,
BatchMintAndRegisterIpAndMakeDerivativeResponse,
BatchRegisterRequest,
BatchRegisterResponse,
BatchRegisterDerivativeRequest,
BatchRegisterDerivativeResponse,
} from "./types/resources/ipAsset";

export type {
Expand Down Expand Up @@ -86,6 +95,8 @@ export type {
CreateBatchPermissionSignatureRequest,
PermissionSignatureRequest,
PermissionSignatureResponse,
SignatureRequest,
SignatureResponse,
} from "./types/resources/permission";
export { AccessPermission } from "./types/resources/permission";
export type {
Expand Down Expand Up @@ -130,5 +141,5 @@ export type {
LicensingModulePredictMintingLicenseFeeResponse,
} from "./abi/generated";

export { getPermissionSignature } from "./utils/sign";
export { getPermissionSignature, getSignature } from "./utils/sign";
export { convertCIDtoHashIPFS, convertHashIPFStoCID } from "./utils/ipfs";
7 changes: 3 additions & 4 deletions packages/core-sdk/src/resources/ipAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ export class IPAccountClient {
* @param request - The request object containing necessary data to execute IP Account a transaction.
* @param request.ipId The Ip Id to get ip account.
* @param request.to The recipient of the transaction.
* @param request.value The amount of Ether to send.
* @param request.data The data to send along with the transaction.
* @param request.signer The signer of the transaction.
* @param request.deadline The deadline of the transaction signature.
* @param request.signature The signature of the transaction, EIP-712 encoded.
* @param request.txOptions - [Optional] transaction. This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
* @param request.value [Optional] The amount of Ether to send.
* @param request.txOptions [Optional] This extends `WaitForTransactionReceiptParameters` from the Viem library, excluding the `hash` property.
* @returns Tx hash for the transaction.
*/
public async executeWithSig(
Expand All @@ -87,13 +87,12 @@ export class IPAccountClient {

const req = {
to: getAddress(request.to, "request.to"),
value: BigInt(0),
value: BigInt(request.value || 0),
data: request.data,
signer: getAddress(request.signer, "request.signer"),
deadline: BigInt(request.deadline),
signature: request.signature,
};

if (request.txOptions?.encodedTxDataOnly) {
return { encodedTxData: ipAccountClient.executeWithSigEncode(req) };
} else {
Expand Down
Loading