@townsq/mm-sdk 1.7.0 → 1.9.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 (33) hide show
  1. package/dist/chains/evm/common/constant/tokens.js +16 -0
  2. package/dist/chains/evm/common/constant/tokens.js.map +1 -1
  3. package/dist/chains/evm/common/types/module.d.ts +7 -0
  4. package/dist/chains/evm/common/utils/events.d.ts +25 -0
  5. package/dist/chains/evm/common/utils/events.js +132 -0
  6. package/dist/chains/evm/common/utils/events.js.map +1 -0
  7. package/dist/chains/evm/hub/constants/chain.js +29 -0
  8. package/dist/chains/evm/hub/constants/chain.js.map +1 -1
  9. package/dist/chains/evm/hub/modules/ts-hub-loan.js +1 -1
  10. package/dist/chains/evm/hub/modules/ts-hub-loan.js.map +1 -1
  11. package/dist/common/constants/chain.js +20 -0
  12. package/dist/common/constants/chain.js.map +1 -1
  13. package/dist/common/constants/pool.d.ts +2 -0
  14. package/dist/common/constants/pool.js +2 -0
  15. package/dist/common/constants/pool.js.map +1 -1
  16. package/dist/common/types/token.d.ts +2 -0
  17. package/dist/common/types/token.js +2 -0
  18. package/dist/common/types/token.js.map +1 -1
  19. package/dist/lifeline/modules/ts-account.js.map +1 -1
  20. package/dist/lifeline/modules/ts-loan.d.ts +4 -2
  21. package/dist/lifeline/modules/ts-loan.js +7 -2
  22. package/dist/lifeline/modules/ts-loan.js.map +1 -1
  23. package/package.json +3 -1
  24. package/src/chains/evm/common/constant/tokens.ts +16 -1
  25. package/src/chains/evm/common/types/module.ts +8 -0
  26. package/src/chains/evm/{hub → common}/utils/events.ts +39 -2
  27. package/src/chains/evm/hub/constants/chain.ts +60 -25
  28. package/src/chains/evm/hub/modules/ts-hub-loan.ts +2 -1
  29. package/src/common/constants/chain.ts +68 -36
  30. package/src/common/constants/pool.ts +2 -0
  31. package/src/common/types/token.ts +3 -0
  32. package/src/lifeline/modules/ts-account.ts +3 -0
  33. package/src/lifeline/modules/ts-loan.ts +94 -84
@@ -64,16 +64,16 @@ export const SPOKE_CHAIN: Record<
64
64
  tsChainId: TS_CHAIN_ID.MONAD,
65
65
  spokeOperationAddress: convertToGenericAddress(
66
66
  '0x63cb1cf5accbcc57e0cca047be9673ea5022b8db' as EvmAddress,
67
- ChainType.EVM
67
+ ChainType.EVM,
68
68
  ),
69
69
  messageDispatcherAddress: convertToGenericAddress(
70
70
  '0xb4a545a183bd072548ddfe9ddadc2c6f962ac14f' as EvmAddress,
71
- ChainType.EVM
71
+ ChainType.EVM,
72
72
  ),
73
73
  adapters: {
74
74
  [AdapterType.HUB]: convertToGenericAddress(
75
75
  '0x2970fde6064178d51d961689cb5b64226ab11fc2' as EvmAddress,
76
- ChainType.EVM
76
+ ChainType.EVM,
77
77
  ),
78
78
  },
79
79
  tokens: {
@@ -86,7 +86,7 @@ export const SPOKE_CHAIN: Record<
86
86
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.MON],
87
87
  spokeAddress: convertToGenericAddress(
88
88
  '0x0392354326960f891926835eedab127766b21668' as EvmAddress,
89
- ChainType.EVM
89
+ ChainType.EVM,
90
90
  ),
91
91
  },
92
92
  [MAINNET_TS_TOKEN_ID.wMON]: {
@@ -94,7 +94,7 @@ export const SPOKE_CHAIN: Record<
94
94
  type: TokenType.ERC20,
95
95
  address: convertToGenericAddress(
96
96
  '0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A' as EvmAddress,
97
- ChainType.EVM
97
+ ChainType.EVM,
98
98
  ),
99
99
  decimals: 18,
100
100
  },
@@ -102,7 +102,7 @@ export const SPOKE_CHAIN: Record<
102
102
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.wMON],
103
103
  spokeAddress: convertToGenericAddress(
104
104
  '0xa2B1AC2Bb0a6Ad5E74D74F8809A2F935813d273a' as EvmAddress,
105
- ChainType.EVM
105
+ ChainType.EVM,
106
106
  ),
107
107
  },
108
108
  [MAINNET_TS_TOKEN_ID.USDC]: {
@@ -110,7 +110,7 @@ export const SPOKE_CHAIN: Record<
110
110
  type: TokenType.ERC20,
111
111
  address: convertToGenericAddress(
112
112
  '0x754704Bc059F8C67012fEd69BC8A327a5aafb603' as EvmAddress,
113
- ChainType.EVM
113
+ ChainType.EVM,
114
114
  ),
115
115
  decimals: 6,
116
116
  },
@@ -118,7 +118,7 @@ export const SPOKE_CHAIN: Record<
118
118
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.USDC],
119
119
  spokeAddress: convertToGenericAddress(
120
120
  '0xa457235b68606a7921b7c525d92e9592e793b4c0' as EvmAddress,
121
- ChainType.EVM
121
+ ChainType.EVM,
122
122
  ),
123
123
  },
124
124
  [MAINNET_TS_TOKEN_ID.AZND]: {
@@ -126,7 +126,7 @@ export const SPOKE_CHAIN: Record<
126
126
  type: TokenType.ERC20,
127
127
  address: convertToGenericAddress(
128
128
  '0x4917a5ec9fCb5e10f47CBB197aBe6aB63be81fE8' as EvmAddress,
129
- ChainType.EVM
129
+ ChainType.EVM,
130
130
  ),
131
131
  decimals: 18,
132
132
  },
@@ -134,7 +134,7 @@ export const SPOKE_CHAIN: Record<
134
134
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.AZND],
135
135
  spokeAddress: convertToGenericAddress(
136
136
  '0x21883c045311fc211dcb102280857cacd6cd11a0' as EvmAddress,
137
- ChainType.EVM
137
+ ChainType.EVM,
138
138
  ),
139
139
  },
140
140
  [MAINNET_TS_TOKEN_ID.muBOND]: {
@@ -142,7 +142,7 @@ export const SPOKE_CHAIN: Record<
142
142
  type: TokenType.ERC20,
143
143
  address: convertToGenericAddress(
144
144
  '0x336D414754967C6682B5A665C7DAF6F1409E63e8' as EvmAddress,
145
- ChainType.EVM
145
+ ChainType.EVM,
146
146
  ),
147
147
  decimals: 18,
148
148
  },
@@ -150,7 +150,7 @@ export const SPOKE_CHAIN: Record<
150
150
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.muBOND],
151
151
  spokeAddress: convertToGenericAddress(
152
152
  '0x65602dbA7c8C8bC9c64a0Dea9aC80d173998fEaa' as EvmAddress,
153
- ChainType.EVM
153
+ ChainType.EVM,
154
154
  ),
155
155
  },
156
156
  [MAINNET_TS_TOKEN_ID.AUSD]: {
@@ -158,7 +158,7 @@ export const SPOKE_CHAIN: Record<
158
158
  type: TokenType.ERC20,
159
159
  address: convertToGenericAddress(
160
160
  '0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a' as EvmAddress,
161
- ChainType.EVM
161
+ ChainType.EVM,
162
162
  ),
163
163
  decimals: 6,
164
164
  },
@@ -166,7 +166,7 @@ export const SPOKE_CHAIN: Record<
166
166
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.AUSD],
167
167
  spokeAddress: convertToGenericAddress(
168
168
  '0xbf97097a38af76416c1e67fa072bdfde080241cd' as EvmAddress,
169
- ChainType.EVM
169
+ ChainType.EVM,
170
170
  ),
171
171
  },
172
172
  [MAINNET_TS_TOKEN_ID.earnAUSD]: {
@@ -174,7 +174,7 @@ export const SPOKE_CHAIN: Record<
174
174
  type: TokenType.ERC20,
175
175
  address: convertToGenericAddress(
176
176
  '0x103222f020e98Bba0AD9809A011FDF8e6F067496' as EvmAddress,
177
- ChainType.EVM
177
+ ChainType.EVM,
178
178
  ),
179
179
  decimals: 6,
180
180
  },
@@ -182,7 +182,7 @@ export const SPOKE_CHAIN: Record<
182
182
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.earnAUSD],
183
183
  spokeAddress: convertToGenericAddress(
184
184
  '0x184da9d07f5301eeb62b87b5f4f4e65f8114f0fd' as EvmAddress,
185
- ChainType.EVM
185
+ ChainType.EVM,
186
186
  ),
187
187
  },
188
188
  [MAINNET_TS_TOKEN_ID.IoAZND]: {
@@ -190,7 +190,7 @@ export const SPOKE_CHAIN: Record<
190
190
  type: TokenType.ERC20,
191
191
  address: convertToGenericAddress(
192
192
  '0x9c82eB49B51F7Dc61e22Ff347931CA32aDc6cd90' as EvmAddress,
193
- ChainType.EVM
193
+ ChainType.EVM,
194
194
  ),
195
195
  decimals: 18,
196
196
  },
@@ -198,7 +198,7 @@ export const SPOKE_CHAIN: Record<
198
198
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.IoAZND],
199
199
  spokeAddress: convertToGenericAddress(
200
200
  '0x1defe62f5455538ec89b80ccd9c55f9e5df29d31' as EvmAddress,
201
- ChainType.EVM
201
+ ChainType.EVM,
202
202
  ),
203
203
  },
204
204
  [MAINNET_TS_TOKEN_ID.USD1]: {
@@ -206,7 +206,7 @@ export const SPOKE_CHAIN: Record<
206
206
  type: TokenType.ERC20,
207
207
  address: convertToGenericAddress(
208
208
  '0x111111d2bf19e43C34263401e0CAd979eD1cdb61' as EvmAddress,
209
- ChainType.EVM
209
+ ChainType.EVM,
210
210
  ),
211
211
  decimals: 6,
212
212
  },
@@ -214,7 +214,7 @@ export const SPOKE_CHAIN: Record<
214
214
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.USD1],
215
215
  spokeAddress: convertToGenericAddress(
216
216
  '0x2d8bbbd148fb36ec7802fb5b3aa5e12c1611026a' as EvmAddress,
217
- ChainType.EVM
217
+ ChainType.EVM,
218
218
  ),
219
219
  },
220
220
  [MAINNET_TS_TOKEN_ID.WETH]: {
@@ -222,7 +222,7 @@ export const SPOKE_CHAIN: Record<
222
222
  type: TokenType.ERC20,
223
223
  address: convertToGenericAddress(
224
224
  '0xEE8c0E9f1BFFb4Eb878d8f15f368A02a35481242' as EvmAddress,
225
- ChainType.EVM
225
+ ChainType.EVM,
226
226
  ),
227
227
  decimals: 18,
228
228
  },
@@ -230,7 +230,7 @@ export const SPOKE_CHAIN: Record<
230
230
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.WETH],
231
231
  spokeAddress: convertToGenericAddress(
232
232
  '0xd75c4342d1f5bfd3eaaf4c7b39cda9aa8f64ab9c' as EvmAddress,
233
- ChainType.EVM
233
+ ChainType.EVM,
234
234
  ),
235
235
  },
236
236
  [MAINNET_TS_TOKEN_ID.WBTC]: {
@@ -238,7 +238,7 @@ export const SPOKE_CHAIN: Record<
238
238
  type: TokenType.ERC20,
239
239
  address: convertToGenericAddress(
240
240
  '0x0555E30da8f98308EdB960aa94C0Db47230d2B9c' as EvmAddress,
241
- ChainType.EVM
241
+ ChainType.EVM,
242
242
  ),
243
243
  decimals: 8,
244
244
  },
@@ -246,7 +246,7 @@ export const SPOKE_CHAIN: Record<
246
246
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.WBTC],
247
247
  spokeAddress: convertToGenericAddress(
248
248
  '0x9f9524c49330d23e088953842c34759f795fd4e9' as EvmAddress,
249
- ChainType.EVM
249
+ ChainType.EVM,
250
250
  ),
251
251
  },
252
252
  [MAINNET_TS_TOKEN_ID.sMON]: {
@@ -254,7 +254,7 @@ export const SPOKE_CHAIN: Record<
254
254
  type: TokenType.ERC20,
255
255
  address: convertToGenericAddress(
256
256
  '0xA3227C5969757783154C60bF0bC1944180ed81B9' as EvmAddress,
257
- ChainType.EVM
257
+ ChainType.EVM,
258
258
  ),
259
259
  decimals: 18,
260
260
  },
@@ -262,7 +262,7 @@ export const SPOKE_CHAIN: Record<
262
262
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.sMON],
263
263
  spokeAddress: convertToGenericAddress(
264
264
  '0x4461d789d599fe1f89936ecbcb9ae11bf1ee6440' as EvmAddress,
265
- ChainType.EVM
265
+ ChainType.EVM,
266
266
  ),
267
267
  },
268
268
  [MAINNET_TS_TOKEN_ID.shMON]: {
@@ -270,7 +270,7 @@ export const SPOKE_CHAIN: Record<
270
270
  type: TokenType.ERC20,
271
271
  address: convertToGenericAddress(
272
272
  '0x1B68626dCa36c7fE922fD2d55E4f631d962dE19c' as EvmAddress,
273
- ChainType.EVM
273
+ ChainType.EVM,
274
274
  ),
275
275
  decimals: 18,
276
276
  },
@@ -278,7 +278,7 @@ export const SPOKE_CHAIN: Record<
278
278
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.shMON],
279
279
  spokeAddress: convertToGenericAddress(
280
280
  '0x359c20164d7b64310e376de609ee511ab49185cf' as EvmAddress,
281
- ChainType.EVM
281
+ ChainType.EVM,
282
282
  ),
283
283
  },
284
284
  [MAINNET_TS_TOKEN_ID.gMON]: {
@@ -286,7 +286,7 @@ export const SPOKE_CHAIN: Record<
286
286
  type: TokenType.ERC20,
287
287
  address: convertToGenericAddress(
288
288
  '0x8498312A6B3CbD158bf0c93AbdCF29E6e4F55081' as EvmAddress,
289
- ChainType.EVM
289
+ ChainType.EVM,
290
290
  ),
291
291
  decimals: 18,
292
292
  },
@@ -294,7 +294,7 @@ export const SPOKE_CHAIN: Record<
294
294
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.gMON],
295
295
  spokeAddress: convertToGenericAddress(
296
296
  '0xc4bcdf95ad95ed26258e167c95c87c73efdfb2aa' as EvmAddress,
297
- ChainType.EVM
297
+ ChainType.EVM,
298
298
  ),
299
299
  },
300
300
  [MAINNET_TS_TOKEN_ID.aprMON]: {
@@ -302,7 +302,7 @@ export const SPOKE_CHAIN: Record<
302
302
  type: TokenType.ERC20,
303
303
  address: convertToGenericAddress(
304
304
  '0x0c65A0BC65a5D819235B71F554D210D3F80E0852' as EvmAddress,
305
- ChainType.EVM
305
+ ChainType.EVM,
306
306
  ),
307
307
  decimals: 18,
308
308
  },
@@ -310,7 +310,7 @@ export const SPOKE_CHAIN: Record<
310
310
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.aprMON],
311
311
  spokeAddress: convertToGenericAddress(
312
312
  '0xb1a54ea5f0c700454bce454144fb8e6e6254a3c7' as EvmAddress,
313
- ChainType.EVM
313
+ ChainType.EVM,
314
314
  ),
315
315
  },
316
316
  [MAINNET_TS_TOKEN_ID.USDT]: {
@@ -318,7 +318,7 @@ export const SPOKE_CHAIN: Record<
318
318
  type: TokenType.ERC20,
319
319
  address: convertToGenericAddress(
320
320
  '0xe7cd86e13AC4309349F30B3435a9d337750fC82D' as EvmAddress,
321
- ChainType.EVM
321
+ ChainType.EVM,
322
322
  ),
323
323
  decimals: 6,
324
324
  },
@@ -326,7 +326,7 @@ export const SPOKE_CHAIN: Record<
326
326
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.USDT],
327
327
  spokeAddress: convertToGenericAddress(
328
328
  '0x228589575b37d594a5e973f6558a26620a89f1ba' as EvmAddress,
329
- ChainType.EVM
329
+ ChainType.EVM,
330
330
  ),
331
331
  },
332
332
  [MAINNET_TS_TOKEN_ID.sAUSD]: {
@@ -334,7 +334,7 @@ export const SPOKE_CHAIN: Record<
334
334
  type: TokenType.ERC20,
335
335
  address: convertToGenericAddress(
336
336
  '0xD793c04B87386A6bb84ee61D98e0065FdE7fdA5E' as EvmAddress,
337
- ChainType.EVM
337
+ ChainType.EVM,
338
338
  ),
339
339
  decimals: 6,
340
340
  },
@@ -342,7 +342,39 @@ export const SPOKE_CHAIN: Record<
342
342
  poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.sAUSD],
343
343
  spokeAddress: convertToGenericAddress(
344
344
  '0xd3ed6ecdbb9ba63c5771c5281da32526c52512ab' as EvmAddress,
345
- ChainType.EVM
345
+ ChainType.EVM,
346
+ ),
347
+ },
348
+ [MAINNET_TS_TOKEN_ID.syzUSD]: {
349
+ token: {
350
+ type: TokenType.ERC20,
351
+ address: convertToGenericAddress(
352
+ '0x484be0540aD49f351eaa04eeB35dF0f937D4E73f' as EvmAddress,
353
+ ChainType.EVM,
354
+ ),
355
+ decimals: 18,
356
+ },
357
+ TsTokenId: MAINNET_TS_TOKEN_ID.syzUSD,
358
+ poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.syzUSD],
359
+ spokeAddress: convertToGenericAddress(
360
+ '0x51e3ad34d58e568c5250d3a0e61b3ef4ffef36b1' as EvmAddress,
361
+ ChainType.EVM,
362
+ ),
363
+ },
364
+ [MAINNET_TS_TOKEN_ID.yzUSD]: {
365
+ token: {
366
+ type: TokenType.ERC20,
367
+ address: convertToGenericAddress(
368
+ '0x9dcB0D17eDDE04D27F387c89fECb78654C373858' as EvmAddress,
369
+ ChainType.EVM,
370
+ ),
371
+ decimals: 18,
372
+ },
373
+ TsTokenId: MAINNET_TS_TOKEN_ID.yzUSD,
374
+ poolId: MAINNET_POOLS[MAINNET_TS_TOKEN_ID.yzUSD],
375
+ spokeAddress: convertToGenericAddress(
376
+ '0x6caafd3a8ddec6ef4e528f6285ac9b7db755a3c0' as EvmAddress,
377
+ ChainType.EVM,
346
378
  ),
347
379
  },
348
380
  },
@@ -23,6 +23,8 @@ export const MAINNET_POOLS = {
23
23
  [MAINNET_TS_TOKEN_ID.USDT]: 20,
24
24
  [MAINNET_TS_TOKEN_ID.sAUSD]: 21,
25
25
  [MAINNET_TS_TOKEN_ID.IoAZND]: 17,
26
+ [MAINNET_TS_TOKEN_ID.syzUSD]: 25,
27
+ [MAINNET_TS_TOKEN_ID.yzUSD]: 24,
26
28
  } as const satisfies Record<MainnetTsTokenId, number>;
27
29
 
28
30
  const MAINNET_TS_TOKEN_IDS_FROM_POOL = Object.fromEntries(
@@ -19,6 +19,9 @@ export const MAINNET_TS_TOKEN_ID = {
19
19
  gMON: 'gMON',
20
20
  sMON: 'sMON',
21
21
  USDT: 'USDT',
22
+ yzUSD:'yzUSD',
23
+ syzUSD:'syzUSD'
24
+
22
25
  } as const;
23
26
  export type MainnetTsTokenId =
24
27
  (typeof MAINNET_TS_TOKEN_ID)[keyof typeof MAINNET_TS_TOKEN_ID];
@@ -40,6 +40,8 @@ import {
40
40
  PrepareInviteAddressCall,
41
41
  PrepareUnregisterAddressCall,
42
42
  } from '../../common/types/module.js';
43
+
44
+
43
45
  export const prepare = {
44
46
  async createAccount(
45
47
  nonce: Nonce,
@@ -417,4 +419,5 @@ export const read = {
417
419
  tsChainIds
418
420
  );
419
421
  },
422
+
420
423
  };