Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sdk to 14 and related fixes #3444

Merged
merged 11 commits into from
Feb 26, 2025
Merged

Update sdk to 14 and related fixes #3444

merged 11 commits into from
Feb 26, 2025

Conversation

davidyuk
Copy link
Member

@davidyuk davidyuk commented Dec 26, 2024

Copy link

@@ -1,3 +1,5 @@
@use 'variables';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 8, column 8 of file:///Users/denis/Documents/superhero-wallet/src/styles/typography.scss:8:8:
Sass @ import rules are deprecated and will be removed in Dart Sass 3.0.0.
More info and automated migrator: https://sass-lang.com/d/import

@@ -4,7 +4,7 @@ import { STUB_ACCOUNT, STUB_TX_BASE_64 } from '@/constants/stubs';

const callbackUrl = encodeURIComponent('http://localhost');
const encodedContractCallTx = encodeURIComponent('tx_+HQrAaEBbLQV9y00r/WCZ4XWrEVDpdiLPiLx2282rdKA1dkRTlmCA7yhBWuJbvnfcBIKpR/IbC+ywuM9P7fvmDFNerFKykCB+M1qA4al2v8FcAAAhzcV8VZnVACDGBf4hDuaygCQKxEV1igBG2+HI4byb8D/wPOLADU=');
const encodedGaAttachTx = encodeURIComponent('tx_+O1QAaEByqPFadmQk4sGtyDiquosAZyKJNmherKOhheVIEYTLCITuIv4iUYDoIMndi6iAoqQltixF/3A6WlN0+rWVAan4LvFLy2pEJlhwLhcuDv+RNZEHwA3ADcAGg6CPwEDP/5s8lcLADcCFwcXdwAIPAIE+wNNTm90IGluIEF1dGggY29udGV4dAEBAJsvAhFE1kQfEWluaXQRbPJXCyVhdXRob3JpemWCLwCFNy4xLjAAoGzyVwsKFZm3CCkeUKo9rxPQx/JIS8M33a0kE6N/1KAJgwcAA4ZIjzqPaAAATIQ7msoAhysRRNZEHz+4yEN3');
const encodedUnknownTx = encodeURIComponent('tx_+FKB/wGhAcqjxWnZkJOLBrcg4qrqLAGciiTZoXqyjoYXlSBGEywioQHKo8Vp2ZCTiwa3IOKq6iwBnIok2aF6so6GF5UgRhMsIguGDyb1YcgAABOAFw87cw==');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this test better to choose a completely broken transaction, to ensure that the wallet is forward-compatible.

The problem I had with GaAttachTx is that currently, sdk rejects building such transactions with non-1 nonce.

nonce should be equal 1 if GaAttachTx, got 19 instead

currently it will fail only if I request to replace the signer

Tag,
} from '@aeternity/aepp-sdk';
import { getHdWalletAccountFromSeed } from '@aeternity/aepp-sdk-13';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make a new release of sdk to fix that. Meanwhile, you can use it as is since tree shaking will remove the unused code.

@@ -0,0 +1,203 @@
beforeEach(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was done here aa852fa .
Isn't it working properly?

Copy link

Copy link

Copy link

Copy link

@@ -100,8 +101,7 @@ const runContentScript = () => {
if (document.readyState === 'complete') {
clearInterval(readyStateCheckInterval);
const port = browser.runtime.connect();
// @ts-expect-error
const extConnection = new BrowserRuntimeConnection({ port });
const extConnection = new BrowserRuntimeConnection({ port, debug: false });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain this change? What is pros/cons of this?

Copy link
Member Author

@davidyuk davidyuk Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a bug on sdk side that I'll fix in 14.1.0: debug shouldn't be required. From your side @ts-expect-error is an overkill because it can ignore a more significant TS error, its usage should be limited.

@dvdbak
Copy link
Collaborator

dvdbak commented Feb 13, 2025

Build URL is open in a black screen. Not able to test.

@davidyuk davidyuk force-pushed the feature/update-sdk branch 2 times, most recently from 1994413 to 91e8cb5 Compare February 13, 2025 19:19
Copy link

@dvdbak
Copy link
Collaborator

dvdbak commented Feb 14, 2025

It is not possible to import an AE account via private key.
Tryied with: 2602a31e7a3ce342a6f287ee10164cadb88fd16eaa883bd9b93a75f653be03322594d09b5907f8a6f1a9fd2c7e5b067720fe78d862e83b9d6a7ef0f0fb3173f2
image

@dvdbak
Copy link
Collaborator

dvdbak commented Feb 14, 2025

Unable to create a Gift card. created gift card has 0 value.
on Mainnet and Testnet

Nagrywanie.ekranu.2025-02-14.124655.mp4

@CedrikNikita CedrikNikita linked an issue Feb 18, 2025 that may be closed by this pull request
@davidyuk
Copy link
Member Author

I fixed the above two bugs, also

  • added ability to add account by sk_-encoded private key, like sk_HjvV4utY9bQGZtp4vJ4mexCUjAoBcSW1mMT9Y9q4S6UYSqiqB
  • improved useStorageRef types to fix warning
Invalid prop: type check failed for prop "secretKey". Expected Buffer, got Object  at <InviteItem>
at <IonContent>
at <IonPage>
at <Invite>

Copy link

if (restoredValue !== null) {
await setStorageState(restoredValue);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think setStorageState here was used in case we would want to introduce serializer to an existing (stored) value,

@dvdbak
Copy link
Collaborator

dvdbak commented Feb 19, 2025

#3498 Able to import twice the same account via sk_ prefixed key
@CedrikNikita Will it be handle by the Wallet?

Copy link

@davidyuk
Copy link
Member Author

I've reverted the ability to import sk_-encoded private key, will do it separately

@dvdbak
Copy link
Collaborator

dvdbak commented Feb 21, 2025

LGTM

@CedrikNikita CedrikNikita merged commit feae8b6 into develop Feb 26, 2025
6 checks passed
@CedrikNikita CedrikNikita deleted the feature/update-sdk branch February 26, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to sdk 14.x.x
3 participants