@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.
- package/_cjs/actions/index.js +3 -1
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/schemas/crossActionBundle.js +8 -2
- package/_cjs/actions/schemas/crossActionBundle.js.map +1 -1
- package/_cjs/actions/utils.js +1318 -1
- package/_cjs/actions/utils.js.map +1 -1
- package/_cjs/index.js +3 -1
- package/_cjs/index.js.map +1 -1
- package/_esm/actions/index.js +1 -1
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/schemas/crossActionBundle.js +8 -2
- package/_esm/actions/schemas/crossActionBundle.js.map +1 -1
- package/_esm/actions/utils.js +1389 -0
- package/_esm/actions/utils.js.map +1 -1
- package/_esm/index.js +1 -1
- package/_esm/index.js.map +1 -1
- package/_types/actions/index.d.ts +2 -2
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/parsers/default.d.ts +1 -1
- package/_types/actions/schemas/action.d.ts +950 -950
- package/_types/actions/schemas/borrow/borrow.d.ts +16 -16
- package/_types/actions/schemas/borrow/borrowWithDebt.d.ts +16 -16
- package/_types/actions/schemas/crossActionBundle.d.ts +1578 -45107
- package/_types/actions/schemas/crossActionBundle.d.ts.map +1 -1
- package/_types/actions/schemas/crossReplace/bridgeFrom.d.ts +16 -16
- package/_types/actions/schemas/crossReplace/bridgeTo.d.ts +16 -16
- package/_types/actions/schemas/crossReplace/crossReplace.d.ts +16 -16
- package/_types/actions/schemas/crossTrade/crossTrade.d.ts +16 -16
- package/_types/actions/schemas/default/accountAction.d.ts +18 -18
- package/_types/actions/schemas/default/normalAction.d.ts +18 -18
- package/_types/actions/schemas/deposit/addLiquidity.d.ts +16 -16
- package/_types/actions/schemas/deposit/deposit.d.ts +16 -16
- package/_types/actions/schemas/deposit/depositWithBond.d.ts +16 -16
- package/_types/actions/schemas/deposit/stake.d.ts +16 -16
- package/_types/actions/schemas/fee/fee.d.ts +16 -16
- package/_types/actions/schemas/fee/transactionFee.d.ts +16 -16
- package/_types/actions/schemas/ignore/approve.d.ts +16 -16
- package/_types/actions/schemas/ignore/failTx.d.ts +16 -16
- package/_types/actions/schemas/ignore/ignore.d.ts +8 -8
- package/_types/actions/schemas/ignore/move.d.ts +8 -8
- package/_types/actions/schemas/ignore/receiveFromCex.d.ts +16 -16
- package/_types/actions/schemas/ignore/revoke.d.ts +16 -16
- package/_types/actions/schemas/ignore/sendToCex.d.ts +16 -16
- package/_types/actions/schemas/ignore/spam.d.ts +16 -16
- package/_types/actions/schemas/income/atomicArbitrage.d.ts +16 -16
- package/_types/actions/schemas/income/freeMintNft.d.ts +16 -16
- package/_types/actions/schemas/income/income.d.ts +16 -16
- package/_types/actions/schemas/income/nftRoyalty.d.ts +8 -8
- package/_types/actions/schemas/income/swapIncome.d.ts +8 -8
- package/_types/actions/schemas/reduce/reduce.d.ts +8 -8
- package/_types/actions/schemas/repayment/repayment.d.ts +16 -16
- package/_types/actions/schemas/repayment/repaymentWithDebt.d.ts +16 -16
- package/_types/actions/schemas/replace/replace.d.ts +16 -16
- package/_types/actions/schemas/replace/swapNft.d.ts +16 -16
- package/_types/actions/schemas/replace/unwrap.d.ts +16 -16
- package/_types/actions/schemas/replace/wrap.d.ts +16 -16
- package/_types/actions/schemas/trade/buyCrypto.d.ts +16 -16
- package/_types/actions/schemas/trade/buyNft.d.ts +16 -16
- package/_types/actions/schemas/trade/mintNft.d.ts +16 -16
- package/_types/actions/schemas/trade/sellCrypto.d.ts +16 -16
- package/_types/actions/schemas/trade/sellNft.d.ts +16 -16
- package/_types/actions/schemas/trade/trade.d.ts +16 -16
- package/_types/actions/schemas/transfer/swapTransfer.d.ts +8 -8
- package/_types/actions/schemas/transfer/transfer.d.ts +16 -16
- package/_types/actions/schemas/valuedown/valuedown.d.ts +16 -16
- package/_types/actions/schemas/valueup/valueup.d.ts +16 -16
- package/_types/actions/schemas/withdraw/removeLiquidity.d.ts +16 -16
- package/_types/actions/schemas/withdraw/unstake.d.ts +16 -16
- package/_types/actions/schemas/withdraw/withdraw.d.ts +16 -16
- package/_types/actions/schemas/withdraw/withdrawWithBond.d.ts +16 -16
- package/_types/actions/types/action.d.ts +17 -1
- package/_types/actions/types/action.d.ts.map +1 -1
- package/_types/actions/types/index.d.ts +1 -1
- package/_types/actions/types/index.d.ts.map +1 -1
- package/_types/actions/utils.d.ts +3 -0
- package/_types/actions/utils.d.ts.map +1 -1
- package/_types/apps/schemas.d.ts +4 -4
- package/_types/index.d.ts +2 -2
- package/_types/index.d.ts.map +1 -1
- package/actions/index.ts +4 -0
- package/actions/schemas/crossActionBundle.ts +14 -2
- package/actions/types/action.ts +26 -1
- package/actions/types/index.ts +2 -0
- package/actions/utils.ts +1951 -0
- package/index.ts +4 -0
- package/package.json +1 -1
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod'
|
|
2
|
-
import {
|
|
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(
|
|
11
|
+
actions: z.array(
|
|
12
|
+
z.union([
|
|
13
|
+
accountActionBridgeFromSchema,
|
|
14
|
+
accountActionBridgeToSchema,
|
|
15
|
+
accountActionCrossReplaceSchema,
|
|
16
|
+
accountActionCrossTradeSchema,
|
|
17
|
+
]),
|
|
18
|
+
),
|
|
7
19
|
})
|
package/actions/types/action.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { z } from 'zod'
|
|
2
|
-
import type {
|
|
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
|
+
}
|