@graphprotocol/hypergraph 0.0.14 → 0.2.0

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.
Files changed (123) hide show
  1. package/dist/Entity.d.ts +69 -0
  2. package/dist/Entity.d.ts.map +1 -0
  3. package/dist/Entity.js +174 -0
  4. package/dist/Entity.js.map +1 -0
  5. package/dist/connect/identity-encryption.d.ts +3 -3
  6. package/dist/connect/identity-encryption.d.ts.map +1 -1
  7. package/dist/connect/identity-encryption.js +18 -52
  8. package/dist/connect/identity-encryption.js.map +1 -1
  9. package/dist/connect/login.d.ts +1 -1
  10. package/dist/connect/login.d.ts.map +1 -1
  11. package/dist/connect/login.js +2 -2
  12. package/dist/connect/login.js.map +1 -1
  13. package/dist/connect/parse-auth-params.js +1 -1
  14. package/dist/connect/parse-auth-params.js.map +1 -1
  15. package/dist/connect/smart-account.d.ts.map +1 -1
  16. package/dist/connect/smart-account.js +2 -2
  17. package/dist/connect/smart-account.js.map +1 -1
  18. package/dist/connect/types.d.ts +0 -1
  19. package/dist/connect/types.d.ts.map +1 -1
  20. package/dist/connect/types.js +0 -1
  21. package/dist/connect/types.js.map +1 -1
  22. package/dist/entity/findMany.js +1 -1
  23. package/dist/entity/findMany.js.map +1 -1
  24. package/dist/entity/update.js +1 -1
  25. package/dist/entity/update.js.map +1 -1
  26. package/dist/identity/create-identity-keys.d.ts +3 -0
  27. package/dist/identity/create-identity-keys.d.ts.map +1 -0
  28. package/dist/identity/create-identity-keys.js +20 -0
  29. package/dist/identity/create-identity-keys.js.map +1 -0
  30. package/dist/identity/get-verified-identity.d.ts +1 -1
  31. package/dist/identity/get-verified-identity.d.ts.map +1 -1
  32. package/dist/identity/get-verified-identity.js +17 -4
  33. package/dist/identity/get-verified-identity.js.map +1 -1
  34. package/dist/identity/identity-encryption.js +1 -1
  35. package/dist/identity/identity-encryption.js.map +1 -1
  36. package/dist/identity/index.d.ts +1 -1
  37. package/dist/identity/index.d.ts.map +1 -1
  38. package/dist/identity/index.js +1 -1
  39. package/dist/identity/index.js.map +1 -1
  40. package/dist/identity/login.d.ts +38 -0
  41. package/dist/identity/login.d.ts.map +1 -0
  42. package/dist/identity/login.js +241 -0
  43. package/dist/identity/login.js.map +1 -0
  44. package/dist/identity/prove-ownership.d.ts +1 -1
  45. package/dist/identity/prove-ownership.d.ts.map +1 -1
  46. package/dist/identity/prove-ownership.js +1 -1
  47. package/dist/identity/prove-ownership.js.map +1 -1
  48. package/dist/inboxes/index.d.ts +1 -1
  49. package/dist/inboxes/index.d.ts.map +1 -1
  50. package/dist/inboxes/index.js +1 -1
  51. package/dist/inboxes/index.js.map +1 -1
  52. package/dist/inboxes/message-validation.d.ts.map +1 -1
  53. package/dist/inboxes/message-validation.js +2 -2
  54. package/dist/inboxes/message-validation.js.map +1 -1
  55. package/dist/index.d.ts +2 -1
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +2 -1
  58. package/dist/index.js.map +1 -1
  59. package/dist/mapping/Mapping.d.ts +418 -0
  60. package/dist/mapping/Mapping.d.ts.map +1 -0
  61. package/dist/mapping/Mapping.js +554 -0
  62. package/dist/mapping/Mapping.js.map +1 -0
  63. package/dist/mapping/Utils.d.ts +74 -0
  64. package/dist/mapping/Utils.d.ts.map +1 -0
  65. package/dist/mapping/Utils.js +144 -0
  66. package/dist/mapping/Utils.js.map +1 -0
  67. package/dist/mapping/index.d.ts +3 -0
  68. package/dist/mapping/index.d.ts.map +1 -0
  69. package/dist/mapping/index.js +3 -0
  70. package/dist/mapping/index.js.map +1 -0
  71. package/dist/messages/types.d.ts +1 -1
  72. package/dist/messages/types.d.ts.map +1 -1
  73. package/dist/messages/types.js +2 -2
  74. package/dist/messages/types.js.map +1 -1
  75. package/dist/space-events/apply-event.d.ts +1 -1
  76. package/dist/space-events/apply-event.d.ts.map +1 -1
  77. package/dist/space-events/apply-event.js +1 -1
  78. package/dist/space-events/apply-event.js.map +1 -1
  79. package/dist/space-info/decrypt-space-info.d.ts +1 -1
  80. package/dist/space-info/decrypt-space-info.d.ts.map +1 -1
  81. package/dist/space-info/decrypt-space-info.js.map +1 -1
  82. package/dist/store-connect.d.ts.map +1 -1
  83. package/dist/store-connect.js.map +1 -1
  84. package/dist/store.d.ts +4 -2
  85. package/dist/store.d.ts.map +1 -1
  86. package/dist/store.js +23 -3
  87. package/dist/store.js.map +1 -1
  88. package/dist/type/type.d.ts +0 -1
  89. package/dist/type/type.d.ts.map +1 -1
  90. package/dist/type/type.js +0 -1
  91. package/dist/type/type.js.map +1 -1
  92. package/dist/types.d.ts +0 -13
  93. package/dist/types.d.ts.map +1 -1
  94. package/dist/types.js.map +1 -1
  95. package/dist/utils/hasArrayField.d.ts +2 -0
  96. package/dist/utils/hasArrayField.d.ts.map +1 -0
  97. package/dist/utils/hasArrayField.js +5 -0
  98. package/dist/utils/hasArrayField.js.map +1 -0
  99. package/package.json +4 -3
  100. package/src/connect/identity-encryption.ts +33 -69
  101. package/src/connect/login.ts +3 -3
  102. package/src/connect/parse-auth-params.ts +1 -1
  103. package/src/connect/smart-account.ts +12 -12
  104. package/src/connect/types.ts +0 -1
  105. package/src/entity/findMany.ts +2 -2
  106. package/src/entity/update.ts +1 -1
  107. package/src/identity/get-verified-identity.ts +17 -2
  108. package/src/identity/identity-encryption.ts +1 -1
  109. package/src/identity/index.ts +1 -1
  110. package/src/identity/prove-ownership.ts +2 -3
  111. package/src/inboxes/index.ts +1 -1
  112. package/src/inboxes/message-validation.ts +4 -0
  113. package/src/index.ts +2 -1
  114. package/src/mapping/Mapping.ts +771 -0
  115. package/src/mapping/Utils.ts +156 -0
  116. package/src/mapping/index.ts +2 -0
  117. package/src/messages/types.ts +1 -1
  118. package/src/space-events/apply-event.ts +5 -2
  119. package/src/space-info/decrypt-space-info.ts +1 -7
  120. package/src/store-connect.ts +1 -1
  121. package/src/store.ts +39 -9
  122. package/src/type/type.ts +0 -1
  123. package/src/types.ts +0 -15
@@ -4,7 +4,6 @@ export declare const Text: typeof Schema.String;
4
4
  export declare const Number: typeof Schema.Number;
5
5
  export declare const Checkbox: typeof Schema.Boolean;
6
6
  export declare const Date: typeof Schema.Date;
7
- export declare const Url: typeof Schema.URL;
8
7
  export declare const Point: Schema.transform<typeof Schema.String, Schema.Array$<typeof Schema.Number>>;
9
8
  export declare const Relation: <S extends AnyNoContext>(schema: S) => import("../entity/variant-schema.js").Field<{
10
9
  readonly select: Schema.Schema<ReadonlyArray<EntityWithRelation<S>>>;
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/type/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE3E,eAAO,MAAM,IAAI,sBAAgB,CAAC;AAElC,eAAO,MAAM,MAAM,sBAAgB,CAAC;AACpC,eAAO,MAAM,QAAQ,uBAAiB,CAAC;AAEvC,eAAO,MAAM,IAAI,oBAAc,CAAC;AAChC,eAAO,MAAM,GAAG,mBAAa,CAAC;AAC9B,eAAO,MAAM,KAAK,6EAMhB,CAAC;AAEH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,YAAY,EAAE,QAAQ,CAAC;qBAEX,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;;;EAKjG,CAAC"}
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/type/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE3E,eAAO,MAAM,IAAI,sBAAgB,CAAC;AAElC,eAAO,MAAM,MAAM,sBAAgB,CAAC;AACpC,eAAO,MAAM,QAAQ,uBAAiB,CAAC;AAEvC,eAAO,MAAM,IAAI,oBAAc,CAAC;AAChC,eAAO,MAAM,KAAK,6EAMhB,CAAC;AAEH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,YAAY,EAAE,QAAQ,CAAC;qBAEX,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;;;EAKjG,CAAC"}
package/dist/type/type.js CHANGED
@@ -6,7 +6,6 @@ export const Number = Schema.Number;
6
6
  export const Checkbox = Schema.Boolean;
7
7
  // biome-ignore lint/suspicious/noShadowRestrictedNames: is part of a namespaces module and therefor ok
8
8
  export const Date = Schema.Date;
9
- export const Url = Schema.URL;
10
9
  export const Point = /*#__PURE__*/Schema.transform(Schema.String, /*#__PURE__*/Schema.Array(Number), {
11
10
  strict: true,
12
11
  decode: str => {
@@ -1 +1 @@
1
- {"version":3,"file":"type.js","names":["Schema","Field","Text","String","Number","Checkbox","Boolean","Date","Url","URL","Point","transform","Array","strict","decode","str","split","map","n","globalThis","encode","points","join","Relation","schema","relationSchema","select","insert","optional","update","Undefined"],"sources":["../../src/type/type.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,MAAM,MAAM,eAAe;AACvC,SAASC,KAAK,QAAQ,qBAAqB;AAG3C,OAAO,MAAMC,IAAI,GAAGF,MAAM,CAACG,MAAM;AACjC;AACA,OAAO,MAAMC,MAAM,GAAGJ,MAAM,CAACI,MAAM;AACnC,OAAO,MAAMC,QAAQ,GAAGL,MAAM,CAACM,OAAO;AACtC;AACA,OAAO,MAAMC,IAAI,GAAGP,MAAM,CAACO,IAAI;AAC/B,OAAO,MAAMC,GAAG,GAAGR,MAAM,CAACS,GAAG;AAC7B,OAAO,MAAMC,KAAK,gBAAGV,MAAM,CAACW,SAAS,CAACX,MAAM,CAACG,MAAM,eAAEH,MAAM,CAACY,KAAK,CAACR,MAAM,CAAC,EAAE;EACzES,MAAM,EAAE,IAAI;EACZC,MAAM,EAAGC,GAAW,IAAI;IACtB,OAAOA,GAAG,CAACC,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAAEC,CAAS,IAAKC,UAAU,CAACf,MAAM,CAACc,CAAC,CAAC,CAAC;EAChE,CAAC;EACDE,MAAM,EAAGC,MAAyB,IAAKA,MAAM,CAACC,IAAI,CAAC,GAAG;CACvD,CAAC;AAEF,OAAO,MAAMC,QAAQ,GAA4BC,MAAS,IAAI;EAC5D,MAAMC,cAAc,GAAGxB,KAAK,CAAC;IAC3ByB,MAAM,EAAE1B,MAAM,CAACY,KAAK,CAACY,MAAM,CAAmE;IAC9FG,MAAM,EAAE3B,MAAM,CAAC4B,QAAQ,CAAC5B,MAAM,CAACY,KAAK,CAACZ,MAAM,CAACG,MAAM,CAAC,CAAC;IACpD0B,MAAM,EAAE7B,MAAM,CAAC8B;GAChB,CAAC;EACF,OAAOL,cAAc;AACvB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"type.js","names":["Schema","Field","Text","String","Number","Checkbox","Boolean","Date","Point","transform","Array","strict","decode","str","split","map","n","globalThis","encode","points","join","Relation","schema","relationSchema","select","insert","optional","update","Undefined"],"sources":["../../src/type/type.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,MAAM,MAAM,eAAe;AACvC,SAASC,KAAK,QAAQ,qBAAqB;AAG3C,OAAO,MAAMC,IAAI,GAAGF,MAAM,CAACG,MAAM;AACjC;AACA,OAAO,MAAMC,MAAM,GAAGJ,MAAM,CAACI,MAAM;AACnC,OAAO,MAAMC,QAAQ,GAAGL,MAAM,CAACM,OAAO;AACtC;AACA,OAAO,MAAMC,IAAI,GAAGP,MAAM,CAACO,IAAI;AAC/B,OAAO,MAAMC,KAAK,gBAAGR,MAAM,CAACS,SAAS,CAACT,MAAM,CAACG,MAAM,eAAEH,MAAM,CAACU,KAAK,CAACN,MAAM,CAAC,EAAE;EACzEO,MAAM,EAAE,IAAI;EACZC,MAAM,EAAGC,GAAW,IAAI;IACtB,OAAOA,GAAG,CAACC,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAAEC,CAAS,IAAKC,UAAU,CAACb,MAAM,CAACY,CAAC,CAAC,CAAC;EAChE,CAAC;EACDE,MAAM,EAAGC,MAAyB,IAAKA,MAAM,CAACC,IAAI,CAAC,GAAG;CACvD,CAAC;AAEF,OAAO,MAAMC,QAAQ,GAA4BC,MAAS,IAAI;EAC5D,MAAMC,cAAc,GAAGtB,KAAK,CAAC;IAC3BuB,MAAM,EAAExB,MAAM,CAACU,KAAK,CAACY,MAAM,CAAmE;IAC9FG,MAAM,EAAEzB,MAAM,CAAC0B,QAAQ,CAAC1B,MAAM,CAACU,KAAK,CAACV,MAAM,CAACG,MAAM,CAAC,CAAC;IACpDwB,MAAM,EAAE3B,MAAM,CAAC4B;GAChB,CAAC;EACF,OAAOL,cAAc;AACvB,CAAC","ignoreList":[]}
package/dist/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import type { Id as Grc20Id } from '@graphprotocol/grc-20';
2
1
  import * as Schema from 'effect/Schema';
3
2
  export declare const SignatureWithRecovery: Schema.Struct<{
4
3
  hex: typeof Schema.String;
@@ -64,17 +63,5 @@ export declare class FailedToParseAuthCallbackUrl extends FailedToParseAuthCallb
64
63
  message: string;
65
64
  }> {
66
65
  }
67
- export type MappingEntry = {
68
- typeIds: Grc20Id.Id[];
69
- properties?: {
70
- [key: string]: Grc20Id.Id;
71
- };
72
- relations?: {
73
- [key: string]: Grc20Id.Id;
74
- };
75
- };
76
- export type Mapping = {
77
- [key: string]: MappingEntry;
78
- };
79
66
  export {};
80
67
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,eAAO,MAAM,qBAAqB;;;EAGhC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAErF,eAAO,MAAM,kBAAkB;;;;EAI7B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE/E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;EAahC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAErF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;EAIvC,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,4BAA4B,CAAC,CAAC;;;;AAEnG,qBAAa,2BAA4B,SAAQ,iCAAgD;IAC/F,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;CAAG;;;;AAEL,qBAAa,4BAA6B,SAAQ,kCAAiD;IACjG,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;CAAG;AAEL,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC;IACtB,UAAU,CAAC,EAAE;QACX,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC;KAC3B,CAAC;IACF,SAAS,CAAC,EAAE;QACV,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC;KAC3B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAC;CAC7B,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,eAAO,MAAM,qBAAqB;;;EAGhC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAErF,eAAO,MAAM,kBAAkB;;;;EAI7B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE/E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;EAahC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAErF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;EAIvC,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,4BAA4B,CAAC,CAAC;;;;AAEnG,qBAAa,2BAA4B,SAAQ,iCAAgD;IAC/F,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;CAAG;;;;AAEL,qBAAa,4BAA6B,SAAQ,kCAAiD;IACjG,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;CAAG"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["Data","Schema","SignatureWithRecovery","Struct","hex","String","recovery","Number","ConnectAuthPayload","expiry","encryptionPublicKey","appId","ConnectCallbackResult","appIdentityAddress","appIdentityAddressPrivateKey","accountAddress","permissionId","signaturePublicKey","signaturePrivateKey","encryptionPrivateKey","sessionToken","sessionTokenExpires","Date","privateSpaces","Array","id","publicSpaces","ConnectCallbackDecryptedData","fields","FailedToParseConnectAuthUrl","TaggedError","FailedToParseAuthCallbackUrl"],"sources":["../src/types.ts"],"sourcesContent":[null],"mappings":"AACA,OAAO,KAAKA,IAAI,MAAM,aAAa;AACnC,OAAO,KAAKC,MAAM,MAAM,eAAe;AAEvC,OAAO,MAAMC,qBAAqB,gBAAGD,MAAM,CAACE,MAAM,CAAC;EACjDC,GAAG,EAAEH,MAAM,CAACI,MAAM;EAClBC,QAAQ,EAAEL,MAAM,CAACM;CAClB,CAAC;AAIF,OAAO,MAAMC,kBAAkB,gBAAGP,MAAM,CAACE,MAAM,CAAC;EAC9CM,MAAM,EAAER,MAAM,CAACM,MAAM;EACrBG,mBAAmB,EAAET,MAAM,CAACI,MAAM;EAClCM,KAAK,EAAEV,MAAM,CAACI;CACf,CAAC;AAIF,OAAO,MAAMO,qBAAqB,gBAAGX,MAAM,CAACE,MAAM,CAAC;EACjDU,kBAAkB,EAAEZ,MAAM,CAACI,MAAM;EACjCS,4BAA4B,EAAEb,MAAM,CAACI,MAAM;EAC3CU,cAAc,EAAEd,MAAM,CAACI,MAAM;EAC7BW,YAAY,EAAEf,MAAM,CAACI,MAAM;EAC3BY,kBAAkB,EAAEhB,MAAM,CAACI,MAAM;EACjCa,mBAAmB,EAAEjB,MAAM,CAACI,MAAM;EAClCK,mBAAmB,EAAET,MAAM,CAACI,MAAM;EAClCc,oBAAoB,EAAElB,MAAM,CAACI,MAAM;EACnCe,YAAY,EAAEnB,MAAM,CAACI,MAAM;EAC3BgB,mBAAmB,EAAEpB,MAAM,CAACqB,IAAI;EAChCC,aAAa,eAAEtB,MAAM,CAACuB,KAAK,cAACvB,MAAM,CAACE,MAAM,CAAC;IAAEsB,EAAE,EAAExB,MAAM,CAACI;EAAM,CAAE,CAAC,CAAC;EACjEqB,YAAY,eAAEzB,MAAM,CAACuB,KAAK,cAACvB,MAAM,CAACE,MAAM,CAAC;IAAEsB,EAAE,EAAExB,MAAM,CAACI;EAAM,CAAE,CAAC;CAChE,CAAC;AAIF,OAAO,MAAMsB,4BAA4B,gBAAG1B,MAAM,CAACE,MAAM,CAAC;EACxD,GAAGS,qBAAqB,CAACgB,MAAM;EAC/BP,mBAAmB,EAAEpB,MAAM,CAACM,MAAM;EAClCE,MAAM,EAAER,MAAM,CAACM;CAChB,CAAC;AAIF,OAAM,MAAOsB,2BAA4B,sBAAQ7B,IAAI,CAAC8B,WAAW,CAAC,6BAA6B,CAE7F;AAEF,OAAM,MAAOC,4BAA6B,sBAAQ/B,IAAI,CAAC8B,WAAW,CAAC,8BAA8B,CAE/F","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":["Data","Schema","SignatureWithRecovery","Struct","hex","String","recovery","Number","ConnectAuthPayload","expiry","encryptionPublicKey","appId","ConnectCallbackResult","appIdentityAddress","appIdentityAddressPrivateKey","accountAddress","permissionId","signaturePublicKey","signaturePrivateKey","encryptionPrivateKey","sessionToken","sessionTokenExpires","Date","privateSpaces","Array","id","publicSpaces","ConnectCallbackDecryptedData","fields","FailedToParseConnectAuthUrl","TaggedError","FailedToParseAuthCallbackUrl"],"sources":["../src/types.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,IAAI,MAAM,aAAa;AACnC,OAAO,KAAKC,MAAM,MAAM,eAAe;AAEvC,OAAO,MAAMC,qBAAqB,gBAAGD,MAAM,CAACE,MAAM,CAAC;EACjDC,GAAG,EAAEH,MAAM,CAACI,MAAM;EAClBC,QAAQ,EAAEL,MAAM,CAACM;CAClB,CAAC;AAIF,OAAO,MAAMC,kBAAkB,gBAAGP,MAAM,CAACE,MAAM,CAAC;EAC9CM,MAAM,EAAER,MAAM,CAACM,MAAM;EACrBG,mBAAmB,EAAET,MAAM,CAACI,MAAM;EAClCM,KAAK,EAAEV,MAAM,CAACI;CACf,CAAC;AAIF,OAAO,MAAMO,qBAAqB,gBAAGX,MAAM,CAACE,MAAM,CAAC;EACjDU,kBAAkB,EAAEZ,MAAM,CAACI,MAAM;EACjCS,4BAA4B,EAAEb,MAAM,CAACI,MAAM;EAC3CU,cAAc,EAAEd,MAAM,CAACI,MAAM;EAC7BW,YAAY,EAAEf,MAAM,CAACI,MAAM;EAC3BY,kBAAkB,EAAEhB,MAAM,CAACI,MAAM;EACjCa,mBAAmB,EAAEjB,MAAM,CAACI,MAAM;EAClCK,mBAAmB,EAAET,MAAM,CAACI,MAAM;EAClCc,oBAAoB,EAAElB,MAAM,CAACI,MAAM;EACnCe,YAAY,EAAEnB,MAAM,CAACI,MAAM;EAC3BgB,mBAAmB,EAAEpB,MAAM,CAACqB,IAAI;EAChCC,aAAa,eAAEtB,MAAM,CAACuB,KAAK,cAACvB,MAAM,CAACE,MAAM,CAAC;IAAEsB,EAAE,EAAExB,MAAM,CAACI;EAAM,CAAE,CAAC,CAAC;EACjEqB,YAAY,eAAEzB,MAAM,CAACuB,KAAK,cAACvB,MAAM,CAACE,MAAM,CAAC;IAAEsB,EAAE,EAAExB,MAAM,CAACI;EAAM,CAAE,CAAC;CAChE,CAAC;AAIF,OAAO,MAAMsB,4BAA4B,gBAAG1B,MAAM,CAACE,MAAM,CAAC;EACxD,GAAGS,qBAAqB,CAACgB,MAAM;EAC/BP,mBAAmB,EAAEpB,MAAM,CAACM,MAAM;EAClCE,MAAM,EAAER,MAAM,CAACM;CAChB,CAAC;AAIF,OAAM,MAAOsB,2BAA4B,sBAAQ7B,IAAI,CAAC8B,WAAW,CAAC,6BAA6B,CAE7F;AAEF,OAAM,MAAOC,4BAA6B,sBAAQ/B,IAAI,CAAC8B,WAAW,CAAC,8BAA8B,CAE/F","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export declare const hasArrayField: (obj: unknown, key: string) => obj is { [K in string]: string[]; };
2
+ //# sourceMappingURL=hasArrayField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hasArrayField.d.ts","sourceRoot":"","sources":["../../src/utils/hasArrayField.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GAAI,KAAK,OAAO,EAAE,KAAK,MAAM,KAAG,GAAG,IAAI,GAAG,CAAC,IAAI,MAAM,GAAG,MAAM,EAAE,GAGzF,CAAC"}
@@ -0,0 +1,5 @@
1
+ export const hasArrayField = (obj, key) => {
2
+ // biome-ignore lint/suspicious/noExplicitAny: any is fine here
3
+ return obj !== null && typeof obj === 'object' && key in obj && Array.isArray(obj[key]);
4
+ };
5
+ //# sourceMappingURL=hasArrayField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hasArrayField.js","names":["hasArrayField","obj","key","Array","isArray"],"sources":["../../src/utils/hasArrayField.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,MAAMA,aAAa,GAAGA,CAACC,GAAY,EAAEC,GAAW,KAAwC;EAC7F;EACA,OAAOD,GAAG,KAAK,IAAI,IAAI,OAAOA,GAAG,KAAK,QAAQ,IAAIC,GAAG,IAAID,GAAG,IAAIE,KAAK,CAACC,OAAO,CAAEH,GAAW,CAACC,GAAG,CAAC,CAAC;AAClG,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphprotocol/hypergraph",
3
- "version": "0.0.14",
3
+ "version": "0.2.0",
4
4
  "description": "SDK for building performant, type-safe, local-first dapps on top of The Graph ecosystem knowledge graphs.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,6 +12,7 @@
12
12
  "main": "./dist/index.js",
13
13
  "module": "./dist/index.js",
14
14
  "types": "./dist/index.d.ts",
15
+ "sideEffects": [],
15
16
  "exports": {
16
17
  ".": "./dist/index.js",
17
18
  "./connect": "./dist/connect/index.js",
@@ -21,6 +22,7 @@
21
22
  "./identity": "./dist/identity/index.js",
22
23
  "./inboxes": "./dist/inboxes/index.js",
23
24
  "./key": "./dist/key/index.js",
25
+ "./mapping": "./dist/mapping/index.js",
24
26
  "./messages": "./dist/messages/index.js",
25
27
  "./space-events": "./dist/space-events/index.js",
26
28
  "./space-info": "./dist/space-info/index.js",
@@ -28,7 +30,6 @@
28
30
  "./store-connect": "./dist/store-connect.js",
29
31
  "./types": "./dist/types.js"
30
32
  },
31
- "sideEffects": [],
32
33
  "dependencies": {
33
34
  "@automerge/automerge": "^2.2.9",
34
35
  "@automerge/automerge-repo": "^2.0.6",
@@ -42,7 +43,7 @@
42
43
  "@serenity-kit/noble-sodium": "^0.2.1",
43
44
  "@xstate/store": "^3.5.1",
44
45
  "bs58check": "^4.0.0",
45
- "effect": "^3.16.10",
46
+ "effect": "^3.17.1",
46
47
  "permissionless": "^0.2.47",
47
48
  "siwe": "^3.0.0",
48
49
  "uuid": "^11.1.0",
@@ -2,12 +2,17 @@ import { gcm } from '@noble/ciphers/aes';
2
2
  import { randomBytes } from '@noble/ciphers/webcrypto';
3
3
  import { hkdf } from '@noble/hashes/hkdf';
4
4
  import { sha256 } from '@noble/hashes/sha256';
5
+ import { cryptoBoxSeal, cryptoBoxSealOpen } from '@serenity-kit/noble-sodium';
5
6
  import type { Hex } from 'viem';
6
7
  import { verifyMessage } from 'viem';
7
-
8
8
  import { bytesToHex, canonicalize, hexToBytes } from '../utils/index.js';
9
9
  import type { IdentityKeys, PrivateAppIdentity, Signer } from './types.js';
10
10
 
11
+ export type AppIdentityForEncryption = Omit<
12
+ PrivateAppIdentity,
13
+ 'sessionToken' | 'sessionTokenExpires' | 'accountAddress'
14
+ >;
15
+
11
16
  // Adapted from the XMTP approach to encrypt keys
12
17
  // See: https://github.com/xmtp/xmtp-js/blob/8d6e5a65813902926baac8150a648587acbaad92/sdks/js-sdk/src/keystore/providers/NetworkKeyManager.ts#L79-L116
13
18
  // (We reimplement their encrypt/decrypt functions using noble).
@@ -113,7 +118,7 @@ export const decryptIdentity = async (signer: Signer, ciphertext: string, nonce:
113
118
  let keysMsg: Uint8Array;
114
119
  try {
115
120
  keysMsg = await decrypt(ciphertext, secretKey);
116
- } catch (e) {
121
+ } catch (_e) {
117
122
  // See https://github.com/xmtp/xmtp-js/blob/8d6e5a65813902926baac8150a648587acbaad92/sdks/js-sdk/src/keystore/providers/NetworkKeyManager.ts#L142-L146
118
123
  if (secretKey.length !== 65) {
119
124
  throw new Error('Expected 65 bytes before trying a different recovery byte');
@@ -134,86 +139,45 @@ export const decryptIdentity = async (signer: Signer, ciphertext: string, nonce:
134
139
  };
135
140
 
136
141
  export const encryptAppIdentity = async (
137
- signer: Signer,
138
- appIdentityAddress: string,
139
- appIdentityAddressPrivateKey: string,
140
- permissionId: string,
142
+ appIdentity: AppIdentityForEncryption,
141
143
  keys: IdentityKeys,
142
- ): Promise<{ ciphertext: string; nonce: string }> => {
143
- const nonce = randomBytes(32);
144
- const message = signatureMessage(nonce);
145
- const signature = (await signer.signMessage(message)) as Hex;
146
-
147
- // Check that the signature is valid
148
- const valid = await verifyMessage({
149
- address: (await signer.getAddress()) as Hex,
150
- message,
151
- signature,
152
- });
153
- if (!valid) {
154
- throw new Error('Invalid signature');
155
- }
156
- const secretKey = hexToBytes(signature);
144
+ ): Promise<{ ciphertext: string }> => {
157
145
  // We use a simple plaintext encoding:
158
146
  // Hex keys separated by newlines
159
147
  const keysTxt = [
160
- keys.encryptionPublicKey,
161
- keys.encryptionPrivateKey,
162
- keys.signaturePublicKey,
163
- keys.signaturePrivateKey,
164
- appIdentityAddress,
165
- appIdentityAddressPrivateKey,
166
- permissionId,
148
+ appIdentity.encryptionPublicKey,
149
+ appIdentity.encryptionPrivateKey,
150
+ appIdentity.signaturePublicKey,
151
+ appIdentity.signaturePrivateKey,
152
+ appIdentity.address,
153
+ appIdentity.addressPrivateKey,
154
+ appIdentity.permissionId,
167
155
  ].join('\n');
168
156
  const keysMsg = new TextEncoder().encode(keysTxt);
169
- const ciphertext = encrypt(keysMsg, secretKey);
170
- return { ciphertext, nonce: bytesToHex(nonce) };
157
+ const ciphertext = bytesToHex(
158
+ cryptoBoxSeal({
159
+ message: keysMsg,
160
+ publicKey: hexToBytes(keys.encryptionPublicKey),
161
+ }),
162
+ );
163
+ return { ciphertext };
171
164
  };
172
165
 
173
- export const decryptAppIdentity = async (
174
- signer: Signer,
175
- ciphertext: string,
176
- nonce: string,
177
- ): Promise<Omit<PrivateAppIdentity, 'sessionToken' | 'sessionTokenExpires' | 'accountAddress'>> => {
178
- const message = signatureMessage(hexToBytes(nonce));
179
- const signature = (await signer.signMessage(message)) as Hex;
180
-
181
- // Check that the signature is valid
182
- const valid = await verifyMessage({
183
- address: (await signer.getAddress()) as Hex,
184
- message,
185
- signature,
166
+ export const decryptAppIdentity = async (ciphertext: string, keys: IdentityKeys): Promise<AppIdentityForEncryption> => {
167
+ const ciphertextBytes = hexToBytes(ciphertext);
168
+ const keysMsg = cryptoBoxSealOpen({
169
+ ciphertext: ciphertextBytes,
170
+ privateKey: hexToBytes(keys.encryptionPrivateKey),
171
+ publicKey: hexToBytes(keys.encryptionPublicKey),
186
172
  });
187
- if (!valid) {
188
- throw new Error('Invalid signature');
189
- }
190
- const secretKey = hexToBytes(signature);
191
- let keysMsg: Uint8Array;
192
- try {
193
- keysMsg = await decrypt(ciphertext, secretKey);
194
- } catch (e) {
195
- // See https://github.com/xmtp/xmtp-js/blob/8d6e5a65813902926baac8150a648587acbaad92/sdks/js-sdk/src/keystore/providers/NetworkKeyManager.ts#L142-L146
196
- if (secretKey.length !== 65) {
197
- throw new Error('Expected 65 bytes before trying a different recovery byte');
198
- }
199
- // Try the other version of recovery byte, either +27 or -27
200
- const lastByte = secretKey[secretKey.length - 1];
201
- let newSecret = secretKey.slice(0, secretKey.length - 1);
202
- if (lastByte < 27) {
203
- newSecret = new Uint8Array([...newSecret, lastByte + 27]);
204
- } else {
205
- newSecret = new Uint8Array([...newSecret, lastByte - 27]);
206
- }
207
- keysMsg = await decrypt(ciphertext, newSecret);
208
- }
209
173
  const keysTxt = new TextDecoder().decode(keysMsg);
210
174
  const [
211
175
  encryptionPublicKey,
212
176
  encryptionPrivateKey,
213
177
  signaturePublicKey,
214
178
  signaturePrivateKey,
215
- appIdentityAddress,
216
- appIdentityAddressPrivateKey,
179
+ address,
180
+ addressPrivateKey,
217
181
  permissionId,
218
182
  ] = keysTxt.split('\n');
219
183
  return {
@@ -221,8 +185,8 @@ export const decryptAppIdentity = async (
221
185
  encryptionPrivateKey,
222
186
  signaturePublicKey,
223
187
  signaturePrivateKey,
224
- address: appIdentityAddress,
225
- addressPrivateKey: appIdentityAddressPrivateKey,
188
+ address,
189
+ addressPrivateKey,
226
190
  permissionId,
227
191
  };
228
192
  };
@@ -9,17 +9,17 @@ import { loadAccountAddress, storeAccountAddress, storeKeys } from './auth-stora
9
9
  import { createIdentityKeys } from './create-identity-keys.js';
10
10
  import { decryptIdentity, encryptIdentity } from './identity-encryption.js';
11
11
  import {
12
- type SmartAccountParams,
13
12
  addSmartAccountOwner,
14
13
  getSmartAccountWalletClient,
15
14
  isSmartAccountDeployed,
15
+ type SmartAccountParams,
16
16
  smartAccountNeedsUpdate,
17
17
  updateLegacySmartAccount,
18
18
  } from './smart-account.js';
19
19
  import type { IdentityKeys, Signer, Storage } from './types.js';
20
20
 
21
21
  export async function identityExists(accountAddress: string, syncServerUri: string) {
22
- const res = await fetch(new URL(`/identity?accountAddress=${accountAddress}`, syncServerUri), {
22
+ const res = await fetch(new URL(`/connect/identity?accountAddress=${accountAddress}`, syncServerUri), {
23
23
  method: 'GET',
24
24
  });
25
25
  return res.status === 200;
@@ -27,7 +27,7 @@ export async function identityExists(accountAddress: string, syncServerUri: stri
27
27
 
28
28
  export async function signup(
29
29
  signer: Signer,
30
- walletClient: WalletClient,
30
+ _walletClient: WalletClient,
31
31
  smartAccountClient: SmartAccountClient,
32
32
  accountAddress: Address,
33
33
  syncServerUri: string,
@@ -31,7 +31,7 @@ export const parseAuthParams = (
31
31
  }
32
32
 
33
33
  return Effect.succeed({ payload: result.right, redirect, nonce });
34
- } catch (error) {
34
+ } catch (_error) {
35
35
  return Effect.fail(new FailedToParseConnectAuthUrl({ message: 'Failed to parse connect auth payload' }));
36
36
  }
37
37
  };
@@ -1,10 +1,6 @@
1
1
  import { MAINNET, TESTNET } from '@graphprotocol/grc-20/contracts';
2
2
  import { randomBytes } from '@noble/hashes/utils';
3
3
  import {
4
- OWNABLE_VALIDATOR_ADDRESS,
5
- RHINESTONE_ATTESTER_ADDRESS,
6
- type Session,
7
- SmartSessionMode,
8
4
  encodeSmartSessionSignature,
9
5
  encodeValidationData,
10
6
  encodeValidatorNonce,
@@ -20,37 +16,41 @@ import {
20
16
  getUniversalActionPolicy,
21
17
  getUsageLimitPolicy,
22
18
  getValueLimitPolicy,
19
+ OWNABLE_VALIDATOR_ADDRESS,
20
+ RHINESTONE_ATTESTER_ADDRESS,
21
+ type Session,
22
+ SmartSessionMode,
23
23
  } from '@rhinestone/module-sdk';
24
- import { type SmartAccountClient, createSmartAccountClient, encodeInstallModule } from 'permissionless';
24
+ import { createSmartAccountClient, encodeInstallModule, type SmartAccountClient } from 'permissionless';
25
25
  import { type ToSafeSmartAccountParameters, toSafeSmartAccount } from 'permissionless/accounts';
26
26
  import { getAccountNonce } from 'permissionless/actions';
27
27
  import { erc7579Actions } from 'permissionless/actions/erc7579';
28
28
  import { createPimlicoClient } from 'permissionless/clients/pimlico';
29
29
  import {
30
- http,
31
30
  type AbiFunction,
32
31
  type Account,
33
32
  type Address,
34
33
  type Calls,
35
34
  type Chain,
36
35
  ContractFunctionExecutionError,
36
+ createPublicClient,
37
+ encodeFunctionData,
38
+ getAbiItem,
37
39
  type Hex,
40
+ http,
38
41
  type Narrow,
39
42
  type PrivateKeyAccount,
40
43
  type SignableMessage,
41
- type WalletClient,
42
- createPublicClient,
43
- encodeFunctionData,
44
- getAbiItem,
45
44
  toBytes,
46
45
  toFunctionSelector,
47
46
  toHex,
47
+ type WalletClient,
48
48
  } from 'viem';
49
49
  import {
50
- type UserOperation,
51
- type WaitForUserOperationReceiptReturnType,
52
50
  entryPoint07Address,
53
51
  getUserOperationHash,
52
+ type UserOperation,
53
+ type WaitForUserOperationReceiptReturnType,
54
54
  } from 'viem/account-abstraction';
55
55
  import { privateKeyToAccount } from 'viem/accounts';
56
56
  import { bytesToHex } from '../utils/hexBytesAddressUtils.js';
@@ -36,7 +36,6 @@ export const AppIdentityResponse = Schema.Struct({
36
36
  accountProof: Schema.String,
37
37
  keyProof: Schema.String,
38
38
  ciphertext: Schema.String,
39
- nonce: Schema.String,
40
39
  sessionToken: Schema.String,
41
40
  address: Schema.String,
42
41
  appId: Schema.String,
@@ -3,7 +3,7 @@ import * as Schema from 'effect/Schema';
3
3
  import { deepMerge } from '../utils/internal/deep-merge.js';
4
4
  import { isRelationField } from '../utils/isRelationField.js';
5
5
  import { canonicalize } from '../utils/jsc.js';
6
- import { type DecodedEntitiesCacheEntry, type QueryEntry, decodedEntitiesCache } from './decodedEntitiesCache.js';
6
+ import { type DecodedEntitiesCacheEntry, decodedEntitiesCache, type QueryEntry } from './decodedEntitiesCache.js';
7
7
  import { entityRelationParentsMap } from './entityRelationParentsMap.js';
8
8
  import { getEntityRelations } from './getEntityRelations.js';
9
9
  import { hasValidTypesProperty } from './hasValidTypesProperty.js';
@@ -367,7 +367,7 @@ export function findMany<const S extends AnyNoContext>(
367
367
  decoded.__schema = type;
368
368
  filtered.push(decoded);
369
369
  }
370
- } catch (error) {
370
+ } catch (_error) {
371
371
  corruptEntityIds.push(id);
372
372
  }
373
373
  }
@@ -19,7 +19,7 @@ export const update = <const S extends AnyNoContext>(handle: DocHandle<DocumentC
19
19
  validate(data);
20
20
 
21
21
  // apply changes to the repo -> updates the existing entity to the repo entities document
22
- let updated: Schema.Schema.Type<S> | undefined = undefined;
22
+ let updated: Schema.Schema.Type<S> | undefined;
23
23
  handle.change((doc) => {
24
24
  if (doc.entities === undefined) {
25
25
  return;
@@ -6,6 +6,8 @@ import { verifyIdentityOwnership } from './prove-ownership.js';
6
6
 
7
7
  export const getVerifiedIdentity = async (
8
8
  accountAddress: string,
9
+ signaturePublicKey: string | null,
10
+ appId: string | null,
9
11
  syncServerUri: string,
10
12
  chain: Chain,
11
13
  rpcUrl: string,
@@ -14,8 +16,19 @@ export const getVerifiedIdentity = async (
14
16
  encryptionPublicKey: string;
15
17
  signaturePublicKey: string;
16
18
  }> => {
19
+ if (signaturePublicKey && appId) {
20
+ throw new Error('Cannot specify both signaturePublicKey and appId');
21
+ }
22
+ if (!signaturePublicKey && !appId) {
23
+ throw new Error('Must specify either signaturePublicKey or appId');
24
+ }
17
25
  const storeState = store.getSnapshot();
18
- const identity = storeState.context.identities[accountAddress];
26
+ const identity = storeState.context.identities[accountAddress]?.find((identity) => {
27
+ if (signaturePublicKey) {
28
+ return identity.signaturePublicKey === signaturePublicKey;
29
+ }
30
+ return identity.appId === appId;
31
+ });
19
32
  if (identity) {
20
33
  return {
21
34
  accountAddress,
@@ -23,7 +36,8 @@ export const getVerifiedIdentity = async (
23
36
  signaturePublicKey: identity.signaturePublicKey,
24
37
  };
25
38
  }
26
- const res = await fetch(`${syncServerUri}/identity?accountAddress=${accountAddress}`);
39
+ const query = signaturePublicKey ? `&signaturePublicKey=${signaturePublicKey}` : `&appId=${appId}`;
40
+ const res = await fetch(`${syncServerUri}/identity?accountAddress=${accountAddress}${query}`);
27
41
  if (res.status !== 200) {
28
42
  throw new Error('Failed to fetch identity');
29
43
  }
@@ -49,6 +63,7 @@ export const getVerifiedIdentity = async (
49
63
  signaturePublicKey: resDecoded.signaturePublicKey,
50
64
  accountProof: resDecoded.accountProof,
51
65
  keyProof: resDecoded.keyProof,
66
+ appId: resDecoded.appId ?? null,
52
67
  });
53
68
  return {
54
69
  accountAddress: resDecoded.accountAddress,
@@ -119,7 +119,7 @@ export const decryptIdentity = async (
119
119
  let keysMsg: Uint8Array;
120
120
  try {
121
121
  keysMsg = await decrypt(ciphertext, secretKey);
122
- } catch (e) {
122
+ } catch (_e) {
123
123
  // See https://github.com/xmtp/xmtp-js/blob/8d6e5a65813902926baac8150a648587acbaad92/sdks/js-sdk/src/keystore/providers/NetworkKeyManager.ts#L142-L146
124
124
  if (secretKey.length !== 65) {
125
125
  throw new Error('Expected 65 bytes before trying a different recovery byte');
@@ -1,6 +1,6 @@
1
1
  export * from './auth-storage.js';
2
2
  export * from './get-verified-identity.js';
3
3
  export * from './identity-encryption.js';
4
- export * from './prove-ownership.js';
5
4
  export * from './logout.js';
5
+ export * from './prove-ownership.js';
6
6
  export * from './types.js';
@@ -1,7 +1,6 @@
1
- import { http, type Chain, type Hex, createPublicClient, verifyMessage } from 'viem';
2
- import { privateKeyToAccount } from 'viem/accounts';
3
-
4
1
  import type { SmartAccountClient } from 'permissionless';
2
+ import { type Chain, createPublicClient, type Hex, http, verifyMessage } from 'viem';
3
+ import { privateKeyToAccount } from 'viem/accounts';
5
4
  import { publicKeyToAddress } from '../utils/index.js';
6
5
  import type { IdentityKeys } from './types.js';
7
6
 
@@ -1,10 +1,10 @@
1
1
  export * from './create-inbox.js';
2
2
  export * from './get-list-inboxes.js';
3
+ export * from './merge-messages.js';
3
4
  export * from './message-encryption.js';
4
5
  export * from './message-validation.js';
5
6
  export * from './prepare-message.js';
6
7
  export * from './recover-inbox-creator.js';
7
8
  export * from './recover-inbox-message-signer.js';
8
9
  export * from './send-message.js';
9
- export * from './merge-messages.js';
10
10
  export * from './types.js';
@@ -24,6 +24,8 @@ export const validateSpaceInboxMessage = async (
24
24
  const signer = recoverSpaceInboxMessageSigner(message, spaceId, inbox.inboxId);
25
25
  const verifiedIdentity = await Identity.getVerifiedIdentity(
26
26
  message.authorAccountAddress,
27
+ signer,
28
+ null,
27
29
  syncServerUri,
28
30
  chain,
29
31
  rpcUrl,
@@ -62,6 +64,8 @@ export const validateAccountInboxMessage = async (
62
64
  const signer = recoverAccountInboxMessageSigner(message, accountAddress, inbox.inboxId);
63
65
  const verifiedIdentity = await Identity.getVerifiedIdentity(
64
66
  message.authorAccountAddress,
67
+ signer,
68
+ null,
65
69
  syncServerUri,
66
70
  chain,
67
71
  rpcUrl,
package/src/index.ts CHANGED
@@ -3,11 +3,12 @@ export * as Entity from './entity/index.js';
3
3
  export * as Identity from './identity/index.js';
4
4
  export * as Inboxes from './inboxes/index.js';
5
5
  export * as Key from './key/index.js';
6
+ export * as Mapping from './mapping/index.js';
6
7
  export * as Messages from './messages/index.js';
7
8
  export * as SpaceEvents from './space-events/index.js';
8
9
  export * as SpaceInfo from './space-info/index.js';
9
- export * as StoreConnect from './store-connect.js';
10
10
  export * from './store.js';
11
+ export * as StoreConnect from './store-connect.js';
11
12
  export * as Type from './type/type.js';
12
13
  export * from './types.js';
13
14
  export * as Utils from './utils/index.js';