-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump SignInWithEth/Sol canisters (#6406)
- Loading branch information
Showing
16 changed files
with
240 additions
and
99 deletions.
There are no files selected for viewing
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
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
106 changes: 68 additions & 38 deletions
106
frontend/openchat-agent/src/services/signInWithEthereum/candid/can.did
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 |
---|---|---|
@@ -1,53 +1,83 @@ | ||
type Address = text; | ||
type CanisterPublicKey = PublicKey; | ||
type Delegation = record { | ||
pubkey : PublicKey; | ||
targets : opt vec principal; | ||
expiration : Timestamp; | ||
}; | ||
type GetAddressResponse = variant { Ok : Address; Err : text }; | ||
type GetDelegationResponse = variant { Ok : SignedDelegation; Err : text }; | ||
type GetPrincipalResponse = variant { Ok : Principal; Err : text }; | ||
type LoginDetails = record { | ||
user_canister_pubkey : CanisterPublicKey; | ||
expiration : Timestamp; | ||
}; | ||
type LoginResponse = variant { Ok : LoginDetails; Err : text }; | ||
type PrepareLoginResponse = variant { Ok : SiweMessage; Err : text }; | ||
type Principal = vec nat8; | ||
type PublicKey = vec nat8; | ||
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; | ||
DisablePrincipalToEthMapping | ||
}; | ||
type SessionKey = PublicKey; | ||
|
||
type SettingsInput = record { | ||
uri : text; | ||
runtime_features : opt vec RuntimeFeature; | ||
domain : text; | ||
statement : opt text; | ||
scheme : opt text; | ||
uri : text; | ||
salt : text; | ||
session_expires_in : opt nat64; | ||
targets : opt vec 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 { | ||
signature : vec nat8; | ||
delegation : Delegation; | ||
signature : blob; | ||
}; | ||
type SiweMessage = text; | ||
type SiweSignature = text; | ||
type Timestamp = nat64; | ||
service : { | ||
get_address : (Principal) -> (GetAddressResponse) query; | ||
get_caller_address : () -> (GetAddressResponse) query; | ||
get_principal : (Address) -> (GetPrincipalResponse) query; | ||
siwe_get_delegation : (Address, SessionKey, Timestamp) -> ( | ||
GetDelegationResponse, | ||
) query; | ||
siwe_login : (SiweSignature, Address, SessionKey) -> (LoginResponse); | ||
siwe_prepare_login : (Address) -> (PrepareLoginResponse); | ||
} | ||
|
||
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; | ||
}; |
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
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
Oops, something went wrong.