-
Notifications
You must be signed in to change notification settings - Fork 926
Conversation
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @lorisleiva and the rest of your teammates on Graphite |
a37e453
to
b557367
Compare
b557367
to
d5bd3ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this example land harder if the imported signers had the same public key address? I feel like the string -> seed -> keypair example might be confusing to some (most people probably just think ‘my private key exists, it has a seed, and it's these exact 256 bits’) and is sort of orthogonal to just trying to demonstrate the signers API.
examples/signers/src/example.ts
Outdated
/** | ||
* SETUP: INSTALL WEB CRYPTO POLYFILL | ||
* This polyfill may be required to access the Web Crypto API in your environment. | ||
*/ | ||
// @ts-expect-error FIXME(https://github.com/solana-labs/solana-web3.js/pull/3047) | ||
install(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted not to do this in the examples, since they just run in Node where Ed25519 is always supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too sure why but I'm getting No key generation implementation could be found
if I don't import the polyfill. Weird as I'm using node v18.19.0
. Any idea how that could be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't seem right. Says it was implemented in v18.4.0
. Let's investigate this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
K, so in Node 18, crypto
is not injected into the global scope by default. You have to add --experimental-global-webcrypto
after tsx
.
You can do this (to all the examples) or not, but I think we're saying that the new web3.js supports Node LTS and up, which at this point is >20.16.0
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way I'd prefer not to have the polyfill in the example, lest people copy and paste it blindly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for looking into this. I thought we were still supporting Node 18 which is why I was using this version but I've bumped it to 20+ and everything works without the polyfill now so I've removed it. Good to know it still works with 18 with an experimental flag though.
993119b
to
e8a2dd9
Compare
d5bd3ce
to
78fc903
Compare
e8a2dd9
to
4872e7a
Compare
78fc903
to
5e9ffad
Compare
4872e7a
to
aa40be3
Compare
5e9ffad
to
df588e1
Compare
aa40be3
to
2b7d98a
Compare
df588e1
to
737fb19
Compare
2b7d98a
to
b678f4f
Compare
5009333
to
f2b5bf4
Compare
Yeah that's a fair point. I've changed this logic to simply use the first 32 bytes of the
By making the change mentioned above, we know have option 2 and 3 which uses the same signer. I've also changed the no-op signer to use the same address so now option 2, 3 and 4 are the same signer. I believe option 1 cannot be included in this though since we're trying to showcase generated signers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b678f4f
to
1f4938d
Compare
f2b5bf4
to
e06db6a
Compare
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/whatwg-fetch@3.6.20 |
d352179
to
4de03f4
Compare
Merge activity
|
4de03f4
to
476d388
Compare
476d388
to
df4c052
Compare
Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up. |
This PR adds an example to the
examples
folder that show-cases how to create and use various signers. It offers 4 different signer options:getPublicKeyFromPrivateKey
that should soon be available in@solana/keys
).Each of these options go through the same 3 signing methods that:
Here is an example of the logs we see when running
pnpm start
on that example.