@sonarwatch/portfolio-plugins 0.12.109 → 0.12.111

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +1 -1
  3. package/src/plugins/raydium/farmsFetcher.d.ts +3 -0
  4. package/src/plugins/raydium/farmsFetcher.js +113 -0
  5. package/src/plugins/raydium/farmsFetcher.js.map +1 -0
  6. package/src/plugins/raydium/farmsJob.d.ts +11 -0
  7. package/src/plugins/raydium/farmsJob.js +165 -0
  8. package/src/plugins/raydium/farmsJob.js.map +1 -0
  9. package/src/plugins/raydium/filters.d.ts +18 -0
  10. package/src/plugins/raydium/filters.js +74 -1
  11. package/src/plugins/raydium/filters.js.map +1 -1
  12. package/src/plugins/raydium/helpers.d.ts +3 -1
  13. package/src/plugins/raydium/helpers.js +25 -1
  14. package/src/plugins/raydium/helpers.js.map +1 -1
  15. package/src/plugins/raydium/index.js +4 -2
  16. package/src/plugins/raydium/index.js.map +1 -1
  17. package/src/plugins/raydium/structs/farms.d.ts +123 -0
  18. package/src/plugins/raydium/structs/farms.js +111 -0
  19. package/src/plugins/raydium/structs/farms.js.map +1 -0
  20. package/src/plugins/raydium/types.d.ts +34 -0
  21. package/src/plugins/raydium/types.js.map +1 -1
  22. package/src/plugins/save/constants.d.ts +5 -3
  23. package/src/plugins/save/constants.js +6 -4
  24. package/src/plugins/save/constants.js.map +1 -1
  25. package/src/plugins/save/index.js +2 -1
  26. package/src/plugins/save/index.js.map +1 -1
  27. package/src/plugins/save/rewardStatsJob.d.ts +3 -0
  28. package/src/plugins/save/rewardStatsJob.js +31 -0
  29. package/src/plugins/save/rewardStatsJob.js.map +1 -0
  30. package/src/plugins/save/rewardsFetcher.js +96 -54
  31. package/src/plugins/save/rewardsFetcher.js.map +1 -1
  32. package/src/plugins/save/structs.d.ts +12 -0
  33. package/src/plugins/save/structs.js +12 -1
  34. package/src/plugins/save/structs.js.map +1 -1
  35. package/src/plugins/save/types.d.ts +46 -0
  36. package/src/plugins/zeta/airdropFetcher.js +2 -2
  37. package/src/plugins/zeta/airdropFetcher.js.map +1 -1
  38. package/src/plugins/zeta/helpers.d.ts +2 -0
  39. package/src/plugins/zeta/helpers.js +13 -1
  40. package/src/plugins/zeta/helpers.js.map +1 -1
@@ -93,3 +93,15 @@ export type ClaimStatus = {
93
93
  amount: BigNumber;
94
94
  };
95
95
  export declare const claimStatusStruct: BeetStruct<ClaimStatus, Partial<ClaimStatus>>;
96
+ export type MerkleDistributor = {
97
+ buffer: Buffer;
98
+ base: PublicKey;
99
+ bump: number;
100
+ root: number[];
101
+ mint: PublicKey;
102
+ maxTotalClaim: BigNumber;
103
+ maxNumNodes: BigNumber;
104
+ totalAmountClaimed: BigNumber;
105
+ numNodesClaimed: BigNumber;
106
+ };
107
+ export declare const merkleDistributorStruct: BeetStruct<MerkleDistributor, Partial<MerkleDistributor>>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.claimStatusStruct = exports.obligationLiquidityStruct = exports.obligationCollateralStruct = exports.obligationStruct = exports.reserveStruct = exports.lastUpdateStruct = exports.liquidityStruct = exports.collateralStruct = exports.reserveConfigStruct = exports.feesStruct = void 0;
3
+ exports.merkleDistributorStruct = exports.claimStatusStruct = exports.obligationLiquidityStruct = exports.obligationCollateralStruct = exports.obligationStruct = exports.reserveStruct = exports.lastUpdateStruct = exports.liquidityStruct = exports.collateralStruct = exports.reserveConfigStruct = exports.feesStruct = void 0;
4
4
  const beet_1 = require("@metaplex-foundation/beet");
5
5
  const beet_solana_1 = require("@metaplex-foundation/beet-solana");
6
6
  const solana_1 = require("../../utils/solana");
@@ -85,4 +85,15 @@ exports.claimStatusStruct = new beet_1.BeetStruct([
85
85
  ['claimedAt', solana_1.i64],
86
86
  ['amount', solana_1.u64],
87
87
  ], (args) => args);
88
+ exports.merkleDistributorStruct = new beet_1.BeetStruct([
89
+ ['buffer', (0, solana_1.blob)(8)],
90
+ ['base', beet_solana_1.publicKey],
91
+ ['bump', beet_1.u8],
92
+ ['root', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
93
+ ['mint', beet_solana_1.publicKey],
94
+ ['maxTotalClaim', solana_1.u64],
95
+ ['maxNumNodes', solana_1.u64],
96
+ ['totalAmountClaimed', solana_1.u64],
97
+ ['numNodesClaimed', solana_1.u64],
98
+ ], (args) => args);
88
99
  //# sourceMappingURL=structs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/save/structs.ts"],"names":[],"mappings":";;;AAAA,oDAAiE;AACjE,kEAA6D;AAG7D,+CAA0D;AAQ7C,QAAA,UAAU,GAAG,IAAI,iBAAU,CACtC;IACE,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,mBAAmB,EAAE,SAAE,CAAC;CAC1B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAY,CACvB,CAAC;AAgBW,QAAA,mBAAmB,GAAG,IAAI,iBAAU,CAC/C;IACE,CAAC,wBAAwB,EAAE,SAAE,CAAC;IAC9B,CAAC,kBAAkB,EAAE,SAAE,CAAC;IACxB,CAAC,kBAAkB,EAAE,SAAE,CAAC;IACxB,CAAC,sBAAsB,EAAE,SAAE,CAAC;IAC5B,CAAC,eAAe,EAAE,SAAE,CAAC;IACrB,CAAC,mBAAmB,EAAE,SAAE,CAAC;IACzB,CAAC,eAAe,EAAE,SAAE,CAAC;IACrB,CAAC,MAAM,EAAE,kBAAU,CAAC;IACpB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,aAAa,EAAE,uBAAS,CAAC;CAC3B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAqB,CAChC,CAAC;AAQW,QAAA,gBAAgB,GAAG,IAAI,iBAAU,CAC5C;IACE,CAAC,YAAY,EAAE,uBAAS,CAAC;IAC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,CAAC,WAAW,EAAE,WAAI,CAAC;IACnB,CAAC,UAAU,EAAE,uBAAS,CAAC;IACvB,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,QAAQ,EAAE,YAAG,CAAC;CAChB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAmB,CAC9B,CAAC"}
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/save/structs.ts"],"names":[],"mappings":";;;AAAA,oDAKmC;AACnC,kEAA6D;AAG7D,+CAA0D;AAQ7C,QAAA,UAAU,GAAG,IAAI,iBAAU,CACtC;IACE,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,mBAAmB,EAAE,SAAE,CAAC;CAC1B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAY,CACvB,CAAC;AAgBW,QAAA,mBAAmB,GAAG,IAAI,iBAAU,CAC/C;IACE,CAAC,wBAAwB,EAAE,SAAE,CAAC;IAC9B,CAAC,kBAAkB,EAAE,SAAE,CAAC;IACxB,CAAC,kBAAkB,EAAE,SAAE,CAAC;IACxB,CAAC,sBAAsB,EAAE,SAAE,CAAC;IAC5B,CAAC,eAAe,EAAE,SAAE,CAAC;IACrB,CAAC,mBAAmB,EAAE,SAAE,CAAC;IACzB,CAAC,eAAe,EAAE,SAAE,CAAC;IACrB,CAAC,MAAM,EAAE,kBAAU,CAAC;IACpB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,aAAa,EAAE,uBAAS,CAAC;CAC3B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAqB,CAChC,CAAC;AAQW,QAAA,gBAAgB,GAAG,IAAI,iBAAU,CAC5C;IACE,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,cAAc,EAAE,uBAAS,C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IACvB,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,QAAQ,EAAE,YAAG,CAAC;CAChB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAmB,CAC9B,CAAC;AAcW,QAAA,uBAAuB,GAAG,IAAI,iBAAU,CACnD;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,MAAM,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;IACvC,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,oBAAoB,EAAE,YAAG,CAAC;IAC3B,CAAC,iBAAiB,EAAE,YAAG,CAAC;CACzB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAyB,CACpC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { PublicKey } from '@solana/web3.js';
1
2
  export interface ApiResponse<T> {
2
3
  results: T[];
3
4
  next: null;
@@ -113,6 +114,24 @@ export type ExternalReward = {
113
114
  lastSlot: number;
114
115
  lastTx: 'string';
115
116
  };
117
+ export type RewardStat = {
118
+ incentivizer: string;
119
+ lastSlot: number;
120
+ market: string;
121
+ mint: string;
122
+ reserveID: string;
123
+ rewardMint: string;
124
+ rewardSymbol: string;
125
+ rewardsPerShare: string;
126
+ side: string;
127
+ tokenMint: string;
128
+ totalBalance: string;
129
+ rewardRates: {
130
+ name: string;
131
+ beginningSlot: number;
132
+ rewardRate: number;
133
+ }[];
134
+ };
116
135
  export type Obligation = {
117
136
  obligationID: string;
118
137
  lotNumber: number;
@@ -121,4 +140,31 @@ export type Obligation = {
121
140
  distributorPublicKey: string;
122
141
  name: string;
123
142
  incentivizer: string;
143
+ distributor: {
144
+ mint: string;
145
+ };
146
+ };
147
+ export type ClaimData = {
148
+ name: string;
149
+ obligationID: string;
150
+ lotNumber: number;
151
+ index: number;
152
+ quantity: string;
153
+ root: string;
154
+ proof: Array<string>;
155
+ distributorPublicKey: PublicKey;
156
+ optionMarketKey: PublicKey | null;
157
+ incentivizer: string;
158
+ };
159
+ export type FullClaimDataType = ClaimData & {
160
+ claimed: boolean;
161
+ claimedAt: number;
162
+ claimStatusBump: number;
163
+ accountFunded: boolean;
164
+ distributor: {
165
+ mint: PublicKey;
166
+ bump: number;
167
+ };
168
+ claimId: PublicKey;
169
+ distributorATAPublicKey: PublicKey;
124
170
  };
@@ -41,7 +41,7 @@ const constants_1 = require("./constants");
41
41
  const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
42
42
  const clients_1 = require("../../utils/clients");
43
43
  const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
44
- const deriveClaimStatuses_1 = require("../../utils/solana/jupiter/deriveClaimStatuses");
44
+ const helpers_1 = require("./helpers");
45
45
  const query = (0, graphql_request_1.gql) `
46
46
  query GetAirdropFinalFrontend($authority: String!) {
47
47
  getAirdropFinalFrontend(authority: $authority) {
@@ -71,7 +71,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
71
71
  const amount = res.getAirdropFinalFrontend.total_allocation;
72
72
  if (amount === 0)
73
73
  return [];
74
- const claimStatuses = (0, deriveClaimStatuses_1.deriveClaimStatuses)(owner, constants_1.distributors, constants_1.distributorPid);
74
+ const claimStatuses = (0, helpers_1.deriveZetaClaimStatuses)(owner, constants_1.distributors);
75
75
  const client = (0, clients_1.getClientSolana)();
76
76
  const claimStatusesAccount = yield (0, getMultipleAccountsInfoSafe_1.getMultipleAccountsInfoSafe)(client, claimStatuses);
77
77
  if (claimStatusesAccount.some((account) => account))
@@ -1 +1 @@
1
- {"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/airdropF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AAC,IAAA,gCAAsB,EACpB,UAAU,CAAC,OAAO,EAClB,MAAM,EACN,SAAS,EACT,UAAU,EACV,SAAS,EACT,EAAE,WAAW,EAAE,aAAa,EAAE,CAC/B;QACH,CAAC,CAAC;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE;gBACJ,OAAO,EAAE,mBAAO;gBAChB,QAAQ,EACN,kMAAkM;gBACpM,MAAM;gBACN,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,KAAK;aACZ;YACD,KAAK,EAAE,IAAI;YACX,SAAS;YACT,UAAU,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE;SAC3C,CAAC;IAEN,OAAO;QACL;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,SAAS;YAChB,SAAS;YACT,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC,KAAK,CAAC;aAChB;YACD,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS;IACT,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAuE;AACvE,mEAA+C;AAG/C,2CAA4E;AAE5E,qGAA6E;AAC7E,iDAAsD;AACtD,gGAA6F;AAC7F,uCAAoD;AAEpD,MAAM,KAAK,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;CAchB,CAAC;AAEF,MAAM,SAAS,GAAG,0BAAS,CAAC,MAAM,CAAC;AAEnC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,GAAG,GAAG,MAAM,IAAA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C;IAEN,OAAO;QACL;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,SAAS;YAChB,SAAS;YACT,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC,KAAK,CAAC;aAChB;YACD,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS;IACT,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -5,3 +5,5 @@ export declare function getCrossMarginAccounts(programId: PublicKey, owner: Publ
5
5
  export declare function getStakeAccountAddress(userKey: PublicKey, bit: number): [PublicKey, number];
6
6
  export declare function getStakeAccountsAddresses(userKey: string, start: number, end: number): PublicKey[];
7
7
  export declare function getTimestamp(stakeDuration: number, startEpoch: number): number;
8
+ export declare function deriveZetaClaimStatus(claimant: string, distributor: string): PublicKey;
9
+ export declare function deriveZetaClaimStatuses(claimant: string, distributors: string[]): PublicKey[];
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getTimestamp = exports.getStakeAccountsAddresses = exports.getStakeAccountAddress = exports.getCrossMarginAccounts = exports.getMarginAccount = exports.getCrossMarginAccount = void 0;
6
+ exports.deriveZetaClaimStatuses = exports.deriveZetaClaimStatus = exports.getTimestamp = exports.getStakeAccountsAddresses = exports.getStakeAccountAddress = exports.getCrossMarginAccounts = exports.getMarginAccount = exports.getCrossMarginAccount = void 0;
7
7
  const web3_js_1 = require("@solana/web3.js");
8
8
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
9
9
  const constants_1 = require("./constants");
@@ -48,4 +48,16 @@ function getTimestamp(stakeDuration, startEpoch) {
48
48
  .toNumber();
49
49
  }
50
50
  exports.getTimestamp = getTimestamp;
51
+ function deriveZetaClaimStatus(claimant, distributor) {
52
+ return web3_js_1.PublicKey.findProgramAddressSync([
53
+ Buffer.from('ClaimStatus'),
54
+ new web3_js_1.PublicKey(distributor).toBytes(),
55
+ new web3_js_1.PublicKey(claimant).toBytes(),
56
+ ], new web3_js_1.PublicKey(constants_1.distributorPid))[0];
57
+ }
58
+ exports.deriveZetaClaimStatus = deriveZetaClaimStatus;
59
+ function deriveZetaClaimStatuses(claimant, distributors) {
60
+ return distributors.map((d) => deriveZetaClaimStatus(claimant, d));
61
+ }
62
+ exports.deriveZetaClaimStatuses = deriveZetaClaimStatuses;
51
63
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA4C;AAC5C,gEAAqC;AACrC,2CAAyC;AAEzC,SAAgB,qBAAqB,CACnC,SAAoB,EACpB,OAAkB,EAClB,UAAkB;IAElB,OAAO,mBAAS,CAAC,sBAAsB,CACrC;QACE,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC;QACpC,OAAO,CAAC,QAAQ,EAAE;QAClB,UAAU,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC;KAC9B,EACD,SAAS,CACV,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AAbD,sDAaC;AAED,SAAgB,gBAAgB,CAC9B,SAAoB,EACpB,SAAoB,EACpB,OAAkB;IAElB,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,SAAS,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,EAC1E,SAAS,CACV,CAAC;AACJ,CAAC;AATD,4CASC;AAED,SAAgB,sBAAsB,CACpC,SAAoB,EACpB,KAAgB,EAChB,OAAe,EACf,KAAa;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,CAAC;AAChB,CAAC;AAJD,oCAIC"}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA4C;AAC5C,gEAAqC;AACrC,2CAAyD;AAEzD,SAAgB,qBAAqB,CACnC,SAAoB,EACpB,OAAkB,EAClB,UAAkB;IAElB,OAAO,mBAAS,CAAC,sBAAsB,CACrC;QACE,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC;QACpC,OAAO,CAAC,QAAQ,EAAE;QAClB,UAAU,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC;KAC9B,EACD,SAAS,CACV,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AAbD,sDAaC;AAED,SAAgB,gBAAgB,CAC9B,SAAoB,EACpB,SAAoB,EACpB,OAAkB;IAElB,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,SAAS,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,EAC1E,SAAS,CACV,CAAC;AACJ,CAAC;AATD,4CASC;AAED,SAAgB,sBAAsB,CACpC,SAAoB,EACpB,KAAgB,EAChB,OAAe,EACf,KAAa;IAEb,MAAM,IAAI,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAXD,wDAWC;AAED,SAAgB,sBAAsB,CACpC,OAAkB,EAClB,GAAW;IAEX,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAA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