diff --git a/package.json b/package.json index 9396d4b..2184782 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kilnfi/sdk", - "version": "2.18.1", + "version": "2.19.0", "autor": "Kiln (https://kiln.fi)", "license": "BUSL-1.1", "description": "JavaScript sdk for Kiln API", diff --git a/src/services/atom.ts b/src/services/atom.ts index f4c4eba..d382673 100644 --- a/src/services/atom.ts +++ b/src/services/atom.ts @@ -28,6 +28,7 @@ export class AtomService extends Service { * @param validatorAddress validator address to delegate to * @param amountAtom how many tokens to stake in ATOM * @param restakeRewards If enabled, the rewards will be automatically restaked + * @param granteeAddress validator grantee address */ async craftStakeTx( accountId: string, @@ -35,6 +36,7 @@ export class AtomService extends Service { validatorAddress: string, amountAtom: number, restakeRewards: boolean = false, + granteeAddress?: string, ): Promise { const { data } = await api.post(`/v1/atom/transaction/stake`, { account_id: accountId, @@ -42,6 +44,7 @@ export class AtomService extends Service { validator: validatorAddress, amount_uatom: this.atomToUatom(amountAtom.toString()), restake_rewards: restakeRewards, + grantee_address: granteeAddress, }); return data; } @@ -63,11 +66,13 @@ export class AtomService extends Service { * Craft atom restake rewards transaction * @param pubkey wallet pubkey, this is different from the wallet address * @param validatorAddress validator address to which the delegation has been made + * @param granteeAddress validator grantee address */ - async craftRestakeRewardsTx(pubkey: string, validatorAddress: string): Promise { + async craftRestakeRewardsTx(pubkey: string, validatorAddress: string, granteeAddress: string): Promise { const { data } = await api.post(`/v1/atom/transaction/restake-rewards`, { pubkey: pubkey, validator_address: validatorAddress, + grantee_address: granteeAddress, }); return data; } diff --git a/src/services/fet.ts b/src/services/fet.ts index c19dcfd..19d306e 100644 --- a/src/services/fet.ts +++ b/src/services/fet.ts @@ -28,6 +28,7 @@ export class FetService extends Service { * @param validatorAddress validator address to delegate to * @param amountFet how many tokens to stake in FET * @param restakeRewards If enabled, the rewards will be automatically restaked + * @param granteeAddress validator grantee address */ async craftStakeTx( accountId: string, @@ -35,6 +36,7 @@ export class FetService extends Service { validatorAddress: string, amountFet: number, restakeRewards: boolean = false, + granteeAddress?: string, ): Promise { const { data } = await api.post(`/v1/fet/transaction/stake`, { account_id: accountId, @@ -42,6 +44,7 @@ export class FetService extends Service { validator: validatorAddress, amount_afet: this.fetToAfet(amountFet.toString()), restake_rewards: restakeRewards, + grantee_address: granteeAddress, }); return data; } @@ -63,11 +66,13 @@ export class FetService extends Service { * Craft fetch.ai restake rewards transaction * @param pubkey wallet pubkey, this is different from the wallet address * @param validatorAddress validator address to which the delegation has been made + * @param granteeAddress validator grantee address */ - async craftRestakeRewardsTx(pubkey: string, validatorAddress: string): Promise { + async craftRestakeRewardsTx(pubkey: string, validatorAddress: string, granteeAddress: string): Promise { const { data } = await api.post(`/v1/fet/transaction/restake-rewards`, { pubkey: pubkey, validator_address: validatorAddress, + grantee_address: granteeAddress, }); return data; } diff --git a/src/services/inj.ts b/src/services/inj.ts index 8ac098f..c44d50b 100644 --- a/src/services/inj.ts +++ b/src/services/inj.ts @@ -27,6 +27,7 @@ export class InjService extends Service { * @param validatorAddress validator address to delegate to * @param amountInj how many tokens to stake in INJ * @param restakeRewards If enabled, the rewards will be automatically restaked + * @param granteeAddress validator grantee address */ async craftStakeTx( accountId: string, @@ -34,6 +35,7 @@ export class InjService extends Service { validatorAddress: string, amountInj: number, restakeRewards: boolean = false, + granteeAddress?: string, ): Promise { const { data } = await api.post(`/v1/inj/transaction/stake`, { account_id: accountId, @@ -41,6 +43,7 @@ export class InjService extends Service { validator: validatorAddress, amount_inj: this.injToAinj(amountInj.toString()), restake_rewards: restakeRewards, + grantee_address: granteeAddress, }); return data; } @@ -62,11 +65,13 @@ export class InjService extends Service { * Craft inj restake rewards transaction * @param pubkey wallet pubkey, this is different from the wallet address * @param validatorAddress validator address to which the delegation has been made + * @param granteeAddress validator grantee address */ - async craftRestakeRewardsTx(pubkey: string, validatorAddress: string): Promise { + async craftRestakeRewardsTx(pubkey: string, validatorAddress: string, granteeAddress: string): Promise { const { data } = await api.post(`/v1/inj/transaction/restake-rewards`, { pubkey: pubkey, validator_address: validatorAddress, + grantee_address: granteeAddress, }); return data; } diff --git a/src/services/osmo.ts b/src/services/osmo.ts index a37f2ad..e7755c9 100644 --- a/src/services/osmo.ts +++ b/src/services/osmo.ts @@ -28,6 +28,7 @@ export class OsmoService extends Service { * @param validatorAddress validator address to delegate to * @param amountOsmo how many tokens to stake in OSMO * @param restakeRewards If enabled, the rewards will be automatically restaked + * @param granteeAddress validator grantee address */ async craftStakeTx( accountId: string, @@ -35,6 +36,7 @@ export class OsmoService extends Service { validatorAddress: string, amountOsmo: number, restakeRewards: boolean = false, + granteeAddress?: string, ): Promise { const { data } = await api.post(`/v1/osmo/transaction/stake`, { account_id: accountId, @@ -42,6 +44,7 @@ export class OsmoService extends Service { validator: validatorAddress, amount_uosmo: this.osmoToUosmo(amountOsmo.toString()), restake_rewards: restakeRewards, + grantee_address: granteeAddress, }); return data; } @@ -63,11 +66,13 @@ export class OsmoService extends Service { * Craft osmo restake rewards transaction * @param pubkey wallet pubkey, this is different from the wallet address * @param validatorAddress validator address to which the delegation has been made + * @param granteeAddress validator grantee address */ - async craftRestakeRewardsTx(pubkey: string, validatorAddress: string): Promise { + async craftRestakeRewardsTx(pubkey: string, validatorAddress: string, granteeAddress: string): Promise { const { data } = await api.post(`/v1/osmo/transaction/restake-rewards`, { pubkey: pubkey, validator_address: validatorAddress, + grantee_address: granteeAddress, }); return data; } diff --git a/src/services/tia.ts b/src/services/tia.ts index 20803cc..676fa78 100644 --- a/src/services/tia.ts +++ b/src/services/tia.ts @@ -27,6 +27,7 @@ export class TiaService extends Service { * @param validatorAddress validator address to delegate to * @param amountTia how many tokens to stake in TIA * @param restakeRewards If enabled, the rewards will be automatically restaked + * @param granteeAddress validator grantee address */ async craftStakeTx( accountId: string, @@ -34,6 +35,7 @@ export class TiaService extends Service { validatorAddress: string, amountTia: number, restakeRewards: boolean = false, + granteeAddress?: string, ): Promise { const { data } = await api.post(`/v1/tia/transaction/stake`, { account_id: accountId, @@ -41,6 +43,7 @@ export class TiaService extends Service { validator: validatorAddress, amount_utia: this.tiaToUtia(amountTia.toString()), restake_rewards: restakeRewards, + grantee_address: granteeAddress, }); return data; } @@ -62,11 +65,13 @@ export class TiaService extends Service { * Craft tia restake rewards transaction * @param pubkey wallet pubkey, this is different from the wallet address * @param validatorAddress validator address to which the delegation has been made + * @param granteeAddress validator grantee address */ - async craftRestakeRewardsTx(pubkey: string, validatorAddress: string): Promise { + async craftRestakeRewardsTx(pubkey: string, validatorAddress: string, granteeAddress: string): Promise { const { data } = await api.post(`/v1/tia/transaction/restake-rewards`, { pubkey: pubkey, validator_address: validatorAddress, + grantee_address: granteeAddress, }); return data; } diff --git a/src/services/zeta.ts b/src/services/zeta.ts index 72eb6bb..8e827e3 100644 --- a/src/services/zeta.ts +++ b/src/services/zeta.ts @@ -28,6 +28,7 @@ export class ZetaService extends Service { * @param validatorAddress validator address to delegate to * @param amountZeta how many tokens to stake in ZETA * @param restakeRewards If enabled, the rewards will be automatically restaked + * @param granteeAddress validator grantee address */ async craftStakeTx( accountId: string, @@ -35,6 +36,7 @@ export class ZetaService extends Service { validatorAddress: string, amountZeta: number, restakeRewards: boolean = false, + granteeAddress?: string, ): Promise { const { data } = await api.post(`/v1/zeta/transaction/stake`, { account_id: accountId, @@ -42,6 +44,7 @@ export class ZetaService extends Service { validator: validatorAddress, amount_azeta: this.zetaToAZeta(amountZeta.toString()), restake_rewards: restakeRewards, + grantee_address: granteeAddress, }); return data; } @@ -63,11 +66,13 @@ export class ZetaService extends Service { * Craft a Zetachain restake rewards transaction * @param pubkey wallet pubkey, this is different from the wallet address * @param validatorAddress validator address to which the delegation has been made + * @param granteeAddress validator grantee address */ - async craftRestakeRewardsTx(pubkey: string, validatorAddress: string): Promise { + async craftRestakeRewardsTx(pubkey: string, validatorAddress: string, granteeAddress: string): Promise { const { data } = await api.post(`/v1/zeta/transaction/restake-rewards`, { pubkey: pubkey, validator_address: validatorAddress, + grantee_address: granteeAddress, }); return data; }