community

package
v0.0.0-...-cb07b45 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Community

type Community struct {
	Chain cw.ChainConfig

	EntryPoint common.Address
	Gateway    *gateway.Gateway

	Paymaster *paymaster.Paymaster

	AccountFactory *accfactory.Accfactory

	GratitudeFactory *grfactory.Grfactory

	ProfileFactory *profactory.Profactory
	// contains filtered or unexported fields
}

func Deploy

func Deploy(es *ethrequest.EthService, key *ecdsa.PrivateKey, address common.Address, chain cw.ChainConfig) (*Community, error)

Deploy instantiates a community struct and deploys the contracts

func New

New instantiates a community struct using the provided addresses for the contracts

func (*Community) CreateAccount

func (c *Community) CreateAccount(owner common.Address) (*common.Address, error)

CreateAccount creates an account for the provided owner

func (*Community) CreateGratitudeApp

func (c *Community) CreateGratitudeApp(owner common.Address) (*common.Address, error)

CreateGratitudeApp creates a gratitude app for the provided owner

func (*Community) CreateProfile

func (c *Community) CreateProfile(owner common.Address) (*common.Address, error)

CreateProfile creates a profile for the provided owner

func (*Community) DeployAccountFactory

func (c *Community) DeployAccountFactory() error

DeployAccountFactory deploys the account factory contract

func (*Community) DeployGateway

func (c *Community) DeployGateway() error

DeployGateway deploys the gateway contract

func (*Community) DeployGratitudeFactory

func (c *Community) DeployGratitudeFactory() error

DeployGratitudeFactory deploys the gratitude factory contract

func (*Community) DeployPaymaster

func (c *Community) DeployPaymaster() error

DeployPaymaster deploys the paymaster contract

func (*Community) DeployProfileFactory

func (c *Community) DeployProfileFactory() error

DeployProfileFactory deploys the profile factory contract

func (*Community) ExportAddress

func (c *Community) ExportAddress() CommunityAddress

func (*Community) FundPaymaster

func (c *Community) FundPaymaster(amount *big.Int) error

FundPaymaster funds the paymaster contract

func (*Community) GetAccount

func (c *Community) GetAccount(owner common.Address) (*account.Account, error)

GetAccount returns the account for the provided owner

func (*Community) GetProfile

func (c *Community) GetProfile(owner common.Address) (*profile.Profile, error)

GetProfile returns the profile for the provided owner

func (*Community) NewTransactor

func (c *Community) NewTransactor() (*bind.TransactOpts, error)

NewTransactor returns a new transactor for the community

func (*Community) NextNonce

func (c *Community) NextNonce() (uint64, error)

NextNonce returns the next nonce for the community

func (*Community) SubmitOp

func (c *Community) SubmitOp(sender common.Address, data []byte) error

SubmitOp submits an operation to the gateway for processing

type CommunityAddress

type CommunityAddress struct {
	Gateway          common.Address `json:"gateway"`
	Paymaster        common.Address `json:"paymaster"`
	AccountFactory   common.Address `json:"accountFactory"`
	GratitudeFactory common.Address `json:"gratitudeFactory"`
	ProfileFactory   common.Address `json:"profileFactory"`
	Chain            cw.ChainConfig `json:"chain"`
}

type Handlers

type Handlers struct {
	// contains filtered or unexported fields
}

func NewHandlers

func NewHandlers(r *response.Responder, c *Community) *Handlers

func (*Handlers) Config

func (h *Handlers) Config(w http.ResponseWriter, r *http.Request)

Config returns the community config of addresses and chain info

func (*Handlers) CreateAccount

func (h *Handlers) CreateAccount(w http.ResponseWriter, r *http.Request)

CreateAccount creates an account in the community and returns the address

func (*Handlers) SubmitOp

func (h *Handlers) SubmitOp(w http.ResponseWriter, r *http.Request)

SubmitOp submits an operation to the gateway for processing

type SubmitOpRequest

type SubmitOpRequest struct {
	Data []byte `json:"data"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL