@reyaxyz/community-sdk 0.56.16 → 0.57.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 (41) hide show
  1. package/dist/client/index.js +0 -32
  2. package/dist/client/index.js.map +1 -1
  3. package/dist/index.js +0 -2
  4. package/dist/index.js.map +1 -1
  5. package/dist/modules/index.js +0 -2
  6. package/dist/modules/index.js.map +1 -1
  7. package/dist/types/client/index.d.ts +0 -20
  8. package/dist/types/client/index.d.ts.map +1 -1
  9. package/dist/types/index.d.ts +0 -2
  10. package/dist/types/index.d.ts.map +1 -1
  11. package/dist/types/modules/index.d.ts +0 -2
  12. package/dist/types/modules/index.d.ts.map +1 -1
  13. package/package.json +4 -4
  14. package/src/client/index.ts +0 -34
  15. package/src/index.ts +0 -2
  16. package/src/modules/index.ts +0 -2
  17. package/dist/modules/sbt/index.js +0 -110
  18. package/dist/modules/sbt/index.js.map +0 -1
  19. package/dist/modules/sbt/types.js +0 -3
  20. package/dist/modules/sbt/types.js.map +0 -1
  21. package/dist/modules/vltz/encode.js +0 -56
  22. package/dist/modules/vltz/encode.js.map +0 -1
  23. package/dist/modules/vltz/index.js +0 -147
  24. package/dist/modules/vltz/index.js.map +0 -1
  25. package/dist/modules/vltz/types.js +0 -3
  26. package/dist/modules/vltz/types.js.map +0 -1
  27. package/dist/types/modules/sbt/index.d.ts +0 -11
  28. package/dist/types/modules/sbt/index.d.ts.map +0 -1
  29. package/dist/types/modules/sbt/types.d.ts +0 -23
  30. package/dist/types/modules/sbt/types.d.ts.map +0 -1
  31. package/dist/types/modules/vltz/encode.d.ts +0 -3
  32. package/dist/types/modules/vltz/encode.d.ts.map +0 -1
  33. package/dist/types/modules/vltz/index.d.ts +0 -11
  34. package/dist/types/modules/vltz/index.d.ts.map +0 -1
  35. package/dist/types/modules/vltz/types.d.ts +0 -22
  36. package/dist/types/modules/vltz/types.d.ts.map +0 -1
  37. package/src/modules/sbt/index.ts +0 -38
  38. package/src/modules/sbt/types.ts +0 -26
  39. package/src/modules/vltz/encode.ts +0 -59
  40. package/src/modules/vltz/index.ts +0 -86
  41. package/src/modules/vltz/types.ts +0 -26
@@ -7,10 +7,8 @@ exports.CommunityClient = void 0;
7
7
  var common_1 = require("@reyaxyz/common");
8
8
  var vote_1 = __importDefault(require("../modules/vote"));
9
9
  var lge_1 = __importDefault(require("../modules/lge"));
10
- var sbt_1 = __importDefault(require("../modules/sbt"));
11
10
  var referral_1 = __importDefault(require("../modules/referral"));
12
11
  var discord_1 = __importDefault(require("../modules/discord"));
13
- var vltz_1 = __importDefault(require("../modules/vltz"));
14
12
  var tge_1 = __importDefault(require("../modules/tge"));
15
13
  /**
16
14
  * @description Client for Community SDK, used to interact with the Reya community.
@@ -18,8 +16,6 @@ var tge_1 = __importDefault(require("../modules/tge"));
18
16
  var CommunityClient = /** @class */ (function () {
19
17
  function CommunityClient() {
20
18
  this._voteModule = new vote_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
21
- this._sbtModule = new sbt_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
22
- this._vltzModule = new vltz_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
23
19
  this._lgeModule = new lge_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
24
20
  this._referralModule = new referral_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
25
21
  this._discordModule = new discord_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
@@ -49,34 +45,6 @@ var CommunityClient = /** @class */ (function () {
49
45
  enumerable: false,
50
46
  configurable: true
51
47
  });
52
- Object.defineProperty(CommunityClient, "sbt", {
53
- /**
54
- * Provides access to the SbtModule instance.
55
- * This getter allows for interacting with vote-related functionalities.
56
- *
57
- * @returns {SbtModule} An instance of SbtModule for vote operations.
58
- * @memberof CommunityClient
59
- */
60
- get: function () {
61
- return CommunityClient.getInstance()._sbtModule;
62
- },
63
- enumerable: false,
64
- configurable: true
65
- });
66
- Object.defineProperty(CommunityClient, "vltz", {
67
- /**
68
- * Provides access to the VltzModule instance.
69
- * This getter allows for interacting with vote-related functionalities.
70
- *
71
- * @returns {VltzModule} An instance of VltzModule for vote operations.
72
- * @memberof CommunityClient
73
- */
74
- get: function () {
75
- return CommunityClient.getInstance()._vltzModule;
76
- },
77
- enumerable: false,
78
- configurable: true
79
- });
80
48
  Object.defineProperty(CommunityClient, "lge", {
81
49
  /**
82
50
  * Provides access to the LGEModule instance.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["client/index.ts"],"names":[],"mappings":"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","sourcesContent":["import { getApiClientConfig, ServiceConfig } from '@reyaxyz/common';\nimport VoteModule from '../modules/vote';\nimport LGEModule from '../modules/lge';\nimport SbtModule from '../modules/sbt';\nimport ReferralModule from '../modules/referral';\nimport DiscordModule from '../modules/discord';\nimport VltzModule from '../modules/vltz';\nimport TGEModule from '../modules/tge';\n\n/**\n * @description Client for Community SDK, used to interact with the Reya community.\n */\nexport class CommunityClient {\n private static instance: CommunityClient;\n private static config: ServiceConfig = getApiClientConfig('test');\n\n private readonly _voteModule: VoteModule;\n private readonly _sbtModule: SbtModule;\n private readonly _vltzModule: VltzModule;\n private readonly _lgeModule: LGEModule;\n private readonly _referralModule: ReferralModule;\n private readonly _discordModule: DiscordModule;\n private readonly _tgeModule: TGEModule;\n\n private constructor() {\n this._voteModule = new VoteModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._sbtModule = new SbtModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._vltzModule = new VltzModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._lgeModule = new LGEModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._referralModule = new ReferralModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._discordModule = new DiscordModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._tgeModule = new TGEModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n }\n\n public static configure(environment: ServiceConfig['environment']): void {\n CommunityClient.config = getApiClientConfig(environment);\n CommunityClient.instance = new CommunityClient();\n }\n\n private static getInstance(): CommunityClient {\n if (!CommunityClient.instance) {\n throw new Error(\n 'Client is not configured. Please configure it before using.',\n );\n }\n return CommunityClient.instance;\n }\n\n /**\n * Provides access to the VoteModule instance.\n * This getter allows for interacting with vote-related functionalities.\n *\n * @returns {VoteModule} An instance of VoteModule for vote operations.\n * @memberof CommunityClient\n */\n public static get vote(): VoteModule {\n return CommunityClient.getInstance()._voteModule;\n }\n\n /**\n * Provides access to the SbtModule instance.\n * This getter allows for interacting with vote-related functionalities.\n *\n * @returns {SbtModule} An instance of SbtModule for vote operations.\n * @memberof CommunityClient\n */\n public static get sbt(): SbtModule {\n return CommunityClient.getInstance()._sbtModule;\n }\n\n /**\n * Provides access to the VltzModule instance.\n * This getter allows for interacting with vote-related functionalities.\n *\n * @returns {VltzModule} An instance of VltzModule for vote operations.\n * @memberof CommunityClient\n */\n public static get vltz(): VltzModule {\n return CommunityClient.getInstance()._vltzModule;\n }\n\n /**\n * Provides access to the LGEModule instance.\n * This getter allows for interacting with LGE-related functionalities.\n *\n * @returns {LGEModule} An instance of LGEModule for LGE operations.\n * @memberof CommunityClient\n */\n public static get lge(): LGEModule {\n return CommunityClient.getInstance()._lgeModule;\n }\n\n /**\n * Provides access to the TGEModule instance.\n * This getter allows for interacting with TGE-related functionalities.\n *\n * @returns {TGEModule} An instance of TGEModule for TGE operations.\n * @memberof CommunityClient\n */\n public static get tge(): TGEModule {\n return CommunityClient.getInstance()._tgeModule;\n }\n\n /**\n * Provides access to the ReferralModule instance.\n * This getter allows for interacting with referral related functionalities.\n *\n * @returns {ReferralModule} An instance of ReferralModule .\n * @memberof CommunityClient\n */\n public static get referral(): ReferralModule {\n return CommunityClient.getInstance()._referralModule;\n }\n\n /**\n * Provides access to the DiscordModule instance.\n * This getter allows for interacting with discord-related functionalities.\n *\n * @returns {DiscordModule} An instance of DiscordModule.\n * @memberof CommunityClient\n */\n public static get discord(): DiscordModule {\n return CommunityClient.getInstance()._discordModule;\n }\n\n public static get supportedChain(): number {\n return CommunityClient.config.chain;\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["client/index.ts"],"names":[],"mappings":";;;;;;AAAA,0CAAoE;AACpE,yDAAyC;AACzC,uDAAuC;AACvC,iEAAiD;AACjD,+DAA+C;AAC/C,uDAAuC;AAEvC;;GAEG;AACH;IAUE;QACE,IAAI,CAAC,WAAW,GAAG,IAAI,cAAU,CAC/B,eAAe,CAAC,MAAM,CAAC,WAAW,EAClC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,CAAC;QACF,IAAI,CAAC,UAAU,GAAG,IAAI,aAAS,CAC7B,eAAe,CAAC,MAAM,CAAC,WAAW,EAClC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,IAAI,kBAAc,CACvC,eAAe,CAAC,MAAM,CAAC,WAAW,EAClC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,IAAI,iBAAa,CACrC,eAAe,CAAC,MAAM,CAAC,WAAW,EAClC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,CAAC;QACF,IAAI,CAAC,UAAU,GAAG,IAAI,aAAS,CAC7B,eAAe,CAAC,MAAM,CAAC,WAAW,EAClC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,CAAC;IACJ,CAAC;IAEa,yBAAS,GAAvB,UAAwB,WAAyC;QAC/D,eAAe,CAAC,MAAM,GAAG,IAAA,2BAAkB,EAAC,WAAW,CAAC,CAAC;QACzD,eAAe,CAAC,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;IACnD,CAAC;IAEc,2BAAW,GAA1B;QACE,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAC;QACJ,CAAC;QACD,OAAO,eAAe,CAAC,QAAQ,CAAC;IAClC,CAAC;IASD,sBAAkB,uBAAI;QAPtB;;;;;;WAMG;aACH;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,WAAW,CAAC;QACnD,CAAC;;;OAAA;IASD,sBAAkB,sBAAG;QAPrB;;;;;;WAMG;aACH;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC;QAClD,CAAC;;;OAAA;IASD,sBAAkB,sBAAG;QAPrB;;;;;;WAMG;aACH;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC;QAClD,CAAC;;;OAAA;IASD,sBAAkB,2BAAQ;QAP1B;;;;;;WAMG;aACH;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC;QACvD,CAAC;;;OAAA;IASD,sBAAkB,0BAAO;QAPzB;;;;;;WAMG;aACH;YACE,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC;QACtD,CAAC;;;OAAA;IAED,sBAAkB,iCAAc;aAAhC;YACE,OAAO,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC;QACtC,CAAC;;;OAAA;IAtGc,sBAAM,GAAkB,IAAA,2BAAkB,EAAC,MAAM,CAAC,CAAC;IAuGpE,sBAAC;CAAA,AAzGD,IAyGC;AAzGY,0CAAe","sourcesContent":["import { getApiClientConfig, ServiceConfig } from '@reyaxyz/common';\nimport VoteModule from '../modules/vote';\nimport LGEModule from '../modules/lge';\nimport ReferralModule from '../modules/referral';\nimport DiscordModule from '../modules/discord';\nimport TGEModule from '../modules/tge';\n\n/**\n * @description Client for Community SDK, used to interact with the Reya community.\n */\nexport class CommunityClient {\n private static instance: CommunityClient;\n private static config: ServiceConfig = getApiClientConfig('test');\n\n private readonly _voteModule: VoteModule;\n private readonly _lgeModule: LGEModule;\n private readonly _referralModule: ReferralModule;\n private readonly _discordModule: DiscordModule;\n private readonly _tgeModule: TGEModule;\n\n private constructor() {\n this._voteModule = new VoteModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._lgeModule = new LGEModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._referralModule = new ReferralModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._discordModule = new DiscordModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._tgeModule = new TGEModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n }\n\n public static configure(environment: ServiceConfig['environment']): void {\n CommunityClient.config = getApiClientConfig(environment);\n CommunityClient.instance = new CommunityClient();\n }\n\n private static getInstance(): CommunityClient {\n if (!CommunityClient.instance) {\n throw new Error(\n 'Client is not configured. Please configure it before using.',\n );\n }\n return CommunityClient.instance;\n }\n\n /**\n * Provides access to the VoteModule instance.\n * This getter allows for interacting with vote-related functionalities.\n *\n * @returns {VoteModule} An instance of VoteModule for vote operations.\n * @memberof CommunityClient\n */\n public static get vote(): VoteModule {\n return CommunityClient.getInstance()._voteModule;\n }\n\n /**\n * Provides access to the LGEModule instance.\n * This getter allows for interacting with LGE-related functionalities.\n *\n * @returns {LGEModule} An instance of LGEModule for LGE operations.\n * @memberof CommunityClient\n */\n public static get lge(): LGEModule {\n return CommunityClient.getInstance()._lgeModule;\n }\n\n /**\n * Provides access to the TGEModule instance.\n * This getter allows for interacting with TGE-related functionalities.\n *\n * @returns {TGEModule} An instance of TGEModule for TGE operations.\n * @memberof CommunityClient\n */\n public static get tge(): TGEModule {\n return CommunityClient.getInstance()._tgeModule;\n }\n\n /**\n * Provides access to the ReferralModule instance.\n * This getter allows for interacting with referral related functionalities.\n *\n * @returns {ReferralModule} An instance of ReferralModule .\n * @memberof CommunityClient\n */\n public static get referral(): ReferralModule {\n return CommunityClient.getInstance()._referralModule;\n }\n\n /**\n * Provides access to the DiscordModule instance.\n * This getter allows for interacting with discord-related functionalities.\n *\n * @returns {DiscordModule} An instance of DiscordModule.\n * @memberof CommunityClient\n */\n public static get discord(): DiscordModule {\n return CommunityClient.getInstance()._discordModule;\n }\n\n public static get supportedChain(): number {\n return CommunityClient.config.chain;\n }\n}\n"]}
package/dist/index.js CHANGED
@@ -19,7 +19,5 @@ __exportStar(require("./modules/vote/types"), exports);
19
19
  __exportStar(require("./modules/lge/types"), exports);
20
20
  __exportStar(require("./modules/referral/types"), exports);
21
21
  __exportStar(require("./modules/discord/types"), exports);
22
- __exportStar(require("./modules/sbt/types"), exports);
23
- __exportStar(require("./modules/vltz/types"), exports);
24
22
  __exportStar(require("./modules/tge/types"), exports);
25
23
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,uDAAqC;AACrC,sDAAoC;AACpC,2DAAyC;AACzC,0DAAwC;AACxC,sDAAoC;AACpC,uDAAqC;AACrC,sDAAoC","sourcesContent":["export * from './client';\nexport * from './modules/vote/types';\nexport * from './modules/lge/types';\nexport * from './modules/referral/types';\nexport * from './modules/discord/types';\nexport * from './modules/sbt/types';\nexport * from './modules/vltz/types';\nexport * from './modules/tge/types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,uDAAqC;AACrC,sDAAoC;AACpC,2DAAyC;AACzC,0DAAwC;AACxC,sDAAoC","sourcesContent":["export * from './client';\nexport * from './modules/vote/types';\nexport * from './modules/lge/types';\nexport * from './modules/referral/types';\nexport * from './modules/discord/types';\nexport * from './modules/tge/types';\n"]}
@@ -18,7 +18,5 @@ __exportStar(require("./vote"), exports);
18
18
  __exportStar(require("./lge"), exports);
19
19
  __exportStar(require("./referral"), exports);
20
20
  __exportStar(require("./discord"), exports);
21
- __exportStar(require("./sbt"), exports);
22
- __exportStar(require("./vltz"), exports);
23
21
  __exportStar(require("./tge"), exports);
24
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,wCAAsB;AACtB,6CAA2B;AAC3B,4CAA0B;AAC1B,wCAAsB;AACtB,yCAAuB;AACvB,wCAAsB","sourcesContent":["export * from './vote';\nexport * from './lge';\nexport * from './referral';\nexport * from './discord';\nexport * from './sbt';\nexport * from './vltz';\nexport * from './tge';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,wCAAsB;AACtB,6CAA2B;AAC3B,4CAA0B;AAC1B,wCAAsB","sourcesContent":["export * from './vote';\nexport * from './lge';\nexport * from './referral';\nexport * from './discord';\nexport * from './tge';\n"]}
@@ -1,10 +1,8 @@
1
1
  import { ServiceConfig } from '@reyaxyz/common';
2
2
  import VoteModule from '../modules/vote';
3
3
  import LGEModule from '../modules/lge';
4
- import SbtModule from '../modules/sbt';
5
4
  import ReferralModule from '../modules/referral';
6
5
  import DiscordModule from '../modules/discord';
7
- import VltzModule from '../modules/vltz';
8
6
  import TGEModule from '../modules/tge';
9
7
  /**
10
8
  * @description Client for Community SDK, used to interact with the Reya community.
@@ -13,8 +11,6 @@ export declare class CommunityClient {
13
11
  private static instance;
14
12
  private static config;
15
13
  private readonly _voteModule;
16
- private readonly _sbtModule;
17
- private readonly _vltzModule;
18
14
  private readonly _lgeModule;
19
15
  private readonly _referralModule;
20
16
  private readonly _discordModule;
@@ -30,22 +26,6 @@ export declare class CommunityClient {
30
26
  * @memberof CommunityClient
31
27
  */
32
28
  static get vote(): VoteModule;
33
- /**
34
- * Provides access to the SbtModule instance.
35
- * This getter allows for interacting with vote-related functionalities.
36
- *
37
- * @returns {SbtModule} An instance of SbtModule for vote operations.
38
- * @memberof CommunityClient
39
- */
40
- static get sbt(): SbtModule;
41
- /**
42
- * Provides access to the VltzModule instance.
43
- * This getter allows for interacting with vote-related functionalities.
44
- *
45
- * @returns {VltzModule} An instance of VltzModule for vote operations.
46
- * @memberof CommunityClient
47
- */
48
- static get vltz(): VltzModule;
49
29
  /**
50
30
  * Provides access to the LGEModule instance.
51
31
  * This getter allows for interacting with LGE-related functionalities.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAEvC;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IACzC,OAAO,CAAC,MAAM,CAAC,MAAM,CAA6C;IAElE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;IACzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;IACzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;IACjD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgB;IAC/C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IAEvC,OAAO;WA+BO,SAAS,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,IAAI;IAKxE,OAAO,CAAC,MAAM,CAAC,WAAW;IAS1B;;;;;;OAMG;IACH,WAAkB,IAAI,IAAI,UAAU,CAEnC;IAED;;;;;;OAMG;IACH,WAAkB,GAAG,IAAI,SAAS,CAEjC;IAED;;;;;;OAMG;IACH,WAAkB,IAAI,IAAI,UAAU,CAEnC;IAED;;;;;;OAMG;IACH,WAAkB,GAAG,IAAI,SAAS,CAEjC;IAED;;;;;;OAMG;IACH,WAAkB,GAAG,IAAI,SAAS,CAEjC;IAED;;;;;;OAMG;IACH,WAAkB,QAAQ,IAAI,cAAc,CAE3C;IAED;;;;;;OAMG;IACH,WAAkB,OAAO,IAAI,aAAa,CAEzC;IAED,WAAkB,cAAc,IAAI,MAAM,CAEzC;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAEvC;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IACzC,OAAO,CAAC,MAAM,CAAC,MAAM,CAA6C;IAElE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;IACzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;IACjD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgB;IAC/C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IAEvC,OAAO;WAuBO,SAAS,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,IAAI;IAKxE,OAAO,CAAC,MAAM,CAAC,WAAW;IAS1B;;;;;;OAMG;IACH,WAAkB,IAAI,IAAI,UAAU,CAEnC;IAED;;;;;;OAMG;IACH,WAAkB,GAAG,IAAI,SAAS,CAEjC;IAED;;;;;;OAMG;IACH,WAAkB,GAAG,IAAI,SAAS,CAEjC;IAED;;;;;;OAMG;IACH,WAAkB,QAAQ,IAAI,cAAc,CAE3C;IAED;;;;;;OAMG;IACH,WAAkB,OAAO,IAAI,aAAa,CAEzC;IAED,WAAkB,cAAc,IAAI,MAAM,CAEzC;CACF"}
@@ -3,7 +3,5 @@ export * from './modules/vote/types';
3
3
  export * from './modules/lge/types';
4
4
  export * from './modules/referral/types';
5
5
  export * from './modules/discord/types';
6
- export * from './modules/sbt/types';
7
- export * from './modules/vltz/types';
8
6
  export * from './modules/tge/types';
9
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC"}
@@ -2,7 +2,5 @@ export * from './vote';
2
2
  export * from './lge';
3
3
  export * from './referral';
4
4
  export * from './discord';
5
- export * from './sbt';
6
- export * from './vltz';
7
5
  export * from './tge';
8
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/community-sdk",
3
- "version": "0.56.16",
3
+ "version": "0.57.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -10,8 +10,8 @@
10
10
  "url": "https://github.com/Reya-Labs/reya-off-chain-monorepo.git"
11
11
  },
12
12
  "dependencies": {
13
- "@reyaxyz/common": "0.334.0",
14
- "@reyaxyz/sdk": "0.142.23",
13
+ "@reyaxyz/common": "0.335.0",
14
+ "@reyaxyz/sdk": "0.142.25",
15
15
  "ethers": "6.9.0"
16
16
  },
17
17
  "main": "dist/index.js",
@@ -38,5 +38,5 @@
38
38
  "generate:coverage-badges": "npx istanbul-badges-readme --silent"
39
39
  },
40
40
  "packageManager": "pnpm@8.3.1",
41
- "gitHead": "dd24f4ded375cdf56b8884ef0efc74c0855d1b7b"
41
+ "gitHead": "af0af5bcedc07c510977e3acec2b7a3a4e13664b"
42
42
  }
@@ -1,10 +1,8 @@
1
1
  import { getApiClientConfig, ServiceConfig } from '@reyaxyz/common';
2
2
  import VoteModule from '../modules/vote';
3
3
  import LGEModule from '../modules/lge';
4
- import SbtModule from '../modules/sbt';
5
4
  import ReferralModule from '../modules/referral';
6
5
  import DiscordModule from '../modules/discord';
7
- import VltzModule from '../modules/vltz';
8
6
  import TGEModule from '../modules/tge';
9
7
 
10
8
  /**
@@ -15,8 +13,6 @@ export class CommunityClient {
15
13
  private static config: ServiceConfig = getApiClientConfig('test');
16
14
 
17
15
  private readonly _voteModule: VoteModule;
18
- private readonly _sbtModule: SbtModule;
19
- private readonly _vltzModule: VltzModule;
20
16
  private readonly _lgeModule: LGEModule;
21
17
  private readonly _referralModule: ReferralModule;
22
18
  private readonly _discordModule: DiscordModule;
@@ -27,14 +23,6 @@ export class CommunityClient {
27
23
  CommunityClient.config.apiEndpoint,
28
24
  CommunityClient.config.logging,
29
25
  );
30
- this._sbtModule = new SbtModule(
31
- CommunityClient.config.apiEndpoint,
32
- CommunityClient.config.logging,
33
- );
34
- this._vltzModule = new VltzModule(
35
- CommunityClient.config.apiEndpoint,
36
- CommunityClient.config.logging,
37
- );
38
26
  this._lgeModule = new LGEModule(
39
27
  CommunityClient.config.apiEndpoint,
40
28
  CommunityClient.config.logging,
@@ -78,28 +66,6 @@ export class CommunityClient {
78
66
  return CommunityClient.getInstance()._voteModule;
79
67
  }
80
68
 
81
- /**
82
- * Provides access to the SbtModule instance.
83
- * This getter allows for interacting with vote-related functionalities.
84
- *
85
- * @returns {SbtModule} An instance of SbtModule for vote operations.
86
- * @memberof CommunityClient
87
- */
88
- public static get sbt(): SbtModule {
89
- return CommunityClient.getInstance()._sbtModule;
90
- }
91
-
92
- /**
93
- * Provides access to the VltzModule instance.
94
- * This getter allows for interacting with vote-related functionalities.
95
- *
96
- * @returns {VltzModule} An instance of VltzModule for vote operations.
97
- * @memberof CommunityClient
98
- */
99
- public static get vltz(): VltzModule {
100
- return CommunityClient.getInstance()._vltzModule;
101
- }
102
-
103
69
  /**
104
70
  * Provides access to the LGEModule instance.
105
71
  * This getter allows for interacting with LGE-related functionalities.
package/src/index.ts CHANGED
@@ -3,6 +3,4 @@ export * from './modules/vote/types';
3
3
  export * from './modules/lge/types';
4
4
  export * from './modules/referral/types';
5
5
  export * from './modules/discord/types';
6
- export * from './modules/sbt/types';
7
- export * from './modules/vltz/types';
8
6
  export * from './modules/tge/types';
@@ -2,6 +2,4 @@ export * from './vote';
2
2
  export * from './lge';
3
3
  export * from './referral';
4
4
  export * from './discord';
5
- export * from './sbt';
6
- export * from './vltz';
7
5
  export * from './tge';
@@ -1,110 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
24
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
25
- return new (P || (P = Promise))(function (resolve, reject) {
26
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
27
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
28
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
29
- step((generator = generator.apply(thisArg, _arguments || [])).next());
30
- });
31
- };
32
- var __generator = (this && this.__generator) || function (thisArg, body) {
33
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
34
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
35
- function verb(n) { return function (v) { return step([n, v]); }; }
36
- function step(op) {
37
- if (f) throw new TypeError("Generator is already executing.");
38
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
39
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
40
- if (y = 0, t) op = [op[0] & 2, t.value];
41
- switch (op[0]) {
42
- case 0: case 1: t = op; break;
43
- case 4: _.label++; return { value: op[1], done: false };
44
- case 5: _.label++; y = op[1]; op = [0]; continue;
45
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
46
- default:
47
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
48
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
49
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
50
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
51
- if (t[2]) _.ops.pop();
52
- _.trys.pop(); continue;
53
- }
54
- op = body.call(thisArg, _);
55
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
56
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
57
- }
58
- };
59
- Object.defineProperty(exports, "__esModule", { value: true });
60
- var common_1 = require("@reyaxyz/common");
61
- var common_2 = require("@reyaxyz/common");
62
- var SbtModule = /** @class */ (function (_super) {
63
- __extends(SbtModule, _super);
64
- function SbtModule(apiUrl, loggingEnabled) {
65
- var _this = _super.call(this, apiUrl) || this;
66
- _this.loggingEnabled = false;
67
- _this.loggingEnabled = loggingEnabled;
68
- return _this;
69
- }
70
- // WRITE
71
- SbtModule.prototype.mint = function (params) {
72
- return __awaiter(this, void 0, void 0, function () {
73
- return __generator(this, function (_a) {
74
- throw new Error('Unimplemented.');
75
- });
76
- });
77
- };
78
- // READ
79
- SbtModule.prototype.getSbtMintedStatus = function (params) {
80
- return __awaiter(this, void 0, void 0, function () {
81
- var uri;
82
- return __generator(this, function (_a) {
83
- uri = "/api/sbt/mint-status/owner/".concat(params.ownerAddress, "/tokenCount/0");
84
- return [2 /*return*/, this.get(uri)];
85
- });
86
- });
87
- };
88
- SbtModule.prototype.getSbtsInfo = function () {
89
- return __awaiter(this, void 0, void 0, function () {
90
- var uri;
91
- return __generator(this, function (_a) {
92
- uri = "/api/sbt/info";
93
- return [2 /*return*/, this.get(uri)];
94
- });
95
- });
96
- };
97
- __decorate([
98
- (0, common_2.Logger)('SbtModule.mint')
99
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
100
- ], SbtModule.prototype, "mint", null);
101
- __decorate([
102
- (0, common_2.Logger)('SbtModule.getSbtMintedStatus')
103
- ], SbtModule.prototype, "getSbtMintedStatus", null);
104
- __decorate([
105
- (0, common_2.Logger)('SbtModule.getSbtsInfo')
106
- ], SbtModule.prototype, "getSbtsInfo", null);
107
- return SbtModule;
108
- }(common_1.RestClient));
109
- exports.default = SbtModule;
110
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/sbt/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA6C;AAQ7C,0CAAmD;AAEnD;IAAuC,6BAAU;IAG/C,mBAAY,MAAc,EAAE,cAAuB;QACjD,YAAA,MAAK,YAAC,MAAM,CAAC,SAAC;QAHhB,oBAAc,GAAY,KAAK,CAAC;QAI9B,KAAI,CAAC,cAAc,GAAG,cAAc,CAAC;;IACvC,CAAC;IAED,QAAQ;IAGF,wBAAI,GAAJ,UAAK,MAAqB;;;gBAC9B,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;;;KACnC;IAED,OAAO;IAED,sCAAkB,GAAlB,UAAmB,MAA0B;;;;gBAC3C,GAAG,GAAG,qCAA8B,MAAM,CAAC,YAAY,kBAAe,CAAC;gBAC7E,sBAAO,IAAI,CAAC,GAAG,CAAqB,GAAG,CAAC,EAAC;;;KAC1C;IAGK,+BAAW,GAAX;;;;gBACE,GAAG,GAAG,eAAe,CAAC;gBAC5B,sBAAO,IAAI,CAAC,GAAG,CAAoB,GAAG,CAAC,EAAC;;;KACzC;IAfK;QAFL,IAAA,eAAM,EAAC,gBAAgB,CAAC;QACzB,6DAA6D;yCAG5D;IAIK;QADL,IAAA,eAAM,EAAC,8BAA8B,CAAC;uDAItC;IAGK;QADL,IAAA,eAAM,EAAC,uBAAuB,CAAC;gDAI/B;IACH,gBAAC;CAAA,AA3BD,CAAuC,mBAAU,GA2BhD;kBA3BoB,SAAS","sourcesContent":["import { RestClient } from '@reyaxyz/common';\nimport {\n SbtMintResult,\n SbtMintParams,\n GetSbtMintedParams,\n GetSbtMintedResult,\n GetSbtsInfoResult,\n} from './types';\nimport { Logger, Loggable } from '@reyaxyz/common';\n\nexport default class SbtModule extends RestClient implements Loggable {\n loggingEnabled: boolean = false;\n\n constructor(apiUrl: string, loggingEnabled: boolean) {\n super(apiUrl);\n this.loggingEnabled = loggingEnabled;\n }\n\n // WRITE\n @Logger('SbtModule.mint')\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async mint(params: SbtMintParams): Promise<SbtMintResult> {\n throw new Error('Unimplemented.');\n }\n\n // READ\n @Logger('SbtModule.getSbtMintedStatus')\n async getSbtMintedStatus(params: GetSbtMintedParams) {\n const uri = `/api/sbt/mint-status/owner/${params.ownerAddress}/tokenCount/0`;\n return this.get<GetSbtMintedResult>(uri);\n }\n\n @Logger('SbtModule.getSbtsInfo')\n async getSbtsInfo() {\n const uri = `/api/sbt/info`;\n return this.get<GetSbtsInfoResult>(uri);\n }\n}\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/sbt/types.ts"],"names":[],"mappings":"","sourcesContent":["import { SbtMintedStatusEntity } from '@reyaxyz/common';\nimport { Signer } from 'ethers';\n\nexport type SbtMintResult = {\n transactionHash: string | null;\n};\nexport type SbtMintParams = {\n signer: Signer;\n};\n\nexport type SignedSbtMintTx = {\n signature: string;\n deadline: number;\n sbtRoot: string;\n};\n\nexport type GetSbtMintedParams = {\n ownerAddress: string;\n};\nexport type GetSbtMintedResult = SbtMintedStatusEntity;\n\nexport type GetSbtsInfoResult = {\n totalSbts: number;\n deadlineMs: number;\n newFee: 0.01;\n};\n"]}
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.encodeMint = void 0;
4
- var ethers_1 = require("ethers");
5
- var abi = [
6
- {
7
- type: 'function',
8
- name: 'mint',
9
- inputs: [
10
- {
11
- name: 'leafInfo',
12
- type: 'tuple',
13
- internalType: 'struct LeafInfo',
14
- components: [
15
- {
16
- name: 'owner',
17
- type: 'address',
18
- internalType: 'address',
19
- },
20
- {
21
- name: 'allocation',
22
- type: 'uint256',
23
- internalType: 'uint256',
24
- },
25
- ],
26
- },
27
- {
28
- name: 'proof',
29
- type: 'bytes32[]',
30
- internalType: 'bytes32[]',
31
- },
32
- {
33
- name: 'merkleRoot',
34
- type: 'bytes32',
35
- internalType: 'bytes32',
36
- },
37
- ],
38
- outputs: [
39
- {
40
- name: '',
41
- type: 'uint256',
42
- internalType: 'uint256',
43
- },
44
- ],
45
- stateMutability: 'nonpayable',
46
- },
47
- ];
48
- var encodeMint = function (owner, allocation, proof, merkleRoot) {
49
- var functionSignature = 'mint';
50
- var parameters = [{ owner: owner, allocation: allocation }, proof, merkleRoot];
51
- var INTERFACE = new ethers_1.Interface(abi);
52
- var calldata = INTERFACE.encodeFunctionData(functionSignature, parameters);
53
- return { calldata: calldata, value: BigInt(0).toString(10) };
54
- };
55
- exports.encodeMint = encodeMint;
56
- //# sourceMappingURL=encode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"encode.js","sourceRoot":"/","sources":["modules/vltz/encode.ts"],"names":[],"mappings":";;;AACA,iCAAmC;AAEnC,IAAM,GAAG,GAAG;IACV;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,OAAO;gBACb,YAAY,EAAE,iBAAiB;gBAC/B,UAAU,EAAE;oBACV;wBACE,IAAI,EAAE,OAAO;wBACb,IAAI,EAAE,SAAS;wBACf,YAAY,EAAE,SAAS;qBACxB;oBACD;wBACE,IAAI,EAAE,YAAY;wBAClB,IAAI,EAAE,SAAS;wBACf,YAAY,EAAE,SAAS;qBACxB;iBACF;aACF;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,WAAW;gBACjB,YAAY,EAAE,WAAW;aAC1B;YACD;gBACE,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,SAAS;gBACf,YAAY,EAAE,SAAS;aACxB;SACF;QACD,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,SAAS;gBACf,YAAY,EAAE,SAAS;aACxB;SACF;QACD,eAAe,EAAE,YAAY;KAC9B;CACF,CAAC;AAEK,IAAM,UAAU,GAAG,UACxB,KAAa,EACb,UAAkB,EAClB,KAAe,EACf,UAAkB;IAElB,IAAM,iBAAiB,GAAG,MAAM,CAAC;IACjC,IAAM,UAAU,GAAG,CAAC,EAAE,KAAK,OAAA,EAAE,UAAU,YAAA,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IAC9D,IAAM,SAAS,GAAG,IAAI,kBAAS,CAAC,GAAG,CAAC,CAAC;IACrC,IAAM,QAAQ,GAAG,SAAS,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;IAC7E,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;AAC/D,CAAC,CAAC;AAXW,QAAA,UAAU,cAWrB","sourcesContent":["import { MethodParameters } from '@reyaxyz/common';\nimport { Interface } from 'ethers';\n\nconst abi = [\n {\n type: 'function',\n name: 'mint',\n inputs: [\n {\n name: 'leafInfo',\n type: 'tuple',\n internalType: 'struct LeafInfo',\n components: [\n {\n name: 'owner',\n type: 'address',\n internalType: 'address',\n },\n {\n name: 'allocation',\n type: 'uint256',\n internalType: 'uint256',\n },\n ],\n },\n {\n name: 'proof',\n type: 'bytes32[]',\n internalType: 'bytes32[]',\n },\n {\n name: 'merkleRoot',\n type: 'bytes32',\n internalType: 'bytes32',\n },\n ],\n outputs: [\n {\n name: '',\n type: 'uint256',\n internalType: 'uint256',\n },\n ],\n stateMutability: 'nonpayable',\n },\n];\n\nexport const encodeMint = (\n owner: string,\n allocation: string,\n proof: string[],\n merkleRoot: string,\n): MethodParameters => {\n const functionSignature = 'mint';\n const parameters = [{ owner, allocation }, proof, merkleRoot];\n const INTERFACE = new Interface(abi);\n const calldata = INTERFACE.encodeFunctionData(functionSignature, parameters);\n return { calldata: calldata, value: BigInt(0).toString(10) };\n};\n"]}
@@ -1,147 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
24
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
25
- return new (P || (P = Promise))(function (resolve, reject) {
26
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
27
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
28
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
29
- step((generator = generator.apply(thisArg, _arguments || [])).next());
30
- });
31
- };
32
- var __generator = (this && this.__generator) || function (thisArg, body) {
33
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
34
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
35
- function verb(n) { return function (v) { return step([n, v]); }; }
36
- function step(op) {
37
- if (f) throw new TypeError("Generator is already executing.");
38
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
39
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
40
- if (y = 0, t) op = [op[0] & 2, t.value];
41
- switch (op[0]) {
42
- case 0: case 1: t = op; break;
43
- case 4: _.label++; return { value: op[1], done: false };
44
- case 5: _.label++; y = op[1]; op = [0]; continue;
45
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
46
- default:
47
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
48
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
49
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
50
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
51
- if (t[2]) _.ops.pop();
52
- _.trys.pop(); continue;
53
- }
54
- op = body.call(thisArg, _);
55
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
56
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
57
- }
58
- };
59
- Object.defineProperty(exports, "__esModule", { value: true });
60
- var common_1 = require("@reyaxyz/common");
61
- var common_2 = require("@reyaxyz/common");
62
- var encode_1 = require("./encode");
63
- var VltzModule = /** @class */ (function (_super) {
64
- __extends(VltzModule, _super);
65
- function VltzModule(apiUrl, loggingEnabled) {
66
- var _this = _super.call(this, apiUrl) || this;
67
- _this.loggingEnabled = false;
68
- _this.loggingEnabled = loggingEnabled;
69
- return _this;
70
- }
71
- // WRITE
72
- VltzModule.prototype.mint = function (params) {
73
- var _a;
74
- return __awaiter(this, void 0, void 0, function () {
75
- var network, chainId, walletAddress, scaledAllocation, deadlineMs, _b, data, value, result;
76
- return __generator(this, function (_c) {
77
- switch (_c.label) {
78
- case 0: return [4 /*yield*/, ((_a = params.signer.provider) === null || _a === void 0 ? void 0 : _a.getNetwork())];
79
- case 1:
80
- network = _c.sent();
81
- chainId = Number(network === null || network === void 0 ? void 0 : network.chainId);
82
- return [4 /*yield*/, params.signer.getAddress()];
83
- case 2:
84
- walletAddress = _c.sent();
85
- scaledAllocation = (0, common_1.scale)(18)(Number(params.allocation)).toString();
86
- if (!(chainId === common_1.MoneyInOutChainId.ethereumSepolia ||
87
- chainId === common_1.MoneyInOutChainId.ethereumMainnet)) {
88
- throw new Error('Network not supported. Switch to Ethereum.');
89
- }
90
- // if current time (UTC) is past the mint deadline, throw error
91
- if (params.merkleRoot == common_1.VLTZ_MINTING_DETAILS[chainId].rounds[1].root) {
92
- deadlineMs = common_1.VLTZ_MINTING_DETAILS[chainId].rounds[1].mintDeadline * 1000;
93
- if (Date.now() > deadlineMs) {
94
- throw new Error('Claim deadline passed');
95
- }
96
- }
97
- _b = (0, encode_1.encodeMint)(walletAddress, scaledAllocation, params.merkleProof, params.merkleRoot), data = _b.calldata, value = _b.value;
98
- return [4 /*yield*/, (0, common_1.executeTransaction)(params.signer, data, value, chainId, params.contractAddress)];
99
- case 3:
100
- result = _c.sent();
101
- return [2 /*return*/, {
102
- transactionHash: (result === null || result === void 0 ? void 0 : result.hash) || null,
103
- }];
104
- }
105
- });
106
- });
107
- };
108
- // READ
109
- VltzModule.prototype.getVltzRoundInfo = function (params) {
110
- return __awaiter(this, void 0, void 0, function () {
111
- var uri;
112
- return __generator(this, function (_a) {
113
- switch (_a.label) {
114
- case 0:
115
- uri = "/api/vltz/round/".concat(params.id);
116
- return [4 /*yield*/, this.get(uri)];
117
- case 1: return [2 /*return*/, _a.sent()];
118
- }
119
- });
120
- });
121
- };
122
- VltzModule.prototype.getVltzWalletInfo = function (params) {
123
- return __awaiter(this, void 0, void 0, function () {
124
- var uri;
125
- return __generator(this, function (_a) {
126
- switch (_a.label) {
127
- case 0:
128
- uri = "/api/vltz/wallet/".concat(params.address, "/").concat(params.roundId);
129
- return [4 /*yield*/, this.get(uri)];
130
- case 1: return [2 /*return*/, _a.sent()];
131
- }
132
- });
133
- });
134
- };
135
- __decorate([
136
- (0, common_2.Logger)('VltzModule.mint')
137
- ], VltzModule.prototype, "mint", null);
138
- __decorate([
139
- (0, common_2.Logger)('VltzModule.getVltzRoundInfo')
140
- ], VltzModule.prototype, "getVltzRoundInfo", null);
141
- __decorate([
142
- (0, common_2.Logger)('VltzModule.getVltzWalletInfo')
143
- ], VltzModule.prototype, "getVltzWalletInfo", null);
144
- return VltzModule;
145
- }(common_1.RestClient));
146
- exports.default = VltzModule;
147
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/vltz/index.ts"],"names":[],"mappings":"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","sourcesContent":["import {\n executeTransaction,\n MoneyInOutChainId,\n RestClient,\n scale,\n VLTZ_MINTING_DETAILS,\n} from '@reyaxyz/common';\nimport {\n VltzMintResult,\n VltzMintParams,\n VltzRoundInfoResult,\n VltzRoundInfoParams,\n VltzWalletInfoParams,\n VltzWalletInfoResult,\n} from './types';\nimport { Logger, Loggable } from '@reyaxyz/common';\nimport { encodeMint } from './encode';\n\nexport default class VltzModule extends RestClient implements Loggable {\n loggingEnabled: boolean = false;\n\n constructor(apiUrl: string, loggingEnabled: boolean) {\n super(apiUrl);\n this.loggingEnabled = loggingEnabled;\n }\n\n // WRITE\n @Logger('VltzModule.mint')\n async mint(params: VltzMintParams): Promise<VltzMintResult> {\n const network = await params.signer.provider?.getNetwork();\n const chainId: MoneyInOutChainId = Number(network?.chainId);\n const walletAddress = await params.signer.getAddress();\n\n const scaledAllocation = scale(18)(Number(params.allocation)).toString();\n\n if (\n !(\n chainId === MoneyInOutChainId.ethereumSepolia ||\n chainId === MoneyInOutChainId.ethereumMainnet\n )\n ) {\n throw new Error('Network not supported. Switch to Ethereum.');\n }\n\n // if current time (UTC) is past the mint deadline, throw error\n if (params.merkleRoot == VLTZ_MINTING_DETAILS[chainId].rounds[1].root) {\n const deadlineMs =\n VLTZ_MINTING_DETAILS[chainId].rounds[1].mintDeadline * 1000;\n if (Date.now() > deadlineMs) {\n throw new Error('Claim deadline passed');\n }\n }\n\n const { calldata: data, value } = encodeMint(\n walletAddress,\n scaledAllocation,\n params.merkleProof,\n params.merkleRoot,\n );\n\n const result = await executeTransaction(\n params.signer,\n data,\n value,\n chainId,\n params.contractAddress,\n );\n\n return {\n transactionHash: result?.hash || null,\n };\n }\n\n // READ\n @Logger('VltzModule.getVltzRoundInfo')\n async getVltzRoundInfo(params: VltzRoundInfoParams) {\n const uri = `/api/vltz/round/${params.id}`;\n return await this.get<VltzRoundInfoResult>(uri);\n }\n\n @Logger('VltzModule.getVltzWalletInfo')\n async getVltzWalletInfo(params: VltzWalletInfoParams) {\n const uri = `/api/vltz/wallet/${params.address}/${params.roundId}`;\n return await this.get<VltzWalletInfoResult>(uri);\n }\n}\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"/","sources":["modules/vltz/types.ts"],"names":[],"mappings":"","sourcesContent":["import { VltzRoundInfo, VltzWalletInfo } from '@reyaxyz/common';\nimport { Signer } from 'ethers';\n\nexport type VltzMintResult = {\n transactionHash: string | null;\n};\nexport type VltzMintParams = {\n signer: Signer;\n allocation: number;\n merkleRoot: string;\n merkleProof: string[];\n contractAddress: string;\n};\n\nexport type VltzRoundInfoParams = {\n id: string;\n};\n\nexport type VltzRoundInfoResult = VltzRoundInfo;\n\nexport type VltzWalletInfoParams = {\n address: string;\n roundId: string;\n};\n\nexport type VltzWalletInfoResult = VltzWalletInfo;\n"]}
@@ -1,11 +0,0 @@
1
- import { RestClient } from '@reyaxyz/common';
2
- import { SbtMintResult, SbtMintParams, GetSbtMintedParams, GetSbtsInfoResult } from './types';
3
- import { Loggable } from '@reyaxyz/common';
4
- export default class SbtModule extends RestClient implements Loggable {
5
- loggingEnabled: boolean;
6
- constructor(apiUrl: string, loggingEnabled: boolean);
7
- mint(params: SbtMintParams): Promise<SbtMintResult>;
8
- getSbtMintedStatus(params: GetSbtMintedParams): Promise<import("@reyaxyz/common").SbtMintedStatusEntity>;
9
- getSbtsInfo(): Promise<GetSbtsInfoResult>;
10
- }
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/sbt/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,aAAa,EACb,aAAa,EACb,kBAAkB,EAElB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAU,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,UAAW,YAAW,QAAQ;IACnE,cAAc,EAAE,OAAO,CAAS;gBAEpB,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO;IAQ7C,IAAI,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAMnD,kBAAkB,CAAC,MAAM,EAAE,kBAAkB;IAM7C,WAAW;CAIlB"}
@@ -1,23 +0,0 @@
1
- import { SbtMintedStatusEntity } from '@reyaxyz/common';
2
- import { Signer } from 'ethers';
3
- export type SbtMintResult = {
4
- transactionHash: string | null;
5
- };
6
- export type SbtMintParams = {
7
- signer: Signer;
8
- };
9
- export type SignedSbtMintTx = {
10
- signature: string;
11
- deadline: number;
12
- sbtRoot: string;
13
- };
14
- export type GetSbtMintedParams = {
15
- ownerAddress: string;
16
- };
17
- export type GetSbtMintedResult = SbtMintedStatusEntity;
18
- export type GetSbtsInfoResult = {
19
- totalSbts: number;
20
- deadlineMs: number;
21
- newFee: 0.01;
22
- };
23
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/sbt/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,MAAM,aAAa,GAAG;IAC1B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AACF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AAEvD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,IAAI,CAAC;CACd,CAAC"}
@@ -1,3 +0,0 @@
1
- import { MethodParameters } from '@reyaxyz/common';
2
- export declare const encodeMint: (owner: string, allocation: string, proof: string[], merkleRoot: string) => MethodParameters;
3
- //# sourceMappingURL=encode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"encode.d.ts","sourceRoot":"/","sources":["modules/vltz/encode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AA+CnD,eAAO,MAAM,UAAU,UACd,MAAM,cACD,MAAM,SACX,MAAM,EAAE,cACH,MAAM,KACjB,gBAMF,CAAC"}
@@ -1,11 +0,0 @@
1
- import { RestClient } from '@reyaxyz/common';
2
- import { VltzMintResult, VltzMintParams, VltzRoundInfoParams, VltzWalletInfoParams } from './types';
3
- import { Loggable } from '@reyaxyz/common';
4
- export default class VltzModule extends RestClient implements Loggable {
5
- loggingEnabled: boolean;
6
- constructor(apiUrl: string, loggingEnabled: boolean);
7
- mint(params: VltzMintParams): Promise<VltzMintResult>;
8
- getVltzRoundInfo(params: VltzRoundInfoParams): Promise<import("@reyaxyz/common").VltzRoundInfo>;
9
- getVltzWalletInfo(params: VltzWalletInfoParams): Promise<import("@reyaxyz/common").VltzWalletInfo>;
10
- }
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/vltz/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAGX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,cAAc,EACd,cAAc,EAEd,mBAAmB,EACnB,oBAAoB,EAErB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAU,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGnD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,UAAW,YAAW,QAAQ;IACpE,cAAc,EAAE,OAAO,CAAS;gBAEpB,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO;IAO7C,IAAI,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IA+CrD,gBAAgB,CAAC,MAAM,EAAE,mBAAmB;IAM5C,iBAAiB,CAAC,MAAM,EAAE,oBAAoB;CAIrD"}
@@ -1,22 +0,0 @@
1
- import { VltzRoundInfo, VltzWalletInfo } from '@reyaxyz/common';
2
- import { Signer } from 'ethers';
3
- export type VltzMintResult = {
4
- transactionHash: string | null;
5
- };
6
- export type VltzMintParams = {
7
- signer: Signer;
8
- allocation: number;
9
- merkleRoot: string;
10
- merkleProof: string[];
11
- contractAddress: string;
12
- };
13
- export type VltzRoundInfoParams = {
14
- id: string;
15
- };
16
- export type VltzRoundInfoResult = VltzRoundInfo;
17
- export type VltzWalletInfoParams = {
18
- address: string;
19
- roundId: string;
20
- };
21
- export type VltzWalletInfoResult = VltzWalletInfo;
22
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["modules/vltz/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,MAAM,cAAc,GAAG;IAC3B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AACF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAEhD,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC"}
@@ -1,38 +0,0 @@
1
- import { RestClient } from '@reyaxyz/common';
2
- import {
3
- SbtMintResult,
4
- SbtMintParams,
5
- GetSbtMintedParams,
6
- GetSbtMintedResult,
7
- GetSbtsInfoResult,
8
- } from './types';
9
- import { Logger, Loggable } from '@reyaxyz/common';
10
-
11
- export default class SbtModule extends RestClient implements Loggable {
12
- loggingEnabled: boolean = false;
13
-
14
- constructor(apiUrl: string, loggingEnabled: boolean) {
15
- super(apiUrl);
16
- this.loggingEnabled = loggingEnabled;
17
- }
18
-
19
- // WRITE
20
- @Logger('SbtModule.mint')
21
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
22
- async mint(params: SbtMintParams): Promise<SbtMintResult> {
23
- throw new Error('Unimplemented.');
24
- }
25
-
26
- // READ
27
- @Logger('SbtModule.getSbtMintedStatus')
28
- async getSbtMintedStatus(params: GetSbtMintedParams) {
29
- const uri = `/api/sbt/mint-status/owner/${params.ownerAddress}/tokenCount/0`;
30
- return this.get<GetSbtMintedResult>(uri);
31
- }
32
-
33
- @Logger('SbtModule.getSbtsInfo')
34
- async getSbtsInfo() {
35
- const uri = `/api/sbt/info`;
36
- return this.get<GetSbtsInfoResult>(uri);
37
- }
38
- }
@@ -1,26 +0,0 @@
1
- import { SbtMintedStatusEntity } from '@reyaxyz/common';
2
- import { Signer } from 'ethers';
3
-
4
- export type SbtMintResult = {
5
- transactionHash: string | null;
6
- };
7
- export type SbtMintParams = {
8
- signer: Signer;
9
- };
10
-
11
- export type SignedSbtMintTx = {
12
- signature: string;
13
- deadline: number;
14
- sbtRoot: string;
15
- };
16
-
17
- export type GetSbtMintedParams = {
18
- ownerAddress: string;
19
- };
20
- export type GetSbtMintedResult = SbtMintedStatusEntity;
21
-
22
- export type GetSbtsInfoResult = {
23
- totalSbts: number;
24
- deadlineMs: number;
25
- newFee: 0.01;
26
- };
@@ -1,59 +0,0 @@
1
- import { MethodParameters } from '@reyaxyz/common';
2
- import { Interface } from 'ethers';
3
-
4
- const abi = [
5
- {
6
- type: 'function',
7
- name: 'mint',
8
- inputs: [
9
- {
10
- name: 'leafInfo',
11
- type: 'tuple',
12
- internalType: 'struct LeafInfo',
13
- components: [
14
- {
15
- name: 'owner',
16
- type: 'address',
17
- internalType: 'address',
18
- },
19
- {
20
- name: 'allocation',
21
- type: 'uint256',
22
- internalType: 'uint256',
23
- },
24
- ],
25
- },
26
- {
27
- name: 'proof',
28
- type: 'bytes32[]',
29
- internalType: 'bytes32[]',
30
- },
31
- {
32
- name: 'merkleRoot',
33
- type: 'bytes32',
34
- internalType: 'bytes32',
35
- },
36
- ],
37
- outputs: [
38
- {
39
- name: '',
40
- type: 'uint256',
41
- internalType: 'uint256',
42
- },
43
- ],
44
- stateMutability: 'nonpayable',
45
- },
46
- ];
47
-
48
- export const encodeMint = (
49
- owner: string,
50
- allocation: string,
51
- proof: string[],
52
- merkleRoot: string,
53
- ): MethodParameters => {
54
- const functionSignature = 'mint';
55
- const parameters = [{ owner, allocation }, proof, merkleRoot];
56
- const INTERFACE = new Interface(abi);
57
- const calldata = INTERFACE.encodeFunctionData(functionSignature, parameters);
58
- return { calldata: calldata, value: BigInt(0).toString(10) };
59
- };
@@ -1,86 +0,0 @@
1
- import {
2
- executeTransaction,
3
- MoneyInOutChainId,
4
- RestClient,
5
- scale,
6
- VLTZ_MINTING_DETAILS,
7
- } from '@reyaxyz/common';
8
- import {
9
- VltzMintResult,
10
- VltzMintParams,
11
- VltzRoundInfoResult,
12
- VltzRoundInfoParams,
13
- VltzWalletInfoParams,
14
- VltzWalletInfoResult,
15
- } from './types';
16
- import { Logger, Loggable } from '@reyaxyz/common';
17
- import { encodeMint } from './encode';
18
-
19
- export default class VltzModule extends RestClient implements Loggable {
20
- loggingEnabled: boolean = false;
21
-
22
- constructor(apiUrl: string, loggingEnabled: boolean) {
23
- super(apiUrl);
24
- this.loggingEnabled = loggingEnabled;
25
- }
26
-
27
- // WRITE
28
- @Logger('VltzModule.mint')
29
- async mint(params: VltzMintParams): Promise<VltzMintResult> {
30
- const network = await params.signer.provider?.getNetwork();
31
- const chainId: MoneyInOutChainId = Number(network?.chainId);
32
- const walletAddress = await params.signer.getAddress();
33
-
34
- const scaledAllocation = scale(18)(Number(params.allocation)).toString();
35
-
36
- if (
37
- !(
38
- chainId === MoneyInOutChainId.ethereumSepolia ||
39
- chainId === MoneyInOutChainId.ethereumMainnet
40
- )
41
- ) {
42
- throw new Error('Network not supported. Switch to Ethereum.');
43
- }
44
-
45
- // if current time (UTC) is past the mint deadline, throw error
46
- if (params.merkleRoot == VLTZ_MINTING_DETAILS[chainId].rounds[1].root) {
47
- const deadlineMs =
48
- VLTZ_MINTING_DETAILS[chainId].rounds[1].mintDeadline * 1000;
49
- if (Date.now() > deadlineMs) {
50
- throw new Error('Claim deadline passed');
51
- }
52
- }
53
-
54
- const { calldata: data, value } = encodeMint(
55
- walletAddress,
56
- scaledAllocation,
57
- params.merkleProof,
58
- params.merkleRoot,
59
- );
60
-
61
- const result = await executeTransaction(
62
- params.signer,
63
- data,
64
- value,
65
- chainId,
66
- params.contractAddress,
67
- );
68
-
69
- return {
70
- transactionHash: result?.hash || null,
71
- };
72
- }
73
-
74
- // READ
75
- @Logger('VltzModule.getVltzRoundInfo')
76
- async getVltzRoundInfo(params: VltzRoundInfoParams) {
77
- const uri = `/api/vltz/round/${params.id}`;
78
- return await this.get<VltzRoundInfoResult>(uri);
79
- }
80
-
81
- @Logger('VltzModule.getVltzWalletInfo')
82
- async getVltzWalletInfo(params: VltzWalletInfoParams) {
83
- const uri = `/api/vltz/wallet/${params.address}/${params.roundId}`;
84
- return await this.get<VltzWalletInfoResult>(uri);
85
- }
86
- }
@@ -1,26 +0,0 @@
1
- import { VltzRoundInfo, VltzWalletInfo } from '@reyaxyz/common';
2
- import { Signer } from 'ethers';
3
-
4
- export type VltzMintResult = {
5
- transactionHash: string | null;
6
- };
7
- export type VltzMintParams = {
8
- signer: Signer;
9
- allocation: number;
10
- merkleRoot: string;
11
- merkleProof: string[];
12
- contractAddress: string;
13
- };
14
-
15
- export type VltzRoundInfoParams = {
16
- id: string;
17
- };
18
-
19
- export type VltzRoundInfoResult = VltzRoundInfo;
20
-
21
- export type VltzWalletInfoParams = {
22
- address: string;
23
- roundId: string;
24
- };
25
-
26
- export type VltzWalletInfoResult = VltzWalletInfo;