Fee Bump
Installation
deno add jsr:@colibri/plugin-fee-bumpOverview
Quick Start
import { PIPE_InvokeContract, LocalSigner, NetworkConfig } from "@colibri/core";
import { PLG_FeeBump } from "@colibri/plugin-fee-bump";
import { Operation } from "stellar-sdk";
// User's signer (the one making the contract call)
const userSigner = LocalSigner.fromSecret("USER_SECRET...");
// Fee bump source's signer (covers the fees)
const feeSourceSigner = LocalSigner.fromSecret("FEE_SOURCE_SECRET...");
const network = NetworkConfig.TestNet();
// Create the pipeline
const pipeline = PIPE_InvokeContract.create({ networkConfig: network });
// Create and add fee bump plugin
const feeBumpPlugin = PLG_FeeBump.create({
networkConfig: network,
feeBumpConfig: {
source: feeSourceSigner.publicKey(),
fee: "1000000", // 0.1 XLM in stroops
signers: [feeSourceSigner],
},
});
pipeline.addPlugin(feeBumpPlugin, PLG_FeeBump.target);
// Run the pipeline
const result = await pipeline.run({
operations: [
Operation.invokeContractFunction({
contract: "CABC...",
function: "transfer",
args: [...],
}),
],
config: {
source: userSigner.publicKey(),
fee: "100000",
signers: [userSigner],
},
});PLG_FeeBump
Creating a Plugin
Configuration
Property
Type
Description
Fee Calculation
How It Works
Error Handling
Error Codes
Code
Class
Description
Handling Errors
Usage Patterns
Covered Fees for User Onboarding
Enterprise Fee Management
Dynamic Fee Calculation
Security Considerations
1. Validate Transactions
2. Rate Limiting
3. Fee Limits
Next Steps
Last updated