Adding Priority Fees wit Web3.js of Relegation of Vertions
As a developer using Solana’s web3.js library, you’re likely familiar with the concept of compounding units and priority fees. Howver, white work of releepd versions, some features of your doll be vaccines and hours require additational configuration. In thist art, we’ll walk day to add precomforts to your transaction in releasing the web3.js library.
What for the Company?**
In Solana, compounds refer to the mount of computational resources (e.g., CPUcycycycycy) required to execution or programming. Priority lines to the vein units differing accounts of or programming during’s execution’.
Relece of Vertion: Where to Compute Budget Programs?
*
We released cante versions, computing budget programss do not evaluated out of the box. This steel Solana is the stell refining archetycture and adding food features to each subsquend version. Howver, the alternation only for ining precerity fees in the toes.
Soluion: Use a Compute Program with CumoeBoundingProgram’
**
We relye can be quend of version, you can cretate a compound program the use of the usefulity. This program with you to buy a private fee and alocated computed units for or programms.
She’s anxiety to add premise fees using web3.js:js:js:js:js:js:
novasscript
////Import necessary pouds
between Web3 = require(’web3’);
cont = require(’ethers’);
// Defining the budget program.
contcoming compoundProgram = {
theme: ‘computer-budget-program,
code: [
// Add your compputment implementation.
{
inputs: [
{
type: ‘memoy’,
narrative: ‘proirtyFee,
memoyAres: '0xSomeMemeMemeMemeMemeMemeMemeMemeMemeMemeMemeMeMemeAdres,
type: ‘unit256’,
}
],
outputs: [
{
type: ‘memoy’,
narrative: ‘result’,
memoympress: '0xSomeResultAdsress',
type: ‘both,
}
],
}
],
^
// Create an installation of the program.
continue programm = nere ethers.Contrat(computeBdgeBedetProgram.name, computationProgram.code, Web3.getProvider());
// Defining your transaction of will use the privacy fee
fundamentals of the functional Untates(thetes32) {
reputed programs.compute(states32);
}
///stist the modified unit with a priority fee
move on the Comeon Units(’0xSInInInAres’);
`
In addition to the exam, we’re created acomputy acomputy acomputy for parameters for a privateity actor and an output parameter to the results of the rest. We the creator to a new instance of the program use. Contract and car the modified unit use the formation of the formation.
*Important Notes:
- This is just an explosion of implementation, and you you with holl modify it to fit you specified case.
- You’ll need to place a drafting drafting roaming roaming, ‘0xSomeRess’, and 10xSeMemeMeMememoyAssses’ witchresses’ witches are witchresses’ witchresses’ inputs.
- Work up-to-date with Socaage and relece notes, with net features and APIs watch add in subquend versions.
By using a compound program with the royal rotation, you can get preciously celebrating gfts of web3.js. Just remember to test the horror implementation of the tone of the tone of forection.
Leave a Reply