Skip to content

Commit

Permalink
Update to @nimiq/core v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sisou committed Nov 19, 2024
1 parent 2c27f8f commit 23b3d18
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"homepage": "https://github.com/nimiq/keyguard/client#readme",
"dependencies": {
"@nimiq/albatross-wasm": "npm:@nimiq/core@next",
"@nimiq/albatross-wasm": "npm:@nimiq/core@^2.0.0",
"@nimiq/rpc": "^0.3.0",
"@opengsn/common": "^2.2.5"
},
Expand Down
8 changes: 4 additions & 4 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@
"@ethersproject/properties" "^5.7.0"
"@ethersproject/strings" "^5.7.0"

"@nimiq/albatross-wasm@npm:@nimiq/core@next":
version "2.0.0-next.rc.5"
resolved "https://registry.yarnpkg.com/@nimiq/core/-/core-2.0.0-next.rc.5.tgz#eed8a533e609f387cd6fa9d8759b3068f5192b84"
integrity sha512-vXqsBv8Yacbnu+O9/3KPk9JcM1w0xq3LrHpwb6uXop1rIpe2+p55B1MT/1EvwNcHce8hQk/ghtC1Vau4fyhELQ==
"@nimiq/albatross-wasm@npm:@nimiq/core@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@nimiq/core/-/core-2.0.0.tgz#ed1509f7914b52ee4ba42eddb0eb596f867dd76f"
integrity sha512-cr388Q3NiSBpIDA7zAlLwlyMf/+qp+p6ytCNah3fzXluC2l8JGrpDqNT1ezzchjZTbj1hjJE7gcyUSzzpPDvnQ==
dependencies:
comlink "^4.4.1"
websocket "^1.0.34"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"homepage": "https://github.com/nimiq/keyguard#readme",
"devDependencies": {
"@nimiq/albatross-wasm": "npm:@nimiq/core@next",
"@nimiq/albatross-wasm": "npm:@nimiq/core@^2.0.0",
"@nimiq/core-web": "1.6.3",
"@nimiq/rpc": "^0.3.0",
"@nimiq/style": "^0.8.3",
Expand Down
6 changes: 5 additions & 1 deletion src/lib/RequestParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ class RequestParser { // eslint-disable-line no-unused-vars

const flags = object.flags || 0/* Nimiq.Transaction.Flag.NONE */;

if (flags === 0 /* Nimiq.Transaction.Flag.NONE */ && recipientType !== 3 && recipientData.byteLength > 64) {
if (
flags === 0 /* Nimiq.Transaction.Flag.NONE */
&& recipientType !== Nimiq.AccountType.Staking
&& recipientData.byteLength > 64
) {
throw new Errors.InvalidRequestError('Data must not exceed 64 bytes');
}
if (flags === 1 /* Nimiq.Transaction.Flag.CONTRACT_CREATION */
Expand Down
3 changes: 1 addition & 2 deletions src/request/sign-staking/SignStaking.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ class SignStaking {
_formatData(plain) {
console.log(plain);
// That either the recipient or the sender is a staking account type is validated in SignStakingApi
// @ts-ignore Wrong type definition
if (plain.recipientType === 3) {
if (plain.recipientType === 'basic') {
switch (plain.data.type) {
case 'create-staker': {
let text = 'Start staking';
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,10 @@
"@jridgewell/resolve-uri" "^3.1.0"
"@jridgewell/sourcemap-codec" "^1.4.14"

"@nimiq/albatross-wasm@npm:@nimiq/core@next":
version "2.0.0-next.rc.5"
resolved "https://registry.yarnpkg.com/@nimiq/core/-/core-2.0.0-next.rc.5.tgz#eed8a533e609f387cd6fa9d8759b3068f5192b84"
integrity sha512-vXqsBv8Yacbnu+O9/3KPk9JcM1w0xq3LrHpwb6uXop1rIpe2+p55B1MT/1EvwNcHce8hQk/ghtC1Vau4fyhELQ==
"@nimiq/albatross-wasm@npm:@nimiq/core@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@nimiq/core/-/core-2.0.0.tgz#ed1509f7914b52ee4ba42eddb0eb596f867dd76f"
integrity sha512-cr388Q3NiSBpIDA7zAlLwlyMf/+qp+p6ytCNah3fzXluC2l8JGrpDqNT1ezzchjZTbj1hjJE7gcyUSzzpPDvnQ==
dependencies:
comlink "^4.4.1"
websocket "^1.0.34"
Expand Down

0 comments on commit 23b3d18

Please sign in to comment.