From 4a816fec841a3dff9b10c01a96a56e9155e9545a Mon Sep 17 00:00:00 2001 From: Vinh Date: Fri, 8 Nov 2024 04:14:28 -0800 Subject: [PATCH] wallet management api --- aggregator/rpc_server.go | 26 +- aggregator/task_engine.go | 2 +- core/chainio/aa/aa.go | 11 + core/taskengine/doc.go | 31 +- core/taskengine/engine.go | 160 ++++++--- core/taskengine/engine_test.go | 1 + core/taskengine/processor.go | 4 +- core/taskengine/schema.go | 64 ++++ examples/example.js | 78 +++-- model/task.go | 4 +- model/user.go | 20 ++ protobuf/avs.pb.go | 586 +++++++++++++++++++++++---------- protobuf/avs.proto | 39 ++- protobuf/avs_grpc.pb.go | 36 ++ 14 files changed, 766 insertions(+), 296 deletions(-) create mode 100644 core/taskengine/engine_test.go create mode 100644 core/taskengine/schema.go diff --git a/aggregator/rpc_server.go b/aggregator/rpc_server.go index 555baf10..96cb1910 100644 --- a/aggregator/rpc_server.go +++ b/aggregator/rpc_server.go @@ -39,8 +39,16 @@ type RpcServer struct { } // Get nonce of an existing smart wallet of a given owner -func (r *RpcServer) GetNonce(ctx context.Context, payload *avsproto.NonceRequest) (*avsproto.NonceResp, error) { +func (r *RpcServer) CreateWallet(ctx context.Context, payload *avsproto.CreateWalletReq) (*avsproto.CreateWalletResp, error) { + user, err := r.verifyAuth(ctx) + if err != nil { + return nil, status.Errorf(codes.Unauthenticated, "invalid authentication key") + } + return r.engine.CreateSmartWallet(user, payload) +} +// Get nonce of an existing smart wallet of a given owner +func (r *RpcServer) GetNonce(ctx context.Context, payload *avsproto.NonceRequest) (*avsproto.NonceResp, error) { ownerAddress := common.HexToAddress(payload.Owner) nonce, err := aa.GetNonce(r.smartWalletRpc, ownerAddress, big.NewInt(0)) @@ -55,17 +63,15 @@ func (r *RpcServer) GetNonce(ctx context.Context, payload *avsproto.NonceRequest // GetAddress returns smart account address of the given owner in the auth key func (r *RpcServer) GetSmartAccountAddress(ctx context.Context, payload *avsproto.AddressRequest) (*avsproto.AddressResp, error) { - ownerAddress := common.HexToAddress(payload.Owner) - salt := big.NewInt(0) - sender, err := aa.GetSenderAddress(r.smartWalletRpc, ownerAddress, salt) - + user, err := r.verifyAuth(ctx) if err != nil { - return nil, status.Errorf(codes.Code(avsproto.Error_SmartWalletNotFoundError), "cannot determine smart wallet address") + return nil, status.Errorf(codes.Unauthenticated, "invalid authentication key") } + + wallets, err := r.engine.GetSmartWallets(user.Address) + return &avsproto.AddressResp{ - SmartAccountAddress: sender.String(), - // TODO: return the right salt - Salt: big.NewInt(0).String(), + Wallets: wallets, }, nil } @@ -160,12 +166,14 @@ func (r *RpcServer) GetTask(ctx context.Context, taskID *avsproto.UUID) (*avspro return task.ToProtoBuf() } +// Operator action func (r *RpcServer) SyncTasks(payload *avsproto.SyncTasksReq, srv avsproto.Aggregator_SyncTasksServer) error { err := r.engine.StreamCheckToOperator(payload, srv) return err } +// Operator action func (r *RpcServer) UpdateChecks(ctx context.Context, payload *avsproto.UpdateChecksReq) (*avsproto.UpdateChecksResp, error) { if err := r.engine.AggregateChecksResult(payload.Address, payload.Id); err != nil { return nil, err diff --git a/aggregator/task_engine.go b/aggregator/task_engine.go index bb0adf7f..3042b67e 100644 --- a/aggregator/task_engine.go +++ b/aggregator/task_engine.go @@ -34,7 +34,7 @@ func (agg *Aggregator) startTaskEngine(ctx context.Context) { agg.queue, agg.logger, ) - agg.engine.Start() + agg.engine.MustStart() agg.queue.MustStart() agg.worker.MustStart() diff --git a/core/chainio/aa/aa.go b/core/chainio/aa/aa.go index dbaf89c9..7197a263 100644 --- a/core/chainio/aa/aa.go +++ b/core/chainio/aa/aa.go @@ -69,6 +69,17 @@ func GetSenderAddress(conn *ethclient.Client, ownerAddress common.Address, salt return &sender, nil } +// Compute smart wallet address for a particular factory +func GetSenderAddressForFactory(conn *ethclient.Client, ownerAddress common.Address, customFactoryAddress common.Address, salt *big.Int) (*common.Address, error) { + simpleFactory, err := NewSimpleFactory(customFactoryAddress, conn) + if err != nil { + return nil, err + } + + sender, err := simpleFactory.GetAddress(nil, ownerAddress, salt) + return &sender, nil +} + func GetNonce(conn *ethclient.Client, ownerAddress common.Address, salt *big.Int) (*big.Int, error) { if salt == nil { salt = defaultSalt diff --git a/core/taskengine/doc.go b/core/taskengine/doc.go index 67829f30..dec9d460 100644 --- a/core/taskengine/doc.go +++ b/core/taskengine/doc.go @@ -1,16 +1,27 @@ /* -package trigger monitor the condition on when to fire a task -there are 3 trigger types: +Task Engine handles task storage and execution. We use badgerdb for all of our task storage. We like to make sure of Go cross compiling extensively and want to leverage pure-go as much as possible. badgerdb sastify that requirement. -Interval: Repeated at certain interval -Cron: trigger on time on cron -Onchain Event: when an event is emiited from a contract -Ev +**Wallet Info** -# Storage Layout +w:: = {factory_address: address, salt: salt} -Task is store into 2 storage -t:a:: the raw json of task data -u:: the task status +**Task Storage** + +w:: -> {factory, salt} +t:: -> task payload, the source of truth of task information +u::: -> task status +h::: -> an execution history + +The task storage was designed for fast retrieve time at the cost of extra storage. + +The storage can also be easily back-up, sync due to simplicity of supported write operation. + +**Data console** + +Storage can also be inspect with telnet: + + telnet /tmp/ap.sock + +Then issue `get ` or `list ` or `list *` to inspect current keys in the storage. */ package taskengine diff --git a/core/taskengine/engine.go b/core/taskengine/engine.go index 3903cbab..85dd0f4c 100644 --- a/core/taskengine/engine.go +++ b/core/taskengine/engine.go @@ -15,8 +15,11 @@ import ( "github.com/AvaProtocol/ap-avs/model" "github.com/AvaProtocol/ap-avs/storage" sdklogging "github.com/Layr-Labs/eigensdk-go/logging" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/ethclient" "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" grpcstatus "google.golang.org/grpc/status" avsproto "github.com/AvaProtocol/ap-avs/protobuf" @@ -50,6 +53,7 @@ type Engine struct { lock *sync.Mutex trackSyncedTasks map[string]*operatorState + smartWalletConfig *config.SmartWalletConfig // when shutdown is true, our engine will perform the shutdown // pending execution will be pushed out before the shutdown completely // to force shutdown, one can type ctrl+c twice @@ -91,10 +95,11 @@ func New(db storage.Storage, config *config.Config, queue *apqueue.Queue, logger db: db, queue: queue, - lock: &sync.Mutex{}, - tasks: make(map[string]*model.Task), - trackSyncedTasks: make(map[string]*operatorState), - shutdown: false, + lock: &sync.Mutex{}, + tasks: make(map[string]*model.Task), + trackSyncedTasks: make(map[string]*operatorState), + smartWalletConfig: config.SmartWallet, + shutdown: false, logger: logger, } @@ -110,14 +115,15 @@ func (n *Engine) Stop() { n.shutdown = true } -func (n *Engine) Start() { +func (n *Engine) MustStart() { var err error n.seq, err = n.db.GetSequence([]byte("t:seq"), 1000) if err != nil { panic(err) } - kvs, e := n.db.GetByPrefix([]byte(fmt.Sprintf("t:%s:", TaskStatusToStorageKey(avsproto.TaskStatus_Active)))) + // Upon booting we will get all the active tasks to sync to operator + kvs, e := n.db.GetByPrefix(TaskByStatusStoragePrefix(avsproto.TaskStatus_Active)) if e != nil { panic(e) } @@ -127,7 +133,87 @@ func (n *Engine) Start() { n.tasks[string(item.Key)] = &task } } +} + +func (n *Engine) GetSmartWallets(owner common.Address) ([]*avsproto.SmartWallet, error) { + // This is the default wallet with our own factory + salt := big.NewInt(0) + sender, err := aa.GetSenderAddress(rpcConn, owner, salt) + if err != nil { + return nil, status.Errorf(codes.Code(avsproto.Error_SmartWalletNotFoundError), "cannot determine smart wallet address") + } + + // now load the customize wallet with different salt or factory that was initialed and store in our db + wallets := []*avsproto.SmartWallet{ + &avsproto.SmartWallet{ + Address: sender.String(), + Factory: n.smartWalletConfig.FactoryAddress.String(), + Salt: salt.String(), + }, + } + + items, err := n.db.GetByPrefix(WalletByOwnerPrefix(owner)) + + if err != nil { + return nil, status.Errorf(codes.Code(avsproto.Error_SmartWalletNotFoundError), "cannot determine smart wallet address") + } + + for _, item := range items { + w := &model.SmartWallet{} + w.FromStorageData(item.Value) + wallets = append(wallets, &avsproto.SmartWallet{ + Address: w.Address.String(), + Factory: w.Factory.String(), + Salt: w.Salt.String(), + }) + } + + return wallets, nil +} + +func (n *Engine) CreateSmartWallet(user *model.User, payload *avsproto.CreateWalletReq) (*avsproto.CreateWalletResp, error) { + // Verify data + // when user passing a custom factory address, we want to validate it + if payload.FactoryAddress != "" && !common.IsHexAddress(payload.FactoryAddress) { + return nil, status.Errorf(codes.InvalidArgument, "invalid factory address") + } + + salt := big.NewInt(0) + if payload.Salt != "" { + var ok bool + salt, ok = math.ParseBig256(payload.Salt) + if !ok { + return nil, status.Errorf(codes.InvalidArgument, "invalid salt value") + } + } + + factoryAddress := n.smartWalletConfig.FactoryAddress + if payload.FactoryAddress != "" { + factoryAddress = common.HexToAddress(payload.FactoryAddress) + + } + + sender, err := aa.GetSenderAddressForFactory(rpcConn, user.Address, factoryAddress, salt) + + wallet := &model.SmartWallet{ + Owner: &user.Address, + Address: sender, + Factory: &factoryAddress, + Salt: salt, + } + + updates := map[string][]byte{} + + updates[string(WalletStorageKey(wallet))], err = wallet.ToJSON() + + if err = n.db.BatchWrite(updates); err != nil { + return nil, status.Errorf(codes.Code(avsproto.Error_StorageWriteError), "cannot update key to storage") + } + + return &avsproto.CreateWalletResp{ + Address: sender.String(), + }, nil } func (n *Engine) CreateTask(user *model.User, taskPayload *avsproto.CreateTaskReq) (*model.Task, error) { @@ -140,12 +226,7 @@ func (n *Engine) CreateTask(user *model.User, taskPayload *avsproto.CreateTaskRe return nil, grpcstatus.Errorf(codes.Code(avsproto.Error_SmartWalletRpcError), "cannot get smart wallet address") } - taskID, err := n.NewTaskID() - if err != nil { - return nil, grpcstatus.Errorf(codes.Code(avsproto.Error_StorageUnavailable), "cannot create task right now. storage unavailable") - } - - task, err := model.NewTaskFromProtobuf(taskID, user, taskPayload) + task, err := model.NewTaskFromProtobuf(user, taskPayload) if err != nil { return nil, err @@ -153,8 +234,8 @@ func (n *Engine) CreateTask(user *model.User, taskPayload *avsproto.CreateTaskRe updates := map[string][]byte{} - updates[TaskStorageKey(task.ID, task.Status)], err = task.ToJSON() - updates[TaskUserKey(task)] = []byte(fmt.Sprintf("%d", avsproto.TaskStatus_Active)) + updates[string(TaskStorageKey(task.ID, task.Status))], err = task.ToJSON() + updates[string(TaskUserKey(task))] = []byte(fmt.Sprintf("%d", avsproto.TaskStatus_Active)) if err = n.db.BatchWrite(updates); err != nil { return nil, err @@ -249,8 +330,8 @@ func (n *Engine) AggregateChecksResult(address string, ids []string) error { n.logger.Debug("mark task in executing status", "task_id", id) if err := n.db.Move( - []byte(fmt.Sprintf("t:%s:%s", TaskStatusToStorageKey(avsproto.TaskStatus_Active), id)), - []byte(fmt.Sprintf("t:%s:%s", TaskStatusToStorageKey(avsproto.TaskStatus_Executing), id)), + []byte(TaskStorageKey(id, avsproto.TaskStatus_Active)), + []byte(TaskStorageKey(id, avsproto.TaskStatus_Executing)), ); err != nil { n.logger.Error("error moving the task storage from active to executing", "task", id, "error", err) } @@ -263,7 +344,7 @@ func (n *Engine) AggregateChecksResult(address string, ids []string) error { } func (n *Engine) ListTasksByUser(user *model.User) ([]*avsproto.ListTasksResp_TaskItemResp, error) { - taskIDs, err := n.db.GetByPrefix([]byte(fmt.Sprintf("u:%s", user.Address.String()))) + taskIDs, err := n.db.GetByPrefix(UserTaskStoragePrefix(user.Address)) if err != nil { return nil, grpcstatus.Errorf(codes.Code(avsproto.Error_StorageUnavailable), "storage is not ready") @@ -326,8 +407,8 @@ func (n *Engine) DeleteTaskByUser(user *model.User, taskID string) (bool, error) return false, fmt.Errorf("Only non executing task can be deleted") } - n.db.Delete([]byte(TaskStorageKey(task.ID, task.Status))) - n.db.Delete([]byte(TaskUserKey(task))) + n.db.Delete(TaskStorageKey(task.ID, task.Status)) + n.db.Delete(TaskUserKey(task)) return true, nil } @@ -346,13 +427,13 @@ func (n *Engine) CancelTaskByUser(user *model.User, taskID string) (bool, error) updates := map[string][]byte{} oldStatus := task.Status task.SetCanceled() - updates[TaskStorageKey(task.ID, oldStatus)], err = task.ToJSON() - updates[TaskUserKey(task)] = []byte(fmt.Sprintf("%d", task.Status)) + updates[string(TaskStorageKey(task.ID, oldStatus))], err = task.ToJSON() + updates[string(TaskUserKey(task))] = []byte(fmt.Sprintf("%d", task.Status)) if err = n.db.BatchWrite(updates); err == nil { n.db.Move( - []byte(TaskStorageKey(task.ID, oldStatus)), - []byte(TaskStorageKey(task.ID, task.Status)), + TaskStorageKey(task.ID, oldStatus), + TaskStorageKey(task.ID, task.Status), ) delete(n.tasks, task.ID) @@ -363,37 +444,8 @@ func (n *Engine) CancelTaskByUser(user *model.User, taskID string) (bool, error) return true, nil } -func TaskStorageKey(id string, status avsproto.TaskStatus) string { - return fmt.Sprintf( - "t:%s:%s", - TaskStatusToStorageKey(status), - id, - ) -} - -func TaskUserKey(t *model.Task) string { - return fmt.Sprintf( - "u:%s", - t.Key(), - ) -} - -func TaskStatusToStorageKey(v avsproto.TaskStatus) string { - switch v { - case 1: - return "c" - case 2: - return "f" - case 3: - return "l" - case 4: - return "x" - } - - return "a" -} - -func (n *Engine) NewTaskID() (string, error) { +// A global counter for the task engine +func (n *Engine) NewSeqID() (string, error) { num := uint64(0) var err error diff --git a/core/taskengine/engine_test.go b/core/taskengine/engine_test.go new file mode 100644 index 00000000..4566ba7c --- /dev/null +++ b/core/taskengine/engine_test.go @@ -0,0 +1 @@ +package taskengine diff --git a/core/taskengine/processor.go b/core/taskengine/processor.go index 6b8d8bd0..8c5ea991 100644 --- a/core/taskengine/processor.go +++ b/core/taskengine/processor.go @@ -65,8 +65,8 @@ func (c *ContractProcessor) Perform(job *apqueue.Job) error { defer func() { updates := map[string][]byte{} - updates[TaskStorageKey(task.ID, avsproto.TaskStatus_Executing)], err = task.ToJSON() - updates[TaskUserKey(task)] = []byte(fmt.Sprintf("%d", task.Status)) + updates[string(TaskStorageKey(task.ID, avsproto.TaskStatus_Executing))], err = task.ToJSON() + updates[string(TaskUserKey(task))] = []byte(fmt.Sprintf("%d", task.Status)) if err = c.db.BatchWrite(updates); err == nil { c.db.Move( diff --git a/core/taskengine/schema.go b/core/taskengine/schema.go new file mode 100644 index 00000000..5d91d15a --- /dev/null +++ b/core/taskengine/schema.go @@ -0,0 +1,64 @@ +package taskengine + +import ( + "fmt" + "strings" + + "github.com/AvaProtocol/ap-avs/model" + avsproto "github.com/AvaProtocol/ap-avs/protobuf" + "github.com/ethereum/go-ethereum/common" +) + +// Prefix +func UserTaskStoragePrefix(address common.Address) []byte { + return []byte(fmt.Sprintf("u:%s", strings.ToLower(address.String()))) +} + +func TaskByStatusStoragePrefix(status avsproto.TaskStatus) []byte { + return []byte(fmt.Sprintf("t:%s:", TaskStatusToStorageKey(status))) +} + +func WalletByOwnerPrefix(owner common.Address) []byte { + return []byte(fmt.Sprintf( + "w:%s", + strings.ToLower(owner.String()), + )) +} + +func WalletStorageKey(w *model.SmartWallet) string { + return fmt.Sprintf( + "w:%s:%s", + strings.ToLower(w.Owner.String()), + strings.ToLower(w.Address.String()), + ) +} + +func TaskStorageKey(id string, status avsproto.TaskStatus) []byte { + return []byte(fmt.Sprintf( + "t:%s:%s", + TaskStatusToStorageKey(status), + id, + )) +} + +func TaskUserKey(t *model.Task) []byte { + return []byte(fmt.Sprintf( + "u:%s", + t.Key(), + )) +} + +func TaskStatusToStorageKey(v avsproto.TaskStatus) string { + switch v { + case 1: + return "c" + case 2: + return "f" + case 3: + return "l" + case 4: + return "x" + } + + return "a" +} diff --git a/examples/example.js b/examples/example.js index 3e4a9514..480e0da3 100644 --- a/examples/example.js +++ b/examples/example.js @@ -24,6 +24,7 @@ const config = { TEST_TRANSFER_TOKEN: "0x2e8bdb63d09ef989a0018eeb1c47ef84e3e61f7b", TEST_TRANSFER_TO: "0xe0f7D11FD714674722d325Cd86062A5F1882E13a", ORACLE_PRICE_CONTRACT: "0x694AA1769357215DE4FAC081bf1f309aDC325306", + // on local development we still target smart wallet on sepolia RPC_PROVIDER: "https://sepolia.gateway.tenderly.co", }, @@ -166,25 +167,20 @@ async function deleteTask(owner, token, taskId) { console.log("Delete Task ", taskId, "\n", result); } -async function getWallet(owner, token) { +async function getWallets(owner, token) { const metadata = new grpc.Metadata(); metadata.add("authkey", token); - const walletResponse = await asyncRPC( + const walletsResp = await asyncRPC( client, "GetSmartAccountAddress", - { owner: owner }, + { }, metadata ); // Update the provider creation const provider = new ethers.JsonRpcProvider(config[env].RPC_PROVIDER); - const balance = await provider.getBalance( - walletResponse.smart_account_address - ); - const balanceInEth = _.floor(ethers.formatEther(balance), 2); - // Get token balance const tokenAddress = config[env].TEST_TRANSFER_TOKEN; const tokenAbi = [ @@ -194,26 +190,38 @@ async function getWallet(owner, token) { ]; const tokenContract = new ethers.Contract(tokenAddress, tokenAbi, provider); - const tokenBalance = await tokenContract.balanceOf( - walletResponse.smart_account_address - ); - const tokenDecimals = await tokenContract.decimals(); - const tokenSymbol = await tokenContract.symbol(); - const tokenBalanceFormatted = _.floor( - ethers.formatUnits(tokenBalance, tokenDecimals), - 2 - ); + let wallets = []; + for (const wallet of walletsResp.wallets) { + const balance = await provider.getBalance( + wallet.address + ); + const balanceInEth = _.floor(ethers.formatEther(balance), 2); - const result = _.extend(walletResponse, { - balances: [ + const tokenBalance = await tokenContract.balanceOf(wallet.address); + + const tokenDecimals = await tokenContract.decimals(); + const tokenSymbol = await tokenContract.symbol(); + const tokenBalanceFormatted = _.floor(ethers.formatUnits(tokenBalance, tokenDecimals),2); + wallets.push({...wallet, balances: [ `${balanceInEth} ETH`, `${tokenBalanceFormatted} ${tokenSymbol}`, - ], - }); + ]}); + } + console.log("Smart wallet address for ", owner, "\n", wallets); - console.log("Smart wallet address for ", owner, "\n", result); + return wallets; +} - return result; +const createWallet = async (owner, token, salt, factoryAddress) => { + const metadata = new grpc.Metadata(); + metadata.add("authkey", token); + + return await asyncRPC( + client, + "CreateWallet", + { salt, factoryAddress }, + metadata + ); } const main = async (cmd) => { @@ -223,6 +231,11 @@ const main = async (cmd) => { let taskCondition = ""; switch (cmd) { + case "create-wallet": + salt = process.argv[3] || 0; + let smartWalletAddress = await createWallet(owner, token, process.argv[3], process.argv[4]); + console.log("inside vm", smartWalletAddress) + break; case "schedule": // ETH-USD pair on sepolia // https://sepolia.etherscan.io/address/0x694AA1769357215DE4FAC081bf1f309aDC325306#code @@ -282,7 +295,7 @@ const main = async (cmd) => { break; case "wallet": - await getWallet(owner, token); + await getWallets(owner, token); break; case "genTaskData": @@ -296,14 +309,15 @@ const main = async (cmd) => { default: console.log(`Usage: - wallet: to find smart wallet address for this eoa - tasks: to find all tasks - get : to get task detail - schedule: to schedule a task with chainlink eth-usd its condition will be matched quickly - schedule2: to schedule a task with chainlink that has a very high price target - schedule-generic: to schedule a task with an arbitrary contract query - cancel : to cancel a task - delete : to completely remove a task`); + create-wallet : to create a smart wallet with a salt, and optionally a factory contract + wallet: to find smart wallet address for this eoa + tasks: to find all tasks + get : to get task detail + schedule: to schedule a task with chainlink eth-usd its condition will be matched quickly + schedule2: to schedule a task with chainlink that has a very high price target + schedule-generic: to schedule a task with an arbitrary contract query + cancel : to cancel a task + delete : to completely remove a task`); } } diff --git a/model/task.go b/model/task.go index 2f623814..8bd89e73 100644 --- a/model/task.go +++ b/model/task.go @@ -47,7 +47,7 @@ func GenerateTaskID() string { } // Populate a task structure from proto payload -func NewTaskFromProtobuf(taskID string, user *User, body *avsproto.CreateTaskReq) (*Task, error) { +func NewTaskFromProtobuf(user *User, body *avsproto.CreateTaskReq) (*Task, error) { if body == nil { return nil, nil } @@ -55,6 +55,8 @@ func NewTaskFromProtobuf(taskID string, user *User, body *avsproto.CreateTaskReq owner := user.Address aaAddress := user.SmartAccountAddress + taskID := GenerateTaskID() + t := &Task{ ID: taskID, diff --git a/model/user.go b/model/user.go index 2570f391..32a7bf88 100644 --- a/model/user.go +++ b/model/user.go @@ -1,6 +1,9 @@ package model import ( + "encoding/json" + "math/big" + "github.com/ethereum/go-ethereum/common" ) @@ -8,3 +11,20 @@ type User struct { Address common.Address SmartAccountAddress *common.Address } + +type SmartWallet struct { + Owner *common.Address `json:"owner"` + Address *common.Address `json:"address"` + Factory *common.Address `json:"factory,omitempty"` + Salt *big.Int `json:"salt"` +} + +func (w *SmartWallet) ToJSON() ([]byte, error) { + return json.Marshal(w) +} + +func (w *SmartWallet) FromStorageData(body []byte) error { + err := json.Unmarshal(body, w) + + return err +} diff --git a/protobuf/avs.pb.go b/protobuf/avs.pb.go index 5200b46d..66c2e50a 100644 --- a/protobuf/avs.pb.go +++ b/protobuf/avs.pb.go @@ -83,6 +83,7 @@ const ( Error_RpcNodeError Error = 1000 // storage system isn't available to respond to query Error_StorageUnavailable Error = 2000 + Error_StorageWriteError Error = 2001 // target chain of smart wallet is error and cannot used to determine smartwallet info Error_SmartWalletRpcError Error = 6000 Error_SmartWalletNotFoundError Error = 6001 @@ -96,6 +97,7 @@ var ( 0: "UnknowError", 1000: "RpcNodeError", 2000: "StorageUnavailable", + 2001: "StorageWriteError", 6000: "SmartWalletRpcError", 6001: "SmartWalletNotFoundError", 7000: "TaskDataCorrupted", @@ -104,6 +106,7 @@ var ( "UnknowError": 0, "RpcNodeError": 1000, "StorageUnavailable": 2000, + "StorageWriteError": 2001, "SmartWalletRpcError": 6000, "SmartWalletNotFoundError": 6001, "TaskDataCorrupted": 7000, @@ -1852,7 +1855,10 @@ type AddressRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + // filter out by factory address or salt + // otherwise return all the wallet + Factory string `protobuf:"bytes,1,opt,name=factory,proto3" json:"factory,omitempty"` + Salt string `protobuf:"bytes,2,opt,name=salt,proto3" json:"salt,omitempty"` } func (x *AddressRequest) Reset() { @@ -1887,25 +1893,32 @@ func (*AddressRequest) Descriptor() ([]byte, []int) { return file_protobuf_avs_proto_rawDescGZIP(), []int{23} } -func (x *AddressRequest) GetOwner() string { +func (x *AddressRequest) GetFactory() string { if x != nil { - return x.Owner + return x.Factory } return "" } -type AddressResp struct { +func (x *AddressRequest) GetSalt() string { + if x != nil { + return x.Salt + } + return "" +} + +type SmartWallet struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SmartAccountAddress string `protobuf:"bytes,1,opt,name=smart_account_address,json=smartAccountAddress,proto3" json:"smart_account_address,omitempty"` - // we need to use string to re-present the bigint salt, the client can decode it with etherjs for example - Salt string `protobuf:"bytes,2,opt,name=salt,proto3" json:"salt,omitempty"` + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Salt string `protobuf:"bytes,2,opt,name=salt,proto3" json:"salt,omitempty"` + Factory string `protobuf:"bytes,3,opt,name=factory,proto3" json:"factory,omitempty"` } -func (x *AddressResp) Reset() { - *x = AddressResp{} +func (x *SmartWallet) Reset() { + *x = SmartWallet{} if protoimpl.UnsafeEnabled { mi := &file_protobuf_avs_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1913,13 +1926,13 @@ func (x *AddressResp) Reset() { } } -func (x *AddressResp) String() string { +func (x *SmartWallet) String() string { return protoimpl.X.MessageStringOf(x) } -func (*AddressResp) ProtoMessage() {} +func (*SmartWallet) ProtoMessage() {} -func (x *AddressResp) ProtoReflect() protoreflect.Message { +func (x *SmartWallet) ProtoReflect() protoreflect.Message { mi := &file_protobuf_avs_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1931,25 +1944,79 @@ func (x *AddressResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use AddressResp.ProtoReflect.Descriptor instead. -func (*AddressResp) Descriptor() ([]byte, []int) { +// Deprecated: Use SmartWallet.ProtoReflect.Descriptor instead. +func (*SmartWallet) Descriptor() ([]byte, []int) { return file_protobuf_avs_proto_rawDescGZIP(), []int{24} } -func (x *AddressResp) GetSmartAccountAddress() string { +func (x *SmartWallet) GetAddress() string { if x != nil { - return x.SmartAccountAddress + return x.Address } return "" } -func (x *AddressResp) GetSalt() string { +func (x *SmartWallet) GetSalt() string { if x != nil { return x.Salt } return "" } +func (x *SmartWallet) GetFactory() string { + if x != nil { + return x.Factory + } + return "" +} + +type AddressResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Wallets []*SmartWallet `protobuf:"bytes,1,rep,name=wallets,proto3" json:"wallets,omitempty"` +} + +func (x *AddressResp) Reset() { + *x = AddressResp{} + if protoimpl.UnsafeEnabled { + mi := &file_protobuf_avs_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddressResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddressResp) ProtoMessage() {} + +func (x *AddressResp) ProtoReflect() protoreflect.Message { + mi := &file_protobuf_avs_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddressResp.ProtoReflect.Descriptor instead. +func (*AddressResp) Descriptor() ([]byte, []int) { + return file_protobuf_avs_proto_rawDescGZIP(), []int{25} +} + +func (x *AddressResp) GetWallets() []*SmartWallet { + if x != nil { + return x.Wallets + } + return nil +} + type ListTasksReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1959,7 +2026,7 @@ type ListTasksReq struct { func (x *ListTasksReq) Reset() { *x = ListTasksReq{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[25] + mi := &file_protobuf_avs_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1972,7 +2039,7 @@ func (x *ListTasksReq) String() string { func (*ListTasksReq) ProtoMessage() {} func (x *ListTasksReq) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[25] + mi := &file_protobuf_avs_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1985,7 +2052,7 @@ func (x *ListTasksReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListTasksReq.ProtoReflect.Descriptor instead. func (*ListTasksReq) Descriptor() ([]byte, []int) { - return file_protobuf_avs_proto_rawDescGZIP(), []int{25} + return file_protobuf_avs_proto_rawDescGZIP(), []int{26} } type ListTasksResp struct { @@ -1999,7 +2066,7 @@ type ListTasksResp struct { func (x *ListTasksResp) Reset() { *x = ListTasksResp{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[26] + mi := &file_protobuf_avs_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2012,7 +2079,7 @@ func (x *ListTasksResp) String() string { func (*ListTasksResp) ProtoMessage() {} func (x *ListTasksResp) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[26] + mi := &file_protobuf_avs_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2025,7 +2092,7 @@ func (x *ListTasksResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListTasksResp.ProtoReflect.Descriptor instead. func (*ListTasksResp) Descriptor() ([]byte, []int) { - return file_protobuf_avs_proto_rawDescGZIP(), []int{26} + return file_protobuf_avs_proto_rawDescGZIP(), []int{27} } func (x *ListTasksResp) GetTasks() []*ListTasksResp_TaskItemResp { @@ -2048,7 +2115,7 @@ type GetKeyReq struct { func (x *GetKeyReq) Reset() { *x = GetKeyReq{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[27] + mi := &file_protobuf_avs_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2061,7 +2128,7 @@ func (x *GetKeyReq) String() string { func (*GetKeyReq) ProtoMessage() {} func (x *GetKeyReq) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[27] + mi := &file_protobuf_avs_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2074,7 +2141,7 @@ func (x *GetKeyReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetKeyReq.ProtoReflect.Descriptor instead. func (*GetKeyReq) Descriptor() ([]byte, []int) { - return file_protobuf_avs_proto_rawDescGZIP(), []int{27} + return file_protobuf_avs_proto_rawDescGZIP(), []int{28} } func (x *GetKeyReq) GetOwner() string { @@ -2109,7 +2176,7 @@ type KeyResp struct { func (x *KeyResp) Reset() { *x = KeyResp{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[28] + mi := &file_protobuf_avs_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2122,7 +2189,7 @@ func (x *KeyResp) String() string { func (*KeyResp) ProtoMessage() {} func (x *KeyResp) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[28] + mi := &file_protobuf_avs_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2135,7 +2202,7 @@ func (x *KeyResp) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyResp.ProtoReflect.Descriptor instead. func (*KeyResp) Descriptor() ([]byte, []int) { - return file_protobuf_avs_proto_rawDescGZIP(), []int{28} + return file_protobuf_avs_proto_rawDescGZIP(), []int{29} } func (x *KeyResp) GetKey() string { @@ -2158,7 +2225,7 @@ type UpdateChecksReq struct { func (x *UpdateChecksReq) Reset() { *x = UpdateChecksReq{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[29] + mi := &file_protobuf_avs_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2171,7 +2238,7 @@ func (x *UpdateChecksReq) String() string { func (*UpdateChecksReq) ProtoMessage() {} func (x *UpdateChecksReq) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[29] + mi := &file_protobuf_avs_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2184,7 +2251,7 @@ func (x *UpdateChecksReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateChecksReq.ProtoReflect.Descriptor instead. func (*UpdateChecksReq) Descriptor() ([]byte, []int) { - return file_protobuf_avs_proto_rawDescGZIP(), []int{29} + return file_protobuf_avs_proto_rawDescGZIP(), []int{30} } func (x *UpdateChecksReq) GetAddress() string { @@ -2219,7 +2286,7 @@ type UpdateChecksResp struct { func (x *UpdateChecksResp) Reset() { *x = UpdateChecksResp{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[30] + mi := &file_protobuf_avs_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2232,7 +2299,7 @@ func (x *UpdateChecksResp) String() string { func (*UpdateChecksResp) ProtoMessage() {} func (x *UpdateChecksResp) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[30] + mi := &file_protobuf_avs_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2245,7 +2312,7 @@ func (x *UpdateChecksResp) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateChecksResp.ProtoReflect.Descriptor instead. func (*UpdateChecksResp) Descriptor() ([]byte, []int) { - return file_protobuf_avs_proto_rawDescGZIP(), []int{30} + return file_protobuf_avs_proto_rawDescGZIP(), []int{31} } func (x *UpdateChecksResp) GetUpdatedAt() *timestamppb.Timestamp { @@ -2255,6 +2322,109 @@ func (x *UpdateChecksResp) GetUpdatedAt() *timestamppb.Timestamp { return nil } +type CreateWalletReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Salt string `protobuf:"bytes,1,opt,name=salt,proto3" json:"salt,omitempty"` + // this is the factory address for the wallet, when leaving its empty, we will use our default factory address + FactoryAddress string `protobuf:"bytes,2,opt,name=factory_address,json=factoryAddress,proto3" json:"factory_address,omitempty"` +} + +func (x *CreateWalletReq) Reset() { + *x = CreateWalletReq{} + if protoimpl.UnsafeEnabled { + mi := &file_protobuf_avs_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateWalletReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateWalletReq) ProtoMessage() {} + +func (x *CreateWalletReq) ProtoReflect() protoreflect.Message { + mi := &file_protobuf_avs_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateWalletReq.ProtoReflect.Descriptor instead. +func (*CreateWalletReq) Descriptor() ([]byte, []int) { + return file_protobuf_avs_proto_rawDescGZIP(), []int{32} +} + +func (x *CreateWalletReq) GetSalt() string { + if x != nil { + return x.Salt + } + return "" +} + +func (x *CreateWalletReq) GetFactoryAddress() string { + if x != nil { + return x.FactoryAddress + } + return "" +} + +type CreateWalletResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (x *CreateWalletResp) Reset() { + *x = CreateWalletResp{} + if protoimpl.UnsafeEnabled { + mi := &file_protobuf_avs_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateWalletResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateWalletResp) ProtoMessage() {} + +func (x *CreateWalletResp) ProtoReflect() protoreflect.Message { + mi := &file_protobuf_avs_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateWalletResp.ProtoReflect.Descriptor instead. +func (*CreateWalletResp) Descriptor() ([]byte, []int) { + return file_protobuf_avs_proto_rawDescGZIP(), []int{33} +} + +func (x *CreateWalletResp) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + type Checkin_Status struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2268,7 +2438,7 @@ type Checkin_Status struct { func (x *Checkin_Status) Reset() { *x = Checkin_Status{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[31] + mi := &file_protobuf_avs_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2281,7 +2451,7 @@ func (x *Checkin_Status) String() string { func (*Checkin_Status) ProtoMessage() {} func (x *Checkin_Status) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[31] + mi := &file_protobuf_avs_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2330,7 +2500,7 @@ type ListTasksResp_TaskItemResp struct { func (x *ListTasksResp_TaskItemResp) Reset() { *x = ListTasksResp_TaskItemResp{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_avs_proto_msgTypes[33] + mi := &file_protobuf_avs_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2343,7 +2513,7 @@ func (x *ListTasksResp_TaskItemResp) String() string { func (*ListTasksResp_TaskItemResp) ProtoMessage() {} func (x *ListTasksResp_TaskItemResp) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_avs_proto_msgTypes[33] + mi := &file_protobuf_avs_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2356,7 +2526,7 @@ func (x *ListTasksResp_TaskItemResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListTasksResp_TaskItemResp.ProtoReflect.Descriptor instead. func (*ListTasksResp_TaskItemResp) Descriptor() ([]byte, []int) { - return file_protobuf_avs_proto_rawDescGZIP(), []int{26, 0} + return file_protobuf_avs_proto_rawDescGZIP(), []int{27, 0} } func (x *ListTasksResp_TaskItemResp) GetId() string { @@ -2592,53 +2762,68 @@ var file_protobuf_avs_proto_rawDesc = []byte{ 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x21, 0x0a, 0x09, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x6e, - 0x63, 0x65, 0x22, 0x26, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x55, 0x0a, 0x0b, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x6d, 0x61, - 0x72, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, - 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, 0x6c, - 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, - 0x71, 0x22, 0x9d, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x3c, 0x0a, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x54, 0x61, - 0x73, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x52, 0x05, 0x74, 0x61, 0x73, 0x6b, - 0x73, 0x1a, 0x4e, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x2e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x16, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, - 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x22, 0x5e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, - 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, - 0x64, 0x41, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x22, 0x1b, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x59, - 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, - 0x71, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4d, 0x0a, 0x10, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x39, 0x0a, - 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x2a, 0x4f, 0x0a, 0x0b, 0x54, 0x72, 0x69, 0x67, - 0x67, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x69, 0x6d, 0x65, 0x54, - 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, - 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x10, 0x02, 0x2a, 0x95, 0x01, 0x0a, 0x05, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0c, 0x52, 0x70, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x10, 0xe8, 0x07, 0x12, 0x17, 0x0a, 0x12, 0x53, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x55, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x10, 0xd0, 0x0f, + 0x63, 0x65, 0x22, 0x3e, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x12, + 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, + 0x6c, 0x74, 0x22, 0x55, 0x0a, 0x0b, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, + 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x61, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x12, + 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x40, 0x0a, 0x0b, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, 0x07, 0x77, 0x61, 0x6c, 0x6c, + 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, + 0x65, 0x74, 0x52, 0x07, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x22, 0x0e, 0x0a, 0x0c, 0x4c, + 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x22, 0x9d, 0x01, 0x0a, 0x0d, + 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3c, 0x0a, + 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, + 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x74, 0x65, 0x6d, + 0x52, 0x65, 0x73, 0x70, 0x52, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x1a, 0x4e, 0x0a, 0x0c, 0x54, + 0x61, 0x73, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x61, 0x67, + 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x5e, 0x0a, 0x09, 0x47, + 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1d, + 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1c, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x1b, 0x0a, 0x07, 0x4b, + 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x59, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x22, 0x4d, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x22, 0x4e, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x61, 0x6c, 0x6c, + 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x61, 0x63, + 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x22, 0x2c, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x61, 0x6c, 0x6c, + 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x2a, 0x4f, 0x0a, 0x0b, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x0f, 0x0a, 0x0b, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x10, 0x00, + 0x12, 0x18, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x45, 0x78, + 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x10, + 0x02, 0x2a, 0xad, 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x0f, 0x0a, 0x0b, 0x55, + 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0c, + 0x52, 0x70, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xe8, 0x07, 0x12, + 0x17, 0x0a, 0x12, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x55, 0x6e, 0x61, 0x76, 0x61, 0x69, + 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x10, 0xd0, 0x0f, 0x12, 0x16, 0x0a, 0x11, 0x53, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd1, 0x0f, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x70, 0x63, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xf0, 0x2e, 0x12, 0x1d, 0x0a, 0x18, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, @@ -2660,7 +2845,7 @@ var file_protobuf_avs_proto_rawDesc = []byte{ 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x10, 0x04, 0x2a, 0x20, 0x0a, 0x0e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x4a, - 0x61, 0x76, 0x61, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x10, 0x00, 0x32, 0xd7, 0x05, 0x0a, 0x0a, + 0x61, 0x76, 0x61, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x10, 0x00, 0x32, 0xa4, 0x06, 0x0a, 0x0a, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x61, 0x67, @@ -2674,40 +2859,45 @@ var file_protobuf_avs_proto_rawDesc = []byte{ 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, - 0x12, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x61, 0x67, - 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, - 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x4c, 0x69, 0x73, - 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, - 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, - 0x1a, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x2f, 0x0a, - 0x07, 0x47, 0x65, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x10, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, 0x55, 0x49, 0x44, 0x1a, 0x10, 0x2e, 0x61, 0x67, 0x67, - 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x22, 0x00, 0x12, 0x3c, - 0x0a, 0x0a, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x10, 0x2e, 0x61, - 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, 0x55, 0x49, 0x44, 0x1a, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0a, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x10, 0x2e, 0x61, 0x67, 0x67, - 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, 0x55, 0x49, 0x44, 0x1a, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, - 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x04, 0x50, 0x69, - 0x6e, 0x67, 0x12, 0x13, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x69, 0x6e, 0x1a, 0x17, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x00, 0x12, 0x44, 0x0a, 0x09, 0x53, 0x79, 0x6e, 0x63, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, - 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x79, 0x6e, - 0x63, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x54, 0x61, 0x73, 0x6b, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x30, 0x01, 0x12, 0x4b, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, 0x1b, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x61, 0x6c, 0x6c, + 0x65, 0x74, 0x12, 0x1b, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, + 0x1c, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, + 0x45, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x19, 0x2e, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, + 0x73, 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, + 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x2f, 0x0a, 0x07, 0x47, 0x65, + 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x10, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x6f, 0x72, 0x2e, 0x55, 0x55, 0x49, 0x44, 0x1a, 0x10, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0a, 0x43, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x10, 0x2e, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, 0x55, 0x49, 0x44, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, + 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0a, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x10, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, + 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, 0x55, 0x49, 0x44, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, + 0x13, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x69, 0x6e, 0x1a, 0x17, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, + 0x72, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, + 0x44, 0x0a, 0x09, 0x53, 0x79, 0x6e, 0x63, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x54, 0x61, + 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x00, 0x30, 0x01, 0x12, 0x4b, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x12, 0x1b, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x61, 0x76, 0x73, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x00, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x61, 0x76, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2723,7 +2913,7 @@ func file_protobuf_avs_proto_rawDescGZIP() []byte { } var file_protobuf_avs_proto_enumTypes = make([]protoimpl.EnumInfo, 5) -var file_protobuf_avs_proto_msgTypes = make([]protoimpl.MessageInfo, 34) +var file_protobuf_avs_proto_msgTypes = make([]protoimpl.MessageInfo, 37) var file_protobuf_avs_proto_goTypes = []interface{}{ (TriggerType)(0), // 0: aggregator.TriggerType (Error)(0), // 1: aggregator.Error @@ -2754,28 +2944,31 @@ var file_protobuf_avs_proto_goTypes = []interface{}{ (*NonceRequest)(nil), // 26: aggregator.NonceRequest (*NonceResp)(nil), // 27: aggregator.NonceResp (*AddressRequest)(nil), // 28: aggregator.AddressRequest - (*AddressResp)(nil), // 29: aggregator.AddressResp - (*ListTasksReq)(nil), // 30: aggregator.ListTasksReq - (*ListTasksResp)(nil), // 31: aggregator.ListTasksResp - (*GetKeyReq)(nil), // 32: aggregator.GetKeyReq - (*KeyResp)(nil), // 33: aggregator.KeyResp - (*UpdateChecksReq)(nil), // 34: aggregator.UpdateChecksReq - (*UpdateChecksResp)(nil), // 35: aggregator.UpdateChecksResp - (*Checkin_Status)(nil), // 36: aggregator.Checkin.Status - nil, // 37: aggregator.HTTPAPICall.HeadersEntry - (*ListTasksResp_TaskItemResp)(nil), // 38: aggregator.ListTasksResp.TaskItemResp - (*timestamppb.Timestamp)(nil), // 39: google.protobuf.Timestamp - (*wrapperspb.BoolValue)(nil), // 40: google.protobuf.BoolValue + (*SmartWallet)(nil), // 29: aggregator.SmartWallet + (*AddressResp)(nil), // 30: aggregator.AddressResp + (*ListTasksReq)(nil), // 31: aggregator.ListTasksReq + (*ListTasksResp)(nil), // 32: aggregator.ListTasksResp + (*GetKeyReq)(nil), // 33: aggregator.GetKeyReq + (*KeyResp)(nil), // 34: aggregator.KeyResp + (*UpdateChecksReq)(nil), // 35: aggregator.UpdateChecksReq + (*UpdateChecksResp)(nil), // 36: aggregator.UpdateChecksResp + (*CreateWalletReq)(nil), // 37: aggregator.CreateWalletReq + (*CreateWalletResp)(nil), // 38: aggregator.CreateWalletResp + (*Checkin_Status)(nil), // 39: aggregator.Checkin.Status + nil, // 40: aggregator.HTTPAPICall.HeadersEntry + (*ListTasksResp_TaskItemResp)(nil), // 41: aggregator.ListTasksResp.TaskItemResp + (*timestamppb.Timestamp)(nil), // 42: google.protobuf.Timestamp + (*wrapperspb.BoolValue)(nil), // 43: google.protobuf.BoolValue } var file_protobuf_avs_proto_depIdxs = []int32{ - 36, // 0: aggregator.Checkin.status:type_name -> aggregator.Checkin.Status - 39, // 1: aggregator.CheckinResp.updated_at:type_name -> google.protobuf.Timestamp + 39, // 0: aggregator.Checkin.status:type_name -> aggregator.Checkin.Status + 42, // 1: aggregator.CheckinResp.updated_at:type_name -> google.protobuf.Timestamp 0, // 2: aggregator.TaskTrigger.trigger_type:type_name -> aggregator.TriggerType 10, // 3: aggregator.TaskTrigger.schedule:type_name -> aggregator.TimeCondition 11, // 4: aggregator.TaskTrigger.contract_query:type_name -> aggregator.ContractQueryCondition 12, // 5: aggregator.TaskTrigger.expression:type_name -> aggregator.ExpressionCondition 9, // 6: aggregator.SyncTasksResp.trigger:type_name -> aggregator.TaskTrigger - 37, // 7: aggregator.HTTPAPICall.headers:type_name -> aggregator.HTTPAPICall.HeadersEntry + 40, // 7: aggregator.HTTPAPICall.headers:type_name -> aggregator.HTTPAPICall.HeadersEntry 4, // 8: aggregator.CustomCode.type:type_name -> aggregator.CustomCodeType 19, // 9: aggregator.BranchAction.If:type_name -> aggregator.ConditionJump 19, // 10: aggregator.BranchAction.ElseIfs:type_name -> aggregator.ConditionJump @@ -2794,37 +2987,40 @@ var file_protobuf_avs_proto_depIdxs = []int32{ 22, // 23: aggregator.Task.executions:type_name -> aggregator.Execution 9, // 24: aggregator.CreateTaskReq.trigger:type_name -> aggregator.TaskTrigger 21, // 25: aggregator.CreateTaskReq.actions:type_name -> aggregator.TaskAction - 38, // 26: aggregator.ListTasksResp.tasks:type_name -> aggregator.ListTasksResp.TaskItemResp - 39, // 27: aggregator.UpdateChecksResp.updated_at:type_name -> google.protobuf.Timestamp - 39, // 28: aggregator.Checkin.Status.last_heartbeat:type_name -> google.protobuf.Timestamp - 3, // 29: aggregator.ListTasksResp.TaskItemResp.status:type_name -> aggregator.TaskStatus - 32, // 30: aggregator.Aggregator.GetKey:input_type -> aggregator.GetKeyReq - 26, // 31: aggregator.Aggregator.GetNonce:input_type -> aggregator.NonceRequest - 28, // 32: aggregator.Aggregator.GetSmartAccountAddress:input_type -> aggregator.AddressRequest - 24, // 33: aggregator.Aggregator.CreateTask:input_type -> aggregator.CreateTaskReq - 30, // 34: aggregator.Aggregator.ListTasks:input_type -> aggregator.ListTasksReq - 5, // 35: aggregator.Aggregator.GetTask:input_type -> aggregator.UUID - 5, // 36: aggregator.Aggregator.CancelTask:input_type -> aggregator.UUID - 5, // 37: aggregator.Aggregator.DeleteTask:input_type -> aggregator.UUID - 6, // 38: aggregator.Aggregator.Ping:input_type -> aggregator.Checkin - 8, // 39: aggregator.Aggregator.SyncTasks:input_type -> aggregator.SyncTasksReq - 34, // 40: aggregator.Aggregator.UpdateChecks:input_type -> aggregator.UpdateChecksReq - 33, // 41: aggregator.Aggregator.GetKey:output_type -> aggregator.KeyResp - 27, // 42: aggregator.Aggregator.GetNonce:output_type -> aggregator.NonceResp - 29, // 43: aggregator.Aggregator.GetSmartAccountAddress:output_type -> aggregator.AddressResp - 25, // 44: aggregator.Aggregator.CreateTask:output_type -> aggregator.CreateTaskResp - 31, // 45: aggregator.Aggregator.ListTasks:output_type -> aggregator.ListTasksResp - 23, // 46: aggregator.Aggregator.GetTask:output_type -> aggregator.Task - 40, // 47: aggregator.Aggregator.CancelTask:output_type -> google.protobuf.BoolValue - 40, // 48: aggregator.Aggregator.DeleteTask:output_type -> google.protobuf.BoolValue - 7, // 49: aggregator.Aggregator.Ping:output_type -> aggregator.CheckinResp - 13, // 50: aggregator.Aggregator.SyncTasks:output_type -> aggregator.SyncTasksResp - 35, // 51: aggregator.Aggregator.UpdateChecks:output_type -> aggregator.UpdateChecksResp - 41, // [41:52] is the sub-list for method output_type - 30, // [30:41] is the sub-list for method input_type - 30, // [30:30] is the sub-list for extension type_name - 30, // [30:30] is the sub-list for extension extendee - 0, // [0:30] is the sub-list for field type_name + 29, // 26: aggregator.AddressResp.wallets:type_name -> aggregator.SmartWallet + 41, // 27: aggregator.ListTasksResp.tasks:type_name -> aggregator.ListTasksResp.TaskItemResp + 42, // 28: aggregator.UpdateChecksResp.updated_at:type_name -> google.protobuf.Timestamp + 42, // 29: aggregator.Checkin.Status.last_heartbeat:type_name -> google.protobuf.Timestamp + 3, // 30: aggregator.ListTasksResp.TaskItemResp.status:type_name -> aggregator.TaskStatus + 33, // 31: aggregator.Aggregator.GetKey:input_type -> aggregator.GetKeyReq + 26, // 32: aggregator.Aggregator.GetNonce:input_type -> aggregator.NonceRequest + 28, // 33: aggregator.Aggregator.GetSmartAccountAddress:input_type -> aggregator.AddressRequest + 37, // 34: aggregator.Aggregator.CreateWallet:input_type -> aggregator.CreateWalletReq + 24, // 35: aggregator.Aggregator.CreateTask:input_type -> aggregator.CreateTaskReq + 31, // 36: aggregator.Aggregator.ListTasks:input_type -> aggregator.ListTasksReq + 5, // 37: aggregator.Aggregator.GetTask:input_type -> aggregator.UUID + 5, // 38: aggregator.Aggregator.CancelTask:input_type -> aggregator.UUID + 5, // 39: aggregator.Aggregator.DeleteTask:input_type -> aggregator.UUID + 6, // 40: aggregator.Aggregator.Ping:input_type -> aggregator.Checkin + 8, // 41: aggregator.Aggregator.SyncTasks:input_type -> aggregator.SyncTasksReq + 35, // 42: aggregator.Aggregator.UpdateChecks:input_type -> aggregator.UpdateChecksReq + 34, // 43: aggregator.Aggregator.GetKey:output_type -> aggregator.KeyResp + 27, // 44: aggregator.Aggregator.GetNonce:output_type -> aggregator.NonceResp + 30, // 45: aggregator.Aggregator.GetSmartAccountAddress:output_type -> aggregator.AddressResp + 38, // 46: aggregator.Aggregator.CreateWallet:output_type -> aggregator.CreateWalletResp + 25, // 47: aggregator.Aggregator.CreateTask:output_type -> aggregator.CreateTaskResp + 32, // 48: aggregator.Aggregator.ListTasks:output_type -> aggregator.ListTasksResp + 23, // 49: aggregator.Aggregator.GetTask:output_type -> aggregator.Task + 43, // 50: aggregator.Aggregator.CancelTask:output_type -> google.protobuf.BoolValue + 43, // 51: aggregator.Aggregator.DeleteTask:output_type -> google.protobuf.BoolValue + 7, // 52: aggregator.Aggregator.Ping:output_type -> aggregator.CheckinResp + 13, // 53: aggregator.Aggregator.SyncTasks:output_type -> aggregator.SyncTasksResp + 36, // 54: aggregator.Aggregator.UpdateChecks:output_type -> aggregator.UpdateChecksResp + 43, // [43:55] is the sub-list for method output_type + 31, // [31:43] is the sub-list for method input_type + 31, // [31:31] is the sub-list for extension type_name + 31, // [31:31] is the sub-list for extension extendee + 0, // [0:31] is the sub-list for field type_name } func init() { file_protobuf_avs_proto_init() } @@ -3122,7 +3318,7 @@ func file_protobuf_avs_proto_init() { } } file_protobuf_avs_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddressResp); i { + switch v := v.(*SmartWallet); i { case 0: return &v.state case 1: @@ -3134,7 +3330,7 @@ func file_protobuf_avs_proto_init() { } } file_protobuf_avs_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTasksReq); i { + switch v := v.(*AddressResp); i { case 0: return &v.state case 1: @@ -3146,7 +3342,7 @@ func file_protobuf_avs_proto_init() { } } file_protobuf_avs_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTasksResp); i { + switch v := v.(*ListTasksReq); i { case 0: return &v.state case 1: @@ -3158,7 +3354,7 @@ func file_protobuf_avs_proto_init() { } } file_protobuf_avs_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetKeyReq); i { + switch v := v.(*ListTasksResp); i { case 0: return &v.state case 1: @@ -3170,7 +3366,7 @@ func file_protobuf_avs_proto_init() { } } file_protobuf_avs_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyResp); i { + switch v := v.(*GetKeyReq); i { case 0: return &v.state case 1: @@ -3182,7 +3378,7 @@ func file_protobuf_avs_proto_init() { } } file_protobuf_avs_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateChecksReq); i { + switch v := v.(*KeyResp); i { case 0: return &v.state case 1: @@ -3194,7 +3390,7 @@ func file_protobuf_avs_proto_init() { } } file_protobuf_avs_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateChecksResp); i { + switch v := v.(*UpdateChecksReq); i { case 0: return &v.state case 1: @@ -3206,7 +3402,19 @@ func file_protobuf_avs_proto_init() { } } file_protobuf_avs_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Checkin_Status); i { + switch v := v.(*UpdateChecksResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protobuf_avs_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateWalletReq); i { case 0: return &v.state case 1: @@ -3218,6 +3426,30 @@ func file_protobuf_avs_proto_init() { } } file_protobuf_avs_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateWalletResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protobuf_avs_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Checkin_Status); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protobuf_avs_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListTasksResp_TaskItemResp); i { case 0: return &v.state @@ -3236,7 +3468,7 @@ func file_protobuf_avs_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_protobuf_avs_proto_rawDesc, NumEnums: 5, - NumMessages: 34, + NumMessages: 37, NumExtensions: 0, NumServices: 1, }, diff --git a/protobuf/avs.proto b/protobuf/avs.proto index 9a446458..6d54df34 100644 --- a/protobuf/avs.proto +++ b/protobuf/avs.proto @@ -63,6 +63,7 @@ enum Error { RpcNodeError = 1000; // storage system isn't available to respond to query StorageUnavailable = 2000; + StorageWriteError = 2001; // target chain of smart wallet is error and cannot used to determine smartwallet info SmartWalletRpcError = 6000; SmartWalletNotFoundError = 6001; @@ -254,13 +255,20 @@ message NonceResp { } message AddressRequest { - string owner = 1; + // filter out by factory address or salt + // otherwise return all the wallet + string factory = 1; + string salt = 2; } -message AddressResp { - string smart_account_address = 1; - // we need to use string to re-present the bigint salt, the client can decode it with etherjs for example +message SmartWallet { + string address = 1; string salt = 2; + string factory = 3; +} + +message AddressResp { + repeated SmartWallet wallets = 1; } message ListTasksReq {} @@ -294,20 +302,31 @@ message UpdateChecksResp { google.protobuf.Timestamp updated_at = 1; } +message CreateWalletReq { + string salt = 1; + // this is the factory address for the wallet, when leaving its empty, we will use our default factory address + string factory_address = 2; +} + +message CreateWalletResp { + string address = 1; +} + service Aggregator { // Auth rpc GetKey(GetKeyReq) returns (KeyResp) {}; // Smart Acccount - rpc GetNonce(NonceRequest) returns (NonceResp) {}; + rpc GetNonce(NonceRequest) returns (NonceResp) {}; rpc GetSmartAccountAddress(AddressRequest) returns (AddressResp) {}; // Task Management - rpc CreateTask(CreateTaskReq) returns (CreateTaskResp) {}; - rpc ListTasks(ListTasksReq) returns (ListTasksResp) {}; - rpc GetTask(UUID) returns (Task) {}; - rpc CancelTask(UUID) returns (google.protobuf.BoolValue) {}; - rpc DeleteTask(UUID) returns (google.protobuf.BoolValue) {}; + rpc CreateWallet(CreateWalletReq) returns (CreateWalletResp) {}; + rpc CreateTask(CreateTaskReq) returns (CreateTaskResp) {}; + rpc ListTasks(ListTasksReq) returns (ListTasksResp) {}; + rpc GetTask(UUID) returns (Task) {}; + rpc CancelTask(UUID) returns (google.protobuf.BoolValue) {}; + rpc DeleteTask(UUID) returns (google.protobuf.BoolValue) {}; // Operator endpoint rpc Ping(Checkin) returns (CheckinResp) {}; diff --git a/protobuf/avs_grpc.pb.go b/protobuf/avs_grpc.pb.go index 061e9c6a..80dbc557 100644 --- a/protobuf/avs_grpc.pb.go +++ b/protobuf/avs_grpc.pb.go @@ -29,6 +29,7 @@ type AggregatorClient interface { GetNonce(ctx context.Context, in *NonceRequest, opts ...grpc.CallOption) (*NonceResp, error) GetSmartAccountAddress(ctx context.Context, in *AddressRequest, opts ...grpc.CallOption) (*AddressResp, error) // Task Management + CreateWallet(ctx context.Context, in *CreateWalletReq, opts ...grpc.CallOption) (*CreateWalletResp, error) CreateTask(ctx context.Context, in *CreateTaskReq, opts ...grpc.CallOption) (*CreateTaskResp, error) ListTasks(ctx context.Context, in *ListTasksReq, opts ...grpc.CallOption) (*ListTasksResp, error) GetTask(ctx context.Context, in *UUID, opts ...grpc.CallOption) (*Task, error) @@ -75,6 +76,15 @@ func (c *aggregatorClient) GetSmartAccountAddress(ctx context.Context, in *Addre return out, nil } +func (c *aggregatorClient) CreateWallet(ctx context.Context, in *CreateWalletReq, opts ...grpc.CallOption) (*CreateWalletResp, error) { + out := new(CreateWalletResp) + err := c.cc.Invoke(ctx, "/aggregator.Aggregator/CreateWallet", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *aggregatorClient) CreateTask(ctx context.Context, in *CreateTaskReq, opts ...grpc.CallOption) (*CreateTaskResp, error) { out := new(CreateTaskResp) err := c.cc.Invoke(ctx, "/aggregator.Aggregator/CreateTask", in, out, opts...) @@ -180,6 +190,7 @@ type AggregatorServer interface { GetNonce(context.Context, *NonceRequest) (*NonceResp, error) GetSmartAccountAddress(context.Context, *AddressRequest) (*AddressResp, error) // Task Management + CreateWallet(context.Context, *CreateWalletReq) (*CreateWalletResp, error) CreateTask(context.Context, *CreateTaskReq) (*CreateTaskResp, error) ListTasks(context.Context, *ListTasksReq) (*ListTasksResp, error) GetTask(context.Context, *UUID) (*Task, error) @@ -205,6 +216,9 @@ func (UnimplementedAggregatorServer) GetNonce(context.Context, *NonceRequest) (* func (UnimplementedAggregatorServer) GetSmartAccountAddress(context.Context, *AddressRequest) (*AddressResp, error) { return nil, status.Errorf(codes.Unimplemented, "method GetSmartAccountAddress not implemented") } +func (UnimplementedAggregatorServer) CreateWallet(context.Context, *CreateWalletReq) (*CreateWalletResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateWallet not implemented") +} func (UnimplementedAggregatorServer) CreateTask(context.Context, *CreateTaskReq) (*CreateTaskResp, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateTask not implemented") } @@ -296,6 +310,24 @@ func _Aggregator_GetSmartAccountAddress_Handler(srv interface{}, ctx context.Con return interceptor(ctx, in, info, handler) } +func _Aggregator_CreateWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateWalletReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AggregatorServer).CreateWallet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/aggregator.Aggregator/CreateWallet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AggregatorServer).CreateWallet(ctx, req.(*CreateWalletReq)) + } + return interceptor(ctx, in, info, handler) +} + func _Aggregator_CreateTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateTaskReq) if err := dec(in); err != nil { @@ -462,6 +494,10 @@ var Aggregator_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetSmartAccountAddress", Handler: _Aggregator_GetSmartAccountAddress_Handler, }, + { + MethodName: "CreateWallet", + Handler: _Aggregator_CreateWallet_Handler, + }, { MethodName: "CreateTask", Handler: _Aggregator_CreateTask_Handler,