GenerateUserOp
With "generateUserOp" on Krypcore, you can easily execute user operations. This powerful feature allows users to establish, customise, and manage numerous operations within their smart contract wallet in a few simple clicks, providing a streamlined and user-friendly experience. Unleash the power of personalised and efficient control over your digital assets.
This deploys GenerateUserOp using this method.
API Specification
GenerateUserOp Details
POST
https://web3-proxy-dev.krypcore.com/api/v0/scWallet/generateUserOp
To generateUserOp under the given instance.
Headers
Request Body
{
"Data": {
"userOp": {
"callData": "******",
"callGasLimit": "0x34b8",
"initCode": "******",
"maxFeePerGas": "0xa8621424",
"maxPriorityFeePerGas": "0xa8621424",
"nonce": "0x0",
"paymasterAndData": "0x",
"preVerificationGas": "0xc57e",
"sender": "*****",
"signature": "0x",
"verificationGasLimit": "0x684eb"
},
"userOpHash": "******"
},
"Message": "",
"Status": "SUCCESS"
}
{
"message": "Internal Server Error"
}
{
"message": "Invalid API key in request"
}
Take a look at how you might call this method using our official libraries, or via curl
curl --location 'https://web3-proxy-dev.krypcore.com/api/v0/scWallet/generateUserOp' \
--header 'DappId: ******' \
--header 'Authorization: ******' \
--header 'Content-Type: application/json' \
--data '{"walletName":"ak10", "to":"0xc2de797fab7d2d2b26246e93fcf2cd5873a90b10","method":"store","params":[{"type":"uint256","value":"35"}],"isContractTxn":true,"contractABI":"[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"}],\"name\":\"store\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"retrieve\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"}'
var myHeaders = new Headers();
myHeaders.append("DappId", "******");
myHeaders.append("Authorization", "******");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"walletName": "ak10",
"to": "0xc2de797fab7d2d2b26246e93fcf2cd5873a90b10",
"method": "store",
"params": [
{
"type": "uint256",
"value": "35"
}
],
"isContractTxn": true,
"contractABI": "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"}],\"name\":\"store\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"retrieve\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://web3-proxy-dev.krypcore.com/api/v0/scWallet/generateUserOp", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
import requests
import json
url = "https://web3-proxy-dev.krypcore.com/api/v0/scWallet/generateUserOp"
payload = json.dumps({
"walletName": "ak10",
"to": "0xc2de797fab7d2d2b26246e93fcf2cd5873a90b10",
"method": "store",
"params": [
{
"type": "uint256",
"value": "35"
}
],
"isContractTxn": True,
"contractABI": "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"}],\"name\":\"store\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"retrieve\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"
})
headers = {
'DappId': '******',
'Authorization': '******',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://web3-proxy-dev.krypcore.com/api/v0/scWallet/generateUserOp"
method := "POST"
payload := strings.NewReader(`{"walletName":"ak10", "to":"0xc2de797fab7d2d2b26246e93fcf2cd5873a90b10","method":"store","params":[{"type":"uint256","value":"35"}],"isContractTxn":true,"contractABI":"[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"}],\"name\":\"store\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"retrieve\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("DappId", "******")
req.Header.Add("Authorization", "******")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Last updated