signet.js 0.0.10-beta1 → 0.0.10-beta3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signet.js",
3
- "version": "0.0.10-beta1",
3
+ "version": "0.0.10-beta3",
4
4
  "description": "A TypeScript library for handling multi-chain transactions and signatures using Signet MPC",
5
5
  "type": "module",
6
6
  "exports": {
package/types/index.d.cts CHANGED
@@ -934,16 +934,6 @@ interface SignatureErrorData {
934
934
  responder: string;
935
935
  error: string;
936
936
  }
937
- interface RequestIdArgs {
938
- address: Address;
939
- payload: Hex;
940
- path: string;
941
- keyVersion: number;
942
- chainId: bigint;
943
- algo: string;
944
- dest: string;
945
- params: string;
946
- }
947
937
 
948
938
  /**
949
939
  * Implementation of the ChainSignatureContract for EVM chains.
@@ -1001,33 +991,27 @@ declare class ChainSignatureContract extends ChainSignatureContract$2 {
1001
991
  /**
1002
992
  * Generates the request ID for a signature request allowing to track the response.
1003
993
  *
1004
- * @param request - The signature request object containing:
1005
- * @param request.address - The contract/wallet address calling the signing contract
1006
- * @param request.payload - The data payload to be signed as a hex string
1007
- * @param request.path - The derivation path for the key
1008
- * @param request.keyVersion - The version of the key to use
1009
- * @param request.chainId - The chain ID as a bigint
1010
- * @param request.algo - The signing algorithm to use
1011
- * @param request.dest - The destination for the signature
1012
- * @param request.params - Additional parameters for the signing process
994
+ * @param args - The signature request object containing:
995
+ * @param args.payload - The data payload to be signed as a hex string
996
+ * @param args.path - The derivation path for the key
997
+ * @param args.keyVersion - The version of the key to use
998
+ * @param options - The signature request object containing:
999
+ * @param options.algo - The signing algorithm to use
1000
+ * @param options.dest - The destination for the signature
1001
+ * @param options.params - Additional parameters for the signing process
1013
1002
  * @returns A hex string representing the unique request ID
1014
1003
  *
1015
1004
  * @example
1016
1005
  * ```typescript
1017
1006
  * const requestId = ChainSignatureContract.getRequestId({
1018
- * address: walletClient.account.address,
1019
1007
  * payload: payload: `0x${Buffer.from(args.payload).toString('hex')}`,,
1020
1008
  * path: '',
1021
- * keyVersion: 0,
1022
- * chainId: 1n,
1023
- * algo: '',
1024
- * dest: '',
1025
- * params: ''
1009
+ * keyVersion: 0
1026
1010
  * });
1027
1011
  * console.log(requestId); // 0x...
1028
1012
  * ```
1029
1013
  */
1030
- getRequestId(request: RequestIdArgs): Hex;
1014
+ getRequestId(args: SignArgs, options?: SignOptions['sign']): Hex;
1031
1015
  getErrorFromEvents(requestId: Hex, fromBlock: bigint): Promise<SignatureErrorData | undefined>;
1032
1016
  /**
1033
1017
  * Searches for SignatureResponded events that match the given requestId.
package/types/index.d.ts CHANGED
@@ -934,16 +934,6 @@ interface SignatureErrorData {
934
934
  responder: string;
935
935
  error: string;
936
936
  }
937
- interface RequestIdArgs {
938
- address: Address;
939
- payload: Hex;
940
- path: string;
941
- keyVersion: number;
942
- chainId: bigint;
943
- algo: string;
944
- dest: string;
945
- params: string;
946
- }
947
937
 
948
938
  /**
949
939
  * Implementation of the ChainSignatureContract for EVM chains.
@@ -1001,33 +991,27 @@ declare class ChainSignatureContract extends ChainSignatureContract$2 {
1001
991
  /**
1002
992
  * Generates the request ID for a signature request allowing to track the response.
1003
993
  *
1004
- * @param request - The signature request object containing:
1005
- * @param request.address - The contract/wallet address calling the signing contract
1006
- * @param request.payload - The data payload to be signed as a hex string
1007
- * @param request.path - The derivation path for the key
1008
- * @param request.keyVersion - The version of the key to use
1009
- * @param request.chainId - The chain ID as a bigint
1010
- * @param request.algo - The signing algorithm to use
1011
- * @param request.dest - The destination for the signature
1012
- * @param request.params - Additional parameters for the signing process
994
+ * @param args - The signature request object containing:
995
+ * @param args.payload - The data payload to be signed as a hex string
996
+ * @param args.path - The derivation path for the key
997
+ * @param args.keyVersion - The version of the key to use
998
+ * @param options - The signature request object containing:
999
+ * @param options.algo - The signing algorithm to use
1000
+ * @param options.dest - The destination for the signature
1001
+ * @param options.params - Additional parameters for the signing process
1013
1002
  * @returns A hex string representing the unique request ID
1014
1003
  *
1015
1004
  * @example
1016
1005
  * ```typescript
1017
1006
  * const requestId = ChainSignatureContract.getRequestId({
1018
- * address: walletClient.account.address,
1019
1007
  * payload: payload: `0x${Buffer.from(args.payload).toString('hex')}`,,
1020
1008
  * path: '',
1021
- * keyVersion: 0,
1022
- * chainId: 1n,
1023
- * algo: '',
1024
- * dest: '',
1025
- * params: ''
1009
+ * keyVersion: 0
1026
1010
  * });
1027
1011
  * console.log(requestId); // 0x...
1028
1012
  * ```
1029
1013
  */
1030
- getRequestId(request: RequestIdArgs): Hex;
1014
+ getRequestId(args: SignArgs, options?: SignOptions['sign']): Hex;
1031
1015
  getErrorFromEvents(requestId: Hex, fromBlock: bigint): Promise<SignatureErrorData | undefined>;
1032
1016
  /**
1033
1017
  * Searches for SignatureResponded events that match the given requestId.