-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from AAStarCommunity/v1.0-mock-gas
V1.0 mock
- Loading branch information
Showing
45 changed files
with
596 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package model | ||
|
||
import "errors" | ||
|
||
type TryPayUserOpRequest struct { | ||
ForceStrategyId string `json:"force_strategy_id"` | ||
ForceNetWork string `json:"force_network"` | ||
ForceTokens string `json:"force_tokens"` | ||
ForceEntryPointAddress string `json:"force_entrypoint_address"` | ||
UserOperation UserOperationItem `json:"user_operation"` | ||
Extra interface{} `json:"extra"` | ||
} | ||
|
||
func (request *TryPayUserOpRequest) Validate() error { | ||
if len(request.ForceStrategyId) == 0 { | ||
if len(request.ForceNetWork) == 0 || len(request.ForceTokens) == 0 || len(request.ForceEntryPointAddress) == 0 { | ||
return errors.New("strategy configuration illegal") | ||
} | ||
} | ||
return nil | ||
} | ||
|
||
type GetSupportEntrypointRequest struct { | ||
} | ||
|
||
func (request *GetSupportEntrypointRequest) Validate() error { | ||
return nil | ||
} | ||
|
||
type GetSupportStrategyRequest struct { | ||
} | ||
|
||
func (request *GetSupportStrategyRequest) Validate() error { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package model | ||
|
||
type TryPayUserOpResponse struct { | ||
StrategyId string `json:"strategy_id"` | ||
EntryPointAddress string `json:"entrypoint_address"` | ||
PayMasterAddress string `json:"paymaster_address"` | ||
PayMasterSignature string `json:"paymaster_signature"` | ||
PayReceipt interface{} `json:"pay_receipt"` | ||
GasInfo *ComputeGasResponse `json:"gas_info"` | ||
} | ||
|
||
type ComputeGasResponse struct { | ||
StrategyId string `json:"strategy_id"` | ||
TokenCost string `json:"token_cost"` | ||
Network string `json:"network"` | ||
Token string `json:"token"` | ||
UsdCost string `json:"usd_cost"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package model |
2 changes: 1 addition & 1 deletion
2
rpc_server/models/client_credential.go → common/model/client_credential.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package models | ||
package model | ||
|
||
type ClientCredential struct { | ||
ApiKey string `json:"apiKey"` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package model | ||
|
||
type Strategy struct { | ||
Id string | ||
EntryPointAddress string | ||
PayMasterAddress string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package model | ||
|
||
type UserOperationItem struct { | ||
Sender string `json:"sender" binding:"required"` | ||
Nonce string `json:"nonce" binding:"required"` | ||
InitCode string `json:"init_code"` | ||
CallGasLimit string `json:"call_gas_limit" binding:"required"` | ||
VerificationGasList string `json:"verification_gas_list" binding:"required"` | ||
PerVerificationGas string `json:"per_verification_gas" binding:"required"` | ||
MaxFeePerGas string `json:"max_fee_per_gas" binding:"required"` | ||
MaxPriorityFeePerGas string `json:"max_priority_fee_per_gas" binding:"required"` | ||
Signature string `json:"signature"` | ||
//paymasterAndData string `json:"paymaster_and_data"` | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
jwt: | ||
security: hello-eth-paymaster | ||
security: hello-ethereum-paymaster | ||
realm: aastar | ||
idkey: id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.