Skip to content

Commit

Permalink
chore: docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
khanti42 committed Nov 21, 2024
1 parent 7a4fd30 commit bfe1070
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('signDeclareTransaction', () => {
senderAddress: address,
chainId,
networkName: STARKNET_SEPOLIA_TESTNET_NETWORK.name,
details: request.details,
declareTransactions: request.details,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class SignDeclareTransactionRpc extends AccountRpcController<
senderAddress: details.senderAddress,
networkName: this.network.name,
chainId: this.network.chainId,
details,
declareTransactions: details,
}))
) {
throw new UserRejectedOpError() as unknown as Error;
Expand Down
2 changes: 1 addition & 1 deletion packages/starknet-snap/src/rpcs/sign-transaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('signTransaction', () => {
senderAddress: address,
chainId,
networkName: STARKNET_SEPOLIA_TESTNET_NETWORK.name,
details: request.transactions,
transactions: request.transactions,
});
});

Expand Down
2 changes: 1 addition & 1 deletion packages/starknet-snap/src/rpcs/sign-transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class SignTransactionRpc extends AccountRpcController<
senderAddress: address,
networkName: this.network.name,
chainId: this.network.chainId,
details: transactions,
transactions,
}))
) {
throw new UserRejectedOpError() as unknown as Error;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type SignDeclareTransactionUIProps = {
senderAddress: string;
networkName: string;
chainId: string;
details: Infer<typeof DeclareSignDetailsStruct>;
declareTransactions: Infer<typeof DeclareSignDetailsStruct>;
};

/**
Expand All @@ -19,19 +19,22 @@ export type SignDeclareTransactionUIProps = {
* @param options.senderAddress - The address of the sender initiating the transaction.
* @param options.networkName - The name of the blockchain network where the transaction will occur.
* @param options.chainId - The chain ID of the blockchain network.
* @param options.details - The details of the Declare transaction, conforming to the `DeclareSignDetailsStruct` structure.
* @param options.declareTransactions - The details of the Declare transaction.
* @returns A JSX component for the user to review and confirm the Declare transaction signing.
*/
export const SignDeclareTransactionUI: SnapComponent<
SignDeclareTransactionUIProps
> = ({ senderAddress, networkName, chainId, details }) => {
> = ({ senderAddress, networkName, chainId, declareTransactions }) => {
return (
<Box>
<Heading>Do you want to sign this transaction?</Heading>
<Section>
<AddressUI label="Signer" address={senderAddress} chainId={chainId} />
<NetworkUI networkName={networkName} />
<JsonDataUI label={'Declare Transaction Details'} data={details} />
<JsonDataUI
label={'Declare Transaction Details'}
data={declareTransactions}
/>
</Section>
</Box>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/starknet-snap/src/ui/components/SignMessageUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type SignMessageUIProps = {
* @param options - The options to configure the component.
* @param options.address - The address of the signer.
* @param options.chainId - The chain ID of the blockchain network.
* @param options.typedDataMessage - The typed data message to be signed, conforming to the `TypeDataStruct` structure.
* @param options.typedDataMessage - The typed data message to be signed.
* @returns A JSX component for the user to review and confirm the message signing.
*/
export const SignMessageUI: SnapComponent<SignMessageUIProps> = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type SignTransactionUIProps = {
senderAddress: string;
networkName: string;
chainId: string;
details: Infer<typeof CallDataStruct>[];
transactions: Infer<typeof CallDataStruct>[];
};

/**
Expand All @@ -19,22 +19,22 @@ export type SignTransactionUIProps = {
* @param options.senderAddress - The address of the sender initiating the transaction.
* @param options.networkName - The name of the blockchain network where the transaction will occur.
* @param options.chainId - The chain ID of the blockchain network.
* @param options.details - An array of transaction details conforming to the `CallDataStruct` structure.
* @param options.transactions - An array of transactions Call.
* @returns A JSX component for the user to review and confirm the transaction signing.
*/
export const SignTransactionUI: SnapComponent<SignTransactionUIProps> = ({
senderAddress,
networkName,
chainId,
details,
transactions,
}) => {
return (
<Box>
<Heading>Do you want to sign this transaction?</Heading>
<Section>
<AddressUI label="Signer" address={senderAddress} chainId={chainId} />
<NetworkUI networkName={networkName} />
<JsonDataUI label={'Transactions'} data={details} />
<JsonDataUI label={'Transactions'} data={transactions} />
</Section>
</Box>
);
Expand Down

0 comments on commit bfe1070

Please sign in to comment.