Documentation ¶
Index ¶
- Constants
- Variables
- type AddContractRequest
- type AddDestinationRequest
- type AddDestinationResponse
- type AddMethodRequest
- type AddMethodResponse
- type AddProxyContractsRequest
- type Bcnmy
- func (b *Bcnmy) AddContract(data *AddContractRequest) (*GeneralResponse, error)
- func (b *Bcnmy) AddDestinationAddresses(data *AddDestinationRequest) (*AddDestinationResponse, error)
- func (b *Bcnmy) AddMethod(data *AddMethodRequest) (*AddMethodResponse, error)
- func (b *Bcnmy) AddProxyContracts(data *AddProxyContractsRequest) (*ProxyContractsResponse, error)
- func (b *Bcnmy) BuildTransactParams(metaTxMessage *MetaTxMessage, typedDataHash string) ([]byte, error)
- func (b *Bcnmy) CreateDapp(data *CreateDappRequest) (*CreateDappResponse, error)
- func (b *Bcnmy) DeleteContract(data *DeleteContractRequest) (*GeneralResponse, error)
- func (b *Bcnmy) DeleteMethod(data *DeleteMethodRequest) (*GeneralResponse, error)
- func (b *Bcnmy) EnhanceTransact(from string, method string, signature []byte, metaTxMessage *MetaTxMessage, ...) (*MetaTxResponse, *types.Transaction, *types.Receipt, error)
- func (b *Bcnmy) GetAuthorization() string
- func (b *Bcnmy) GetGasTankBalance() (*GasTankBalanceResponse, error)
- func (b *Bcnmy) GetMetaAPI(ctx context.Context) (*MetaAPIResponse, error)
- func (b *Bcnmy) GetProxyContracts() (*GetProxyContractsResponse, error)
- func (b *Bcnmy) GetUniqueUserData(data *UniqueUserDataRequest) (*UniqueUserDataResponse, error)
- func (b *Bcnmy) GetUserLimit(data *UserLimitRequest) (*UserLimitResponse, error)
- func (b *Bcnmy) Pack(method string, params ...interface{}) ([]byte, error)
- func (b *Bcnmy) PatchProxyContracts(data *PatchProxyContractsRequest) (*ProxyContractsResponse, error)
- func (b *Bcnmy) RawTransact(signer *Signer, method string, params ...interface{}) (*MetaTxResponse, *types.Transaction, *types.Receipt, error)
- func (b *Bcnmy) SendMetaNativeTx(data *MetaTxRequest) (*MetaTxResponse, error)
- func (b *Bcnmy) WithAuthToken(authToken string) *Bcnmy
- func (b *Bcnmy) WithDapp(jsonABI string, dappAddress common.Address) (*Bcnmy, error)
- func (b *Bcnmy) WithFieldTimeout(timeout time.Duration) *Bcnmy
- type CreateDappRequest
- type CreateDappResponse
- type DeleteContractRequest
- type DeleteMethodRequest
- type GasTankBalanceResponse
- type GeneralResponse
- type GetProxyContractsResponse
- type MetaAPIInfo
- type MetaAPIResponse
- type MetaTxLimit
- type MetaTxMessage
- type MetaTxRequest
- type MetaTxResponse
- type PatchProxyContractsRequest
- type ProxyContractsResponse
- type Signer
- type UniqueUserDataRequest
- type UniqueUserDataResponse
- type UserLimitRequest
- type UserLimitResponse
Constants ¶
View Source
const ( MetaAPIURL = "https://api.biconomy.io/api/v1/meta-api" MetaTxNativeURL = "https://api.biconomy.io/api/v2/meta-tx/native" CreateDappPublicURL = "https://api.biconomy.io/api/v1/dapp/public-api/create-dapp" AddContractURL = "https://api.biconomy.io/api/v1/smart-contract/public-api/addContract" AddMethodURL = "https://api.biconomy.io/api/v1/meta-api/public-api/addMethod" DeleteContractURL = "https://api.biconomy.io/api/v1/smart-contract/public-api/deleteContract" DeleteMethodURL = "https://api.biconomy.io/api/v1/meta-api/public-api/deleteMethod" AddDestinationAddressesURL = "https://api.biconomy.io/api/v1/dapp/whitelist/destination" ProxyContractsURL = "https://api.biconomy.io/api/v1/dapp/whitelist/proxy-contracts" UniqueUserDataURL = "https://data.biconomy.io/api/v1/dapp/uniqueUserData" UserLimitURL = "https://data.biconomy.io/api/v1/dapp/user-limit" GasTankBalanceURL = "https://data.biconomy.io/api/v1/dapp/gas-tank-balance" )
View Source
const ( SignatureEIP712Type = "EIP712_SIGN" EIP712DomainType = "EIP712Domain" ForwardRequestType = "ERC20ForwardRequest" ForwardRequestName = "Biconomy Forwarder" Version = "1" )
Variables ¶
View Source
var ForwarderAddressMap = map[string]common.Address{ "1": common.HexToAddress("0x84a0856b038eaAd1cC7E297cF34A7e72685A8693"), "3": common.HexToAddress("0x3D1D6A62c588C1Ee23365AF623bdF306Eb47217A"), "4": common.HexToAddress("0xFD4973FeB2031D4409fB57afEE5dF2051b171104"), "5": common.HexToAddress("0xE041608922d06a4F26C0d4c27d8bCD01daf1f792"), "42": common.HexToAddress("0xF82986F574803dfFd9609BE8b9c7B92f63a1410E"), "56": common.HexToAddress("0x86C80a8aa58e0A4fa09A69624c31Ab2a6CAD56b8"), "97": common.HexToAddress("0x61456BF1715C1415730076BB79ae118E806E74d2"), "100": common.HexToAddress("0x86C80a8aa58e0A4fa09A69624c31Ab2a6CAD56b8"), "137": common.HexToAddress("0xf0511f123164602042ab2bCF02111fA5D3Fe97CD"), "250": common.HexToAddress("0x64CD353384109423a966dCd3Aa30D884C9b2E057"), "1287": common.HexToAddress("0x3AF14449e18f2c3677bFCB5F954Dc68d5fb74a75"), "4002": common.HexToAddress("0x69FB8Dca8067A5D38703b9e8b39cf2D51473E4b4"), "80001": common.HexToAddress("0x69015912AA33720b842dCD6aC059Ed623F28d9f7"), "42161": common.HexToAddress("0xfe0fa3C06d03bDC7fb49c892BbB39113B534fB57"), "421611": common.HexToAddress("0x67454E169d613a8e9BA6b06af2D267696EAaAf41"), }
View Source
var SignedTypes = apitypes.Types{ "EIP712Domain": []apitypes.Type{ {Name: "name", Type: "string"}, {Name: "version", Type: "string"}, {Name: "verifyingContract", Type: "address"}, {Name: "salt", Type: "bytes32"}, }, "ERC20ForwardRequest": []apitypes.Type{ {Name: "from", Type: "address"}, {Name: "to", Type: "address"}, {Name: "token", Type: "address"}, {Name: "txGas", Type: "uint256"}, {Name: "tokenGasPrice", Type: "uint256"}, {Name: "batchId", Type: "uint256"}, {Name: "batchNonce", Type: "uint256"}, {Name: "deadline", Type: "uint256"}, {Name: "data", Type: "bytes"}, }, }
Functions ¶
This section is empty.
Types ¶
type AddContractRequest ¶
type AddContractRequest struct { ContractName string `json:"contractName"` ContractAddress string `json:"contractAddress"` ContractType string `json:"contractType"` // SCW for contract wallet or SC for contract WalletType string `json:"walletType"` // SCW or GNOSIS or blank MetaTransactionType string `json:"metaTransactionType"` // DEFAULT, TRUSTED_FORWARDER, ERC20_FORWARDER ABI string `json:"abi"` }
type AddDestinationRequest ¶
type AddDestinationRequest struct {
DestinationAddresses []string `json:"destinationAddresses"`
}
type AddDestinationResponse ¶
type AddMethodRequest ¶
type AddMethodResponse ¶
type AddProxyContractsRequest ¶
type AddProxyContractsRequest struct {
Addresses []string `json:"addresses"`
}
type Bcnmy ¶
type Bcnmy struct {
// contains filtered or unexported fields
}
func (*Bcnmy) AddContract ¶
func (b *Bcnmy) AddContract(data *AddContractRequest) (*GeneralResponse, error)
func (*Bcnmy) AddDestinationAddresses ¶
func (b *Bcnmy) AddDestinationAddresses(data *AddDestinationRequest) (*AddDestinationResponse, error)
func (*Bcnmy) AddMethod ¶
func (b *Bcnmy) AddMethod(data *AddMethodRequest) (*AddMethodResponse, error)
func (*Bcnmy) AddProxyContracts ¶
func (b *Bcnmy) AddProxyContracts(data *AddProxyContractsRequest) (*ProxyContractsResponse, error)
func (*Bcnmy) BuildTransactParams ¶ added in v0.0.5
func (b *Bcnmy) BuildTransactParams(metaTxMessage *MetaTxMessage, typedDataHash string) ([]byte, error)
func (*Bcnmy) CreateDapp ¶
func (b *Bcnmy) CreateDapp(data *CreateDappRequest) (*CreateDappResponse, error)
func (*Bcnmy) DeleteContract ¶
func (b *Bcnmy) DeleteContract(data *DeleteContractRequest) (*GeneralResponse, error)
func (*Bcnmy) DeleteMethod ¶
func (b *Bcnmy) DeleteMethod(data *DeleteMethodRequest) (*GeneralResponse, error)
func (*Bcnmy) EnhanceTransact ¶
func (b *Bcnmy) EnhanceTransact(from string, method string, signature []byte, metaTxMessage *MetaTxMessage, typedDataHash string) (*MetaTxResponse, *types.Transaction, *types.Receipt, error)
/ Backend using this method, handle frontend passing signature, MetaTxMessage and / ForwardRequestType data Hash value
func (*Bcnmy) GetAuthorization ¶
func (*Bcnmy) GetGasTankBalance ¶
func (b *Bcnmy) GetGasTankBalance() (*GasTankBalanceResponse, error)
func (*Bcnmy) GetMetaAPI ¶
func (b *Bcnmy) GetMetaAPI(ctx context.Context) (*MetaAPIResponse, error)
func (*Bcnmy) GetProxyContracts ¶
func (b *Bcnmy) GetProxyContracts() (*GetProxyContractsResponse, error)
func (*Bcnmy) GetUniqueUserData ¶
func (b *Bcnmy) GetUniqueUserData(data *UniqueUserDataRequest) (*UniqueUserDataResponse, error)
func (*Bcnmy) GetUserLimit ¶
func (b *Bcnmy) GetUserLimit(data *UserLimitRequest) (*UserLimitResponse, error)
func (*Bcnmy) PatchProxyContracts ¶
func (b *Bcnmy) PatchProxyContracts(data *PatchProxyContractsRequest) (*ProxyContractsResponse, error)
func (*Bcnmy) RawTransact ¶
func (b *Bcnmy) RawTransact(signer *Signer, method string, params ...interface{}) (*MetaTxResponse, *types.Transaction, *types.Receipt, error)
func (*Bcnmy) SendMetaNativeTx ¶
func (b *Bcnmy) SendMetaNativeTx(data *MetaTxRequest) (*MetaTxResponse, error)
func (*Bcnmy) WithAuthToken ¶
type CreateDappRequest ¶
type CreateDappResponse ¶
type DeleteContractRequest ¶
type DeleteMethodRequest ¶
type GasTankBalanceResponse ¶
type GasTankBalanceResponse struct { GeneralResponse DappGasTankData struct { EffectiveBalanceInWei *big.Int `json:"effectiveBalanceInWei"` EffectiveBalanceInStandardForm string `json:"effectiveBalanceInStandardForm"` IsBelowThreshold bool `json:"isBelowThreshold"` IsInGracePeriod bool `json:"isInGracePeriod"` } `json:"dappGasTankData"` }
type GeneralResponse ¶
type GetProxyContractsResponse ¶
type GetProxyContractsResponse struct { ProxyContractsResponse Total int `json:"total"` Addresses []struct { Address string `json:"address"` Status bool `json:"status"` } `json:"addresses"` }
type MetaAPIInfo ¶
type MetaAPIInfo struct { /// need to filter non contractAdress ContractAddress string `json:"contractAddress"` ID string `json:"id"` Name string `json:"name"` URL string `json:"url"` Version int `json:"version"` Method string `json:"method"` MethodType string `json:"methodType"` APIType string `json:"apiType"` MetaTxLimitStatus int `json:"metaTxLimitStatus"` MetaTxLimit MetaTxLimit `json:"metaTxLimit"` }
type MetaAPIResponse ¶
type MetaAPIResponse struct { Log string `json:"log"` Flag int `json:"flag"` Total int `json:"total"` ListAPI []MetaAPIInfo `json:"listApis"` }
type MetaTxLimit ¶
type MetaTxMessage ¶
type MetaTxMessage struct { From common.Address `json:"from"` To common.Address `json:"to"` Token common.Address `json:"token"` TxGas uint64 `json:"txGas"` TokenGasPrice string `json:"tokenGasPrice"` BatchId *big.Int `json:"batchId"` BatchNonce *big.Int `json:"batchNonce"` Deadline *big.Int `json:"deadline"` Data string `json:"data"` }
func (*MetaTxMessage) TypedData ¶
func (m *MetaTxMessage) TypedData() apitypes.TypedDataMessage
type MetaTxRequest ¶
type MetaTxResponse ¶
type MetaTxResponse struct { TxHash common.Hash `json:"txHash"` Log string `json:"log"` Flag int `json:"flag"` Message string `json:"message"` Error string `json:"error"` Code int `json:"code"` Limit struct { Type int `json:"type"` LimitLeft int `json:"limitLeft"` ResetTime int `json:"resetTime"` } `json:"limit"` Allowed bool `json:"allowed"` }
type ProxyContractsResponse ¶
type UniqueUserDataRequest ¶
type UniqueUserDataResponse ¶
type UniqueUserDataResponse struct { GeneralResponse UniqueUserData []struct { Date string `json:"date"` Count int `json:"count"` Addresses []string `json:"addresses"` } }
type UserLimitRequest ¶
type UserLimitResponse ¶
type UserLimitResponse struct { GeneralResponse UserLimitData struct { LimitLeft struct { SignerAddress string `json:"signerAddress"` TransactionLimitLeft int `json:"transactionLimitLeft"` TransactionCount int `json:"transactionCount"` AreLimitsConsumed bool `json:"areLimitsConsumed"` UserTransactionLimit int `json:"userTransactionLimit"` } `json:"limitLeft"` LimitType string `json:"limitType"` LimitStartTime *big.Int `json:"limitStartTime"` LimitEndTime *big.Int `json:"limitEndTime"` TimePeriodInDays int `json:"timePeriodInDays"` } `json:"userLimitData"` }
Click to show internal directories.
Click to hide internal directories.