From b1e81105c80d856daf8a129dc72b379bf98bbf76 Mon Sep 17 00:00:00 2001 From: Patryk Kalinowski Date: Thu, 21 Nov 2024 19:44:09 +0100 Subject: [PATCH] deps: update to the released go-sequence --- go.mod | 2 +- go.sum | 2 + proto/waas/wallet.gen.go | 2066 +++++++++++++++-- rpc/helpers_test.go | 42 +- .../0xsequence/go-sequence/core/v2/v2.go | 3 - .../go-sequence/intents/intent.gen.go | 7 +- .../go-sequence/intents/intent.ridl | 6 +- .../go-sequence/relayer/proto/relayer.gen.go | 50 - .../0xsequence/go-sequence/wallet.go | 3 - vendor/modules.txt | 3 +- 10 files changed, 1882 insertions(+), 302 deletions(-) diff --git a/go.mod b/go.mod index b0b2333c..effde8d1 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.23.2 require ( github.com/0xsequence/ethkit v1.29.4 - github.com/0xsequence/go-sequence v0.43.0 + github.com/0xsequence/go-sequence v0.43.4 github.com/0xsequence/nitrocontrol v0.3.0 github.com/BurntSushi/toml v1.4.0 github.com/aws/aws-sdk-go-v2 v1.30.3 diff --git a/go.sum b/go.sum index c99c49d9..d7fb449c 100644 --- a/go.sum +++ b/go.sum @@ -5,6 +5,8 @@ github.com/0xsequence/ethkit v1.29.4 h1:vyjCF22OnCEPPsZsczhKaY3qUuSTLcrWsBORj9sr github.com/0xsequence/ethkit v1.29.4/go.mod h1:rv0FAIyEyN0hhwGefbduAz4ujmyjyJXhCd6a0/yF3tk= github.com/0xsequence/go-ethauth v0.13.0 h1:ZaqFEEqy574A2b1P7vjpcy5tb4W/izn+A3swwOYi9wA= github.com/0xsequence/go-ethauth v0.13.0/go.mod h1:f3kx39S9F+W+qvZEB6bkKKbpUstmyB7goUntO3wvlhg= +github.com/0xsequence/go-sequence v0.43.4 h1:zfVXjN6DjOeZNdgtOsD+QB4cLH9i3GH0SRGGvC2BKu4= +github.com/0xsequence/go-sequence v0.43.4/go.mod h1:MReAQwVM5fPEcCuOZPZlWd2Ur4f59H8TnPQVyhY8qD8= github.com/0xsequence/nitrocontrol v0.3.0 h1:D0/gX576zQhitrJnBfBrOFFufEOzh6f2jO/+2ynwIUA= github.com/0xsequence/nitrocontrol v0.3.0/go.mod h1:sTG5akVPzoVr3unv/7h9aZGaT+BVGmvUMOdwXFeIEEA= github.com/0xsequence/nsm v0.1.0 h1:gVOViRWPUW/c5VEmGy2gCw1az/nqP3gY7VD9V2+069k= diff --git a/proto/waas/wallet.gen.go b/proto/waas/wallet.gen.go index f6444783..69f8ea9b 100644 --- a/proto/waas/wallet.gen.go +++ b/proto/waas/wallet.gen.go @@ -1,9 +1,9 @@ -// sequence-wallet v0.1.0 a8355f9df73abff9adbb268e841b65f2d6d9fbd9 +// sequence-wallet v0.1.0 de9a81468e4f81efd8ba7c66be580713fa9e1b3e // -- -// Code generated by webrpc-gen@v0.19.3 with golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.20.3 with golang generator. DO NOT EDIT. // -// webrpc-gen -schema=wallet.ridl -target=golang -pkg=api -client -out=./clients/wallet.gen.go -package api +// webrpc-gen -schema=wallet.ridl -target=golang -pkg=proto_wallet -server -client -out=./wallet.gen.go +package proto_wallet import ( "bytes" @@ -14,6 +14,7 @@ import ( "io" "net/http" "net/url" + "strings" "time" "github.com/0xsequence/go-sequence/lib/prototyp" @@ -31,7 +32,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "a8355f9df73abff9adbb268e841b65f2d6d9fbd9" + return "de9a81468e4f81efd8ba7c66be580713fa9e1b3e" } // @@ -144,6 +145,35 @@ type IntentResponse struct { Data interface{} `json:"data"` } +type WalletDeploymentState string + +const ( + WalletDeploymentState_UNKNOWN WalletDeploymentState = "UNKNOWN" + WalletDeploymentState_MISSING WalletDeploymentState = "MISSING" + WalletDeploymentState_DEPLOYED WalletDeploymentState = "DEPLOYED" +) + +func (x WalletDeploymentState) MarshalText() ([]byte, error) { + return []byte(x), nil +} + +func (x *WalletDeploymentState) UnmarshalText(b []byte) error { + *x = WalletDeploymentState(string(b)) + return nil +} + +func (x *WalletDeploymentState) Is(values ...WalletDeploymentState) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + type SortOrder uint32 const ( @@ -202,13 +232,15 @@ type Project struct { // ProjectWallet is an wallet that can be used by a project. The wallet // can be used to sign transactions and messages. type ProjectWallet struct { - Id uint64 `json:"id" db:"id,omitempty"` - ProjectID uint64 `json:"projectID" db:"project_id"` - WalletIndex uint64 `json:"walletIndex" db:"wallet_index"` - WalletAddress prototyp.Hash `json:"walletAddress" db:"wallet_address"` - UserID string `json:"userId" db:"user_id"` - UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` - CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` + Id uint64 `json:"id" db:"id,omitempty"` + ProjectID uint64 `json:"projectID" db:"project_id"` + WalletIndex uint64 `json:"walletIndex" db:"wallet_index"` + WalletAddress prototyp.Hash `json:"walletAddress" db:"wallet_address"` + UserID string `json:"userId" db:"user_id"` + Adopter prototyp.HashMaybe `json:"adopter" db:"adopter"` + ConfigCheckpoint uint32 `json:"configCheckpoint" db:"config_checkpoint"` + UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } // ProjectWalletConfig is a configuration for a project wallet. The configuration @@ -222,232 +254,1803 @@ type ProjectWalletConfig struct { CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at,omitempty"` } -type Transaction struct { - To string `json:"to"` - Value string `json:"value"` - GasLimit string `json:"gasLimit"` - Data string `json:"data"` - DelegateCall bool `json:"delegateCall"` - RevertOnError bool `json:"revertOnError"` -} +type Transaction struct { + To string `json:"to"` + Value string `json:"value"` + GasLimit string `json:"gasLimit"` + Data string `json:"data"` + DelegateCall bool `json:"delegateCall"` + RevertOnError bool `json:"revertOnError"` +} + +type TransactionBundle struct { + ChainID string `json:"chainID"` + Nonce string `json:"nonce"` + Transactions []*Transaction `json:"transactions"` +} + +type SignMessage struct { + ChainID string `json:"chainID"` + Message string `json:"message"` +} + +type ParentWalletStatus struct { + ChainID string `json:"chainID"` + Address string `json:"address"` + Deployed bool `json:"deployed"` + State WalletDeploymentState `json:"state"` + Error *string `json:"error"` +} + +// Chain represents a blockchain network. +type Chain struct { + Id uint64 `json:"id"` + Name string `json:"name"` +} + +// Page represents a results page. This can be used both to request a page and +// to store the state of a page. +type Page struct { + // Common for both numbered pages and cursor: Number of items per page + // TODO: REMOVE.. + PageSize *uint32 `json:"pageSize"` + // Numbered pages: Page number, this is multiplied by the value of the parameter. + // TODO: REMOVE.. + Page *uint32 `json:"page"` + // Number of total items on this query. + // TODO: REMOVE.. + TotalRecords *uint64 `json:"totalRecords"` + // Cursor: column to compare before/after to + Column *string `json:"column"` + // Cursor: return column < before - include to get previous page + Before *interface{} `json:"before"` + // Cursor: return column > after - include to get next page + After *interface{} `json:"after"` + // Sorting filter + Sort []*SortBy `json:"sort"` +} + +type SortBy struct { + Column string `json:"column"` + Order SortOrder `json:"order"` +} + +type ProvidedSignature struct { + Signature string `json:"Signature"` + Digest string `json:"Digest"` + Address string `json:"Address"` +} + +type ProjectWalletPreConfig struct { + ProjectRecoveryAddress string `json:"projectRecoveryAddress"` + UserMapRules *ProjectSessionUserMapRules `json:"userMapRules"` +} + +type ProjectSessionUserMapRules struct { + AllowIdTokens bool `json:"allowIdTokens" db:"allow_id_tokens"` + AllowEmails bool `json:"allowEmails" db:"allow_emails"` + AllowPhones bool `json:"allowPhones" db:"allow_phones"` + UserIdTemplate string `json:"userIdTemplate" db:"user_id_template"` + IdTokenTrustedAuthenticatorIssuer string `json:"idTokenTrustedAuthenticatorIssuer" db:"id_token_trusted_authenticator_issuer"` +} + +type SessionAuthProof struct { + Wallet string `json:"wallet"` + Message *SignMessage `json:"message"` + Signatures []*ProvidedSignature `json:"signatures"` +} + +type MiniSequenceContext struct { + Factory string `json:"factory"` + MainModule string `json:"mainModule"` +} + +var ( + methods = map[string]method{ + "/rpc/WaaS/CreateProject": { + Name: "CreateProject", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/DeployProjectParentWallet": { + Name: "DeployProjectParentWallet", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/UpdateProjectUserMapRules": { + Name: "UpdateProjectUserMapRules", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/ProjectParentConfig": { + Name: "ProjectParentConfig", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/ProjectParentWallet": { + Name: "ProjectParentWallet", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/ProjectParentWalletStatus": { + Name: "ProjectParentWalletStatus", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/ProjectWallets": { + Name: "ProjectWallets", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/ProjectUserSalt": { + Name: "ProjectUserSalt", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/GetProjectParentWalletDeployCalldata": { + Name: "GetProjectParentWalletDeployCalldata", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/ProjectWallet": { + Name: "ProjectWallet", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/SequenceContext": { + Name: "SequenceContext", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/UserSalt": { + Name: "UserSalt", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/UseHotWallet": { + Name: "UseHotWallet", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/Wallets": { + Name: "Wallets", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/GenTransaction": { + Name: "GenTransaction", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/SendTransaction": { + Name: "SendTransaction", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/SignMessage": { + Name: "SignMessage", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/GetSession": { + Name: "GetSession", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/RegisterSession": { + Name: "RegisterSession", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/StartSessionValidation": { + Name: "StartSessionValidation", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/FinishValidateSession": { + Name: "FinishValidateSession", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/InvalidateSession": { + Name: "InvalidateSession", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/SessionAuthProof": { + Name: "SessionAuthProof", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/FederateAccount": { + Name: "FederateAccount", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/RemoveAccount": { + Name: "RemoveAccount", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/InitiateAuth": { + Name: "InitiateAuth", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/AdoptChildWallet": { + Name: "AdoptChildWallet", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/InitiateEmailAuth": { + Name: "InitiateEmailAuth", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/SendIntent": { + Name: "SendIntent", + Service: "WaaS", + Annotations: map[string]string{}, + }, + "/rpc/WaaS/ChainList": { + Name: "ChainList", + Service: "WaaS", + Annotations: map[string]string{}, + }, + } +) + +var WebRPCServices = map[string][]string{ + "WaaS": { + "CreateProject", + "DeployProjectParentWallet", + "UpdateProjectUserMapRules", + "ProjectParentConfig", + "ProjectParentWallet", + "ProjectParentWalletStatus", + "ProjectWallets", + "ProjectUserSalt", + "GetProjectParentWalletDeployCalldata", + "ProjectWallet", + "SequenceContext", + "UserSalt", + "UseHotWallet", + "Wallets", + "GenTransaction", + "SendTransaction", + "SignMessage", + "GetSession", + "RegisterSession", + "StartSessionValidation", + "FinishValidateSession", + "InvalidateSession", + "SessionAuthProof", + "FederateAccount", + "RemoveAccount", + "InitiateAuth", + "AdoptChildWallet", + "InitiateEmailAuth", + "SendIntent", + "ChainList", + }, +} + +// +// Server types +// + +type WaaS interface { + // + // system-admin methods + // + CreateProject(ctx context.Context, projectID uint64, name string, config *ProjectWalletPreConfig, jwtAlg string, jwtSecret *string, jwtPublic *string) (*Project, error) + DeployProjectParentWallet(ctx context.Context, projectID uint64, chainID string) (string, string, error) + UpdateProjectUserMapRules(ctx context.Context, projectID uint64, userMapRules *ProjectSessionUserMapRules) error + ProjectParentConfig(ctx context.Context, projectID uint64) (string, error) + ProjectParentWallet(ctx context.Context, projectID uint64) (string, error) + ProjectParentWalletStatus(ctx context.Context, projectID uint64) ([]*ParentWalletStatus, error) + ProjectWallets(ctx context.Context, projectID uint64, page *Page) ([]*ProjectWallet, *Page, error) + // NOTICE: This is NOT the salt used for the guard + // this salt is used to deterministically being able to compute the relationship + // userId <-> wallet, that way the API can't map users to the wrong wallet + ProjectUserSalt(ctx context.Context, projectID uint64) (string, error) + // similar method to DeployProjectParentWallet, but allows anyone to call it to get + // the transaction calldata to do a parent wallet deployment manually. + GetProjectParentWalletDeployCalldata(ctx context.Context, projectID uint64, chainID string) (string, string, string, error) + // these methods are used by the dss during setup, they reduce the + // amount of configuration that needs to be manually passed around + ProjectWallet(ctx context.Context) (string, error) + SequenceContext(ctx context.Context) (*MiniSequenceContext, error) + UserSalt(ctx context.Context) (string, error) + UseHotWallet(ctx context.Context, walletAddress string) (bool, error) + // wallet rpc caller + Wallets(ctx context.Context, page *Page) ([]*ProjectWallet, *Page, error) + // wallet rpc using sdk + GenTransaction(ctx context.Context, intent *Intent) (*TransactionBundle, error) + SendTransaction(ctx context.Context, intent *Intent, result *TransactionBundle, signatures []*ProvidedSignature) (*IntentResponse, error) + SignMessage(ctx context.Context, intent *Intent, message *SignMessage, signatures []*ProvidedSignature) (*IntentResponse, error) + GetSession(ctx context.Context, sessionId string) (*IntentResponse, error) + RegisterSession(ctx context.Context, userID string, intent *Intent) (*IntentResponse, error) + StartSessionValidation(ctx context.Context, walletAddress string, sessionId string, deviceMetadata string) (*IntentResponse, error) + FinishValidateSession(ctx context.Context, sessionId string, salt string, challenge string) (*IntentResponse, error) + InvalidateSession(ctx context.Context, sessionId string) (bool, error) + SessionAuthProof(ctx context.Context, intent *Intent, proof *SessionAuthProof) (*IntentResponse, error) + FederateAccount(ctx context.Context, userID string, intent *Intent) (*IntentResponse, error) + RemoveAccount(ctx context.Context, intent *Intent) (*IntentResponse, error) + InitiateAuth(ctx context.Context, intent *Intent, answer string, challenge string) (*IntentResponse, error) + AdoptChildWallet(ctx context.Context, intent *Intent, checkpoint uint32, signatures []*ProvidedSignature) (*IntentResponse, error) + // TODO: deprecated; remove once it's not used by waas-auth anymore + InitiateEmailAuth(ctx context.Context, intent *Intent, answerHash string, salt string) (*IntentResponse, error) + // Generic send intent method + SendIntent(ctx context.Context, intent *Intent) (*IntentResponse, error) + // utilities + ChainList(ctx context.Context) ([]*Chain, error) +} + +// +// Client types +// + +type WaaSClient interface { + // + // system-admin methods + // + CreateProject(ctx context.Context, projectID uint64, name string, config *ProjectWalletPreConfig, jwtAlg string, jwtSecret *string, jwtPublic *string) (*Project, error) + DeployProjectParentWallet(ctx context.Context, projectID uint64, chainID string) (string, string, error) + UpdateProjectUserMapRules(ctx context.Context, projectID uint64, userMapRules *ProjectSessionUserMapRules) error + ProjectParentConfig(ctx context.Context, projectID uint64) (string, error) + ProjectParentWallet(ctx context.Context, projectID uint64) (string, error) + ProjectParentWalletStatus(ctx context.Context, projectID uint64) ([]*ParentWalletStatus, error) + ProjectWallets(ctx context.Context, projectID uint64, page *Page) ([]*ProjectWallet, *Page, error) + // NOTICE: This is NOT the salt used for the guard + // this salt is used to deterministically being able to compute the relationship + // userId <-> wallet, that way the API can't map users to the wrong wallet + ProjectUserSalt(ctx context.Context, projectID uint64) (string, error) + // similar method to DeployProjectParentWallet, but allows anyone to call it to get + // the transaction calldata to do a parent wallet deployment manually. + GetProjectParentWalletDeployCalldata(ctx context.Context, projectID uint64, chainID string) (string, string, string, error) + // these methods are used by the dss during setup, they reduce the + // amount of configuration that needs to be manually passed around + ProjectWallet(ctx context.Context) (string, error) + SequenceContext(ctx context.Context) (*MiniSequenceContext, error) + UserSalt(ctx context.Context) (string, error) + UseHotWallet(ctx context.Context, walletAddress string) (bool, error) + // wallet rpc caller + Wallets(ctx context.Context, page *Page) ([]*ProjectWallet, *Page, error) + // wallet rpc using sdk + GenTransaction(ctx context.Context, intent *Intent) (*TransactionBundle, error) + SendTransaction(ctx context.Context, intent *Intent, result *TransactionBundle, signatures []*ProvidedSignature) (*IntentResponse, error) + SignMessage(ctx context.Context, intent *Intent, message *SignMessage, signatures []*ProvidedSignature) (*IntentResponse, error) + GetSession(ctx context.Context, sessionId string) (*IntentResponse, error) + RegisterSession(ctx context.Context, userID string, intent *Intent) (*IntentResponse, error) + StartSessionValidation(ctx context.Context, walletAddress string, sessionId string, deviceMetadata string) (*IntentResponse, error) + FinishValidateSession(ctx context.Context, sessionId string, salt string, challenge string) (*IntentResponse, error) + InvalidateSession(ctx context.Context, sessionId string) (bool, error) + SessionAuthProof(ctx context.Context, intent *Intent, proof *SessionAuthProof) (*IntentResponse, error) + FederateAccount(ctx context.Context, userID string, intent *Intent) (*IntentResponse, error) + RemoveAccount(ctx context.Context, intent *Intent) (*IntentResponse, error) + InitiateAuth(ctx context.Context, intent *Intent, answer string, challenge string) (*IntentResponse, error) + AdoptChildWallet(ctx context.Context, intent *Intent, checkpoint uint32, signatures []*ProvidedSignature) (*IntentResponse, error) + // TODO: deprecated; remove once it's not used by waas-auth anymore + InitiateEmailAuth(ctx context.Context, intent *Intent, answerHash string, salt string) (*IntentResponse, error) + // Generic send intent method + SendIntent(ctx context.Context, intent *Intent) (*IntentResponse, error) + // utilities + ChainList(ctx context.Context) ([]*Chain, error) +} + +// +// Server +// + +type WebRPCServer interface { + http.Handler +} + +type waaSServer struct { + WaaS + OnError func(r *http.Request, rpcErr *WebRPCError) + OnRequest func(w http.ResponseWriter, r *http.Request) error +} + +func NewWaaSServer(svc WaaS) *waaSServer { + return &waaSServer{ + WaaS: svc, + } +} + +func (s *waaSServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { + defer func() { + // In case of a panic, serve a HTTP 500 error and then panic. + if rr := recover(); rr != nil { + s.sendErrorJSON(w, r, ErrWebrpcServerPanic.WithCause(fmt.Errorf("%v", rr))) + panic(rr) + } + }() + + ctx := r.Context() + ctx = context.WithValue(ctx, HTTPResponseWriterCtxKey, w) + ctx = context.WithValue(ctx, HTTPRequestCtxKey, r) + ctx = context.WithValue(ctx, ServiceNameCtxKey, "WaaS") + + r = r.WithContext(ctx) + + var handler func(ctx context.Context, w http.ResponseWriter, r *http.Request) + switch r.URL.Path { + case "/rpc/WaaS/CreateProject": + handler = s.serveCreateProjectJSON + case "/rpc/WaaS/DeployProjectParentWallet": + handler = s.serveDeployProjectParentWalletJSON + case "/rpc/WaaS/UpdateProjectUserMapRules": + handler = s.serveUpdateProjectUserMapRulesJSON + case "/rpc/WaaS/ProjectParentConfig": + handler = s.serveProjectParentConfigJSON + case "/rpc/WaaS/ProjectParentWallet": + handler = s.serveProjectParentWalletJSON + case "/rpc/WaaS/ProjectParentWalletStatus": + handler = s.serveProjectParentWalletStatusJSON + case "/rpc/WaaS/ProjectWallets": + handler = s.serveProjectWalletsJSON + case "/rpc/WaaS/ProjectUserSalt": + handler = s.serveProjectUserSaltJSON + case "/rpc/WaaS/GetProjectParentWalletDeployCalldata": + handler = s.serveGetProjectParentWalletDeployCalldataJSON + case "/rpc/WaaS/ProjectWallet": + handler = s.serveProjectWalletJSON + case "/rpc/WaaS/SequenceContext": + handler = s.serveSequenceContextJSON + case "/rpc/WaaS/UserSalt": + handler = s.serveUserSaltJSON + case "/rpc/WaaS/UseHotWallet": + handler = s.serveUseHotWalletJSON + case "/rpc/WaaS/Wallets": + handler = s.serveWalletsJSON + case "/rpc/WaaS/GenTransaction": + handler = s.serveGenTransactionJSON + case "/rpc/WaaS/SendTransaction": + handler = s.serveSendTransactionJSON + case "/rpc/WaaS/SignMessage": + handler = s.serveSignMessageJSON + case "/rpc/WaaS/GetSession": + handler = s.serveGetSessionJSON + case "/rpc/WaaS/RegisterSession": + handler = s.serveRegisterSessionJSON + case "/rpc/WaaS/StartSessionValidation": + handler = s.serveStartSessionValidationJSON + case "/rpc/WaaS/FinishValidateSession": + handler = s.serveFinishValidateSessionJSON + case "/rpc/WaaS/InvalidateSession": + handler = s.serveInvalidateSessionJSON + case "/rpc/WaaS/SessionAuthProof": + handler = s.serveSessionAuthProofJSON + case "/rpc/WaaS/FederateAccount": + handler = s.serveFederateAccountJSON + case "/rpc/WaaS/RemoveAccount": + handler = s.serveRemoveAccountJSON + case "/rpc/WaaS/InitiateAuth": + handler = s.serveInitiateAuthJSON + case "/rpc/WaaS/AdoptChildWallet": + handler = s.serveAdoptChildWalletJSON + case "/rpc/WaaS/InitiateEmailAuth": + handler = s.serveInitiateEmailAuthJSON + case "/rpc/WaaS/SendIntent": + handler = s.serveSendIntentJSON + case "/rpc/WaaS/ChainList": + handler = s.serveChainListJSON + default: + err := ErrWebrpcBadRoute.WithCause(fmt.Errorf("no WebRPC method defined for path %v", r.URL.Path)) + s.sendErrorJSON(w, r, err) + return + } + + if r.Method != "POST" { + w.Header().Add("Allow", "POST") // RFC 9110. + err := ErrWebrpcBadMethod.WithCause(fmt.Errorf("unsupported method %v (only POST is allowed)", r.Method)) + s.sendErrorJSON(w, r, err) + return + } + + contentType := r.Header.Get("Content-Type") + if i := strings.Index(contentType, ";"); i >= 0 { + contentType = contentType[:i] + } + contentType = strings.TrimSpace(strings.ToLower(contentType)) + + switch contentType { + case "application/json": + if s.OnRequest != nil { + if err := s.OnRequest(w, r); err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + } + + handler(ctx, w, r) + default: + err := ErrWebrpcBadRequest.WithCause(fmt.Errorf("unsupported Content-Type %q (only application/json is allowed)", r.Header.Get("Content-Type"))) + s.sendErrorJSON(w, r, err) + } +} + +func (s *waaSServer) serveCreateProjectJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "CreateProject") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 uint64 `json:"projectID"` + Arg1 string `json:"name"` + Arg2 *ProjectWalletPreConfig `json:"config"` + Arg3 string `json:"jwtAlg"` + Arg4 *string `json:"jwtSecret"` + Arg5 *string `json:"jwtPublic"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.CreateProject(ctx, reqPayload.Arg0, reqPayload.Arg1, reqPayload.Arg2, reqPayload.Arg3, reqPayload.Arg4, reqPayload.Arg5) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 *Project `json:"project"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveDeployProjectParentWalletJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "DeployProjectParentWallet") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 uint64 `json:"projectID"` + Arg1 string `json:"chainID"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, ret1, err := s.WaaS.DeployProjectParentWallet(ctx, reqPayload.Arg0, reqPayload.Arg1) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 string `json:"address"` + Ret1 string `json:"txnHash"` + }{ret0, ret1} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveUpdateProjectUserMapRulesJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "UpdateProjectUserMapRules") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 uint64 `json:"projectID"` + Arg1 *ProjectSessionUserMapRules `json:"userMapRules"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + err = s.WaaS.UpdateProjectUserMapRules(ctx, reqPayload.Arg0, reqPayload.Arg1) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write([]byte("{}")) +} + +func (s *waaSServer) serveProjectParentConfigJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "ProjectParentConfig") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 uint64 `json:"projectID"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.ProjectParentConfig(ctx, reqPayload.Arg0) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 string `json:"config"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveProjectParentWalletJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "ProjectParentWallet") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 uint64 `json:"projectID"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.ProjectParentWallet(ctx, reqPayload.Arg0) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 string `json:"address"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveProjectParentWalletStatusJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "ProjectParentWalletStatus") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 uint64 `json:"projectID"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.ProjectParentWalletStatus(ctx, reqPayload.Arg0) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 []*ParentWalletStatus `json:"parentWalletStatus"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveProjectWalletsJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "ProjectWallets") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 uint64 `json:"projectID"` + Arg1 *Page `json:"page"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, ret1, err := s.WaaS.ProjectWallets(ctx, reqPayload.Arg0, reqPayload.Arg1) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 []*ProjectWallet `json:"wallets"` + Ret1 *Page `json:"page"` + }{ret0, ret1} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveProjectUserSaltJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "ProjectUserSalt") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 uint64 `json:"projectID"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.ProjectUserSalt(ctx, reqPayload.Arg0) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 string `json:"salt"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveGetProjectParentWalletDeployCalldataJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "GetProjectParentWalletDeployCalldata") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 uint64 `json:"projectID"` + Arg1 string `json:"chainID"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, ret1, ret2, err := s.WaaS.GetProjectParentWalletDeployCalldata(ctx, reqPayload.Arg0, reqPayload.Arg1) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 string `json:"parentWalletAddress"` + Ret1 string `json:"toAddress"` + Ret2 string `json:"calldata"` + }{ret0, ret1, ret2} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveProjectWalletJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "ProjectWallet") + + // Call service method implementation. + ret0, err := s.WaaS.ProjectWallet(ctx) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 string `json:"address"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveSequenceContextJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "SequenceContext") + + // Call service method implementation. + ret0, err := s.WaaS.SequenceContext(ctx) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 *MiniSequenceContext `json:"context"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveUserSaltJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "UserSalt") + + // Call service method implementation. + ret0, err := s.WaaS.UserSalt(ctx) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 string `json:"salt"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveUseHotWalletJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "UseHotWallet") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 string `json:"walletAddress"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.UseHotWallet(ctx, reqPayload.Arg0) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 bool `json:"status"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveWalletsJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "Wallets") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 *Page `json:"page"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, ret1, err := s.WaaS.Wallets(ctx, reqPayload.Arg0) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 []*ProjectWallet `json:"wallets"` + Ret1 *Page `json:"page"` + }{ret0, ret1} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveGenTransactionJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "GenTransaction") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 *Intent `json:"intent"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.GenTransaction(ctx, reqPayload.Arg0) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 *TransactionBundle `json:"result"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveSendTransactionJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "SendTransaction") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 *Intent `json:"intent"` + Arg1 *TransactionBundle `json:"result"` + Arg2 []*ProvidedSignature `json:"signatures"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.SendTransaction(ctx, reqPayload.Arg0, reqPayload.Arg1, reqPayload.Arg2) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 *IntentResponse `json:"response"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveSignMessageJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "SignMessage") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 *Intent `json:"intent"` + Arg1 *SignMessage `json:"message"` + Arg2 []*ProvidedSignature `json:"signatures"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.SignMessage(ctx, reqPayload.Arg0, reqPayload.Arg1, reqPayload.Arg2) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 *IntentResponse `json:"response"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveGetSessionJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "GetSession") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 string `json:"sessionId"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.GetSession(ctx, reqPayload.Arg0) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 *IntentResponse `json:"response"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveRegisterSessionJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "RegisterSession") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 string `json:"userID"` + Arg1 *Intent `json:"intent"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.RegisterSession(ctx, reqPayload.Arg0, reqPayload.Arg1) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 *IntentResponse `json:"response"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveStartSessionValidationJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "StartSessionValidation") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 string `json:"walletAddress"` + Arg1 string `json:"sessionId"` + Arg2 string `json:"deviceMetadata"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.StartSessionValidation(ctx, reqPayload.Arg0, reqPayload.Arg1, reqPayload.Arg2) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 *IntentResponse `json:"response"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveFinishValidateSessionJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "FinishValidateSession") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 string `json:"sessionId"` + Arg1 string `json:"salt"` + Arg2 string `json:"challenge"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.FinishValidateSession(ctx, reqPayload.Arg0, reqPayload.Arg1, reqPayload.Arg2) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 *IntentResponse `json:"response"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveInvalidateSessionJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "InvalidateSession") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 string `json:"sessionId"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.InvalidateSession(ctx, reqPayload.Arg0) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 bool `json:"status"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveSessionAuthProofJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "SessionAuthProof") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 *Intent `json:"intent"` + Arg1 *SessionAuthProof `json:"proof"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.SessionAuthProof(ctx, reqPayload.Arg0, reqPayload.Arg1) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 *IntentResponse `json:"response"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveFederateAccountJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "FederateAccount") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 string `json:"userID"` + Arg1 *Intent `json:"intent"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.FederateAccount(ctx, reqPayload.Arg0, reqPayload.Arg1) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 *IntentResponse `json:"response"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveRemoveAccountJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "RemoveAccount") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 *Intent `json:"intent"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.RemoveAccount(ctx, reqPayload.Arg0) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 *IntentResponse `json:"response"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveInitiateAuthJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "InitiateAuth") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 *Intent `json:"intent"` + Arg1 string `json:"answer"` + Arg2 string `json:"challenge"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.InitiateAuth(ctx, reqPayload.Arg0, reqPayload.Arg1, reqPayload.Arg2) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 *IntentResponse `json:"response"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) +} + +func (s *waaSServer) serveAdoptChildWalletJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "AdoptChildWallet") + + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() + + reqPayload := struct { + Arg0 *Intent `json:"intent"` + Arg1 uint32 `json:"checkpoint"` + Arg2 []*ProvidedSignature `json:"signatures"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } + + // Call service method implementation. + ret0, err := s.WaaS.AdoptChildWallet(ctx, reqPayload.Arg0, reqPayload.Arg1, reqPayload.Arg2) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 *IntentResponse `json:"response"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } -type TransactionBundle struct { - ChainID string `json:"chainID"` - Nonce string `json:"nonce"` - Transactions []*Transaction `json:"transactions"` + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) } -type SignMessage struct { - ChainID string `json:"chainID"` - Message string `json:"message"` -} +func (s *waaSServer) serveInitiateEmailAuthJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "InitiateEmailAuth") -type ParentWalletStatus struct { - ChainID string `json:"chainID"` - Address string `json:"address"` - Deployed bool `json:"deployed"` -} + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() -// Chain represents a blockchain network. -type Chain struct { - Id uint64 `json:"id"` - Name string `json:"name"` -} + reqPayload := struct { + Arg0 *Intent `json:"intent"` + Arg1 string `json:"answerHash"` + Arg2 string `json:"salt"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } -// Page represents a results page. This can be used both to request a page and -// to store the state of a page. -type Page struct { - // Common for both numbered pages and cursor: Number of items per page - // TODO: REMOVE.. - PageSize *uint32 `json:"pageSize"` - // Numbered pages: Page number, this is multiplied by the value of the parameter. - // TODO: REMOVE.. - Page *uint32 `json:"page"` - // Number of total items on this query. - // TODO: REMOVE.. - TotalRecords *uint64 `json:"totalRecords"` - // Cursor: column to compare before/after to - Column *string `json:"column"` - // Cursor: return column < before - include to get previous page - Before *interface{} `json:"before"` - // Cursor: return column > after - include to get next page - After *interface{} `json:"after"` - // Sorting filter - Sort []*SortBy `json:"sort"` -} + // Call service method implementation. + ret0, err := s.WaaS.InitiateEmailAuth(ctx, reqPayload.Arg0, reqPayload.Arg1, reqPayload.Arg2) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } -type SortBy struct { - Column string `json:"column"` - Order SortOrder `json:"order"` -} + respPayload := struct { + Ret0 *IntentResponse `json:"response"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } -type ProvidedSignature struct { - Signature string `json:"Signature"` - Digest string `json:"Digest"` - Address string `json:"Address"` + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) } -type ProjectWalletPreConfig struct { - ProjectRecoveryAddress string `json:"projectRecoveryAddress"` - UserMapRules *ProjectSessionUserMapRules `json:"userMapRules"` -} +func (s *waaSServer) serveSendIntentJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "SendIntent") -type ProjectSessionUserMapRules struct { - AllowIdTokens bool `json:"allowIdTokens" db:"allow_id_tokens"` - AllowEmails bool `json:"allowEmails" db:"allow_emails"` - AllowPhones bool `json:"allowPhones" db:"allow_phones"` - UserIdTemplate string `json:"userIdTemplate" db:"user_id_template"` - IdTokenTrustedAuthenticatorIssuer string `json:"idTokenTrustedAuthenticatorIssuer" db:"id_token_trusted_authenticator_issuer"` -} + reqBody, err := io.ReadAll(r.Body) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to read request data: %w", err))) + return + } + defer r.Body.Close() -type SessionAuthProof struct { - Wallet string `json:"wallet"` - Message *SignMessage `json:"message"` - Signatures []*ProvidedSignature `json:"signatures"` -} + reqPayload := struct { + Arg0 *Intent `json:"intent"` + }{} + if err := json.Unmarshal(reqBody, &reqPayload); err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadRequest.WithCause(fmt.Errorf("failed to unmarshal request data: %w", err))) + return + } -type MiniSequenceContext struct { - Factory string `json:"factory"` - MainModule string `json:"mainModule"` + // Call service method implementation. + ret0, err := s.WaaS.SendIntent(ctx, reqPayload.Arg0) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 *IntentResponse `json:"response"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) } -var WebRPCServices = map[string][]string{ - "WaaS": { - "CreateProject", - "DeployProjectParentWallet", - "UpdateProjectUserMapRules", - "ProjectParentConfig", - "ProjectParentWallet", - "ProjectParentWalletStatus", - "ProjectWallets", - "ProjectUserSalt", - "GetProjectParentWalletDeployCalldata", - "ProjectWallet", - "SequenceContext", - "UserSalt", - "UseHotWallet", - "Wallets", - "GenTransaction", - "SendTransaction", - "SignMessage", - "GetSession", - "RegisterSession", - "StartSessionValidation", - "FinishValidateSession", - "InvalidateSession", - "SessionAuthProof", - "FederateAccount", - "RemoveAccount", - "InitiateAuth", - "AdoptChildWallet", - "InitiateEmailAuth", - "SendIntent", - "ChainList", - }, +func (s *waaSServer) serveChainListJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) { + ctx = context.WithValue(ctx, MethodNameCtxKey, "ChainList") + + // Call service method implementation. + ret0, err := s.WaaS.ChainList(ctx) + if err != nil { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } + s.sendErrorJSON(w, r, rpcErr) + return + } + + respPayload := struct { + Ret0 []*Chain `json:"chains"` + }{ret0} + respBody, err := json.Marshal(respPayload) + if err != nil { + s.sendErrorJSON(w, r, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to marshal json response: %w", err))) + return + } + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + w.Write(respBody) } -// -// Server types -// +func (s *waaSServer) sendErrorJSON(w http.ResponseWriter, r *http.Request, rpcErr WebRPCError) { + if s.OnError != nil { + s.OnError(r, &rpcErr) + } -type WaaS interface { - // - // system-admin methods - // - CreateProject(ctx context.Context, projectID uint64, name string, config *ProjectWalletPreConfig, jwtAlg string, jwtSecret *string, jwtPublic *string) (*Project, error) - DeployProjectParentWallet(ctx context.Context, projectID uint64, chainID string) (string, string, error) - UpdateProjectUserMapRules(ctx context.Context, projectID uint64, userMapRules *ProjectSessionUserMapRules) error - ProjectParentConfig(ctx context.Context, projectID uint64) (string, error) - ProjectParentWallet(ctx context.Context, projectID uint64) (string, error) - ProjectParentWalletStatus(ctx context.Context, projectID uint64) ([]*ParentWalletStatus, error) - ProjectWallets(ctx context.Context, projectID uint64, page *Page) ([]*ProjectWallet, *Page, error) - // NOTICE: This is NOT the salt used for the guard - // this salt is used to deterministically being able to compute the relationship - // userId <-> wallet, that way the API can't map users to the wrong wallet - ProjectUserSalt(ctx context.Context, projectID uint64) (string, error) - // similar method to DeployProjectParentWallet, but allows anyone to call it to get - // the transaction calldata to do a parent wallet deployment manually. - GetProjectParentWalletDeployCalldata(ctx context.Context, projectID uint64, chainID string) (string, string, string, error) - // these methods are used by the dss during setup, they reduce the - // amount of configuration that needs to be manually passed around - ProjectWallet(ctx context.Context) (string, error) - SequenceContext(ctx context.Context) (*MiniSequenceContext, error) - UserSalt(ctx context.Context) (string, error) - UseHotWallet(ctx context.Context, walletAddress string) (bool, error) - // wallet rpc caller - Wallets(ctx context.Context, page *Page) ([]*ProjectWallet, *Page, error) - // wallet rpc using sdk - GenTransaction(ctx context.Context, intent *Intent) (*TransactionBundle, error) - SendTransaction(ctx context.Context, intent *Intent, result *TransactionBundle, signatures []*ProvidedSignature) (*IntentResponse, error) - SignMessage(ctx context.Context, intent *Intent, message *SignMessage, signatures []*ProvidedSignature) (*IntentResponse, error) - GetSession(ctx context.Context, sessionId string) (*IntentResponse, error) - RegisterSession(ctx context.Context, userID string, intent *Intent) (*IntentResponse, error) - StartSessionValidation(ctx context.Context, walletAddress string, sessionId string, deviceMetadata string) (*IntentResponse, error) - FinishValidateSession(ctx context.Context, sessionId string, salt string, challenge string) (*IntentResponse, error) - InvalidateSession(ctx context.Context, sessionId string) (bool, error) - SessionAuthProof(ctx context.Context, intent *Intent, proof *SessionAuthProof) (*IntentResponse, error) - FederateAccount(ctx context.Context, userID string, intent *Intent) (*IntentResponse, error) - RemoveAccount(ctx context.Context, intent *Intent) (*IntentResponse, error) - InitiateAuth(ctx context.Context, intent *Intent, answer string, challenge string) (*IntentResponse, error) - AdoptChildWallet(ctx context.Context, intent *Intent, checkpoint uint32, signatures []*ProvidedSignature) (*IntentResponse, error) - // TODO: deprecated; remove once it's not used by waas-auth anymore - InitiateEmailAuth(ctx context.Context, intent *Intent, answerHash string, salt string) (*IntentResponse, error) - // Generic send intent method - SendIntent(ctx context.Context, intent *Intent) (*IntentResponse, error) - // utilities - ChainList(ctx context.Context) ([]*Chain, error) + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(rpcErr.HTTPStatus) + + respBody, _ := json.Marshal(rpcErr) + w.Write(respBody) } -// -// Client types -// +func RespondWithError(w http.ResponseWriter, err error) { + rpcErr, ok := err.(WebRPCError) + if !ok { + rpcErr = ErrWebrpcEndpoint.WithCause(err) + } -type WaaSClient interface { - // - // system-admin methods - // - CreateProject(ctx context.Context, projectID uint64, name string, config *ProjectWalletPreConfig, jwtAlg string, jwtSecret *string, jwtPublic *string) (*Project, error) - DeployProjectParentWallet(ctx context.Context, projectID uint64, chainID string) (string, string, error) - UpdateProjectUserMapRules(ctx context.Context, projectID uint64, userMapRules *ProjectSessionUserMapRules) error - ProjectParentConfig(ctx context.Context, projectID uint64) (string, error) - ProjectParentWallet(ctx context.Context, projectID uint64) (string, error) - ProjectParentWalletStatus(ctx context.Context, projectID uint64) ([]*ParentWalletStatus, error) - ProjectWallets(ctx context.Context, projectID uint64, page *Page) ([]*ProjectWallet, *Page, error) - // NOTICE: This is NOT the salt used for the guard - // this salt is used to deterministically being able to compute the relationship - // userId <-> wallet, that way the API can't map users to the wrong wallet - ProjectUserSalt(ctx context.Context, projectID uint64) (string, error) - // similar method to DeployProjectParentWallet, but allows anyone to call it to get - // the transaction calldata to do a parent wallet deployment manually. - GetProjectParentWalletDeployCalldata(ctx context.Context, projectID uint64, chainID string) (string, string, string, error) - // these methods are used by the dss during setup, they reduce the - // amount of configuration that needs to be manually passed around - ProjectWallet(ctx context.Context) (string, error) - SequenceContext(ctx context.Context) (*MiniSequenceContext, error) - UserSalt(ctx context.Context) (string, error) - UseHotWallet(ctx context.Context, walletAddress string) (bool, error) - // wallet rpc caller - Wallets(ctx context.Context, page *Page) ([]*ProjectWallet, *Page, error) - // wallet rpc using sdk - GenTransaction(ctx context.Context, intent *Intent) (*TransactionBundle, error) - SendTransaction(ctx context.Context, intent *Intent, result *TransactionBundle, signatures []*ProvidedSignature) (*IntentResponse, error) - SignMessage(ctx context.Context, intent *Intent, message *SignMessage, signatures []*ProvidedSignature) (*IntentResponse, error) - GetSession(ctx context.Context, sessionId string) (*IntentResponse, error) - RegisterSession(ctx context.Context, userID string, intent *Intent) (*IntentResponse, error) - StartSessionValidation(ctx context.Context, walletAddress string, sessionId string, deviceMetadata string) (*IntentResponse, error) - FinishValidateSession(ctx context.Context, sessionId string, salt string, challenge string) (*IntentResponse, error) - InvalidateSession(ctx context.Context, sessionId string) (bool, error) - SessionAuthProof(ctx context.Context, intent *Intent, proof *SessionAuthProof) (*IntentResponse, error) - FederateAccount(ctx context.Context, userID string, intent *Intent) (*IntentResponse, error) - RemoveAccount(ctx context.Context, intent *Intent) (*IntentResponse, error) - InitiateAuth(ctx context.Context, intent *Intent, answer string, challenge string) (*IntentResponse, error) - AdoptChildWallet(ctx context.Context, intent *Intent, checkpoint uint32, signatures []*ProvidedSignature) (*IntentResponse, error) - // TODO: deprecated; remove once it's not used by waas-auth anymore - InitiateEmailAuth(ctx context.Context, intent *Intent, answerHash string, salt string) (*IntentResponse, error) - // Generic send intent method - SendIntent(ctx context.Context, intent *Intent) (*IntentResponse, error) - // utilities - ChainList(ctx context.Context) ([]*Chain, error) + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(rpcErr.HTTPStatus) + + respBody, _ := json.Marshal(rpcErr) + w.Write(respBody) } // @@ -1208,6 +2811,12 @@ func HTTPRequestHeaders(ctx context.Context) (http.Header, bool) { // Helpers // +type method struct { + Name string + Service string + Annotations map[string]string +} + type contextKey struct { name string } @@ -1218,7 +2827,9 @@ func (k *contextKey) String() string { var ( HTTPClientRequestHeadersCtxKey = &contextKey{"HTTPClientRequestHeaders"} - HTTPRequestCtxKey = &contextKey{"HTTPRequest"} + HTTPResponseWriterCtxKey = &contextKey{"HTTPResponseWriter"} + + HTTPRequestCtxKey = &contextKey{"HTTPRequest"} ServiceNameCtxKey = &contextKey{"ServiceName"} @@ -1240,6 +2851,25 @@ func RequestFromContext(ctx context.Context) *http.Request { return r } +func MethodCtx(ctx context.Context) (method, bool) { + req := RequestFromContext(ctx) + if req == nil { + return method{}, false + } + + m, ok := methods[req.URL.Path] + if !ok { + return method{}, false + } + + return m, true +} + +func ResponseWriterFromContext(ctx context.Context) http.ResponseWriter { + w, _ := ctx.Value(HTTPResponseWriterCtxKey).(http.ResponseWriter) + return w +} + // // Errors // diff --git a/rpc/helpers_test.go b/rpc/helpers_test.go index c1e670f7..70c7899a 100644 --- a/rpc/helpers_test.go +++ b/rpc/helpers_test.go @@ -489,6 +489,10 @@ type walletServiceMock struct { registeredSessions map[string]struct{} } +func (w walletServiceMock) AdoptChildWallet(ctx context.Context, intent *proto_wallet.Intent, checkpoint uint32, signatures []*proto_wallet.ProvidedSignature) (*proto_wallet.IntentResponse, error) { + panic("unimplemented") +} + func (w walletServiceMock) InitiateAuth(ctx context.Context, intent *proto_wallet.Intent, answer string, challenge string) (*proto_wallet.IntentResponse, error) { return nil, nil } @@ -498,32 +502,32 @@ func (w walletServiceMock) InitiateEmailAuth(ctx context.Context, intent *proto_ } func (w walletServiceMock) UpdateProjectUserMapRules(ctx context.Context, projectID uint64, userMapRules *proto_wallet.ProjectSessionUserMapRules) error { - //TODO implement me + // TODO implement me panic("implement me") } func (w walletServiceMock) GetProjectParentWalletDeployCalldata(ctx context.Context, projectID uint64, chainID string) (string, string, string, error) { - //TODO implement me + // TODO implement me panic("implement me") } func (w walletServiceMock) FederateAccount(ctx context.Context, userID string, intent *proto_wallet.Intent) (*proto_wallet.IntentResponse, error) { - //TODO implement me + // TODO implement me panic("implement me") } func (w walletServiceMock) RemoveAccount(ctx context.Context, intent *proto_wallet.Intent) (*proto_wallet.IntentResponse, error) { - //TODO implement me + // TODO implement me panic("implement me") } func (w walletServiceMock) ProjectParentWalletStatus(ctx context.Context, projectID uint64) ([]*proto_wallet.ParentWalletStatus, error) { - //TODO implement me + // TODO implement me panic("implement me") } func (w walletServiceMock) SessionAuthProof(ctx context.Context, intent *proto_wallet.Intent, proof *proto_wallet.SessionAuthProof) (*proto_wallet.IntentResponse, error) { - //TODO implement me + // TODO implement me panic("implement me") } @@ -539,32 +543,32 @@ func newWalletServiceMock(registeredSessions []string) *walletServiceMock { } func (w walletServiceMock) CreateProject(ctx context.Context, projectID uint64, name string, config *proto_wallet.ProjectWalletPreConfig, jwtAlg string, jwtSecret *string, jwtPublic *string) (*proto_wallet.Project, error) { - //TODO implement me + // TODO implement me panic("implement me") } func (w walletServiceMock) ProjectParentConfig(ctx context.Context, projectId uint64) (string, error) { - //TODO implement me + // TODO implement me panic("implement me") } func (w walletServiceMock) ProjectParentWallet(ctx context.Context, projectId uint64) (string, error) { - //TODO implement me + // TODO implement me panic("implement me") } func (w walletServiceMock) DeployProjectParentWallet(ctx context.Context, projectId uint64, chainID string) (string, string, error) { - //TODO implement me + // TODO implement me panic("implement me") } func (w walletServiceMock) ProjectWallets(ctx context.Context, projectId uint64, page *proto_wallet.Page) ([]*proto_wallet.ProjectWallet, *proto_wallet.Page, error) { - //TODO implement me + // TODO implement me panic("implement me") } func (w walletServiceMock) ProjectUserSalt(ctx context.Context, projectId uint64) (string, error) { - //TODO implement me + // TODO implement me panic("implement me") } @@ -585,12 +589,12 @@ func (w walletServiceMock) UseHotWallet(ctx context.Context, walletAddress strin } func (w walletServiceMock) Wallets(ctx context.Context, page *proto_wallet.Page) ([]*proto_wallet.ProjectWallet, *proto_wallet.Page, error) { - //TODO implement me + // TODO implement me panic("implement me") } func (w walletServiceMock) IsValidMessageSignature(ctx context.Context, chainID uint64, walletAddress string, message string, signature string) (bool, error) { - //TODO implement me + // TODO implement me panic("implement me") } @@ -646,7 +650,7 @@ func (w walletServiceMock) SignMessage(ctx context.Context, intent *proto_wallet } func (w walletServiceMock) GetSession(ctx context.Context, sessionID string) (*proto_wallet.IntentResponse, error) { - //TODO implement me + // TODO implement me panic("implement me") } @@ -667,12 +671,12 @@ func (w *walletServiceMock) RegisterSession(ctx context.Context, userID string, w.registeredUsers[userID] = struct{}{} return &proto_wallet.IntentResponse{ - Code: string(proto.IntentResponseCode_sessionOpened), + Code: proto_wallet.IntentResponseCode_sessionOpened, }, nil } func (w walletServiceMock) StartSessionValidation(ctx context.Context, walletAddress string, sessionID string, deviceMetadata string) (*proto_wallet.IntentResponse, error) { - //TODO implement me + // TODO implement me panic("implement me") } @@ -694,12 +698,12 @@ func (w walletServiceMock) SendIntent(ctx context.Context, intent *proto_wallet. } func (w walletServiceMock) ChainList(ctx context.Context) ([]*proto_wallet.Chain, error) { - //TODO implement me + // TODO implement me panic("implement me") } func (w walletServiceMock) FinishValidateSession(ctx context.Context, sessionId string, salt string, challenge string) (*proto_wallet.IntentResponse, error) { - //TODO implement me + // TODO implement me panic("implement me") } diff --git a/vendor/github.com/0xsequence/go-sequence/core/v2/v2.go b/vendor/github.com/0xsequence/go-sequence/core/v2/v2.go index a8e4b46a..7d845711 100644 --- a/vendor/github.com/0xsequence/go-sequence/core/v2/v2.go +++ b/vendor/github.com/0xsequence/go-sequence/core/v2/v2.go @@ -16,7 +16,6 @@ import ( "github.com/0xsequence/ethkit/go-ethereum/common" "github.com/0xsequence/ethkit/go-ethereum/common/hexutil" "github.com/0xsequence/ethkit/go-ethereum/crypto" - "github.com/0xsequence/go-sequence/contracts" "github.com/0xsequence/go-sequence/core" ) @@ -1533,8 +1532,6 @@ func (c *WalletConfig) BuildRegularSignature(ctx context.Context, sign core.Sign signerSig.Type, signerSig.Signature} signedSigners[signerSig.Signer] = 0 - fmt.Println("!!! ---- found signature for signer", signerSig.Signer.Hex()) - weight := c.Tree.unverifiedWeight(signedSigners) if weight.Cmp(new(big.Int).SetUint64(uint64(c.Threshold_))) >= 0 { signCancel() diff --git a/vendor/github.com/0xsequence/go-sequence/intents/intent.gen.go b/vendor/github.com/0xsequence/go-sequence/intents/intent.gen.go index f7e3add0..540e262b 100644 --- a/vendor/github.com/0xsequence/go-sequence/intents/intent.gen.go +++ b/vendor/github.com/0xsequence/go-sequence/intents/intent.gen.go @@ -1,4 +1,4 @@ -// sequence-waas-intents v0.1.0 151879c2088ea7c2efec761d520d0003377bb6f0 +// sequence-waas-intents v0.1.0 47010351881054ccb75b704db39b04ddc8837c4b // -- // Code generated by webrpc-gen@v0.19.3 with golang generator. DO NOT EDIT. // @@ -25,7 +25,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "151879c2088ea7c2efec761d520d0003377bb6f0" + return "47010351881054ccb75b704db39b04ddc8837c4b" } // @@ -577,7 +577,6 @@ type IntentResponseIdToken struct { type IntentResponseChildWalletAdopted struct { AdopterAddress string `json:"adopterAddress"` - ImageHash string `json:"imageHash"` } type IntentResponseAdopter struct { @@ -585,7 +584,7 @@ type IntentResponseAdopter struct { } type IntentResponseConfirmationRequired struct { - ConfirmationID string `json:"confirmationID"` + ConfirmationID string `json:"confirmationId"` Salt string `json:"salt"` ChallengeType ChallengeType `json:"challengeType"` ChallengeDestination *string `json:"challengeDestination"` diff --git a/vendor/github.com/0xsequence/go-sequence/intents/intent.ridl b/vendor/github.com/0xsequence/go-sequence/intents/intent.ridl index 20458f6c..51899d9e 100644 --- a/vendor/github.com/0xsequence/go-sequence/intents/intent.ridl +++ b/vendor/github.com/0xsequence/go-sequence/intents/intent.ridl @@ -168,11 +168,13 @@ struct IntentDataGetAdopter struct IntentDataConfirmIntent - wallet: string - confirmationID: string + + go.field.name = ConfirmationID - challengeAnswer: string struct IntentDataGetConfirmationStatus - wallet: string - confirmationID: string + + go.field.name = ConfirmationID struct TransactionRaw - type: string @@ -365,13 +367,13 @@ struct IntentResponseIdToken struct IntentResponseChildWalletAdopted - adopterAddress: string - - imageHash: string struct IntentResponseAdopter - adopterAddress: string struct IntentResponseConfirmationRequired - - confirmationID: string + - confirmationId: string + + go.field.name = ConfirmationID - salt: string - challengeType: ChallengeType - challengeDestination?: string diff --git a/vendor/github.com/0xsequence/go-sequence/relayer/proto/relayer.gen.go b/vendor/github.com/0xsequence/go-sequence/relayer/proto/relayer.gen.go index c814b5ba..4d685591 100644 --- a/vendor/github.com/0xsequence/go-sequence/relayer/proto/relayer.gen.go +++ b/vendor/github.com/0xsequence/go-sequence/relayer/proto/relayer.gen.go @@ -14,7 +14,6 @@ import ( "io" "net/http" "net/url" - "strings" "time" "github.com/0xsequence/go-sequence/lib/prototyp" @@ -1343,12 +1342,6 @@ func doHTTPRequest(ctx context.Context, client HTTPClient, url string, in, out i return nil, ErrWebrpcRequestFailed.WithCause(fmt.Errorf("could not build request: %w", err)) } - curl, err := RequestToCurl(req) - if err != nil { - return nil, fmt.Errorf("could not make curl request: %w", err) - } - fmt.Println(curl) - resp, err := client.Do(req) if err != nil { return nil, ErrWebrpcRequestFailed.WithCause(err) @@ -1360,9 +1353,6 @@ func doHTTPRequest(ctx context.Context, client HTTPClient, url string, in, out i return nil, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to read server error response body: %w", err)) } - fmt.Println("RESP CODE:", resp.StatusCode) - fmt.Println(string(respBody)) - var rpcErr WebRPCError if err := json.Unmarshal(respBody, &rpcErr); err != nil { return nil, ErrWebrpcBadResponse.WithCause(fmt.Errorf("failed to unmarshal server error: %w", err)) @@ -1534,43 +1524,3 @@ var ( ErrNotFound = WebRPCError{Code: 3000, Name: "NotFound", Message: "Resource not found", HTTPStatus: 400} ErrInsufficientFee = WebRPCError{Code: 3004, Name: "InsufficientFee", Message: "Insufficient fee", HTTPStatus: 402} ) - -// RequestToCurl generates a curl command from an http.Request -func RequestToCurl(req *http.Request) (string, error) { - // Start building the curl command - var curlCmd strings.Builder - curlCmd.WriteString("curl -X ") - curlCmd.WriteString(req.Method) - - // Add headers to the curl command - for key, values := range req.Header { - for _, value := range values { - curlCmd.WriteString(fmt.Sprintf(" -H \"%s: %s\"", key, value)) - } - } - - // Add body if the method requires it (e.g., POST, PUT) - if req.Body != nil && (req.Method == http.MethodPost || req.Method == http.MethodPut || req.Method == http.MethodPatch) { - var bodyBytes []byte - var err error - if req.Body != nil { - // Read the body into bytes - bodyBytes, err = io.ReadAll(req.Body) - if err != nil { - return "", err - } - // Restore the body to the request so it can still be used - req.Body = io.NopCloser(bytes.NewBuffer(bodyBytes)) - } - - // If there's a non-empty body, add it to the curl command - if len(bodyBytes) > 0 { - curlCmd.WriteString(fmt.Sprintf(" --data '%s'", string(bodyBytes))) - } - } - - // Add the request URL - curlCmd.WriteString(fmt.Sprintf(" \"%s\"", req.URL.String())) - - return curlCmd.String(), nil -} diff --git a/vendor/github.com/0xsequence/go-sequence/wallet.go b/vendor/github.com/0xsequence/go-sequence/wallet.go index 82d94bc8..42d61202 100644 --- a/vendor/github.com/0xsequence/go-sequence/wallet.go +++ b/vendor/github.com/0xsequence/go-sequence/wallet.go @@ -10,7 +10,6 @@ import ( "github.com/0xsequence/ethkit/ethtxn" "github.com/0xsequence/ethkit/go-ethereum/common" "github.com/0xsequence/ethkit/go-ethereum/core/types" - "github.com/0xsequence/go-sequence/core" v1 "github.com/0xsequence/go-sequence/core/v1" v2 "github.com/0xsequence/go-sequence/core/v2" @@ -463,8 +462,6 @@ func (w *Wallet[C]) SignDigest(ctx context.Context, digest common.Hash, optChain return nil, fmt.Errorf("SignDigest, subDigestOf: %w", err) } - fmt.Println("PARENT SignDigest: ", common.Bytes2Hex(subDigest)) - sign := func(ctx context.Context, signerAddress common.Address, signatures []core.SignerSignature) (core.SignerSignatureType, []byte, error) { signer, _ := w.GetSigner(signerAddress) diff --git a/vendor/modules.txt b/vendor/modules.txt index 226486e0..560e6ab2 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -41,7 +41,7 @@ github.com/0xsequence/ethkit/util # github.com/0xsequence/go-ethauth v0.13.0 ## explicit; go 1.17 github.com/0xsequence/go-ethauth -# github.com/0xsequence/go-sequence v0.43.0 => /Users/patryk/Projects/Horizon/go-sequence +# github.com/0xsequence/go-sequence v0.43.4 ## explicit; go 1.22.0 github.com/0xsequence/go-sequence github.com/0xsequence/go-sequence/contracts @@ -1106,4 +1106,3 @@ moul.io/http2curl/v2 ## explicit; go 1.17 rsc.io/tmplfunc rsc.io/tmplfunc/internal/parse -# github.com/0xsequence/go-sequence => /Users/patryk/Projects/Horizon/go-sequence