Skip to content

Commit

Permalink
Allow setting a custom senderType for SignMultisigTransaction
Browse files Browse the repository at this point in the history
  • Loading branch information
sisou committed Sep 28, 2024
1 parent 4a740c6 commit f4e6c18
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions client/PublicRequestTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ export interface SignMultisigTransactionRequest extends BasicRequest {
signer: string; // Address

sender: string;
senderType?: Nimiq.Account.Type;
senderLabel: string;
recipient: string;
recipientType?: Nimiq.Account.Type;
Expand Down
2 changes: 2 additions & 0 deletions src/lib/RequestParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ export class RequestParser {
signer: Nimiq.Address.fromAny(signMultisigTxRequest.signer),

sender: Nimiq.Address.fromString(signMultisigTxRequest.sender),
senderType: signMultisigTxRequest.senderType || Nimiq.Account.Type.BASIC,
senderLabel: signMultisigTxRequest.senderLabel,
recipient: Nimiq.Address.fromString(signMultisigTxRequest.recipient),
recipientType: signMultisigTxRequest.recipientType || Nimiq.Account.Type.BASIC,
Expand Down Expand Up @@ -996,6 +997,7 @@ export class RequestParser {
signer: signMultisigTxRequest.signer.toUserFriendlyAddress(),

sender: signMultisigTxRequest.sender.toUserFriendlyAddress(),
senderType: signMultisigTxRequest.senderType,
senderLabel: signMultisigTxRequest.senderLabel,
recipient: signMultisigTxRequest.recipient.toUserFriendlyAddress(),
recipientType: signMultisigTxRequest.recipientType,
Expand Down
3 changes: 2 additions & 1 deletion src/lib/RequestTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ export interface ParsedSignMultisigTransactionRequest extends ParsedBasicRequest
signer: Nimiq.Address;

sender: Nimiq.Address;
senderType: Nimiq.Account.Type;
senderLabel: string;
recipient: Nimiq.Address;
recipientType?: Nimiq.Account.Type;
recipientType: Nimiq.Account.Type;
recipientLabel?: string;
value: number;
fee?: number;
Expand Down
2 changes: 1 addition & 1 deletion src/views/SignMultisigTransaction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class SignMultisigTransaction extends Vue {
sender: this.request.sender.serialize(),
senderLabel: this.request.senderLabel,
senderType: Nimiq.Account.Type.BASIC,
senderType: this.request.senderType,
recipient: this.request.recipient.serialize(),
recipientType: this.request.recipientType,
recipientLabel: this.request.recipientLabel,
Expand Down

0 comments on commit f4e6c18

Please sign in to comment.