import cobo_waas2
from cobo_waas2.models.fee_station_check_fee_station_usage import (
FeeStationCheckFeeStationUsage,
)
from cobo_waas2.models.fee_station_check_fee_station_usage_response import (
FeeStationCheckFeeStationUsageResponse,
)
from cobo_waas2.rest import ApiException
from pprint import pprint
# See configuration.py for a list of all supported configurations.
configuration = cobo_waas2.Configuration(
# Replace `<YOUR_PRIVATE_KEY>` with your private key
api_private_key="<YOUR_PRIVATE_KEY>",
# Select the development environment. To use the production environment, change the URL to https://api.cobo.com/v2.
host="https://api.dev.cobo.com/v2",
)
# Enter a context with an instance of the API client
with cobo_waas2.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = cobo_waas2.FeeStationApi(api_client)
fee_station_check_fee_station_usage = cobo_waas2.FeeStationCheckFeeStationUsage(
request_id="f47ac10b-58cc-4372-a567-0e02b2c3d479",
amount="100.5",
token_id="ETH_USDT",
estimated_fee_amount="0.0021",
from_address="0x1234567890abcdef1234567890abcdef12345678",
from_wallet_id="f47ac10b-58cc-4372-a567-0e02b2c3d479"
)
try:
# Check Fee Station usage
api_response = api_instance.check_fee_station_usage(
fee_station_check_fee_station_usage=fee_station_check_fee_station_usage
)
print("The response of FeeStationApi->check_fee_station_usage:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling FeeStationApi->check_fee_station_usage: %s\n" % e)
// Import classes:
import com.cobo.waas2.ApiClient;
import com.cobo.waas2.ApiException;
import com.cobo.waas2.Configuration;
import com.cobo.waas2.Env;
import com.cobo.waas2.api.FeeStationApi;
import com.cobo.waas2.model.*;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Select the development environment. To use the production environment, replace `Env.DEV` with
// `Env.PROD
defaultClient.setEnv(Env.DEV);
// Replace `<YOUR_PRIVATE_KEY>` with your private key
defaultClient.setPrivKey("<YOUR_PRIVATE_KEY>");
FeeStationApi apiInstance = new FeeStationApi();
FeeStationCheckFeeStationUsage feeStationCheckFeeStationUsage =
new FeeStationCheckFeeStationUsage();
try {
FeeStationCheckFeeStationUsageResponse result =
apiInstance.checkFeeStationUsage(feeStationCheckFeeStationUsage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FeeStationApi#checkFeeStationUsage");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
package main
import (
"context"
"fmt"
coboWaas2 "github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2"
"github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2/crypto"
"os"
)
func main() {
feeStationCheckFeeStationUsage := *coboWaas2.NewFeeStationCheckFeeStationUsage("f47ac10b-58cc-4372-a567-0e02b2c3d479", "100.5", "ETH_USDT", "0.0021", "0x1234567890abcdef1234567890abcdef12345678", "f47ac10b-58cc-4372-a567-0e02b2c3d479")
configuration := coboWaas2.NewConfiguration()
// Initialize the API client
apiClient := coboWaas2.NewAPIClient(configuration)
ctx := context.Background()
// Select the development environment. To use the production environment, replace coboWaas2.DevEnv with coboWaas2.ProdEnv
ctx = context.WithValue(ctx, coboWaas2.ContextEnv, coboWaas2.DevEnv)
// Replace `<YOUR_PRIVATE_KEY>` with your private key
ctx = context.WithValue(ctx, coboWaas2.ContextPortalSigner, crypto.Ed25519Signer{
Secret: "<YOUR_PRIVATE_KEY>",
})
resp, r, err := apiClient.FeeStationAPI.CheckFeeStationUsage(ctx).
FeeStationCheckFeeStationUsage(feeStationCheckFeeStationUsage).
Execute()
if err != nil {
fmt.Fprintf(
os.Stderr,
"Error when calling `FeeStationAPI.CheckFeeStationUsage``: %v\n",
err,
)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CheckFeeStationUsage`: FeeStationCheckFeeStationUsageResponse
fmt.Fprintf(os.Stdout, "Response from `FeeStationAPI.CheckFeeStationUsage`: %v\n", resp)
}
const CoboWaas2 = require("@cobo/cobo-waas2");
// Initialize the API client
const apiClient = CoboWaas2.ApiClient.instance;
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
apiClient.setEnv(CoboWaas2.Env.DEV);
// Replace `<YOUR_PRIVATE_KEY>` with your private key
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
// Call the API
const apiInstance = new CoboWaas2.FeeStationApi();
const opts = {
FeeStationCheckFeeStationUsage:
new CoboWaas2.FeeStationCheckFeeStationUsage(),
};
apiInstance.checkFeeStationUsage(opts).then(
(data) => {
console.log("API called successfully. Returned data: " + data);
},
(error) => {
console.error(error);
},
);
{
"token_id": "ETH",
"balance": "0.0021",
"gas_station_type": "CoboOperationStation",
"is_fee_station_applicable": true,
"is_balance_sufficient": false,
"total_fee_amount": "0.0021",
"is_sponsor_applicable": true,
"sponsored_fee_amount": "0.0021",
"sponsored_token_id": "ETH_USDT"
}{
"error_code": 123,
"error_message": "<string>",
"error_id": "0b6ddf19083c4bd1a9ca01bec44b24dd"
}{
"error_code": 123,
"error_message": "<string>",
"error_id": "0b6ddf19083c4bd1a9ca01bec44b24dd"
}Check Fee Station usage
This operation evaluates Fee Station usage for the current transaction.
It determines whether Fee station can be used, checks if the Fee Station balance is sufficient, and returns a breakdown of the amounts involved, including any portion that must be covered by the user or sponsored in USD stablecoin.
import cobo_waas2
from cobo_waas2.models.fee_station_check_fee_station_usage import (
FeeStationCheckFeeStationUsage,
)
from cobo_waas2.models.fee_station_check_fee_station_usage_response import (
FeeStationCheckFeeStationUsageResponse,
)
from cobo_waas2.rest import ApiException
from pprint import pprint
# See configuration.py for a list of all supported configurations.
configuration = cobo_waas2.Configuration(
# Replace `<YOUR_PRIVATE_KEY>` with your private key
api_private_key="<YOUR_PRIVATE_KEY>",
# Select the development environment. To use the production environment, change the URL to https://api.cobo.com/v2.
host="https://api.dev.cobo.com/v2",
)
# Enter a context with an instance of the API client
with cobo_waas2.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = cobo_waas2.FeeStationApi(api_client)
fee_station_check_fee_station_usage = cobo_waas2.FeeStationCheckFeeStationUsage(
request_id="f47ac10b-58cc-4372-a567-0e02b2c3d479",
amount="100.5",
token_id="ETH_USDT",
estimated_fee_amount="0.0021",
from_address="0x1234567890abcdef1234567890abcdef12345678",
from_wallet_id="f47ac10b-58cc-4372-a567-0e02b2c3d479"
)
try:
# Check Fee Station usage
api_response = api_instance.check_fee_station_usage(
fee_station_check_fee_station_usage=fee_station_check_fee_station_usage
)
print("The response of FeeStationApi->check_fee_station_usage:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling FeeStationApi->check_fee_station_usage: %s\n" % e)
// Import classes:
import com.cobo.waas2.ApiClient;
import com.cobo.waas2.ApiException;
import com.cobo.waas2.Configuration;
import com.cobo.waas2.Env;
import com.cobo.waas2.api.FeeStationApi;
import com.cobo.waas2.model.*;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Select the development environment. To use the production environment, replace `Env.DEV` with
// `Env.PROD
defaultClient.setEnv(Env.DEV);
// Replace `<YOUR_PRIVATE_KEY>` with your private key
defaultClient.setPrivKey("<YOUR_PRIVATE_KEY>");
FeeStationApi apiInstance = new FeeStationApi();
FeeStationCheckFeeStationUsage feeStationCheckFeeStationUsage =
new FeeStationCheckFeeStationUsage();
try {
FeeStationCheckFeeStationUsageResponse result =
apiInstance.checkFeeStationUsage(feeStationCheckFeeStationUsage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FeeStationApi#checkFeeStationUsage");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
package main
import (
"context"
"fmt"
coboWaas2 "github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2"
"github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2/crypto"
"os"
)
func main() {
feeStationCheckFeeStationUsage := *coboWaas2.NewFeeStationCheckFeeStationUsage("f47ac10b-58cc-4372-a567-0e02b2c3d479", "100.5", "ETH_USDT", "0.0021", "0x1234567890abcdef1234567890abcdef12345678", "f47ac10b-58cc-4372-a567-0e02b2c3d479")
configuration := coboWaas2.NewConfiguration()
// Initialize the API client
apiClient := coboWaas2.NewAPIClient(configuration)
ctx := context.Background()
// Select the development environment. To use the production environment, replace coboWaas2.DevEnv with coboWaas2.ProdEnv
ctx = context.WithValue(ctx, coboWaas2.ContextEnv, coboWaas2.DevEnv)
// Replace `<YOUR_PRIVATE_KEY>` with your private key
ctx = context.WithValue(ctx, coboWaas2.ContextPortalSigner, crypto.Ed25519Signer{
Secret: "<YOUR_PRIVATE_KEY>",
})
resp, r, err := apiClient.FeeStationAPI.CheckFeeStationUsage(ctx).
FeeStationCheckFeeStationUsage(feeStationCheckFeeStationUsage).
Execute()
if err != nil {
fmt.Fprintf(
os.Stderr,
"Error when calling `FeeStationAPI.CheckFeeStationUsage``: %v\n",
err,
)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CheckFeeStationUsage`: FeeStationCheckFeeStationUsageResponse
fmt.Fprintf(os.Stdout, "Response from `FeeStationAPI.CheckFeeStationUsage`: %v\n", resp)
}
const CoboWaas2 = require("@cobo/cobo-waas2");
// Initialize the API client
const apiClient = CoboWaas2.ApiClient.instance;
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
apiClient.setEnv(CoboWaas2.Env.DEV);
// Replace `<YOUR_PRIVATE_KEY>` with your private key
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
// Call the API
const apiInstance = new CoboWaas2.FeeStationApi();
const opts = {
FeeStationCheckFeeStationUsage:
new CoboWaas2.FeeStationCheckFeeStationUsage(),
};
apiInstance.checkFeeStationUsage(opts).then(
(data) => {
console.log("API called successfully. Returned data: " + data);
},
(error) => {
console.error(error);
},
);
{
"token_id": "ETH",
"balance": "0.0021",
"gas_station_type": "CoboOperationStation",
"is_fee_station_applicable": true,
"is_balance_sufficient": false,
"total_fee_amount": "0.0021",
"is_sponsor_applicable": true,
"sponsored_fee_amount": "0.0021",
"sponsored_token_id": "ETH_USDT"
}{
"error_code": 123,
"error_message": "<string>",
"error_id": "0b6ddf19083c4bd1a9ca01bec44b24dd"
}{
"error_code": 123,
"error_message": "<string>",
"error_id": "0b6ddf19083c4bd1a9ca01bec44b24dd"
}import cobo_waas2
from cobo_waas2.models.fee_station_check_fee_station_usage import (
FeeStationCheckFeeStationUsage,
)
from cobo_waas2.models.fee_station_check_fee_station_usage_response import (
FeeStationCheckFeeStationUsageResponse,
)
from cobo_waas2.rest import ApiException
from pprint import pprint
# See configuration.py for a list of all supported configurations.
configuration = cobo_waas2.Configuration(
# Replace `<YOUR_PRIVATE_KEY>` with your private key
api_private_key="<YOUR_PRIVATE_KEY>",
# Select the development environment. To use the production environment, change the URL to https://api.cobo.com/v2.
host="https://api.dev.cobo.com/v2",
)
# Enter a context with an instance of the API client
with cobo_waas2.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = cobo_waas2.FeeStationApi(api_client)
fee_station_check_fee_station_usage = cobo_waas2.FeeStationCheckFeeStationUsage(
request_id="f47ac10b-58cc-4372-a567-0e02b2c3d479",
amount="100.5",
token_id="ETH_USDT",
estimated_fee_amount="0.0021",
from_address="0x1234567890abcdef1234567890abcdef12345678",
from_wallet_id="f47ac10b-58cc-4372-a567-0e02b2c3d479"
)
try:
# Check Fee Station usage
api_response = api_instance.check_fee_station_usage(
fee_station_check_fee_station_usage=fee_station_check_fee_station_usage
)
print("The response of FeeStationApi->check_fee_station_usage:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling FeeStationApi->check_fee_station_usage: %s\n" % e)
// Import classes:
import com.cobo.waas2.ApiClient;
import com.cobo.waas2.ApiException;
import com.cobo.waas2.Configuration;
import com.cobo.waas2.Env;
import com.cobo.waas2.api.FeeStationApi;
import com.cobo.waas2.model.*;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Select the development environment. To use the production environment, replace `Env.DEV` with
// `Env.PROD
defaultClient.setEnv(Env.DEV);
// Replace `<YOUR_PRIVATE_KEY>` with your private key
defaultClient.setPrivKey("<YOUR_PRIVATE_KEY>");
FeeStationApi apiInstance = new FeeStationApi();
FeeStationCheckFeeStationUsage feeStationCheckFeeStationUsage =
new FeeStationCheckFeeStationUsage();
try {
FeeStationCheckFeeStationUsageResponse result =
apiInstance.checkFeeStationUsage(feeStationCheckFeeStationUsage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FeeStationApi#checkFeeStationUsage");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
package main
import (
"context"
"fmt"
coboWaas2 "github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2"
"github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2/crypto"
"os"
)
func main() {
feeStationCheckFeeStationUsage := *coboWaas2.NewFeeStationCheckFeeStationUsage("f47ac10b-58cc-4372-a567-0e02b2c3d479", "100.5", "ETH_USDT", "0.0021", "0x1234567890abcdef1234567890abcdef12345678", "f47ac10b-58cc-4372-a567-0e02b2c3d479")
configuration := coboWaas2.NewConfiguration()
// Initialize the API client
apiClient := coboWaas2.NewAPIClient(configuration)
ctx := context.Background()
// Select the development environment. To use the production environment, replace coboWaas2.DevEnv with coboWaas2.ProdEnv
ctx = context.WithValue(ctx, coboWaas2.ContextEnv, coboWaas2.DevEnv)
// Replace `<YOUR_PRIVATE_KEY>` with your private key
ctx = context.WithValue(ctx, coboWaas2.ContextPortalSigner, crypto.Ed25519Signer{
Secret: "<YOUR_PRIVATE_KEY>",
})
resp, r, err := apiClient.FeeStationAPI.CheckFeeStationUsage(ctx).
FeeStationCheckFeeStationUsage(feeStationCheckFeeStationUsage).
Execute()
if err != nil {
fmt.Fprintf(
os.Stderr,
"Error when calling `FeeStationAPI.CheckFeeStationUsage``: %v\n",
err,
)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CheckFeeStationUsage`: FeeStationCheckFeeStationUsageResponse
fmt.Fprintf(os.Stdout, "Response from `FeeStationAPI.CheckFeeStationUsage`: %v\n", resp)
}
const CoboWaas2 = require("@cobo/cobo-waas2");
// Initialize the API client
const apiClient = CoboWaas2.ApiClient.instance;
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
apiClient.setEnv(CoboWaas2.Env.DEV);
// Replace `<YOUR_PRIVATE_KEY>` with your private key
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
// Call the API
const apiInstance = new CoboWaas2.FeeStationApi();
const opts = {
FeeStationCheckFeeStationUsage:
new CoboWaas2.FeeStationCheckFeeStationUsage(),
};
apiInstance.checkFeeStationUsage(opts).then(
(data) => {
console.log("API called successfully. Returned data: " + data);
},
(error) => {
console.error(error);
},
);
Authorizations
The API key. For more details, refer to API key.
In the API playground, enter your API secret, and your API key will be accordingly calculated.
Body
The request body for evaluating Fee Station usage.
The information for evaluating Fee Station usage.
The request ID that is used to track a transaction request. The request ID is provided by you and must be unique within your organization.
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
The estimated transaction fee required for this transfer, before applying any Fee Station rules.
"0.0021"
The blockchain address that initiates the transfer.
"0x1234567890abcdef1234567890abcdef12345678"
The wallet ID.
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
Applicable to transfer requests only. The amount of tokens to be transferred in this request.
"100.5"
Applicable to transfer requests only. The token ID of the asset to be transferred. You can retrieve available token IDs by calling List enabled tokens.
"ETH_USDT"
The token ID used to pay the gas fee for the main transaction. You can retrieve available token IDs by calling List enabled tokens.
"ETH"
The mode of transaction fee payment using Fee Station. Currently, Fee Station supports eligible transactions made with MPC Wallets and Web3 Wallets on EVM-compatible chains, TRON, and Solana. For more details, refer to Fee Station.
ProActiveAutoFuel: Always use Fee Station to pay transaction fees.PassiveAutoFuel: Use Fee Station only when the source address balance is insufficient to cover transaction fees.UsePortalPreference: Use fueling strategy based on the Portal configuration.DisableAutoFuel: Do not use Fee Station for transaction fee payment under any circumstances.
If this parameter is not specified, it defaults to the behavior of UsePortalPreference.
Note: TRON and Solana do not support PassiveAutoFuel due to their fee delegation mechanisms.
PassiveAutoFuel, ProActiveAutoFuel, UsePortalPreference, DisableAutoFuel "PassiveAutoFuel"
Response
The request was successful.
The fee station evaluation result for the transfer request.
The token used to pay the gas fee for this specific transaction. You can retrieve the IDs of all supported tokens by calling List enabled tokens.
"ETH"
The current token balance available in Fee Station.
"0.0021"
The Fee Station mode used for automatic gas payment:
FeeStation: The user uses their own Fee Station balance to cover the gas fee.CoboOperationStation: Cobo covers the gas fee on behalf of the user.
FeeStation, CoboOperationStation "CoboOperationStation"
Indicates whether Fee Station is applied for this transfer request.
true
If Fee Station is used, indicates whether its balance is sufficient to cover the required gas fee.
false
The total gas amount required for this transfer request.
"0.0021"
Indicates whether USD stablecoin sponsorship is applied when the Fee Station balance is insufficient.
true
The amount of gas fee sponsored by USD stablecoin when applicable.
"0.0021"
The token ID used to sponsor the gas fee.
"ETH_USDT"
Was this page helpful?
