diff --git a/client/PublicRequestTypes.ts b/client/PublicRequestTypes.ts index 7c318988..67b1910b 100644 --- a/client/PublicRequestTypes.ts +++ b/client/PublicRequestTypes.ts @@ -260,16 +260,14 @@ export interface EncryptionKeyParams { export interface MultisigInfo { publicKeys: Bytes[]; - numberOfSigners: number; - signerPublicKeys?: Bytes[]; // Can be omitted when all publicKeys need to sign - secret: { - aggregatedSecret: Bytes; - } | { - encryptedSecrets: Bytes[]; - bScalar: Bytes; + signers: Array<{ + publicKey: Bytes; + commitments: Bytes[]; + }>; + secrets: Bytes[] | { + encrypted: Bytes[]; keyParams: EncryptionKeyParams; }; - aggregatedCommitment: Bytes; userName?: string; } @@ -277,10 +275,10 @@ export interface SignMultisigTransactionRequest extends BasicRequest { signer: string; // Address sender: string; - senderType?: Nimiq.Account.Type; + senderType?: Nimiq.AccountType; senderLabel: string; recipient: string; - recipientType?: Nimiq.Account.Type; + recipientType?: Nimiq.AccountType; recipientLabel?: string; value: number; fee?: number; diff --git a/package.json b/package.json index ed840f71..f8816aa2 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@nimiq/electrum-client": "https://github.com/nimiq/electrum-client#build", "@nimiq/fastspot-api": "^1.10.2", "@nimiq/iqons": "^1.5.2", - "@nimiq/keyguard-client": "https://gitpkg.now.sh/nimiq/keyguard?scripts.postinstall=cd%20client%20%26%26%20.%2Fbuild-gitpkg.sh&a62aa9f557e2ac4c0d7306828e423230f423a0f1", + "@nimiq/keyguard-client": "https://gitpkg.now.sh/nimiq/keyguard?scripts.postinstall=cd%20client%20%26%26%20.%2Fbuild-gitpkg.sh&fbbcf067a5043d9d56bd24c5a2ac79f63355fac1", "@nimiq/ledger-api": "^3.1.1", "@nimiq/oasis-api": "^1.1.1", "@nimiq/rpc": "^0.4.1", diff --git a/src/i18n/en.po b/src/i18n/en.po index 728bb66f..02e1f85e 100644 --- a/src/i18n/en.po +++ b/src/i18n/en.po @@ -291,6 +291,10 @@ msgstr "" msgid "Choose an Account" msgstr "" +#: src/views/ConnectAccount.vue:5 +msgid "Choose an Account to log in" +msgstr "" + #: src/views/CashlinkReceive.vue:64 #: src/views/ChooseAddress.vue:18 #: src/views/ChooseAddress.vue:5 @@ -697,7 +701,12 @@ msgstr "" msgid "Login File saved!" msgstr "" +#: src/views/ConnectAccountSuccess.vue:4 +msgid "Login successful" +msgstr "" + #: src/views/ChooseAddress.vue:67 +#: src/views/ConnectAccount.vue:40 msgid "Login to another account" msgstr "" diff --git a/src/lib/RequestParser.ts b/src/lib/RequestParser.ts index 30ba9db8..25b8c0c8 100644 --- a/src/lib/RequestParser.ts +++ b/src/lib/RequestParser.ts @@ -795,35 +795,31 @@ export class RequestParser { signer: Nimiq.Address.fromAny(signMultisigTxRequest.signer), sender: Nimiq.Address.fromString(signMultisigTxRequest.sender), - senderType: signMultisigTxRequest.senderType || Nimiq.Account.Type.BASIC, + senderType: signMultisigTxRequest.senderType || Nimiq.AccountType.Basic, senderLabel: signMultisigTxRequest.senderLabel, recipient: Nimiq.Address.fromString(signMultisigTxRequest.recipient), - recipientType: signMultisigTxRequest.recipientType || Nimiq.Account.Type.BASIC, + recipientType: signMultisigTxRequest.recipientType || Nimiq.AccountType.Basic, recipientLabel: signMultisigTxRequest.recipientLabel, value: signMultisigTxRequest.value, fee: signMultisigTxRequest.fee || 0, data: parseMessage(signMultisigTxRequest.extraData) || new Uint8Array(0), - flags: signMultisigTxRequest.flags || Nimiq.Transaction.Flag.NONE, + flags: signMultisigTxRequest.flags || Nimiq.TransactionFlag.None, validityStartHeight: signMultisigTxRequest.validityStartHeight, multisigConfig: { publicKeys: signMultisigTxRequest.multisigConfig.publicKeys.map((bytes) => parseBytes(bytes)), - numberOfSigners: signMultisigTxRequest.multisigConfig.numberOfSigners, - signerPublicKeys: signMultisigTxRequest.multisigConfig.signerPublicKeys - ? signMultisigTxRequest.multisigConfig.signerPublicKeys.map((bytes) => parseBytes(bytes)) - : signMultisigTxRequest.multisigConfig.publicKeys.map((bytes) => parseBytes(bytes)), - secret: 'aggregatedSecret' in signMultisigTxRequest.multisigConfig.secret - ? {aggregatedSecret: parseBytes( - signMultisigTxRequest.multisigConfig.secret.aggregatedSecret, - ) } + signers: signMultisigTxRequest.multisigConfig.signers.map((signer) => ({ + publicKey: parseBytes(signer.publicKey), + commitments: signer.commitments.map((bytes) => parseBytes(bytes)), + })), + secrets: Array.isArray(signMultisigTxRequest.multisigConfig.secrets) + ? signMultisigTxRequest.multisigConfig.secrets.map((bytes) => parseBytes(bytes)) : { - encryptedSecrets: signMultisigTxRequest.multisigConfig.secret.encryptedSecrets.map( + encrypted: signMultisigTxRequest.multisigConfig.secrets.encrypted.map( (bytes) => parseBytes(bytes), ), - bScalar: parseBytes(signMultisigTxRequest.multisigConfig.secret.bScalar), - keyParams: signMultisigTxRequest.multisigConfig.secret.keyParams, + keyParams: signMultisigTxRequest.multisigConfig.secrets.keyParams, }, - aggregatedCommitment: parseBytes(signMultisigTxRequest.multisigConfig.aggregatedCommitment), userName: signMultisigTxRequest.multisigConfig.userName, }, }; @@ -836,7 +832,7 @@ export class RequestParser { } if (connectAccountRequest.appLogoUrl) { - let origin; + let origin: string; try { origin = new URL(connectAccountRequest.appLogoUrl).origin; } catch (err) { diff --git a/src/lib/RequestTypes.ts b/src/lib/RequestTypes.ts index 1a0d6004..3ee5c6b8 100644 --- a/src/lib/RequestTypes.ts +++ b/src/lib/RequestTypes.ts @@ -56,20 +56,18 @@ export interface ParsedSignTransactionRequest extends ParsedBasicRequest { export interface ParsedMultisigInfo { publicKeys: Uint8Array[]; - numberOfSigners: number; - signerPublicKeys: Uint8Array[]; // Can be omitted when all publicKeys need to sign - secret: { - aggregatedSecret: Uint8Array; - } | { - encryptedSecrets: Uint8Array[]; - bScalar: Uint8Array; + signers: Array<{ + publicKey: Uint8Array; + commitments: Uint8Array[]; + }>; + secrets: Uint8Array[] | { + encrypted: Uint8Array[]; keyParams: { kdf: string; iterations: number; keySize: number; }; }; - aggregatedCommitment: Uint8Array; userName?: string; } @@ -77,10 +75,10 @@ export interface ParsedSignMultisigTransactionRequest extends ParsedBasicRequest signer: Nimiq.Address; sender: Nimiq.Address; - senderType: Nimiq.Account.Type; + senderType: Nimiq.AccountType; senderLabel: string; recipient: Nimiq.Address; - recipientType: Nimiq.Account.Type; + recipientType: Nimiq.AccountType; recipientLabel?: string; value: number; fee?: number; diff --git a/src/views/ConnectAccountSuccess.vue b/src/views/ConnectAccountSuccess.vue index a4b7459b..c5c1f3aa 100644 --- a/src/views/ConnectAccountSuccess.vue +++ b/src/views/ConnectAccountSuccess.vue @@ -17,7 +17,6 @@ import StatusScreen from '../components/StatusScreen.vue'; import { SmallPage, CheckmarkIcon } from '@nimiq/vue-components'; import { WalletInfo } from '../lib/WalletInfo'; import { WalletType } from '../lib/Constants'; -import { loadNimiq } from '../lib/Helpers'; import { ParsedConnectAccountRequest } from '../lib/RequestTypes'; import { WalletStore } from '../lib/WalletStore'; @@ -32,8 +31,6 @@ export default class ConnectAccountSuccess extends Vue { private async mounted() { const startTime = Date.now(); - const nimiqPromise = loadNimiq(); // Required for deriving address from public key - const wallet = this.findWalletByKeyId(this.keyguardRequest.keyId)!; const walletTypeName: Record = { @@ -48,8 +45,6 @@ export default class ConnectAccountSuccess extends Vue { wallet.permissions[this.rpcState.origin] = walletPermissions; await WalletStore.Instance.put(wallet); - await nimiqPromise; - const result: ConnectedAccount = { signatures: this.keyguardResult.signatures.map(({signature, publicKey}) => ({ signer: new Nimiq.PublicKey(publicKey).toAddress().toUserFriendlyAddress(), diff --git a/src/views/SignMultisigTransaction.vue b/src/views/SignMultisigTransaction.vue index 94928b12..2472cfa6 100644 --- a/src/views/SignMultisigTransaction.vue +++ b/src/views/SignMultisigTransaction.vue @@ -53,7 +53,7 @@ export default class SignMultisigTransaction extends Vue { value: this.request.value, fee: this.request.fee || 0, validityStartHeight: this.request.validityStartHeight, - data: this.request.data, + recipientData: this.request.data, flags: this.request.flags, multisigConfig: this.request.multisigConfig, diff --git a/yarn.lock b/yarn.lock index 4e97f0a0..c094eef2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1843,9 +1843,9 @@ dependencies: dom-parser "^0.1.5" -"@nimiq/keyguard-client@https://gitpkg.now.sh/nimiq/keyguard?scripts.postinstall=cd%20client%20%26%26%20.%2Fbuild-gitpkg.sh&a62aa9f557e2ac4c0d7306828e423230f423a0f1": +"@nimiq/keyguard-client@https://gitpkg.now.sh/nimiq/keyguard?scripts.postinstall=cd%20client%20%26%26%20.%2Fbuild-gitpkg.sh&fbbcf067a5043d9d56bd24c5a2ac79f63355fac1": version "1.0.0" - resolved "https://gitpkg.now.sh/nimiq/keyguard?scripts.postinstall=cd%20client%20%26%26%20.%2Fbuild-gitpkg.sh&a62aa9f557e2ac4c0d7306828e423230f423a0f1#b821554c4e4751e93cd9e287cd3617812e2a3ea2" + resolved "https://gitpkg.now.sh/nimiq/keyguard?scripts.postinstall=cd%20client%20%26%26%20.%2Fbuild-gitpkg.sh&fbbcf067a5043d9d56bd24c5a2ac79f63355fac1#69723c531cb46fd97466bf35d6cfadd612836ff6" "@nimiq/ledger-api@^3.1.1": version "3.1.1"