signet.js 0.0.10-beta → 0.0.10-beta2

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-beta",
3
+ "version": "0.0.10-beta2",
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.
@@ -993,36 +983,35 @@ declare class ChainSignatureContract extends ChainSignatureContract$2 {
993
983
  fromBlock: bigint;
994
984
  options?: RetryOptions;
995
985
  }): Promise<RSVSignature | SignatureErrorData | undefined>;
986
+ getCallData(args: SignArgs, options?: SignOptions['sign']): Promise<{
987
+ target: Hex;
988
+ data: Hex;
989
+ value: bigint;
990
+ }>;
996
991
  /**
997
992
  * Generates the request ID for a signature request allowing to track the response.
998
993
  *
999
- * @param request - The signature request object containing:
1000
- * @param request.address - The contract/wallet address calling the signing contract
1001
- * @param request.payload - The data payload to be signed as a hex string
1002
- * @param request.path - The derivation path for the key
1003
- * @param request.keyVersion - The version of the key to use
1004
- * @param request.chainId - The chain ID as a bigint
1005
- * @param request.algo - The signing algorithm to use
1006
- * @param request.dest - The destination for the signature
1007
- * @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
1008
1002
  * @returns A hex string representing the unique request ID
1009
1003
  *
1010
1004
  * @example
1011
1005
  * ```typescript
1012
1006
  * const requestId = ChainSignatureContract.getRequestId({
1013
- * address: walletClient.account.address,
1014
1007
  * payload: payload: `0x${Buffer.from(args.payload).toString('hex')}`,,
1015
1008
  * path: '',
1016
- * keyVersion: 0,
1017
- * chainId: 1n,
1018
- * algo: '',
1019
- * dest: '',
1020
- * params: ''
1009
+ * keyVersion: 0
1021
1010
  * });
1022
1011
  * console.log(requestId); // 0x...
1023
1012
  * ```
1024
1013
  */
1025
- getRequestId(request: RequestIdArgs): Hex;
1014
+ getRequestId(args: SignArgs, options?: SignOptions['sign']): Hex;
1026
1015
  getErrorFromEvents(requestId: Hex, fromBlock: bigint): Promise<SignatureErrorData | undefined>;
1027
1016
  /**
1028
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.
@@ -993,36 +983,35 @@ declare class ChainSignatureContract extends ChainSignatureContract$2 {
993
983
  fromBlock: bigint;
994
984
  options?: RetryOptions;
995
985
  }): Promise<RSVSignature | SignatureErrorData | undefined>;
986
+ getCallData(args: SignArgs, options?: SignOptions['sign']): Promise<{
987
+ target: Hex;
988
+ data: Hex;
989
+ value: bigint;
990
+ }>;
996
991
  /**
997
992
  * Generates the request ID for a signature request allowing to track the response.
998
993
  *
999
- * @param request - The signature request object containing:
1000
- * @param request.address - The contract/wallet address calling the signing contract
1001
- * @param request.payload - The data payload to be signed as a hex string
1002
- * @param request.path - The derivation path for the key
1003
- * @param request.keyVersion - The version of the key to use
1004
- * @param request.chainId - The chain ID as a bigint
1005
- * @param request.algo - The signing algorithm to use
1006
- * @param request.dest - The destination for the signature
1007
- * @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
1008
1002
  * @returns A hex string representing the unique request ID
1009
1003
  *
1010
1004
  * @example
1011
1005
  * ```typescript
1012
1006
  * const requestId = ChainSignatureContract.getRequestId({
1013
- * address: walletClient.account.address,
1014
1007
  * payload: payload: `0x${Buffer.from(args.payload).toString('hex')}`,,
1015
1008
  * path: '',
1016
- * keyVersion: 0,
1017
- * chainId: 1n,
1018
- * algo: '',
1019
- * dest: '',
1020
- * params: ''
1009
+ * keyVersion: 0
1021
1010
  * });
1022
1011
  * console.log(requestId); // 0x...
1023
1012
  * ```
1024
1013
  */
1025
- getRequestId(request: RequestIdArgs): Hex;
1014
+ getRequestId(args: SignArgs, options?: SignOptions['sign']): Hex;
1026
1015
  getErrorFromEvents(requestId: Hex, fromBlock: bigint): Promise<SignatureErrorData | undefined>;
1027
1016
  /**
1028
1017
  * Searches for SignatureResponded events that match the given requestId.