Skip to content

Commit 1fe93ed

Browse files
script-moneypenovicp
authored andcommitted
chore: adjust comments for signTransaction interface
[skip ci]
1 parent b2431d3 commit 1fe93ed

File tree

1 file changed

+36
-33
lines changed

1 file changed

+36
-33
lines changed

src/signer/interface.ts

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,34 @@ export abstract class SignerInterface {
1212
/**
1313
* Method to get the public key of the signer
1414
*
15-
* @returns public key of signer as hex string with 0x prefix
15+
* @returns format: hex-string
1616
*/
1717
public abstract getPubKey(): Promise<string>;
1818

1919
/**
20-
* Sign an JSON object for off-chain usage with the starknet private key and return the signature
21-
* This adds a message prefix so it cant be interchanged with transactions
20+
* Signs a JSON object for off-chain usage with the Starknet private key and returns the signature
21+
* This adds a message prefix so it can't be interchanged with transactions
2222
*
2323
* @param typedData - JSON object to be signed
24-
* @param accountAddress - account
25-
* @returns the signature of the JSON object
26-
* @throws {Error} if the JSON object is not a valid JSON
24+
* @param accountAddress
2725
*/
2826
public abstract signMessage(typedData: TypedData, accountAddress: string): Promise<Signature>;
2927

3028
/**
31-
* Signs a transaction with the starknet private key and returns the signature
29+
* Signs transactions with the Starknet private key and returns the signature
3230
*
33-
* @param invocation the invocation object containing:
34-
* - contractAddress - the address of the contract
35-
* - entrypoint - the entrypoint of the contract
36-
* - calldata - (defaults to []) the calldata
37-
* @param abi (optional) the abi of the contract for better displaying
38-
*
39-
* @returns signature
31+
* @param transactions - Array of Call objects, each including:<br/>
32+
* - contractAddress<br/>
33+
* - entrypoint<br/>
34+
* - calldata<br/>
35+
* @param transactionsDetail - InvocationsSignerDetails object with:<br/>
36+
* - walletAddress<br/>
37+
* - chainId<br/>
38+
* - cairoVersion<br/>
39+
* - maxFee<br/>
40+
* - version<br/>
41+
* - nonce<br/>
42+
* @param abis - (optional) An array of Abi objects for displaying decoded data
4043
*/
4144
public abstract signTransaction(
4245
transactions: Call[],
@@ -45,33 +48,33 @@ export abstract class SignerInterface {
4548
): Promise<Signature>;
4649

4750
/**
48-
* Signs a DEPLOY_ACCOUNT transaction with the starknet private key and returns the signature
51+
* Signs a DEPLOY_ACCOUNT transaction with the Starknet private key and returns the signature
4952
*
50-
* @param transaction
51-
* - contractAddress - the computed address of the contract
52-
* - constructorCalldata - calldata to be passed in deploy constructor
53-
* - addressSalt - contract address salt
54-
* - chainId - the chainId to declare contract on
55-
* - maxFee - maxFee for the declare transaction
56-
* - version - transaction version
57-
* - nonce - Nonce of the declare transaction
58-
* @returns signature
53+
* @param transaction<br/>
54+
* - contractAddress<br/>
55+
* - chainId<br/>
56+
* - classHash<br/>
57+
* - constructorCalldata<br/>
58+
* - addressSalt<br/>
59+
* - maxFee<br/>
60+
* - version<br/>
61+
* - nonce<br/>
5962
*/
6063
public abstract signDeployAccountTransaction(
6164
transaction: DeployAccountSignerDetails
6265
): Promise<Signature>;
6366

6467
/**
65-
* Signs a DECLARE transaction with the starknet private key and returns the signature
68+
* Signs a DECLARE transaction with the Starknet private key and returns the signature
6669
*
67-
* @param transaction
68-
* - classHash - computed class hash. Will be replaced by ContractClass in future once class hash is present in CompiledContract
69-
* - senderAddress - the address of the sender
70-
* - chainId - the chainId to declare contract on
71-
* - maxFee - maxFee for the declare transaction
72-
* - version - transaction version
73-
* - nonce - Nonce of the declare transaction
74-
* @returns signature
70+
* @param transaction<br/>
71+
* - classHash<br/>
72+
* - compiledClassHash? - used for Cairo1<br/>
73+
* - senderAddress<br/>
74+
* - chainId<br/>
75+
* - maxFee<br/>
76+
* - version<br/>
77+
* - nonce<br/>
7578
*/
7679
public abstract signDeclareTransaction(transaction: DeclareSignerDetails): Promise<Signature>;
7780
}

0 commit comments

Comments
 (0)