-
Notifications
You must be signed in to change notification settings - Fork 259
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
Feat/sol auth #653
Feat/sol auth #653
Conversation
Implement solana auth in auth package
…into feat/sol-auth
🦋 Changeset detectedLatest commit: 3438b92 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Yet to write docs for this. |
.changeset/poor-fans-talk.md
Outdated
@@ -0,0 +1,5 @@ | |||
--- | |||
'@moralisweb3/auth': major |
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.
Should be minor release bump
timeout: number; | ||
} | ||
|
||
// Temporary solution to allow allow chain id enum generated from swagger |
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.
Can you fix this in the datatype?
For EvmChain we introduced a apiHex
value, for this we could do something similar called apiId
or something.
return EndpointResolver.create(core, BASE_URL, initializeChallenge).fetch({ | ||
chainId: EvmChain.create(chain).decimal, | ||
return EndpointResolver.create(core, BASE_URL, initializeChallengeEvm).fetch({ | ||
// TODO: remove this when the API is fixed |
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.
What needs to be fixed? the ChainId?
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.
Ahh taking out. it has been fixed already. The enum for chainId was wrong from swagger, had ETH|ROPSTEN|....
instead of 1|3|4...
packages/auth/src/methods/verify.ts
Outdated
|
||
export interface VerifyEvmOptions { | ||
export interface VerifEvmOptions { |
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.
Why the rename?
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.
typo🤭
code: AuthErrorCode.INCORRECT_NETWORK, | ||
message: `Incorrect network provided. Got "${options.network}", Valid values are: ${Object.values(AuthNetwork) | ||
.map((value) => `"${value}"`) | ||
.join(', ')}`, |
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.
👍
createEndpoint({ | ||
name: 'Verify Challenge (EVM)', | ||
getUrl: () => `/challenge/verify/evm`, | ||
apiToResult: ({ chainId, ...data }: ApiResult) => ({ | ||
...data, | ||
// TODO: revisit EVM logic once we know how authentication in other networks work | ||
chain: EvmChain.create(chainId), | ||
solNetwork: undefined, |
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.
Why do we provide a solNetwork here? That seems wrong
apiToResult: ({ network, ...data }: ApiResult) => ({ | ||
...data, | ||
solNetwork: SolNetwork.create(network), | ||
chain: undefined, |
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.
Why do we provide chain here?
…into feat/sol-auth
…into feat/sol-auth
name: 'Pull request'
about: A new pull request
New Pull Request
Checklist
Issue Description
Implement solana auth in auth package