-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from kristoferlund/dev
v0.1.0
- Loading branch information
Showing
17 changed files
with
9,259 additions
and
17,706 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import js from '@eslint/js' | ||
import globals from 'globals' | ||
import reactHooks from 'eslint-plugin-react-hooks' | ||
import reactRefresh from 'eslint-plugin-react-refresh' | ||
import tseslint from 'typescript-eslint' | ||
|
||
export default tseslint.config( | ||
{ ignores: ['dist'] }, | ||
{ | ||
extends: [js.configs.recommended, ...tseslint.configs.recommended], | ||
files: ['**/*.{ts,tsx}'], | ||
languageOptions: { | ||
ecmaVersion: 2020, | ||
globals: globals.browser, | ||
}, | ||
plugins: { | ||
'react-hooks': reactHooks, | ||
'react-refresh': reactRefresh, | ||
}, | ||
rules: { | ||
...reactHooks.configs.recommended.rules, | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
}, | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
type Address = text; | ||
type CanisterPublicKey = PublicKey; | ||
type Principal = blob; | ||
type PublicKey = blob; | ||
type SessionKey = PublicKey; | ||
type SiweMessage = text; | ||
type SiweSignature = text; | ||
type Timestamp = nat64; | ||
type Nonce = text; | ||
|
||
type RuntimeFeature = variant { | ||
IncludeUriInSeed; | ||
DisableEthToPrincipalMapping; | ||
DisablePrincipalToEthMapping | ||
}; | ||
|
||
type SettingsInput = record { | ||
domain : text; | ||
uri : text; | ||
salt : text; | ||
chain_id : opt nat; | ||
scheme : opt text; | ||
statement : opt text; | ||
sign_in_expires_in : opt nat64; | ||
session_expires_in : opt nat64; | ||
targets : opt vec text; | ||
runtime_features: opt vec RuntimeFeature; | ||
}; | ||
|
||
type GetAddressResponse = variant { | ||
Ok : Address; | ||
Err : text; | ||
}; | ||
|
||
type GetDelegationResponse = variant { | ||
Ok : SignedDelegation; | ||
Err : text; | ||
}; | ||
|
||
type SignedDelegation = record { | ||
delegation : Delegation; | ||
signature : blob; | ||
}; | ||
|
||
type Delegation = record { | ||
pubkey : PublicKey; | ||
expiration : Timestamp; | ||
targets : opt vec principal; | ||
}; | ||
|
||
type GetPrincipalResponse = variant { | ||
Ok : Principal; | ||
Err : text; | ||
}; | ||
|
||
type LoginResponse = variant { | ||
Ok : LoginDetails; | ||
Err : text; | ||
}; | ||
|
||
type LoginDetails = record { | ||
expiration : Timestamp; | ||
user_canister_pubkey : CanisterPublicKey; | ||
}; | ||
|
||
type PrepareLoginOkResponse = record { | ||
siwe_message: SiweMessage; | ||
nonce : text; | ||
}; | ||
|
||
type PrepareLoginResponse = variant { | ||
Ok : PrepareLoginOkResponse; | ||
Err : text; | ||
}; | ||
|
||
service : (settings_input : SettingsInput) -> { | ||
"get_address" : (Principal) -> (GetAddressResponse) query; | ||
"get_caller_address" : () -> (GetAddressResponse) query; | ||
"get_principal" : (Address) -> (GetPrincipalResponse) query; | ||
"siwe_prepare_login" : (Address) -> (PrepareLoginResponse); | ||
"siwe_login" : (SiweSignature, Address, SessionKey, Nonce) -> (LoginResponse); | ||
"siwe_get_delegation" : (Address, SessionKey, Timestamp) -> (GetDelegationResponse) query; | ||
}; |
Binary file not shown.
Oops, something went wrong.