@mantle-rwa/sdk 0.1.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 (79) hide show
  1. package/dist/cjs/client.js +198 -0
  2. package/dist/cjs/client.js.map +1 -0
  3. package/dist/cjs/constants/index.js +211 -0
  4. package/dist/cjs/constants/index.js.map +1 -0
  5. package/dist/cjs/errors/index.js +218 -0
  6. package/dist/cjs/errors/index.js.map +1 -0
  7. package/dist/cjs/index.js +51 -0
  8. package/dist/cjs/index.js.map +1 -0
  9. package/dist/cjs/modules/compliance.js +202 -0
  10. package/dist/cjs/modules/compliance.js.map +1 -0
  11. package/dist/cjs/modules/index.js +18 -0
  12. package/dist/cjs/modules/index.js.map +1 -0
  13. package/dist/cjs/modules/kyc.js +278 -0
  14. package/dist/cjs/modules/kyc.js.map +1 -0
  15. package/dist/cjs/modules/token.js +365 -0
  16. package/dist/cjs/modules/token.js.map +1 -0
  17. package/dist/cjs/modules/yield.js +406 -0
  18. package/dist/cjs/modules/yield.js.map +1 -0
  19. package/dist/cjs/package.json +3 -0
  20. package/dist/cjs/types/index.js +20 -0
  21. package/dist/cjs/types/index.js.map +1 -0
  22. package/dist/cjs/utils/index.js +206 -0
  23. package/dist/cjs/utils/index.js.map +1 -0
  24. package/dist/esm/client.js +194 -0
  25. package/dist/esm/client.js.map +1 -0
  26. package/dist/esm/constants/index.js +208 -0
  27. package/dist/esm/constants/index.js.map +1 -0
  28. package/dist/esm/errors/index.js +209 -0
  29. package/dist/esm/errors/index.js.map +1 -0
  30. package/dist/esm/index.js +17 -0
  31. package/dist/esm/index.js.map +1 -0
  32. package/dist/esm/modules/compliance.js +198 -0
  33. package/dist/esm/modules/compliance.js.map +1 -0
  34. package/dist/esm/modules/index.js +8 -0
  35. package/dist/esm/modules/index.js.map +1 -0
  36. package/dist/esm/modules/kyc.js +273 -0
  37. package/dist/esm/modules/kyc.js.map +1 -0
  38. package/dist/esm/modules/token.js +360 -0
  39. package/dist/esm/modules/token.js.map +1 -0
  40. package/dist/esm/modules/yield.js +401 -0
  41. package/dist/esm/modules/yield.js.map +1 -0
  42. package/dist/esm/types/index.js +17 -0
  43. package/dist/esm/types/index.js.map +1 -0
  44. package/dist/esm/utils/index.js +188 -0
  45. package/dist/esm/utils/index.js.map +1 -0
  46. package/dist/types/client.d.ts +93 -0
  47. package/dist/types/client.d.ts.map +1 -0
  48. package/dist/types/constants/index.d.ts +83 -0
  49. package/dist/types/constants/index.d.ts.map +1 -0
  50. package/dist/types/errors/index.d.ts +83 -0
  51. package/dist/types/errors/index.d.ts.map +1 -0
  52. package/dist/types/index.d.ts +13 -0
  53. package/dist/types/index.d.ts.map +1 -0
  54. package/dist/types/modules/compliance.d.ts +29 -0
  55. package/dist/types/modules/compliance.d.ts.map +1 -0
  56. package/dist/types/modules/index.d.ts +8 -0
  57. package/dist/types/modules/index.d.ts.map +1 -0
  58. package/dist/types/modules/kyc.d.ts +131 -0
  59. package/dist/types/modules/kyc.d.ts.map +1 -0
  60. package/dist/types/modules/token.d.ts +145 -0
  61. package/dist/types/modules/token.d.ts.map +1 -0
  62. package/dist/types/modules/yield.d.ts +143 -0
  63. package/dist/types/modules/yield.d.ts.map +1 -0
  64. package/dist/types/types/index.d.ts +254 -0
  65. package/dist/types/types/index.d.ts.map +1 -0
  66. package/dist/types/utils/index.d.ts +80 -0
  67. package/dist/types/utils/index.d.ts.map +1 -0
  68. package/package.json +52 -0
  69. package/src/client.ts +258 -0
  70. package/src/constants/index.ts +226 -0
  71. package/src/errors/index.ts +291 -0
  72. package/src/index.ts +42 -0
  73. package/src/modules/compliance.ts +252 -0
  74. package/src/modules/index.ts +8 -0
  75. package/src/modules/kyc.ts +446 -0
  76. package/src/modules/token.ts +488 -0
  77. package/src/modules/yield.ts +566 -0
  78. package/src/types/index.ts +326 -0
  79. package/src/utils/index.ts +240 -0
@@ -0,0 +1,365 @@
1
+ "use strict";
2
+ /**
3
+ * TokenModule - Handles RWA token deployment and interactions
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TokenModule = exports.TokenInstance = void 0;
7
+ const ethers_1 = require("ethers");
8
+ const constants_1 = require("../constants");
9
+ const errors_1 = require("../errors");
10
+ const utils_1 = require("../utils");
11
+ /**
12
+ * Instance of a connected RWA token
13
+ */
14
+ class TokenInstance {
15
+ _contract;
16
+ _retries;
17
+ _retryDelay;
18
+ /** Token contract address */
19
+ address;
20
+ constructor(address, provider, signer, retries, retryDelay) {
21
+ this.address = (0, utils_1.normalizeAddress)(address);
22
+ this._retries = retries;
23
+ this._retryDelay = retryDelay;
24
+ this._contract = new ethers_1.ethers.Contract(this.address, constants_1.RWA_TOKEN_ABI, signer || provider);
25
+ }
26
+ /*//////////////////////////////////////////////////////////////
27
+ READ FUNCTIONS
28
+ //////////////////////////////////////////////////////////////*/
29
+ /**
30
+ * Get token name
31
+ */
32
+ async name() {
33
+ return this._contract.name();
34
+ }
35
+ /**
36
+ * Get token symbol
37
+ */
38
+ async symbol() {
39
+ return this._contract.symbol();
40
+ }
41
+ /**
42
+ * Get token decimals
43
+ */
44
+ async decimals() {
45
+ return this._contract.decimals();
46
+ }
47
+ /**
48
+ * Get total supply
49
+ */
50
+ async totalSupply() {
51
+ return this._contract.totalSupply();
52
+ }
53
+ /**
54
+ * Get balance of an account
55
+ */
56
+ async balanceOf(account) {
57
+ return this._contract.balanceOf((0, utils_1.normalizeAddress)(account));
58
+ }
59
+ /**
60
+ * Check if token is paused
61
+ */
62
+ async paused() {
63
+ return this._contract.paused();
64
+ }
65
+ /**
66
+ * Get the KYC registry address
67
+ */
68
+ async kycRegistry() {
69
+ return this._contract.kycRegistry();
70
+ }
71
+ /**
72
+ * Get all compliance modules
73
+ */
74
+ async getComplianceModules() {
75
+ return this._contract.getComplianceModules();
76
+ }
77
+ /**
78
+ * Check if an address is a compliance module
79
+ */
80
+ async isComplianceModule(module) {
81
+ return this._contract.isComplianceModule((0, utils_1.normalizeAddress)(module));
82
+ }
83
+ /**
84
+ * Check if a transfer is allowed
85
+ */
86
+ async isTransferAllowed(from, to, amount) {
87
+ const [allowed, reason] = await this._contract.isTransferAllowed((0, utils_1.normalizeAddress)(from), (0, utils_1.normalizeAddress)(to), (0, utils_1.parseAmount)(amount));
88
+ return { allowed, reason };
89
+ }
90
+ /**
91
+ * Get token info
92
+ */
93
+ async getInfo() {
94
+ const [name, symbol, decimals, totalSupply, paused] = await Promise.all([
95
+ this.name(),
96
+ this.symbol(),
97
+ this.decimals(),
98
+ this.totalSupply(),
99
+ this.paused(),
100
+ ]);
101
+ return {
102
+ address: this.address,
103
+ name,
104
+ symbol,
105
+ decimals,
106
+ totalSupply,
107
+ paused,
108
+ };
109
+ }
110
+ /**
111
+ * Get balance at a specific snapshot
112
+ */
113
+ async balanceOfAt(account, snapshotId) {
114
+ return this._contract.balanceOfAt((0, utils_1.normalizeAddress)(account), snapshotId);
115
+ }
116
+ /**
117
+ * Get total supply at a specific snapshot
118
+ */
119
+ async totalSupplyAt(snapshotId) {
120
+ return this._contract.totalSupplyAt(snapshotId);
121
+ }
122
+ /*//////////////////////////////////////////////////////////////
123
+ WRITE FUNCTIONS
124
+ //////////////////////////////////////////////////////////////*/
125
+ /**
126
+ * Mint tokens to an address
127
+ */
128
+ async mint(to, amount, options) {
129
+ const toAddress = (0, utils_1.normalizeAddress)(to);
130
+ const amountWei = (0, utils_1.parseAmount)(amount);
131
+ try {
132
+ const tx = await (0, utils_1.retry)(async () => {
133
+ const gasLimit = options?.gasLimit || await (0, utils_1.estimateGasWithBuffer)(() => this._contract.mint.estimateGas(toAddress, amountWei));
134
+ return this._contract.mint(toAddress, amountWei, { gasLimit });
135
+ }, { retries: options?.retries ?? this._retries, delay: options?.retryDelay ?? this._retryDelay });
136
+ const receipt = await tx.wait();
137
+ const events = (0, utils_1.parseEvents)(receipt, this._contract.interface);
138
+ return (0, utils_1.createTransactionResult)(receipt, events);
139
+ }
140
+ catch (error) {
141
+ throw (0, errors_1.parseContractError)(error, this.address, 'mint');
142
+ }
143
+ }
144
+ /**
145
+ * Burn tokens from an address
146
+ */
147
+ async burn(from, amount, options) {
148
+ const fromAddress = (0, utils_1.normalizeAddress)(from);
149
+ const amountWei = (0, utils_1.parseAmount)(amount);
150
+ try {
151
+ const tx = await (0, utils_1.retry)(async () => {
152
+ const gasLimit = options?.gasLimit || await (0, utils_1.estimateGasWithBuffer)(() => this._contract.burn.estimateGas(fromAddress, amountWei));
153
+ return this._contract.burn(fromAddress, amountWei, { gasLimit });
154
+ }, { retries: options?.retries ?? this._retries, delay: options?.retryDelay ?? this._retryDelay });
155
+ const receipt = await tx.wait();
156
+ const events = (0, utils_1.parseEvents)(receipt, this._contract.interface);
157
+ return (0, utils_1.createTransactionResult)(receipt, events);
158
+ }
159
+ catch (error) {
160
+ throw (0, errors_1.parseContractError)(error, this.address, 'burn');
161
+ }
162
+ }
163
+ /**
164
+ * Transfer tokens
165
+ */
166
+ async transfer(to, amount, options) {
167
+ const toAddress = (0, utils_1.normalizeAddress)(to);
168
+ const amountWei = (0, utils_1.parseAmount)(amount);
169
+ try {
170
+ const tx = await (0, utils_1.retry)(async () => {
171
+ const gasLimit = options?.gasLimit || await (0, utils_1.estimateGasWithBuffer)(() => this._contract.transfer.estimateGas(toAddress, amountWei));
172
+ return this._contract.transfer(toAddress, amountWei, { gasLimit });
173
+ }, { retries: options?.retries ?? this._retries, delay: options?.retryDelay ?? this._retryDelay });
174
+ const receipt = await tx.wait();
175
+ const events = (0, utils_1.parseEvents)(receipt, this._contract.interface);
176
+ return (0, utils_1.createTransactionResult)(receipt, events);
177
+ }
178
+ catch (error) {
179
+ throw (0, errors_1.parseContractError)(error, this.address, 'transfer');
180
+ }
181
+ }
182
+ /**
183
+ * Pause token transfers
184
+ */
185
+ async pause(options) {
186
+ try {
187
+ const tx = await (0, utils_1.retry)(async () => {
188
+ const gasLimit = options?.gasLimit || await (0, utils_1.estimateGasWithBuffer)(() => this._contract.pause.estimateGas());
189
+ return this._contract.pause({ gasLimit });
190
+ }, { retries: options?.retries ?? this._retries, delay: options?.retryDelay ?? this._retryDelay });
191
+ const receipt = await tx.wait();
192
+ const events = (0, utils_1.parseEvents)(receipt, this._contract.interface);
193
+ return (0, utils_1.createTransactionResult)(receipt, events);
194
+ }
195
+ catch (error) {
196
+ throw (0, errors_1.parseContractError)(error, this.address, 'pause');
197
+ }
198
+ }
199
+ /**
200
+ * Unpause token transfers
201
+ */
202
+ async unpause(options) {
203
+ try {
204
+ const tx = await (0, utils_1.retry)(async () => {
205
+ const gasLimit = options?.gasLimit || await (0, utils_1.estimateGasWithBuffer)(() => this._contract.unpause.estimateGas());
206
+ return this._contract.unpause({ gasLimit });
207
+ }, { retries: options?.retries ?? this._retries, delay: options?.retryDelay ?? this._retryDelay });
208
+ const receipt = await tx.wait();
209
+ const events = (0, utils_1.parseEvents)(receipt, this._contract.interface);
210
+ return (0, utils_1.createTransactionResult)(receipt, events);
211
+ }
212
+ catch (error) {
213
+ throw (0, errors_1.parseContractError)(error, this.address, 'unpause');
214
+ }
215
+ }
216
+ /**
217
+ * Create a snapshot
218
+ */
219
+ async snapshot(options) {
220
+ try {
221
+ const tx = await (0, utils_1.retry)(async () => {
222
+ const gasLimit = options?.gasLimit || await (0, utils_1.estimateGasWithBuffer)(() => this._contract.snapshot.estimateGas());
223
+ return this._contract.snapshot({ gasLimit });
224
+ }, { retries: options?.retries ?? this._retries, delay: options?.retryDelay ?? this._retryDelay });
225
+ const receipt = await tx.wait();
226
+ const events = (0, utils_1.parseEvents)(receipt, this._contract.interface);
227
+ const result = (0, utils_1.createTransactionResult)(receipt, events);
228
+ // Extract snapshot ID from event
229
+ const snapshotEvent = events.find((e) => e.name === 'Snapshot');
230
+ const snapshotId = snapshotEvent?.args.id || 0n;
231
+ return { result, snapshotId };
232
+ }
233
+ catch (error) {
234
+ throw (0, errors_1.parseContractError)(error, this.address, 'snapshot');
235
+ }
236
+ }
237
+ /**
238
+ * Set the KYC registry
239
+ */
240
+ async setKYCRegistry(registry, options) {
241
+ const registryAddress = (0, utils_1.normalizeAddress)(registry);
242
+ try {
243
+ const tx = await (0, utils_1.retry)(async () => {
244
+ const gasLimit = options?.gasLimit || await (0, utils_1.estimateGasWithBuffer)(() => this._contract.setKYCRegistry.estimateGas(registryAddress));
245
+ return this._contract.setKYCRegistry(registryAddress, { gasLimit });
246
+ }, { retries: options?.retries ?? this._retries, delay: options?.retryDelay ?? this._retryDelay });
247
+ const receipt = await tx.wait();
248
+ const events = (0, utils_1.parseEvents)(receipt, this._contract.interface);
249
+ return (0, utils_1.createTransactionResult)(receipt, events);
250
+ }
251
+ catch (error) {
252
+ throw (0, errors_1.parseContractError)(error, this.address, 'setKYCRegistry');
253
+ }
254
+ }
255
+ /**
256
+ * Add a compliance module
257
+ */
258
+ async addComplianceModule(module, options) {
259
+ const moduleAddress = (0, utils_1.normalizeAddress)(module);
260
+ try {
261
+ const tx = await (0, utils_1.retry)(async () => {
262
+ const gasLimit = options?.gasLimit || await (0, utils_1.estimateGasWithBuffer)(() => this._contract.addComplianceModule.estimateGas(moduleAddress));
263
+ return this._contract.addComplianceModule(moduleAddress, { gasLimit });
264
+ }, { retries: options?.retries ?? this._retries, delay: options?.retryDelay ?? this._retryDelay });
265
+ const receipt = await tx.wait();
266
+ const events = (0, utils_1.parseEvents)(receipt, this._contract.interface);
267
+ return (0, utils_1.createTransactionResult)(receipt, events);
268
+ }
269
+ catch (error) {
270
+ throw (0, errors_1.parseContractError)(error, this.address, 'addComplianceModule');
271
+ }
272
+ }
273
+ /**
274
+ * Remove a compliance module
275
+ */
276
+ async removeComplianceModule(module, options) {
277
+ const moduleAddress = (0, utils_1.normalizeAddress)(module);
278
+ try {
279
+ const tx = await (0, utils_1.retry)(async () => {
280
+ const gasLimit = options?.gasLimit || await (0, utils_1.estimateGasWithBuffer)(() => this._contract.removeComplianceModule.estimateGas(moduleAddress));
281
+ return this._contract.removeComplianceModule(moduleAddress, { gasLimit });
282
+ }, { retries: options?.retries ?? this._retries, delay: options?.retryDelay ?? this._retryDelay });
283
+ const receipt = await tx.wait();
284
+ const events = (0, utils_1.parseEvents)(receipt, this._contract.interface);
285
+ return (0, utils_1.createTransactionResult)(receipt, events);
286
+ }
287
+ catch (error) {
288
+ throw (0, errors_1.parseContractError)(error, this.address, 'removeComplianceModule');
289
+ }
290
+ }
291
+ /*//////////////////////////////////////////////////////////////
292
+ EVENT LISTENERS
293
+ //////////////////////////////////////////////////////////////*/
294
+ /**
295
+ * Listen for Transfer events
296
+ */
297
+ onTransfer(callback) {
298
+ const listener = (from, to, amount) => {
299
+ callback(from, to, amount);
300
+ };
301
+ this._contract.on('Transfer', listener);
302
+ return () => this._contract.off('Transfer', listener);
303
+ }
304
+ /**
305
+ * Listen for TransferRestricted events
306
+ */
307
+ onTransferRestricted(callback) {
308
+ const listener = (from, to, amount, reason) => {
309
+ callback(from, to, amount, reason);
310
+ };
311
+ this._contract.on('TransferRestricted', listener);
312
+ return () => this._contract.off('TransferRestricted', listener);
313
+ }
314
+ /**
315
+ * Listen for Paused events
316
+ */
317
+ onPaused(callback) {
318
+ const listener = (by) => callback(by);
319
+ this._contract.on('TokensPaused', listener);
320
+ return () => this._contract.off('TokensPaused', listener);
321
+ }
322
+ /**
323
+ * Listen for Unpaused events
324
+ */
325
+ onUnpaused(callback) {
326
+ const listener = (by) => callback(by);
327
+ this._contract.on('TokensUnpaused', listener);
328
+ return () => this._contract.off('TokensUnpaused', listener);
329
+ }
330
+ }
331
+ exports.TokenInstance = TokenInstance;
332
+ /**
333
+ * Module for token operations
334
+ */
335
+ class TokenModule {
336
+ _provider;
337
+ _signer;
338
+ _retries;
339
+ _retryDelay;
340
+ constructor(provider, signer, retries, retryDelay) {
341
+ this._provider = provider;
342
+ this._signer = signer;
343
+ this._retries = retries;
344
+ this._retryDelay = retryDelay;
345
+ }
346
+ /**
347
+ * Connect to an existing token contract
348
+ */
349
+ connect(address) {
350
+ if (!(0, utils_1.isValidAddress)(address)) {
351
+ throw new errors_1.RWAError(errors_1.ErrorCode.INVALID_ADDRESS, `Invalid token address: ${address}`);
352
+ }
353
+ return new TokenInstance(address, this._provider, this._signer, this._retries, this._retryDelay);
354
+ }
355
+ /**
356
+ * Estimate gas for deploying a token
357
+ */
358
+ async estimateDeployGas(_config) {
359
+ // This would require the token bytecode which we don't have in the SDK
360
+ // In practice, deployment is done through the factory
361
+ throw new errors_1.RWAError(errors_1.ErrorCode.INVALID_CONFIGURATION, 'Direct token deployment is not supported. Use RWAClient.deployRWASystem() instead.');
362
+ }
363
+ }
364
+ exports.TokenModule = TokenModule;
365
+ //# sourceMappingURL=token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/modules/token.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,mCAA4D;AAO5D,4CAA6C;AAC7C,sCAAoE;AACpE,oCAQkB;AAElB;;GAEG;AACH,MAAa,aAAa;IACL,SAAS,CAAkB;IAC3B,QAAQ,CAAS;IACjB,WAAW,CAAS;IAErC,6BAA6B;IACpB,OAAO,CAAS;IAEzB,YACI,OAAe,EACf,QAAkB,EAClB,MAAqB,EACrB,OAAe,EACf,UAAkB;QAElB,IAAI,CAAC,OAAO,GAAG,IAAA,wBAAgB,EAAC,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAE9B,IAAI,CAAC,SAAS,GAAG,IAAI,eAAM,CAAC,QAAQ,CAChC,IAAI,CAAC,OAAO,EACZ,yBAAa,EACb,MAAM,IAAI,QAAQ,CACrB,CAAC;IACN,CAAC;IAED;;oEAEgE;IAEhE;;OAEG;IACH,KAAK,CAAC,IAAI;QACN,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM;QACR,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;IACnC,CAAC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