Skip to content

Commit

Permalink
intents: add support for child wallet adoption & intent confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
patrislav committed Nov 14, 2024
1 parent 6287e6d commit 40c3a08
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
47 changes: 46 additions & 1 deletion intents/intent.ridl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ enum IntentName: string
- removeAccount
- listAccounts
- getIdToken
- adoptChildWallet
- getAdopter
- confirmIntent
- getConfirmationStatus

struct IntentDataInitiateAuth
- sessionId: string
Expand Down Expand Up @@ -141,13 +145,35 @@ struct IntentDataRemoveAccount
- accountId: string
+ go.field.name = AccountID

struct IntentDataAdoptChildWallet
- network: string
- wallet: string
- adopter: string
- adopterProof: AdopterProof

struct AdopterProof
- message: string
- signature: string

struct IntentDataGetIdToken
- sessionId: string
+ go.field.name = SessionID
- wallet: string
- nonce?: string
+ go.field.type = string

struct IntentDataGetAdopter
- wallet: string

struct IntentDataConfirmIntent
- wallet: string
- confirmationID: string
- challengeAnswer: string

struct IntentDataGetConfirmationStatus
- wallet: string
- confirmationID: string

struct TransactionRaw
- type: string
- to: string
Expand All @@ -159,7 +185,7 @@ struct AbiData
- abi: string
- func?: string
- args: []any

enum TransactionType: string
- transaction
- erc20send
Expand Down Expand Up @@ -232,6 +258,9 @@ enum IntentResponseCode: string
- accountFederated
- accountRemoved
- idToken
- adopter
- childWalletAdopted
- confirmationRequired

struct IntentResponseAuthInitiated
- sessionId: string
Expand Down Expand Up @@ -334,6 +363,19 @@ struct IntentResponseIdToken
- idToken: string
- expiresIn: int

struct IntentResponseChildWalletAdopted
- adopterAddress: string

struct IntentResponseAdopter
- adopterAddress: string

struct IntentResponseConfirmationRequired
- confirmationID: string
- salt: string
- challengeType: ChallengeType
- challengeDestination?: string
- expiresIn: int

enum IdentityType: string
- None
- Guest
Expand All @@ -351,3 +393,6 @@ struct Account
+ go.tag.json = issuer,omitempty
- email?: string
+ go.tag.json = email,omitempty

enum ChallengeType: string
- EmailOTP
6 changes: 6 additions & 0 deletions intents/intent_response_typed.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ func IntentResponseTypeToCode[T any](t *T) IntentResponseCode {
return IntentResponseCode_accountFederated
case *IntentResponseAccountRemoved:
return IntentResponseCode_accountRemoved
case *IntentResponseChildWalletAdopted:
return IntentResponseCode_childWalletAdopted
case *IntentResponseAdopter:
return IntentResponseCode_adopter
case *IntentResponseConfirmationRequired:
return IntentResponseCode_confirmationRequired
case *IntentResponseIdToken:
return IntentResponseCode_idToken
default:
Expand Down
8 changes: 8 additions & 0 deletions intents/intent_typed.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ func IntentDataTypeToName[T any](t *T) IntentName {
return IntentName_federateAccount
case *IntentDataRemoveAccount:
return IntentName_removeAccount
case *IntentDataAdoptChildWallet:
return IntentName_adoptChildWallet
case *IntentDataGetAdopter:
return IntentName_getAdopter
case *IntentDataConfirmIntent:
return IntentName_confirmIntent
case *IntentDataGetConfirmationStatus:
return IntentName_getConfirmationStatus
case *IntentDataGetIdToken:
return IntentName_getIdToken
default:
Expand Down

0 comments on commit 40c3a08

Please sign in to comment.