Skip to content

Commit

Permalink
Enhance code
Browse files Browse the repository at this point in the history
  • Loading branch information
bonnie57 committed Nov 12, 2024
1 parent bf765e5 commit 827438d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core-sdk/src/resources/ipAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class IPAccountClient {
* @param request.deadline The deadline of the transaction signature.
* @param request.signature The signature of the transaction, EIP-712 encoded.
* @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.
* @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 Down
12 changes: 12 additions & 0 deletions packages/core-sdk/src/utils/sign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ export const getDeadline = (deadline?: bigint | number | string): bigint => {
return deadline ? timestamp + BigInt(deadline) : timestamp + 1000n;
};

/**
* Get the signature.
* @param param - The parameter object containing necessary data to get the signature.
* @param param.state - The IP Account's state.
* @param param.to - The recipient address.
* @param param.encodeData - The encoded data.
* @param param.wallet - The wallet client.
* @param param.verifyingContract - The verifying contract.
* @param param.deadline - The deadline.
* @param param.chainId - The chain ID.
* @returns A Promise that resolves to the signature.
*/
export const getSignature = async ({
state,
to,
Expand Down

0 comments on commit 827438d

Please sign in to comment.