@gearbox-protocol/sdk 8.14.2 → 8.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,7 +44,7 @@ class GearboxRewardsApi {
44
44
  static async getLmRewardsV2({
45
45
  provider,
46
46
  account,
47
- currentTokenData,
47
+ gearTokenAddress,
48
48
  network,
49
49
  airdropDistributorAddress,
50
50
  reportError
@@ -83,7 +83,7 @@ class GearboxRewardsApi {
83
83
  {
84
84
  amount: availableToClaimV2,
85
85
  type: "merkleV2",
86
- rewardToken: currentTokenData.GEAR,
86
+ rewardToken: gearTokenAddress,
87
87
  rewardTokenDecimals: 18,
88
88
  rewardTokenSymbol: "GEAR"
89
89
  }
@@ -57,11 +57,14 @@ class TokenData {
57
57
  this.symbol = payload.symbol;
58
58
  this.name = payload.name;
59
59
  this.decimals = payload.decimals;
60
- this.icon = `${import_endpoint.GearboxBackendApi.getStaticTokenUrl()}${payload.symbol.toLowerCase()}.svg`;
60
+ this.icon = TokenData.getTokenIcon(payload.symbol);
61
61
  }
62
62
  compareBySymbol(b) {
63
63
  return this.symbol > b.symbol ? 1 : -1;
64
64
  }
65
+ static getTokenIcon(symbol) {
66
+ return `${import_endpoint.GearboxBackendApi.getStaticTokenUrl()}${symbol.toLowerCase()}.svg`;
67
+ }
65
68
  }
66
69
  // Annotate the CommonJS export names for ESM import in node:
67
70
  0 && (module.exports = {
@@ -11,7 +11,7 @@ class GearboxRewardsApi {
11
11
  static async getLmRewardsV2({
12
12
  provider,
13
13
  account,
14
- currentTokenData,
14
+ gearTokenAddress,
15
15
  network,
16
16
  airdropDistributorAddress,
17
17
  reportError
@@ -50,7 +50,7 @@ class GearboxRewardsApi {
50
50
  {
51
51
  amount: availableToClaimV2,
52
52
  type: "merkleV2",
53
- rewardToken: currentTokenData.GEAR,
53
+ rewardToken: gearTokenAddress,
54
54
  rewardTokenDecimals: 18,
55
55
  rewardTokenSymbol: "GEAR"
56
56
  }
@@ -34,11 +34,14 @@ class TokenData {
34
34
  this.symbol = payload.symbol;
35
35
  this.name = payload.name;
36
36
  this.decimals = payload.decimals;
37
- this.icon = `${GearboxBackendApi.getStaticTokenUrl()}${payload.symbol.toLowerCase()}.svg`;
37
+ this.icon = TokenData.getTokenIcon(payload.symbol);
38
38
  }
39
39
  compareBySymbol(b) {
40
40
  return this.symbol > b.symbol ? 1 : -1;
41
41
  }
42
+ static getTokenIcon(symbol) {
43
+ return `${GearboxBackendApi.getStaticTokenUrl()}${symbol.toLowerCase()}.svg`;
44
+ }
42
45
  }
43
46
  export {
44
47
  TokenData
@@ -1,6 +1,5 @@
1
1
  import type { Address, PublicClient, WalletClient } from "viem";
2
2
  import type { NetworkType } from "../../chain/index.js";
3
- import type { SupportedToken } from "../../sdk-gov-legacy/index.js";
4
3
  import type { PoolData_Legacy } from "../core/pool.js";
5
4
  import type { TokenData } from "../tokens/tokenData.js";
6
5
  export interface GearboxExtraMerkleLmReward {
@@ -44,7 +43,7 @@ type ReportHandler = (e: unknown, description?: string) => void;
44
43
  export interface GetLmRewardsV2Props {
45
44
  account: Address;
46
45
  provider: PublicClient;
47
- currentTokenData: Record<SupportedToken, Address>;
46
+ gearTokenAddress: Address;
48
47
  airdropDistributorAddress: Address;
49
48
  network: NetworkType;
50
49
  reportError?: ReportHandler;
@@ -75,7 +74,7 @@ export interface ClaimLmRewardsV3Props {
75
74
  signer: WalletClient;
76
75
  }
77
76
  export declare class GearboxRewardsApi {
78
- static getLmRewardsV2({ provider, account, currentTokenData, network, airdropDistributorAddress, reportError, }: GetLmRewardsV2Props): Promise<GearboxLmReward[]>;
77
+ static getLmRewardsV2({ provider, account, gearTokenAddress, network, airdropDistributorAddress, reportError, }: GetLmRewardsV2Props): Promise<GearboxLmReward[]>;
79
78
  static getLmRewardsV3({ pools, tokensList, provider, account, reportError, }: GetLmRewardsV3Props): Promise<(GearboxLmReward | GearboxLmReward[])[]>;
80
79
  static getLmRewardsMerkle({ pools, account, network, reportError, }: GetLmRewardsMerkleProps): Promise<GearboxLmReward[]>;
81
80
  private static extractFulfilled;
@@ -10,4 +10,5 @@ export declare class TokenData {
10
10
  readonly icon: string;
11
11
  constructor(payload: TokenDataPayload);
12
12
  compareBySymbol(b: TokenData): number;
13
+ static getTokenIcon(symbol: string): string;
13
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "8.14.2",
3
+ "version": "8.14.3",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",