@tokemak/graph-cli 0.2.0 → 0.2.1

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.
package/dist/index.js CHANGED
@@ -389,7 +389,6 @@ var GetUserActivityDocument = import_graphql_tag.default`
389
389
  timestamp
390
390
  type
391
391
  data
392
- transactionHash
393
392
  }
394
393
  }
395
394
  `;
@@ -579,12 +578,55 @@ function getSdk(client, withWrapper = defaultWrapper) {
579
578
  };
580
579
  }
581
580
 
581
+ // generated/sdk.base.ts
582
+ var import_graphql_tag2 = __toESM(require("graphql-tag"));
583
+ var GetUserBalanceChangeHistoryDocument2 = import_graphql_tag2.default`
584
+ query GetUserBalanceChangeHistory($userAddress: Bytes!, $first: Int!, $skip: Int!) {
585
+ userAutopoolBalanceChanges(
586
+ where: { walletAddress: $userAddress }
587
+ orderBy: timestamp
588
+ orderDirection: asc
589
+ first: $first
590
+ skip: $skip
591
+ ) {
592
+ vaultAddress
593
+ timestamp
594
+ items {
595
+ shareChange
596
+ assetChange
597
+ staked
598
+ transactionHash
599
+ }
600
+ }
601
+ }
602
+ `;
603
+ var defaultWrapper2 = (action) => action();
604
+ function getSdk2(client, withWrapper = defaultWrapper2) {
605
+ const sdk = getSdk(client, withWrapper);
606
+ return {
607
+ ...sdk,
608
+ GetUserBalanceChangeHistory(variables, requestHeaders) {
609
+ return withWrapper(
610
+ (wrappedRequestHeaders) => client.request(
611
+ GetUserBalanceChangeHistoryDocument2,
612
+ variables,
613
+ { ...requestHeaders, ...wrappedRequestHeaders }
614
+ ),
615
+ "GetUserBalanceChangeHistory",
616
+ "query",
617
+ variables
618
+ );
619
+ }
620
+ };
621
+ }
622
+
582
623
  // clients.ts
583
624
  var import_config = require("@tokemak/config");
625
+ var BASE_CHAIN_ID = 8453;
584
626
  var getSdkByChainId = (chainId) => {
585
627
  const { subgraphEndpoint } = (0, import_config.getCoreConfig)(chainId);
586
628
  const client = new import_graphql_request.GraphQLClient(subgraphEndpoint);
587
- return getSdk(client);
629
+ return chainId === BASE_CHAIN_ID ? getSdk2(client) : getSdk(client);
588
630
  };
589
631
  // Annotate the CommonJS export names for ESM import in node:
590
632
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -353,7 +353,6 @@ var GetUserActivityDocument = gql`
353
353
  timestamp
354
354
  type
355
355
  data
356
- transactionHash
357
356
  }
358
357
  }
359
358
  `;
@@ -543,12 +542,55 @@ function getSdk(client, withWrapper = defaultWrapper) {
543
542
  };
544
543
  }
545
544
 
545
+ // generated/sdk.base.ts
546
+ import gql2 from "graphql-tag";
547
+ var GetUserBalanceChangeHistoryDocument2 = gql2`
548
+ query GetUserBalanceChangeHistory($userAddress: Bytes!, $first: Int!, $skip: Int!) {
549
+ userAutopoolBalanceChanges(
550
+ where: { walletAddress: $userAddress }
551
+ orderBy: timestamp
552
+ orderDirection: asc
553
+ first: $first
554
+ skip: $skip
555
+ ) {
556
+ vaultAddress
557
+ timestamp
558
+ items {
559
+ shareChange
560
+ assetChange
561
+ staked
562
+ transactionHash
563
+ }
564
+ }
565
+ }
566
+ `;
567
+ var defaultWrapper2 = (action) => action();
568
+ function getSdk2(client, withWrapper = defaultWrapper2) {
569
+ const sdk = getSdk(client, withWrapper);
570
+ return {
571
+ ...sdk,
572
+ GetUserBalanceChangeHistory(variables, requestHeaders) {
573
+ return withWrapper(
574
+ (wrappedRequestHeaders) => client.request(
575
+ GetUserBalanceChangeHistoryDocument2,
576
+ variables,
577
+ { ...requestHeaders, ...wrappedRequestHeaders }
578
+ ),
579
+ "GetUserBalanceChangeHistory",
580
+ "query",
581
+ variables
582
+ );
583
+ }
584
+ };
585
+ }
586
+
546
587
  // clients.ts
547
588
  import { getCoreConfig } from "@tokemak/config";
589
+ var BASE_CHAIN_ID = 8453;
548
590
  var getSdkByChainId = (chainId) => {
549
591
  const { subgraphEndpoint } = getCoreConfig(chainId);
550
592
  const client = new GraphQLClient(subgraphEndpoint);
551
- return getSdk(client);
593
+ return chainId === BASE_CHAIN_ID ? getSdk2(client) : getSdk(client);
552
594
  };
553
595
  export {
554
596
  getSdkByChainId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokemak/graph-cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",