@0xtorch/core 0.0.14 → 0.0.16

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 (86) hide show
  1. package/_cjs/actions/index.js +3 -1
  2. package/_cjs/actions/index.js.map +1 -1
  3. package/_cjs/actions/schemas/crossActionBundle.js +8 -2
  4. package/_cjs/actions/schemas/crossActionBundle.js.map +1 -1
  5. package/_cjs/actions/utils.js +1318 -1
  6. package/_cjs/actions/utils.js.map +1 -1
  7. package/_cjs/index.js +3 -1
  8. package/_cjs/index.js.map +1 -1
  9. package/_esm/actions/index.js +1 -1
  10. package/_esm/actions/index.js.map +1 -1
  11. package/_esm/actions/schemas/crossActionBundle.js +8 -2
  12. package/_esm/actions/schemas/crossActionBundle.js.map +1 -1
  13. package/_esm/actions/utils.js +1389 -0
  14. package/_esm/actions/utils.js.map +1 -1
  15. package/_esm/index.js +1 -1
  16. package/_esm/index.js.map +1 -1
  17. package/_types/actions/index.d.ts +2 -2
  18. package/_types/actions/index.d.ts.map +1 -1
  19. package/_types/actions/parsers/default.d.ts +1 -1
  20. package/_types/actions/schemas/action.d.ts +950 -950
  21. package/_types/actions/schemas/borrow/borrow.d.ts +16 -16
  22. package/_types/actions/schemas/borrow/borrowWithDebt.d.ts +16 -16
  23. package/_types/actions/schemas/crossActionBundle.d.ts +1578 -45107
  24. package/_types/actions/schemas/crossActionBundle.d.ts.map +1 -1
  25. package/_types/actions/schemas/crossReplace/bridgeFrom.d.ts +16 -16
  26. package/_types/actions/schemas/crossReplace/bridgeTo.d.ts +16 -16
  27. package/_types/actions/schemas/crossReplace/crossReplace.d.ts +16 -16
  28. package/_types/actions/schemas/crossTrade/crossTrade.d.ts +16 -16
  29. package/_types/actions/schemas/default/accountAction.d.ts +18 -18
  30. package/_types/actions/schemas/default/normalAction.d.ts +18 -18
  31. package/_types/actions/schemas/deposit/addLiquidity.d.ts +16 -16
  32. package/_types/actions/schemas/deposit/deposit.d.ts +16 -16
  33. package/_types/actions/schemas/deposit/depositWithBond.d.ts +16 -16
  34. package/_types/actions/schemas/deposit/stake.d.ts +16 -16
  35. package/_types/actions/schemas/fee/fee.d.ts +16 -16
  36. package/_types/actions/schemas/fee/transactionFee.d.ts +16 -16
  37. package/_types/actions/schemas/ignore/approve.d.ts +16 -16
  38. package/_types/actions/schemas/ignore/failTx.d.ts +16 -16
  39. package/_types/actions/schemas/ignore/ignore.d.ts +8 -8
  40. package/_types/actions/schemas/ignore/move.d.ts +8 -8
  41. package/_types/actions/schemas/ignore/receiveFromCex.d.ts +16 -16
  42. package/_types/actions/schemas/ignore/revoke.d.ts +16 -16
  43. package/_types/actions/schemas/ignore/sendToCex.d.ts +16 -16
  44. package/_types/actions/schemas/ignore/spam.d.ts +16 -16
  45. package/_types/actions/schemas/income/atomicArbitrage.d.ts +16 -16
  46. package/_types/actions/schemas/income/freeMintNft.d.ts +16 -16
  47. package/_types/actions/schemas/income/income.d.ts +16 -16
  48. package/_types/actions/schemas/income/nftRoyalty.d.ts +8 -8
  49. package/_types/actions/schemas/income/swapIncome.d.ts +8 -8
  50. package/_types/actions/schemas/reduce/reduce.d.ts +8 -8
  51. package/_types/actions/schemas/repayment/repayment.d.ts +16 -16
  52. package/_types/actions/schemas/repayment/repaymentWithDebt.d.ts +16 -16
  53. package/_types/actions/schemas/replace/replace.d.ts +16 -16
  54. package/_types/actions/schemas/replace/swapNft.d.ts +16 -16
  55. package/_types/actions/schemas/replace/unwrap.d.ts +16 -16
  56. package/_types/actions/schemas/replace/wrap.d.ts +16 -16
  57. package/_types/actions/schemas/trade/buyCrypto.d.ts +16 -16
  58. package/_types/actions/schemas/trade/buyNft.d.ts +16 -16
  59. package/_types/actions/schemas/trade/mintNft.d.ts +16 -16
  60. package/_types/actions/schemas/trade/sellCrypto.d.ts +16 -16
  61. package/_types/actions/schemas/trade/sellNft.d.ts +16 -16
  62. package/_types/actions/schemas/trade/trade.d.ts +16 -16
  63. package/_types/actions/schemas/transfer/swapTransfer.d.ts +8 -8
  64. package/_types/actions/schemas/transfer/transfer.d.ts +16 -16
  65. package/_types/actions/schemas/valuedown/valuedown.d.ts +16 -16
  66. package/_types/actions/schemas/valueup/valueup.d.ts +16 -16
  67. package/_types/actions/schemas/withdraw/removeLiquidity.d.ts +16 -16
  68. package/_types/actions/schemas/withdraw/unstake.d.ts +16 -16
  69. package/_types/actions/schemas/withdraw/withdraw.d.ts +16 -16
  70. package/_types/actions/schemas/withdraw/withdrawWithBond.d.ts +16 -16
  71. package/_types/actions/types/action.d.ts +17 -1
  72. package/_types/actions/types/action.d.ts.map +1 -1
  73. package/_types/actions/types/index.d.ts +1 -1
  74. package/_types/actions/types/index.d.ts.map +1 -1
  75. package/_types/actions/utils.d.ts +3 -0
  76. package/_types/actions/utils.d.ts.map +1 -1
  77. package/_types/apps/schemas.d.ts +4 -4
  78. package/_types/index.d.ts +2 -2
  79. package/_types/index.d.ts.map +1 -1
  80. package/actions/index.ts +4 -0
  81. package/actions/schemas/crossActionBundle.ts +14 -2
  82. package/actions/types/action.ts +26 -1
  83. package/actions/types/index.ts +2 -0
  84. package/actions/utils.ts +1951 -0
  85. package/index.ts +4 -0
  86. package/package.json +1 -1
@@ -1,7 +1,19 @@
1
1
  import { z } from 'zod'
2
- import { accountActionSchema } from './action'
2
+ import {
3
+ accountActionBridgeFromSchema,
4
+ accountActionBridgeToSchema,
5
+ accountActionCrossReplaceSchema,
6
+ } from './crossReplace'
7
+ import { accountActionCrossTradeSchema } from './crossTrade'
3
8
 
4
9
  export const crossActionBundleSchema = z.object({
5
10
  id: z.string(),
6
- actions: z.array(accountActionSchema),
11
+ actions: z.array(
12
+ z.union([
13
+ accountActionBridgeFromSchema,
14
+ accountActionBridgeToSchema,
15
+ accountActionCrossReplaceSchema,
16
+ accountActionCrossTradeSchema,
17
+ ]),
18
+ ),
7
19
  })
@@ -1,5 +1,11 @@
1
1
  import type { z } from 'zod'
2
- import type { accountActionSchema, normalActionSchema } from '../schemas'
2
+ import type { Nft } from '../../assets'
3
+ import type {
4
+ accountActionSchema,
5
+ crossTypeSchema,
6
+ normalActionSchema,
7
+ } from '../schemas'
8
+ import type { Transfer } from './default'
3
9
 
4
10
  export type NormalAction = z.infer<typeof normalActionSchema>
5
11
 
@@ -10,3 +16,22 @@ export type ActionType = NormalAction['action']
10
16
  export type AccountActionType = AccountAction['action']
11
17
 
12
18
  export type Evidence = AccountAction['evidence']
19
+
20
+ export type BaseNormalAction = Omit<
21
+ NormalAction,
22
+ 'type' | 'loanId' | 'crossId' | 'crossType' | 'target' | 'transfers'
23
+ > & {
24
+ loanId: string | undefined
25
+ crossId: string | undefined
26
+ crossType: z.infer<typeof crossTypeSchema> | undefined
27
+ target: Nft | undefined
28
+ transfers: readonly Transfer[]
29
+ }
30
+
31
+ export type BaseAccountAction = Omit<AccountAction, 'type' | 'transfers'> & {
32
+ loanId: string | undefined
33
+ crossId: string | undefined
34
+ crossType: z.infer<typeof crossTypeSchema> | undefined
35
+ target: Nft | undefined
36
+ transfers: readonly Transfer[]
37
+ }
@@ -2,6 +2,8 @@ export type {
2
2
  AccountAction,
3
3
  AccountActionType,
4
4
  ActionType,
5
+ BaseAccountAction,
6
+ BaseNormalAction,
5
7
  Evidence,
6
8
  NormalAction,
7
9
  } from './action'