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 Billing Center usage
This operation evaluates Billing Center usage for the current transaction.
It determines whether Billing Center can be used, checks if the Billing Center 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 Billing Center usage.
The information for evaluating Billing Center 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 Billing Center 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"
Whether Billing Center pays the on-chain transaction fee for this transaction, and under what condition.
On-chain fees are charged in a chain's gas token, which is usually not the token you are sending. Without Billing Center, the source address must hold that gas token or the transaction fails. When Billing Center covers the fee, the source address does not need to hold any gas token.
For more details, refer to Billing Center.
Accepted values
ProActiveAutoFuel: Always have Billing Center pay the fee, without touching the gas token in the source address.PassiveAutoFuel: Use the gas token in the source address when it is sufficient; otherwise have Billing Center pay the fee.UsePortalPreference: Follow the per-chain sponsorship rules configured on Cobo Portal, under Billing Center > Settings.DisableAutoFuel: Never use Billing Center. The transaction pays its fee from the source address and fails if the balance is insufficient.
If this parameter is not specified, it defaults to UsePortalPreference.
Support and limitations
- Applies to transactions from MPC Wallets and Custodial Wallets (Web3 Wallets) on EVM-compatible chains, TRON, Solana, and Tempo. Other chains, such as BTC, are not supported, and the source address must hold the fee itself.
- TRON, Solana, and Tempo do not support
PassiveAutoFueldue to their fee delegation mechanisms. - The per-chain sponsorship rules on Cobo Portal apply only to API transactions that pass
UsePortalPreference. They do not affect transfers initiated from the Cobo Portal interface.
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 Billing Center.
"0.0021"
The Billing Center mode used for automatic gas payment:
FeeStation: The user uses their own Billing Center balance to cover the gas fee.CoboOperationStation: Cobo covers the gas fee on behalf of the user.
FeeStation, CoboOperationStation "CoboOperationStation"
Indicates whether Billing Center is applied for this transfer request.
true
If Billing Center 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 Billing Center 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?
