@tokemak/graph-cli 0.1.3 → 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
@@ -578,12 +578,55 @@ function getSdk(client, withWrapper = defaultWrapper) {
578
578
  };
579
579
  }
580
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
+
581
623
  // clients.ts
582
624
  var import_config = require("@tokemak/config");
625
+ var BASE_CHAIN_ID = 8453;
583
626
  var getSdkByChainId = (chainId) => {
584
627
  const { subgraphEndpoint } = (0, import_config.getCoreConfig)(chainId);
585
628
  const client = new import_graphql_request.GraphQLClient(subgraphEndpoint);
586
- return getSdk(client);
629
+ return chainId === BASE_CHAIN_ID ? getSdk2(client) : getSdk(client);
587
630
  };
588
631
  // Annotate the CommonJS export names for ESM import in node:
589
632
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -542,12 +542,55 @@ function getSdk(client, withWrapper = defaultWrapper) {
542
542
  };
543
543
  }
544
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
+
545
587
  // clients.ts
546
588
  import { getCoreConfig } from "@tokemak/config";
589
+ var BASE_CHAIN_ID = 8453;
547
590
  var getSdkByChainId = (chainId) => {
548
591
  const { subgraphEndpoint } = getCoreConfig(chainId);
549
592
  const client = new GraphQLClient(subgraphEndpoint);
550
- return getSdk(client);
593
+ return chainId === BASE_CHAIN_ID ? getSdk2(client) : getSdk(client);
551
594
  };
552
595
  export {
553
596
  getSdkByChainId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokemak/graph-cli",
3
- "version": "0.1.3",
3
+ "version": "0.2.1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",