@emberai/onchain-actions-registry 3.0.0-next.1 → 3.0.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.
- package/dist/index.cjs +142 -3
- package/dist/index.d.cts +2718 -209
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2718 -209
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +123 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -38
package/dist/index.cjs
CHANGED
|
@@ -359,6 +359,124 @@ const SwapTokensResponseSchema = zod.z.object({
|
|
|
359
359
|
providerTracking: ProviderTrackingInfoSchema.optional()
|
|
360
360
|
});
|
|
361
361
|
|
|
362
|
+
//#endregion
|
|
363
|
+
//#region src/core/schemas/tokenizedYield.ts
|
|
364
|
+
const MintPtAndYtRequestSchema = zod.z.object({
|
|
365
|
+
walletAddress: zod.z.string().describe("User's wallet address"),
|
|
366
|
+
slippage: zod.z.string().describe("Maximum acceptable slippage percentage as a decimal string").default("0.01"),
|
|
367
|
+
inputToken: TokenSchema.describe("Token to be used for minting PT and YT"),
|
|
368
|
+
amount: zod.z.bigint().describe("Amount of input token to be used for minting"),
|
|
369
|
+
marketAddress: zod.z.string().describe("Address of the yield market")
|
|
370
|
+
});
|
|
371
|
+
const MintPtAndYtResponseSchema = zod.z.object({
|
|
372
|
+
exactPtAmount: zod.z.string().describe("Amount of Principal Tokens (PT) minted"),
|
|
373
|
+
displayPtAmount: zod.z.string().describe("Display amount of Principal Tokens (PT) minted"),
|
|
374
|
+
ptTokenIdentifier: TokenIdentifierSchema.describe("Details of the minted Principal Token (PT)"),
|
|
375
|
+
exactYtAmount: zod.z.string().describe("Amount of Yield Tokens (YT) minted"),
|
|
376
|
+
displayYtAmount: zod.z.string().describe("Display amount of Yield Tokens (YT) minted"),
|
|
377
|
+
ytTokenIdentifier: TokenIdentifierSchema.describe("Details of the minted Yield Token (YT)"),
|
|
378
|
+
transactions: zod.z.array(TransactionPlanSchema).describe("Array of transaction plans required to complete the minting process")
|
|
379
|
+
});
|
|
380
|
+
const BuyPtRequestSchema = zod.z.object({
|
|
381
|
+
walletAddress: zod.z.string().describe("User's wallet address"),
|
|
382
|
+
slippage: zod.z.string().describe("Maximum acceptable slippage percentage as a decimal string").default("0.01"),
|
|
383
|
+
inputToken: TokenSchema.describe("Token to be used for minting PT and YT"),
|
|
384
|
+
amount: zod.z.bigint().describe("Amount of input token to be used for minting"),
|
|
385
|
+
marketAddress: zod.z.string().describe("Address of the yield market")
|
|
386
|
+
});
|
|
387
|
+
const BuyPtResponseSchema = zod.z.object({
|
|
388
|
+
exactPtAmount: zod.z.string().describe("Amount of Principal Tokens (PT) minted"),
|
|
389
|
+
displayPtAmount: zod.z.string().describe("Display amount of Principal Tokens (PT) minted"),
|
|
390
|
+
ptTokenIdentifier: TokenIdentifierSchema.describe("Details of the minted Principal Token (PT)"),
|
|
391
|
+
transactions: zod.z.array(TransactionPlanSchema).describe("Array of transaction plans required to complete the minting process")
|
|
392
|
+
});
|
|
393
|
+
const BuyYtRequestSchema = zod.z.object({
|
|
394
|
+
walletAddress: zod.z.string().describe("User's wallet address"),
|
|
395
|
+
slippage: zod.z.string().describe("Maximum acceptable slippage percentage as a decimal string").default("0.01"),
|
|
396
|
+
inputToken: TokenSchema.describe("Token to be used for minting PT and YT"),
|
|
397
|
+
amount: zod.z.bigint().describe("Amount of input token to be used for minting"),
|
|
398
|
+
marketAddress: zod.z.string().describe("Address of the yield market")
|
|
399
|
+
});
|
|
400
|
+
const BuyYtResponseSchema = zod.z.object({
|
|
401
|
+
exactYtAmount: zod.z.string().describe("Amount of Yield Tokens (YT) minted"),
|
|
402
|
+
displayYtAmount: zod.z.string().describe("Display amount of Yield Tokens (YT) minted"),
|
|
403
|
+
ytTokenIdentifier: TokenIdentifierSchema.describe("Details of the minted Yield Token (YT)"),
|
|
404
|
+
transactions: zod.z.array(TransactionPlanSchema).describe("Array of transaction plans required to complete the minting process")
|
|
405
|
+
});
|
|
406
|
+
const SellPtRequestSchema = zod.z.object({
|
|
407
|
+
walletAddress: zod.z.string().describe("User's wallet address"),
|
|
408
|
+
slippage: zod.z.string().describe("Maximum acceptable slippage percentage as a decimal string").default("0.01"),
|
|
409
|
+
ptToken: TokenSchema.describe("Principal Token (PT) to be sold"),
|
|
410
|
+
amount: zod.z.bigint().describe("Amount of Principal Token (PT) to be sold")
|
|
411
|
+
});
|
|
412
|
+
const SellPtResponseSchema = zod.z.object({
|
|
413
|
+
tokenOut: TokenSchema.describe("Details of the token received from selling PT"),
|
|
414
|
+
exactAmountOut: zod.z.string().describe("Exact amount of token received from selling PT"),
|
|
415
|
+
displayAmountOut: zod.z.string().describe("Display amount of token received from selling PT"),
|
|
416
|
+
transactions: zod.z.array(TransactionPlanSchema).describe("Array of transaction plans required to complete the selling process")
|
|
417
|
+
});
|
|
418
|
+
const SellYtRequestSchema = zod.z.object({
|
|
419
|
+
walletAddress: zod.z.string().describe("User's wallet address"),
|
|
420
|
+
slippage: zod.z.string().describe("Maximum acceptable slippage percentage as a decimal string").default("0.01"),
|
|
421
|
+
ytToken: TokenSchema.describe("Yield Token (YT) to be sold"),
|
|
422
|
+
amount: zod.z.bigint().describe("Amount of Yield Token (YT) to be sold")
|
|
423
|
+
});
|
|
424
|
+
const SellYtResponseSchema = zod.z.object({
|
|
425
|
+
tokenOut: TokenSchema.describe("Details of the token received from selling YT"),
|
|
426
|
+
exactAmountOut: zod.z.string().describe("Exact amount of token received from selling YT"),
|
|
427
|
+
displayAmountOut: zod.z.string().describe("Display amount of token received from selling YT"),
|
|
428
|
+
transactions: zod.z.array(TransactionPlanSchema).describe("Array of transaction plans required to complete the selling process")
|
|
429
|
+
});
|
|
430
|
+
const RedeemPtRequestSchema = zod.z.object({
|
|
431
|
+
walletAddress: zod.z.string().describe("User's wallet address"),
|
|
432
|
+
ptToken: TokenSchema.describe("Principal Token (PT) to be redeemed"),
|
|
433
|
+
amount: zod.z.bigint().describe("Amount of Principal Token (PT) to be redeemed")
|
|
434
|
+
});
|
|
435
|
+
const RedeemPtResponseSchema = zod.z.object({
|
|
436
|
+
underlyingTokenIdentifier: TokenIdentifierSchema.describe("Details of the underlying token received upon redemption"),
|
|
437
|
+
exactUnderlyingAmount: zod.z.string().describe("Exact amount of underlying token received"),
|
|
438
|
+
displayUnderlyingAmount: zod.z.string().describe("Display amount of underlying token received"),
|
|
439
|
+
transactions: zod.z.array(TransactionPlanSchema).describe("Array of transaction plans required to complete the redemption process")
|
|
440
|
+
});
|
|
441
|
+
const ClaimRewardsRequestSchema = zod.z.object({
|
|
442
|
+
walletAddress: zod.z.string().describe("User's wallet address"),
|
|
443
|
+
ytToken: TokenSchema.describe("Yield Token (YT) for which to claim rewards")
|
|
444
|
+
});
|
|
445
|
+
const ClaimRewardsResponseSchema = zod.z.object({ transactions: zod.z.array(TransactionPlanSchema).describe("Array of transaction plans required to complete the reward claiming process") });
|
|
446
|
+
const TokenizedYieldMarketSchema = zod.z.object({
|
|
447
|
+
marketIdentifier: TokenIdentifierSchema.describe("Unique identifier for the yield market"),
|
|
448
|
+
ptToken: TokenSchema.describe("Details of the Principal Token (PT)"),
|
|
449
|
+
ytToken: TokenSchema.describe("Details of the Yield Token (YT)"),
|
|
450
|
+
underlyingToken: TokenSchema.describe("Details of the underlying asset token"),
|
|
451
|
+
expiry: zod.z.string().describe("Expiry date of the yield market in ISO 8601 format"),
|
|
452
|
+
details: zod.z.object({})
|
|
453
|
+
});
|
|
454
|
+
const MarketTokenizedYieldRequestSchema = zod.z.object({ chainIds: zod.z.array(zod.z.string().describe("Blockchain network identifier")).describe("List of chain IDs to filter the markets") });
|
|
455
|
+
const MarketTokenizedYieldResponseSchema = zod.z.object({ markets: zod.z.array(TokenizedYieldMarketSchema).describe("Array of tokenized yield markets matching the request criteria") });
|
|
456
|
+
const TokenizedYieldUserPositionSchema = zod.z.object({
|
|
457
|
+
marketIdentifier: TokenIdentifierSchema.describe("Unique identifier for the yield market"),
|
|
458
|
+
pt: zod.z.object({
|
|
459
|
+
token: TokenSchema.describe("Details of the Principal Token (PT) held by the user"),
|
|
460
|
+
exactAmount: zod.z.string().describe("Exact amount of Principal Token (PT) held"),
|
|
461
|
+
displayAmount: zod.z.string().describe("Display amount of Principal Token (PT) held")
|
|
462
|
+
}),
|
|
463
|
+
yt: zod.z.object({
|
|
464
|
+
token: TokenSchema.describe("Details of the Yield Token (YT) held by the user"),
|
|
465
|
+
exactAmount: zod.z.string().describe("Exact amount of Yield Token (YT) held"),
|
|
466
|
+
displayAmount: zod.z.string().describe("Display amount of Yield Token (YT) held"),
|
|
467
|
+
claimableRewards: zod.z.array(zod.z.object({
|
|
468
|
+
token: TokenSchema.describe("Details of the reward token claimable by the user"),
|
|
469
|
+
exactAmount: zod.z.string().describe("Exact amount of reward token claimable"),
|
|
470
|
+
displayAmount: zod.z.string().describe("Display amount of reward token claimable")
|
|
471
|
+
}))
|
|
472
|
+
})
|
|
473
|
+
});
|
|
474
|
+
const TokenizedYieldUserPositionsRequestSchema = zod.z.object({
|
|
475
|
+
walletAddress: zod.z.string().describe("User's wallet address"),
|
|
476
|
+
chainIds: zod.z.array(zod.z.string().describe("Blockchain network identifier")).describe("List of chain IDs to filter the user positions")
|
|
477
|
+
});
|
|
478
|
+
const TokenizedYieldUserPositionsResponseSchema = zod.z.object({ positions: zod.z.array(TokenizedYieldUserPositionSchema).describe("Array of user positions in tokenized yield markets") });
|
|
479
|
+
|
|
362
480
|
//#endregion
|
|
363
481
|
//#region src/aave-lending-plugin/chain.ts
|
|
364
482
|
/**
|
|
@@ -1101,17 +1219,18 @@ var AAVEAdapter = class {
|
|
|
1101
1219
|
});
|
|
1102
1220
|
return (approvalTx ? [approvalTx] : []).concat([tx]);
|
|
1103
1221
|
}
|
|
1104
|
-
|
|
1222
|
+
repayWithATokens(asset, amount_formatted, from, tokenDecimals) {
|
|
1105
1223
|
ethers.ethers.utils.getAddress(asset);
|
|
1106
1224
|
ethers.ethers.utils.getAddress(from);
|
|
1107
1225
|
const bundle = this.getPoolBundle();
|
|
1108
1226
|
const amount = ethers.utils.parseUnits(amount_formatted, tokenDecimals).toString();
|
|
1109
|
-
|
|
1227
|
+
const tx = bundle.repayWithATokensTxBuilder.generateTxData({
|
|
1110
1228
|
user: from,
|
|
1111
1229
|
reserve: asset,
|
|
1112
1230
|
amount,
|
|
1113
1231
|
rateMode: __aave_contract_helpers.InterestRate.Variable
|
|
1114
|
-
})
|
|
1232
|
+
});
|
|
1233
|
+
return Promise.resolve([tx]);
|
|
1115
1234
|
}
|
|
1116
1235
|
async withdraw(asset, amount, to, from) {
|
|
1117
1236
|
ethers.ethers.utils.getAddress(asset);
|
|
@@ -1297,8 +1416,14 @@ function initializePublicRegistry(chainConfigs) {
|
|
|
1297
1416
|
//#endregion
|
|
1298
1417
|
exports.BorrowTokensRequestSchema = BorrowTokensRequestSchema;
|
|
1299
1418
|
exports.BorrowTokensResponseSchema = BorrowTokensResponseSchema;
|
|
1419
|
+
exports.BuyPtRequestSchema = BuyPtRequestSchema;
|
|
1420
|
+
exports.BuyPtResponseSchema = BuyPtResponseSchema;
|
|
1421
|
+
exports.BuyYtRequestSchema = BuyYtRequestSchema;
|
|
1422
|
+
exports.BuyYtResponseSchema = BuyYtResponseSchema;
|
|
1300
1423
|
exports.ChainSchema = ChainSchema;
|
|
1301
1424
|
exports.ChainTypeSchema = ChainTypeSchema;
|
|
1425
|
+
exports.ClaimRewardsRequestSchema = ClaimRewardsRequestSchema;
|
|
1426
|
+
exports.ClaimRewardsResponseSchema = ClaimRewardsResponseSchema;
|
|
1302
1427
|
exports.ClosePerpetualsOrdersRequestSchema = ClosePerpetualsOrdersRequestSchema;
|
|
1303
1428
|
exports.ClosePerpetualsOrdersResponseSchema = ClosePerpetualsOrdersResponseSchema;
|
|
1304
1429
|
exports.CreatePerpetualsPositionRequestSchema = CreatePerpetualsPositionRequestSchema;
|
|
@@ -1324,6 +1449,10 @@ exports.LiquidityPositionRangeSchema = LiquidityPositionRangeSchema;
|
|
|
1324
1449
|
exports.LiquidityPositionSchema = LiquidityPositionSchema;
|
|
1325
1450
|
exports.LiquidityProvisionRangeSchema = LiquidityProvisionRangeSchema;
|
|
1326
1451
|
exports.LiquiditySuppliedTokenSchema = LiquiditySuppliedTokenSchema;
|
|
1452
|
+
exports.MarketTokenizedYieldRequestSchema = MarketTokenizedYieldRequestSchema;
|
|
1453
|
+
exports.MarketTokenizedYieldResponseSchema = MarketTokenizedYieldResponseSchema;
|
|
1454
|
+
exports.MintPtAndYtRequestSchema = MintPtAndYtRequestSchema;
|
|
1455
|
+
exports.MintPtAndYtResponseSchema = MintPtAndYtResponseSchema;
|
|
1327
1456
|
exports.OrderSchema = OrderSchema;
|
|
1328
1457
|
exports.OrderTypeSchema = OrderTypeSchema;
|
|
1329
1458
|
exports.OrdersDataSchema = OrdersDataSchema;
|
|
@@ -1334,8 +1463,14 @@ exports.PositionsDataSchema = PositionsDataSchema;
|
|
|
1334
1463
|
exports.ProviderTrackingInfoSchema = ProviderTrackingInfoSchema;
|
|
1335
1464
|
exports.ProviderTrackingStatusSchema = ProviderTrackingStatusSchema;
|
|
1336
1465
|
exports.PublicEmberPluginRegistry = PublicEmberPluginRegistry;
|
|
1466
|
+
exports.RedeemPtRequestSchema = RedeemPtRequestSchema;
|
|
1467
|
+
exports.RedeemPtResponseSchema = RedeemPtResponseSchema;
|
|
1337
1468
|
exports.RepayTokensRequestSchema = RepayTokensRequestSchema;
|
|
1338
1469
|
exports.RepayTokensResponseSchema = RepayTokensResponseSchema;
|
|
1470
|
+
exports.SellPtRequestSchema = SellPtRequestSchema;
|
|
1471
|
+
exports.SellPtResponseSchema = SellPtResponseSchema;
|
|
1472
|
+
exports.SellYtRequestSchema = SellYtRequestSchema;
|
|
1473
|
+
exports.SellYtResponseSchema = SellYtResponseSchema;
|
|
1339
1474
|
exports.SupplyLiquidityRequestSchema = SupplyLiquidityRequestSchema;
|
|
1340
1475
|
exports.SupplyLiquidityResponseSchema = SupplyLiquidityResponseSchema;
|
|
1341
1476
|
exports.SupplyTokensRequestSchema = SupplyTokensRequestSchema;
|
|
@@ -1345,6 +1480,10 @@ exports.SwapTokensRequestSchema = SwapTokensRequestSchema;
|
|
|
1345
1480
|
exports.SwapTokensResponseSchema = SwapTokensResponseSchema;
|
|
1346
1481
|
exports.TokenIdentifierSchema = TokenIdentifierSchema;
|
|
1347
1482
|
exports.TokenSchema = TokenSchema;
|
|
1483
|
+
exports.TokenizedYieldMarketSchema = TokenizedYieldMarketSchema;
|
|
1484
|
+
exports.TokenizedYieldUserPositionSchema = TokenizedYieldUserPositionSchema;
|
|
1485
|
+
exports.TokenizedYieldUserPositionsRequestSchema = TokenizedYieldUserPositionsRequestSchema;
|
|
1486
|
+
exports.TokenizedYieldUserPositionsResponseSchema = TokenizedYieldUserPositionsResponseSchema;
|
|
1348
1487
|
exports.TransactionPlanErrorSchema = TransactionPlanErrorSchema;
|
|
1349
1488
|
exports.TransactionPlanSchema = TransactionPlanSchema;
|
|
1350
1489
|
exports.TransactionTypeSchema = TransactionTypeSchema;
|