@opendatalabs/vana-sdk 0.1.0-alpha.81526eb → 0.1.0-alpha.8c2e762

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.
@@ -36755,9 +36755,15 @@ var PermissionsController = class {
36755
36755
  grant
36756
36756
  nonce
36757
36757
  signature
36758
+ startBlock
36759
+ endBlock
36758
36760
  addedAtBlock
36759
36761
  addedAtTimestamp
36760
36762
  transactionHash
36763
+ grantee {
36764
+ id
36765
+ address
36766
+ }
36761
36767
  }
36762
36768
  }
36763
36769
  }
@@ -36792,15 +36798,16 @@ var PermissionsController = class {
36792
36798
  const onChainGrants = userData.permissions.slice(0, limit).map((permission) => ({
36793
36799
  id: BigInt(permission.id),
36794
36800
  grantUrl: permission.grant,
36795
- grantSignature: permission.grantSignature,
36796
- grantHash: permission.grantHash,
36801
+ grantSignature: permission.signature,
36802
+ grantHash: "",
36803
+ // Not available in new schema, compute if needed
36797
36804
  nonce: BigInt(permission.nonce),
36798
36805
  addedAtBlock: BigInt(permission.addedAtBlock),
36799
36806
  addedAtTimestamp: BigInt(permission.addedAtTimestamp || "0"),
36800
36807
  transactionHash: permission.transactionHash || "",
36801
36808
  grantor: userAddress,
36802
- active: true
36803
- // TODO: Add revocation status from subgraph when available
36809
+ active: !permission.endBlock || BigInt(permission.endBlock) === 0n
36810
+ // Active if no end block or end block is 0
36804
36811
  }));
36805
36812
  return onChainGrants.sort((a, b) => {
36806
36813
  if (a.id < b.id) return 1;
@@ -38807,11 +38814,18 @@ var DataController = class {
38807
38814
  query GetUserTrustedServers($userId: ID!) {
38808
38815
  user(id: $userId) {
38809
38816
  id
38810
- trustedServers {
38817
+ serverTrusts {
38811
38818
  id
38812
- serverAddress
38813
- serverUrl
38819
+ server {
38820
+ id
38821
+ serverAddress
38822
+ url
38823
+ publicKey
38824
+ }
38814
38825
  trustedAt
38826
+ trustedAtBlock
38827
+ untrustedAtBlock
38828
+ transactionHash
38815
38829
  }
38816
38830
  }
38817
38831
  }
@@ -38843,12 +38857,14 @@ var DataController = class {
38843
38857
  if (!result.data?.user) {
38844
38858
  return [];
38845
38859
  }
38846
- return (result.data.user.trustedServers || []).map((server) => ({
38847
- id: server.id,
38848
- serverAddress: server.serverAddress,
38849
- serverUrl: server.serverUrl,
38850
- trustedAt: BigInt(server.trustedAt),
38851
- user
38860
+ return (result.data.user.serverTrusts || []).filter((trust) => !trust.untrustedAtBlock).map((trust) => ({
38861
+ id: trust.server.id,
38862
+ serverAddress: trust.server.serverAddress,
38863
+ serverUrl: trust.server.url,
38864
+ trustedAt: BigInt(trust.trustedAt),
38865
+ user,
38866
+ name: ""
38867
+ // Not available in new schema, will be empty
38852
38868
  }));
38853
38869
  } catch (error) {
38854
38870
  console.error("Failed to query trusted servers from subgraph:", error);