To minimize node operating costs, CARV offers official endpoints that assist node operators in batching operations and posting them on-chain. While gasless transactions still necessitate user signatures for specific operations, CARV ensures endpoint availability. However, if you are concerned about risks, you also have the option to independently send transactions to the smart contract.
Base URLs: https://interface.carv.io
Message Construction
To make sure the gasless server still guarantee the authorization from the original node operater, it adopts the standard to proof authorization through the signature.
For more details of message structure:
Example config:
POST ExplorerSendTxNodeEnter
POST /explorer/send_tx_node_enter
Message structure (Golang)
Copy typedData := apitypes.TypedData{
Types: apitypes.Types{
"EIP712Domain": {
{
Name: "name",
Type: "string",
},
{
Name: "version",
Type: "string",
},
{
Name: "chainId",
Type: "uint256",
},
},
"NodeEnterData": {
{
Name: "replacedNode",
Type: "address",
},
{
Name: "expiredAt",
Type: "uint256",
},
},
},
PrimaryType: "NodeEnterData",
Domain: apitypes.TypedDataDomain{
Name: c.cf.Signature.DomainName,
Version: c.cf.Signature.DomainVersion,
ChainId: (*math.HexOrDecimal256)(big.NewInt(c.cf.Chain.ChainId)),
},
Message: apitypes.TypedDataMessage{
"replacedNode": replacedNode.String(),
"expiredAt": expiredAt,
},
}
Body Parameters
Copy {
"signer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
"replaced_node": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
"expired_at": 1000000000,
"v": 27,
"r": "ac0b5874f37c40838a33663da72cf90629a0164f98d7785736cc3fd96abeec67",
"s": "10ba15d823cd831ef4061d474cc42d66933c6e45c2865b6d9c5f3646a2599b55",
"version": "1.0.0"
}
Params
Name
Location
Type
Required
Description
The node to replace. There are 2000 active node limit. To join the active set you have to specify a node has lower delegation than you to replace with.
Response Examples
200 Response
Copy {
"code": 0,
"msg": "string",
"data": {}
}
Responses
HTTP Status Code
Meaning
Description
Data schema
Responses Data Schema
HTTP Status Code 200
HTTP Status Code 400
POST ExplorerSendTxNodeExit
POST /explorer/send_tx_node_exit
Message structure (Golang)
Copy apitypes.TypedData{
Types: apitypes.Types{
"EIP712Domain": {
{
Name: "name",
Type: "string",
},
{
Name: "version",
Type: "string",
},
{
Name: "chainId",
Type: "uint256",
},
},
"NodeExitData": {
{
Name: "expiredAt",
Type: "uint256",
},
},
},
PrimaryType: "NodeExitData",
Domain: apitypes.TypedDataDomain{
Name: c.cf.Signature.DomainName,
Version: c.cf.Signature.DomainVersion,
ChainId: (*math.HexOrDecimal256)(big.NewInt(c.cf.Chain.ChainId)),
},
Message: apitypes.TypedDataMessage{
"expiredAt": expiredAt,
},
}
v, r, s, err := tools.SignTypedDataAndSplit(typedData, c.verifierPrivKey)
if err != nil {
return
}
}
Body Parameters
Copy {
"signer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
"expired_at": 1000000000,
"v": 27,
"r": "ac0b5874f37c40838a33663da72cf90629a0164f98d7785736cc3fd96abeec67",
"s": "10ba15d823cd831ef4061d474cc42d66933c6e45c2865b6d9c5f3646a2599b55",
"version": "1.0.0"
}
Params
Response Examples
200 Response
Copy {
"code": 0,
"msg": "string",
"data": {}
}
Responses
HTTP Status Code
Meaning
Description
Data schema
Responses Data Schema
HTTP Status Code 200
HTTP Status Code 400
POST ExplorerSendTxModifyCommissionRate
POST /explorer/send_tx_modify_commission_rate
Message structure (Golang)
Copy typedData := apitypes.TypedData{
Types: apitypes.Types{
"EIP712Domain": {
{
Name: "name",
Type: "string",
},
{
Name: "version",
Type: "string",
},
{
Name: "chainId",
Type: "uint256",
},
},
"NodeModifyCommissionRateData": {
{
Name: "commissionRate",
Type: "uint32",
},
{
Name: "expiredAt",
Type: "uint256",
},
},
},
PrimaryType: "NodeModifyCommissionRateData",
Domain: apitypes.TypedDataDomain{
Name: c.cf.Signature.DomainName,
Version: c.cf.Signature.DomainVersion,
ChainId: (*math.HexOrDecimal256)(big.NewInt(c.cf.Chain.ChainId)),
},
Message: apitypes.TypedDataMessage{
"commissionRate": strconv.Itoa(int(commissionRate)),
"expiredAt": expiredAt,
},
}
Body Parameters
Copy {
"signer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
"commission_rate": 100,
"expired_at": 1000000000,
"v": 27,
"r": "ac0b5874f37c40838a33663da72cf90629a0164f98d7785736cc3fd96abeec67",
"s": "10ba15d823cd831ef4061d474cc42d66933c6e45c2865b6d9c5f3646a2599b55",
"version": "1.0.0"
}
Params
Response Examples
200 Response
Copy {
"code": 0,
"msg": "string",
"data": {}
}
Responses
HTTP Status Code
Meaning
Description
Data schema
Responses Data Schema
HTTP Status Code 200
HTTP Status Code 400
POST ExplorerSendTxSetRewardClaimer
POST /explorer/send_tx_set_reward_claimer
Message structure (Golang)
Copy typedData := apitypes.TypedData{
Types: apitypes.Types{
"EIP712Domain": {
{
Name: "name",
Type: "string",
},
{
Name: "version",
Type: "string",
},
{
Name: "chainId",
Type: "uint256",
},
},
"NodeSetRewardClaimerData": {
{
Name: "claimer",
Type: "address",
},
{
Name: "expiredAt",
Type: "uint256",
},
},
},
PrimaryType: "NodeSetRewardClaimerData",
Domain: apitypes.TypedDataDomain{
Name: c.cf.Signature.DomainName,
Version: c.cf.Signature.DomainVersion,
ChainId: (*math.HexOrDecimal256)(big.NewInt(c.cf.Chain.ChainId)),
},
Message: apitypes.TypedDataMessage{
"claimer": rewardClaimer.String(),
"expiredAt": expiredAt,
},
}
Body Parameters
Copy {
"signer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
"claimer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
"expired_at": 1000000000,
"v": 27,
"r": "ac0b5874f37c40838a33663da72cf90629a0164f98d7785736cc3fd96abeec67",
"s": "10ba15d823cd831ef4061d474cc42d66933c6e45c2865b6d9c5f3646a2599b55",
"version": "1.0.0"
}
Params
Response Examples
200 Response
Copy {
"code": 0,
"msg": "string",
"data": {}
}
Responses
HTTP Status Code
Meaning
Description
Data schema
Responses Data Schema
HTTP Status Code 200
HTTP Status Code 400
POST ExplorerSendTxNodeReportVerification
POST /explorer/send_tx_node_report_verification
Message structure (Golang)
Copy typedData := apitypes.TypedData{
Types: apitypes.Types{
"EIP712Domain": {
{
Name: "name",
Type: "string",
},
{
Name: "version",
Type: "string",
},
{
Name: "chainId",
Type: "uint256",
},
},
"VerificationData": {
{
Name: "attestationID",
Type: "bytes32",
},
{
Name: "result",
Type: "uint8",
},
{
Name: "index",
Type: "uint32",
},
},
},
PrimaryType: "VerificationData",
Domain: apitypes.TypedDataDomain{
Name: c.cf.Signature.DomainName,
Version: c.cf.Signature.DomainVersion,
ChainId: (*math.HexOrDecimal256)(big.NewInt(c.cf.Chain.ChainId)),
},
Message: apitypes.TypedDataMessage{
"attestationID": attestationId[:],
"result": strconv.Itoa(int(result)),
"index": strconv.Itoa(int(index)),
},
}
Body Parameters
Copy {
"signer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
"attestation_id": "0x518c1c43067238438f81546f39623c49b09a8eeeb0ee14794aafefd9fa84c7ab",
"result": 0,
"index": 1,
"v": 27,
"r": "ac0b5874f37c40838a33663da72cf90629a0164f98d7785736cc3fd96abeec67",
"s": "10ba15d823cd831ef4061d474cc42d66933c6e45c2865b6d9c5f3646a2599b55",
"version": "1.0.0"
}
Params
Response Examples
200 Response
Copy {
"code": 0,
"msg": "string",
"data": null
}
Responses
HTTP Status Code
Meaning
Description
Data schema
Responses Data Schema
HTTP Status Code 200
HTTP Status Code 400