Documentation
¶
Index ¶
- Constants
- func GenerateHexPrivateKey() (string, string, error)
- func GeneratePrivateKey() (*ecdsa.PrivateKey, error)
- func GetAddressFromContext(ctx context.Context) (string, bool)
- func RandomString(length int) string
- func StringWithCharset(length int, charset string) string
- type Community
- type CommunityConfig
- type CommunityERC4337
- type CommunityIPFS
- type CommunityIndexer
- type CommunityNode
- type CommunityPlugin
- type CommunityProfile
- type CommunityScan
- type CommunityToken
- type ContextKey
- type EVMRequester
- type EVMType
- type Event
- type EventState
- type JSONRPCError
- type JsonRPCRequest
- type JsonRPCResponse
- type Message
- type MessageResponse
- type Profile
- type PushMessage
- type PushToken
- type RPCHandlerFunc
- type Sponsor
- type Standard
- type Theme
- type Transfer
- type TransferData
- type TransferStatus
- type UserOp
- type UserOpMessage
- type WebhookMessager
Constants ¶
View Source
const ( // SignatureHeader is the header that contains the signature of the request SignatureHeader = "X-Signature" // AddressHeader is the header that contains the address of the sender AddressHeader = "X-Address" // AppVersionHeader is the header that contains the app version of the sender AppVersionHeader = "X-App-Version" )
View Source
const ImplementationStorageSlotKey = "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"
View Source
const PushMessageAnonymousBody = "%s %s received"
View Source
const PushMessageAnonymousDescriptionBody = "%s"
View Source
const PushMessageAnonymousDescriptionTitle = "%s %s (%s) received"
success
View Source
const PushMessageAnonymousTitle = "%s"
View Source
const PushMessageBody = "%s %s received from %s"
View Source
const PushMessageSendingAnonymousBody = "Receiving %s %s..."
View Source
const PushMessageSendingAnonymousDescriptionBody = "%s"
View Source
const PushMessageSendingAnonymousDescriptionTitle = "Receiving %s %s (%s)..."
sending
View Source
const PushMessageSendingAnonymousTitle = "%s"
View Source
const PushMessageTitle = "%s - %s"
View Source
const Version = "0.0.0"
there is no need to change this value manually, it will be replaced by the build system
Variables ¶
This section is empty.
Functions ¶
func GenerateHexPrivateKey ¶
generate a new private key
func GeneratePrivateKey ¶
func GeneratePrivateKey() (*ecdsa.PrivateKey, error)
generate a new private key
func GetAddressFromContext ¶
get address from context if exists
func RandomString ¶
func StringWithCharset ¶
Types ¶
type CommunityConfig ¶
type CommunityConfig struct { Community Community `json:"community"` Scan CommunityScan `json:"scan"` Indexer CommunityIndexer `json:"indexer"` IPFS CommunityIPFS `json:"ipfs"` Node CommunityNode `json:"node"` ERC4337 CommunityERC4337 `json:"erc4337"` Token CommunityToken `json:"token"` Profile CommunityProfile `json:"profile"` Plugins []CommunityPlugin `json:"plugins,omitempty"` Version int `json:"version"` }
type CommunityERC4337 ¶
type CommunityERC4337 struct { RPCURL string `json:"rpc_url"` PaymasterAddress string `json:"paymaster_address"` EntrypointAddress string `json:"entrypoint_address"` AccountFactoryAddress string `json:"account_factory_address"` PaymasterRPCURL string `json:"paymaster_rpc_url"` PaymasterType string `json:"paymaster_type"` }
type CommunityIPFS ¶
type CommunityIPFS struct {
URL string `json:"url"`
}
type CommunityIndexer ¶
type CommunityNode ¶
type CommunityPlugin ¶
type CommunityProfile ¶
type CommunityProfile struct {
Address string `json:"address"`
}
type CommunityScan ¶
type CommunityToken ¶
type ContextKey ¶
type ContextKey string
const ( ContextKeyAddress ContextKey = AddressHeader ContextKeySignature ContextKey = SignatureHeader )
type EVMRequester ¶
type EVMRequester interface { Context() context.Context Backend() bind.ContractBackend CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error) BaseFee() (*big.Int, error) EstimateGasPrice() (*big.Int, error) EstimateGasLimit(msg ethereum.CallMsg) (uint64, error) NewTx(nonce uint64, from, to common.Address, data []byte, extraGas bool) (*types.Transaction, error) SendTransaction(tx *types.Transaction) error StorageAt(addr common.Address, slot common.Hash) ([]byte, error) ChainID() (*big.Int, error) LatestBlock() (*big.Int, error) FilterLogs(q ethereum.FilterQuery) ([]types.Log, error) BlockTime(number *big.Int) (uint64, error) CallContract(call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) ListenForLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) error WaitForTx(tx *types.Transaction, timeout int) error Close() }
type Event ¶
type Event struct { Contract string `json:"contract"` State EventState `json:"state"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` StartBlock int64 `json:"start_block"` LastBlock int64 `json:"last_block"` Standard Standard `json:"standard"` Name string `json:"name"` Symbol string `json:"symbol"` Decimals int64 `json:"decimals"` }
type EventState ¶
type EventState string
const ( EventStateQueued EventState = "queued" EventStateIndexing EventState = "indexing" EventStateIndexed EventState = "indexed" )
type JSONRPCError ¶
type JsonRPCRequest ¶
type JsonRPCRequest struct { Version string `json:"jsonrpc"` ID int `json:"id"` Method string `json:"method"` Params json.RawMessage `json:"params"` }
type JsonRPCResponse ¶
type JsonRPCResponse struct { Version string `json:"jsonrpc"` ID int `json:"id"` Result any `json:"result"` Error *JSONRPCError `json:"error,omitempty"` }
type Message ¶
type Message struct { ID string CreatedAt time.Time RetryCount int Message any Response *chan MessageResponse }
func NewTxMessage ¶
func (*Message) WaitForResponse ¶
type MessageResponse ¶
type PushMessage ¶
func NewAnonymousPushMessage ¶
func NewAnonymousPushMessage(token []*PushToken, community, amount, symbol string, tx *Transfer) *PushMessage
func NewPushMessage ¶
func NewPushMessage(token []*PushToken, community, name, amount, symbol, username string) *PushMessage
func NewSilentPushMessage ¶
func NewSilentPushMessage(token []*PushToken, tx *Transfer) *PushMessage
type Transfer ¶
type Transfer struct { Hash string `json:"hash"` TxHash string `json:"tx_hash"` TokenID int64 `json:"token_id"` CreatedAt time.Time `json:"created_at"` FromTo string `json:"-"` From string `json:"from"` To string `json:"to"` Nonce int64 `json:"nonce"` Value *big.Int `json:"value"` Data *TransferData `json:"data"` Status TransferStatus `json:"status"` }
func (*Transfer) CombineFromTo ¶
func (*Transfer) GenerateUniqueHash ¶
generate hash for transfer using a provided index, from, to and the tx hash
type TransferData ¶
type TransferData struct {
Description string `json:"description"`
}
func (*TransferData) Scan ¶
func (td *TransferData) Scan(value interface{}) error
TransferData implements the sql.Scanner interface
type TransferStatus ¶
type TransferStatus string
const ( TransferStatusUnknown TransferStatus = "" TransferStatusSending TransferStatus = "sending" TransferStatusPending TransferStatus = "pending" TransferStatusSuccess TransferStatus = "success" TransferStatusFail TransferStatus = "fail" TEMP_HASH_PREFIX = "TEMP_HASH" )
func TransferStatusFromString ¶
func TransferStatusFromString(s string) (TransferStatus, error)
type UserOp ¶
type UserOp struct { Sender common.Address `json:"sender" mapstructure:"sender" validate:"required"` Nonce *big.Int `json:"nonce" mapstructure:"nonce" validate:"required"` InitCode []byte `json:"initCode" mapstructure:"initCode" validate:"required"` CallData []byte `json:"callData" mapstructure:"callData" validate:"required"` CallGasLimit *big.Int `json:"callGasLimit" mapstructure:"callGasLimit" validate:"required"` VerificationGasLimit *big.Int `json:"verificationGasLimit" mapstructure:"verificationGasLimit" validate:"required"` PreVerificationGas *big.Int `json:"preVerificationGas" mapstructure:"preVerificationGas" validate:"required"` MaxFeePerGas *big.Int `json:"maxFeePerGas" mapstructure:"maxFeePerGas" validate:"required"` MaxPriorityFeePerGas *big.Int `json:"maxPriorityFeePerGas" mapstructure:"maxPriorityFeePerGas" validate:"required"` PaymasterAndData []byte `json:"paymasterAndData" mapstructure:"paymasterAndData" validate:"required"` Signature []byte `json:"signature" mapstructure:"signature" validate:"required"` }
func (*UserOp) MarshalJSON ¶
MarshalJSON returns a JSON encoding of the UserOperation.
func (*UserOp) UnmarshalJSON ¶
UnmarshalJSON parses a JSON encoding of the UserOperation.
type UserOpMessage ¶
Click to show internal directories.
Click to hide internal directories.