I want to make a token that would be used as "gift card". So, when one person send it back to my account, I want to pay the transaction fees (in order to let people who haven't got ignis claim their gift). So I need to set a bundler that only bundle, for free, transactions of this token to my account. In testnet, this is the token: 8633185858724739856 (the ms currency GIFTZ@IGNIS) this is my account: ARDOR-JHA7-XH2W-HMF4-CYQ7W How should I configure the bundler?
Asked
Active
Viewed 98 times
1 Answers
3
With Ardor 2.1.0e you can start a bundler which bundles only transactions with certain currency. Use CurrencyBundler filter with parameter the currency ID.
If you want to additionally filter only transactions sent to your account, you'll have to either write a new filter for that like
public class RecipientBundler implements Bundler.Filter {
@Override
public boolean ok(Bundler bundler, ChildTransaction childTransaction) {
return bundler.getAccountId() == childTransaction.getRecipientId();
}
@Override
public String getName() {
return "RecipientBundler";
}
@Override
public String getDescription() {
return "Only bundle the transactions sent to the bundler account";
}
}
...or alternatively you can create the currency as controllable.
With 2.0.14 you'll have to write a filter like the one from above which checks both conditions - that the transaction is transferring your currency and that the transaction is transferring it to your account.
EDIT: More details about the bundling in Ardor 2.1 can be found in nxtwiki
Petko Petkov
- 336
- 1
- 2