@0xtorch/csv 0.0.5 → 0.0.7
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/parseCsvFileToAccountActions.js +4 -4
- package/_cjs/parseCsvFileToAccountActions.js.map +1 -1
- package/_cjs/{parseCsvRowToNormalAction → parseCsvRowToAction}/asset.js +0 -4
- package/_cjs/parseCsvRowToAction/asset.js.map +1 -0
- package/_cjs/parseCsvRowToAction/condition.js.map +1 -0
- package/_cjs/parseCsvRowToAction/index.js +6 -0
- package/_cjs/parseCsvRowToAction/index.js.map +1 -0
- package/_cjs/{parseCsvRowToNormalAction → parseCsvRowToAction}/nft.js +0 -4
- package/_cjs/parseCsvRowToAction/nft.js.map +1 -0
- package/_cjs/{parseCsvRowToNormalAction/parseCsvRowToNormalAction.js → parseCsvRowToAction/parseCsvRowToAction.js} +12 -18
- package/_cjs/parseCsvRowToAction/parseCsvRowToAction.js.map +1 -0
- package/_cjs/{parseCsvRowToNormalAction → parseCsvRowToAction}/text.js +3 -5
- package/_cjs/parseCsvRowToAction/text.js.map +1 -0
- package/_cjs/parseCsvRowToAction/timestamp.js.map +1 -0
- package/_cjs/parseCsvRowToAction/transfer.js.map +1 -0
- package/_cjs/parseCsvRowsToActions.js +34 -0
- package/_cjs/parseCsvRowsToActions.js.map +1 -0
- package/_cjs/schemas/parser.js +2 -2
- package/_cjs/schemas/parser.js.map +1 -1
- package/_cjs/test.js +8 -0
- package/_cjs/test.js.map +1 -0
- package/_esm/parseCsvFileToAccountActions.js +5 -5
- package/_esm/parseCsvFileToAccountActions.js.map +1 -1
- package/_esm/{parseCsvRowToNormalAction → parseCsvRowToAction}/asset.js +0 -4
- package/_esm/parseCsvRowToAction/asset.js.map +1 -0
- package/_esm/parseCsvRowToAction/condition.js.map +1 -0
- package/_esm/parseCsvRowToAction/index.js +2 -0
- package/_esm/parseCsvRowToAction/index.js.map +1 -0
- package/_esm/{parseCsvRowToNormalAction → parseCsvRowToAction}/nft.js +0 -4
- package/_esm/parseCsvRowToAction/nft.js.map +1 -0
- package/_esm/{parseCsvRowToNormalAction/parseCsvRowToNormalAction.js → parseCsvRowToAction/parseCsvRowToAction.js} +10 -16
- package/_esm/parseCsvRowToAction/parseCsvRowToAction.js.map +1 -0
- package/_esm/{parseCsvRowToNormalAction → parseCsvRowToAction}/text.js +3 -5
- package/_esm/parseCsvRowToAction/text.js.map +1 -0
- package/_esm/parseCsvRowToAction/timestamp.js.map +1 -0
- package/_esm/parseCsvRowToAction/transfer.js.map +1 -0
- package/_esm/parseCsvRowsToActions.js +32 -0
- package/_esm/parseCsvRowsToActions.js.map +1 -0
- package/_esm/schemas/parser.js +3 -3
- package/_esm/schemas/parser.js.map +1 -1
- package/_esm/test.js +5 -0
- package/_esm/test.js.map +1 -0
- package/_types/parseCsvFileToAccountActions.d.ts +2 -2
- package/_types/parseCsvFileToAccountActions.d.ts.map +1 -1
- package/_types/parseCsvFileToText.d.ts.map +1 -1
- package/_types/parseCsvRowToAction/asset.d.ts.map +1 -0
- package/_types/parseCsvRowToAction/condition.d.ts.map +1 -0
- package/_types/parseCsvRowToAction/index.d.ts +2 -0
- package/_types/parseCsvRowToAction/index.d.ts.map +1 -0
- package/_types/parseCsvRowToAction/nft.d.ts.map +1 -0
- package/_types/parseCsvRowToAction/parseCsvRowToAction.d.ts +16 -0
- package/_types/parseCsvRowToAction/parseCsvRowToAction.d.ts.map +1 -0
- package/_types/parseCsvRowToAction/text.d.ts.map +1 -0
- package/_types/parseCsvRowToAction/timestamp.d.ts.map +1 -0
- package/_types/parseCsvRowToAction/transfer.d.ts.map +1 -0
- package/_types/{parseCsvRowsToAccountActions.d.ts → parseCsvRowsToActions.d.ts} +4 -4
- package/_types/parseCsvRowsToActions.d.ts.map +1 -0
- package/_types/parseCsvText.d.ts.map +1 -1
- package/_types/schemas/parser.d.ts +9 -9
- package/_types/schemas/schemas.d.ts +5 -5
- package/_types/test.d.ts +5 -0
- package/_types/test.d.ts.map +1 -0
- package/package.json +2 -2
- package/parseCsvFileToAccountActions.ts +11 -13
- package/{parseCsvRowToNormalAction → parseCsvRowToAction}/asset.ts +0 -4
- package/parseCsvRowToAction/index.ts +1 -0
- package/{parseCsvRowToNormalAction → parseCsvRowToAction}/nft.ts +0 -4
- package/{parseCsvRowToNormalAction/parseCsvRowToNormalAction.ts → parseCsvRowToAction/parseCsvRowToAction.ts} +14 -34
- package/{parseCsvRowToNormalAction → parseCsvRowToAction}/text.ts +5 -4
- package/{parseCsvRowsToAccountActions.ts → parseCsvRowsToActions.ts} +12 -25
- package/schemas/parser.ts +3 -3
- package/test.ts +7 -0
- package/tests/assets.ts +2 -3
- package/_cjs/parseCsvRowToNormalAction/asset.js.map +0 -1
- package/_cjs/parseCsvRowToNormalAction/condition.js.map +0 -1
- package/_cjs/parseCsvRowToNormalAction/index.js +0 -6
- package/_cjs/parseCsvRowToNormalAction/index.js.map +0 -1
- package/_cjs/parseCsvRowToNormalAction/nft.js.map +0 -1
- package/_cjs/parseCsvRowToNormalAction/parseCsvRowToNormalAction.js.map +0 -1
- package/_cjs/parseCsvRowToNormalAction/text.js.map +0 -1
- package/_cjs/parseCsvRowToNormalAction/timestamp.js.map +0 -1
- package/_cjs/parseCsvRowToNormalAction/transfer.js.map +0 -1
- package/_cjs/parseCsvRowsToAccountActions.js +0 -49
- package/_cjs/parseCsvRowsToAccountActions.js.map +0 -1
- package/_esm/parseCsvRowToNormalAction/asset.js.map +0 -1
- package/_esm/parseCsvRowToNormalAction/condition.js.map +0 -1
- package/_esm/parseCsvRowToNormalAction/index.js +0 -2
- package/_esm/parseCsvRowToNormalAction/index.js.map +0 -1
- package/_esm/parseCsvRowToNormalAction/nft.js.map +0 -1
- package/_esm/parseCsvRowToNormalAction/parseCsvRowToNormalAction.js.map +0 -1
- package/_esm/parseCsvRowToNormalAction/text.js.map +0 -1
- package/_esm/parseCsvRowToNormalAction/timestamp.js.map +0 -1
- package/_esm/parseCsvRowToNormalAction/transfer.js.map +0 -1
- package/_esm/parseCsvRowsToAccountActions.js +0 -47
- package/_esm/parseCsvRowsToAccountActions.js.map +0 -1
- package/_types/parseCsvRowToNormalAction/asset.d.ts.map +0 -1
- package/_types/parseCsvRowToNormalAction/condition.d.ts.map +0 -1
- package/_types/parseCsvRowToNormalAction/index.d.ts +0 -2
- package/_types/parseCsvRowToNormalAction/index.d.ts.map +0 -1
- package/_types/parseCsvRowToNormalAction/nft.d.ts.map +0 -1
- package/_types/parseCsvRowToNormalAction/parseCsvRowToNormalAction.d.ts +0 -20
- package/_types/parseCsvRowToNormalAction/parseCsvRowToNormalAction.d.ts.map +0 -1
- package/_types/parseCsvRowToNormalAction/text.d.ts.map +0 -1
- package/_types/parseCsvRowToNormalAction/timestamp.d.ts.map +0 -1
- package/_types/parseCsvRowToNormalAction/transfer.d.ts.map +0 -1
- package/_types/parseCsvRowsToAccountActions.d.ts.map +0 -1
- package/parseCsvRowToNormalAction/index.ts +0 -1
- /package/_cjs/{parseCsvRowToNormalAction → parseCsvRowToAction}/condition.js +0 -0
- /package/_cjs/{parseCsvRowToNormalAction → parseCsvRowToAction}/timestamp.js +0 -0
- /package/_cjs/{parseCsvRowToNormalAction → parseCsvRowToAction}/transfer.js +0 -0
- /package/_esm/{parseCsvRowToNormalAction → parseCsvRowToAction}/condition.js +0 -0
- /package/_esm/{parseCsvRowToNormalAction → parseCsvRowToAction}/timestamp.js +0 -0
- /package/_esm/{parseCsvRowToNormalAction → parseCsvRowToAction}/transfer.js +0 -0
- /package/_types/{parseCsvRowToNormalAction → parseCsvRowToAction}/asset.d.ts +0 -0
- /package/_types/{parseCsvRowToNormalAction → parseCsvRowToAction}/condition.d.ts +0 -0
- /package/_types/{parseCsvRowToNormalAction → parseCsvRowToAction}/nft.d.ts +0 -0
- /package/_types/{parseCsvRowToNormalAction → parseCsvRowToAction}/text.d.ts +0 -0
- /package/_types/{parseCsvRowToNormalAction → parseCsvRowToAction}/timestamp.d.ts +0 -0
- /package/_types/{parseCsvRowToNormalAction → parseCsvRowToAction}/transfer.d.ts +0 -0
- /package/{parseCsvRowToNormalAction → parseCsvRowToAction}/condition.ts +0 -0
- /package/{parseCsvRowToNormalAction → parseCsvRowToAction}/timestamp.ts +0 -0
- /package/{parseCsvRowToNormalAction → parseCsvRowToAction}/transfer.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../parseCsvRowToAction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nft.d.ts","sourceRoot":"","sources":["../../parseCsvRowToAction/nft.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAG5C,KAAK,iCAAiC,GAAG;IACvC,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;CACvD,CAAA;AAED,eAAO,MAAM,uBAAuB,iCAIjC,iCAAiC,KAAG,GAWtC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Action, CryptoCurrency, FiatCurrency } from '@0xtorch/core';
|
|
2
|
+
import type { FormattedRow, Parser } from '../types';
|
|
3
|
+
type ParseCsvRowToActionParameters = {
|
|
4
|
+
readonly row: FormattedRow;
|
|
5
|
+
readonly service: string;
|
|
6
|
+
readonly parsers: readonly Parser[];
|
|
7
|
+
readonly symbolAssetMap: {
|
|
8
|
+
[symbol: string]: string;
|
|
9
|
+
} | undefined;
|
|
10
|
+
readonly accountId: string;
|
|
11
|
+
readonly cryptoCurrencies: readonly CryptoCurrency[];
|
|
12
|
+
readonly fiatCurrencies: readonly FiatCurrency[];
|
|
13
|
+
};
|
|
14
|
+
export declare const parseCsvRowToAction: ({ row, service, parsers, symbolAssetMap, accountId, cryptoCurrencies, fiatCurrencies, }: ParseCsvRowToActionParameters) => Action | undefined;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=parseCsvRowToAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseCsvRowToAction.d.ts","sourceRoot":"","sources":["../../parseCsvRowToAction/parseCsvRowToAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAOpD,KAAK,6BAA6B,GAAG;IACnC,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,QAAQ,CAAC,cAAc,EAAE;QAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,SAAS,CAAA;IACjE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,SAAS,cAAc,EAAE,CAAA;IACpD,QAAQ,CAAC,cAAc,EAAE,SAAS,YAAY,EAAE,CAAA;CACjD,CAAA;AAED,eAAO,MAAM,mBAAmB,4FAQ7B,6BAA6B,KAAG,MAAM,GAAG,SAqB3C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../parseCsvRowToAction/text.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C,KAAK,+BAA+B,GAAG;IACrC,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;CACxD,CAAA;AAED,eAAO,MAAM,qBAAqB,iCAI/B,+BAA+B,KAAG,MAsBpC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timestamp.d.ts","sourceRoot":"","sources":["../../parseCsvRowToAction/timestamp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C,KAAK,8BAA8B,GAAG;IACpC,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAA;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,oBAAoB,qBAG9B,8BAA8B,KAAG,MAQnC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../parseCsvRowToAction/transfer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC3E,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAG5C,KAAK,mCAAmC,GAAG;IACzC,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,cAAc,EAAE;QAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,SAAS,CAAA;IACjE,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;IAC3D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,SAAS,cAAc,EAAE,CAAA;IACpD,QAAQ,CAAC,cAAc,EAAE,SAAS,YAAY,EAAE,CAAA;CACjD,CAAA;AAED,eAAO,MAAM,yBAAyB,8FAQnC,mCAAmC,KAAG,QA6BxC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Action, CryptoCurrency, FiatCurrency } from '@0xtorch/core';
|
|
2
2
|
import type { FormattedRow, Parser } from './types';
|
|
3
|
-
type
|
|
3
|
+
type ParseCsvRowsToActionsParameters = {
|
|
4
4
|
readonly rows: readonly FormattedRow[];
|
|
5
5
|
readonly service: string;
|
|
6
6
|
readonly parsers: readonly Parser[];
|
|
@@ -11,6 +11,6 @@ type ParseCsvRowsToAccountActionsParameters = {
|
|
|
11
11
|
readonly cryptoCurrencies: readonly CryptoCurrency[];
|
|
12
12
|
readonly fiatCurrencies: readonly FiatCurrency[];
|
|
13
13
|
};
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const parseCsvRowsToActions: ({ rows, service, parsers, symbolAssetMap, accountId, cryptoCurrencies, fiatCurrencies, }: ParseCsvRowsToActionsParameters) => readonly Action[];
|
|
15
15
|
export {};
|
|
16
|
-
//# sourceMappingURL=
|
|
16
|
+
//# sourceMappingURL=parseCsvRowsToActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseCsvRowsToActions.d.ts","sourceRoot":"","sources":["../parseCsvRowsToActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEnD,KAAK,+BAA+B,GAAG;IACrC,QAAQ,CAAC,IAAI,EAAE,SAAS,YAAY,EAAE,CAAA;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,QAAQ,CAAC,cAAc,EAAE;QAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,SAAS,CAAA;IACjE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,SAAS,cAAc,EAAE,CAAA;IACpD,QAAQ,CAAC,cAAc,EAAE,SAAS,YAAY,EAAE,CAAA;CACjD,CAAA;AAED,eAAO,MAAM,qBAAqB,6FAQ/B,+BAA+B,KAAG,SAAS,MAAM,EA+BnD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseCsvText.d.ts","sourceRoot":"","sources":["../parseCsvText.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY,SACjB,MAAM
|
|
1
|
+
{"version":3,"file":"parseCsvText.d.ts","sourceRoot":"","sources":["../parseCsvText.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY,SACjB,MAAM,KACX,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAMpC,CAAA"}
|
|
@@ -71,13 +71,13 @@ export declare const columnComponentSchema: z.ZodObject<{
|
|
|
71
71
|
}>;
|
|
72
72
|
export declare const actionComponentSchema: z.ZodObject<{
|
|
73
73
|
column: z.ZodString;
|
|
74
|
-
patterns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<"borrow">, z.ZodLiteral<"bridge-from">, z.ZodLiteral<"bridge-to">, z.ZodLiteral<"cross-replace">, z.ZodLiteral<"cross-trade">, z.ZodLiteral<"add-liquidity">, z.ZodLiteral<"deposit">, z.ZodLiteral<"deposit-with-bond">, z.ZodLiteral<"stake">, z.ZodLiteral<"fee">, z.ZodLiteral<"transaction-fee">, z.ZodLiteral<"approve">, z.ZodLiteral<"fail-tx">, z.ZodLiteral<"receive-from-cex">, z.ZodLiteral<"revoke">, z.ZodLiteral<"send-to-cex">, z.ZodLiteral<"spam">, z.ZodLiteral<"
|
|
74
|
+
patterns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<"borrow">, z.ZodLiteral<"bridge-from">, z.ZodLiteral<"bridge-to">, z.ZodLiteral<"cross-replace">, z.ZodLiteral<"cross-trade">, z.ZodLiteral<"add-liquidity">, z.ZodLiteral<"deposit">, z.ZodLiteral<"deposit-with-bond">, z.ZodLiteral<"stake">, z.ZodLiteral<"burn">, z.ZodLiteral<"derivative-fee">, z.ZodLiteral<"fee">, z.ZodLiteral<"interest-fee">, z.ZodLiteral<"pay">, z.ZodLiteral<"realize-loss">, z.ZodLiteral<"stolen">, z.ZodLiteral<"transaction-fee">, z.ZodLiteral<"approve">, z.ZodLiteral<"fail-tx">, z.ZodLiteral<"ignore">, z.ZodLiteral<"move">, z.ZodLiteral<"receive-from-cex">, z.ZodLiteral<"revoke">, z.ZodLiteral<"send-to-cex">, z.ZodLiteral<"spam">, z.ZodLiteral<"airdrop">, z.ZodLiteral<"cash-back">, z.ZodLiteral<"derivative-profit">, z.ZodLiteral<"free-mint">, z.ZodLiteral<"game-reward">, z.ZodLiteral<"gift">, z.ZodLiteral<"hardfork">, z.ZodLiteral<"income">, z.ZodLiteral<"interest">, z.ZodLiteral<"mining">, z.ZodLiteral<"nft-royalty">, z.ZodLiteral<"realize-profit">, z.ZodLiteral<"staking-reward">, z.ZodLiteral<"liquidation">, z.ZodLiteral<"reduce">, z.ZodLiteral<"repayment">, z.ZodLiteral<"replace">, z.ZodLiteral<"swap-nft">, z.ZodLiteral<"unwrap">, z.ZodLiteral<"wrap">, z.ZodLiteral<"atomic-arbitrage">, z.ZodLiteral<"buy-crypto">, z.ZodLiteral<"buy-nft">, z.ZodLiteral<"mint-nft">, z.ZodLiteral<"sell-crypto">, z.ZodLiteral<"sell-nft">, z.ZodLiteral<"trade">, z.ZodLiteral<"transfer">, z.ZodLiteral<"value-down">, z.ZodLiteral<"value-up">, z.ZodLiteral<"remove-liquidity">, z.ZodLiteral<"unstake">, z.ZodLiteral<"withdraw">, z.ZodLiteral<"withdraw-with-bond">]>>;
|
|
75
75
|
}, "strip", z.ZodTypeAny, {
|
|
76
76
|
column: string;
|
|
77
|
-
patterns: Record<string, "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "fee" | "transaction-fee" | "approve" | "fail-tx" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "
|
|
77
|
+
patterns: Record<string, "reduce" | "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "burn" | "derivative-fee" | "fee" | "interest-fee" | "pay" | "realize-loss" | "stolen" | "transaction-fee" | "approve" | "fail-tx" | "ignore" | "move" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "airdrop" | "cash-back" | "derivative-profit" | "free-mint" | "game-reward" | "gift" | "hardfork" | "income" | "interest" | "mining" | "nft-royalty" | "realize-profit" | "staking-reward" | "liquidation" | "repayment" | "replace" | "swap-nft" | "unwrap" | "wrap" | "atomic-arbitrage" | "buy-crypto" | "buy-nft" | "mint-nft" | "sell-crypto" | "sell-nft" | "trade" | "transfer" | "value-down" | "value-up" | "remove-liquidity" | "unstake" | "withdraw" | "withdraw-with-bond">;
|
|
78
78
|
}, {
|
|
79
79
|
column: string;
|
|
80
|
-
patterns: Record<string, "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "fee" | "transaction-fee" | "approve" | "fail-tx" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "
|
|
80
|
+
patterns: Record<string, "reduce" | "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "burn" | "derivative-fee" | "fee" | "interest-fee" | "pay" | "realize-loss" | "stolen" | "transaction-fee" | "approve" | "fail-tx" | "ignore" | "move" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "airdrop" | "cash-back" | "derivative-profit" | "free-mint" | "game-reward" | "gift" | "hardfork" | "income" | "interest" | "mining" | "nft-royalty" | "realize-profit" | "staking-reward" | "liquidation" | "repayment" | "replace" | "swap-nft" | "unwrap" | "wrap" | "atomic-arbitrage" | "buy-crypto" | "buy-nft" | "mint-nft" | "sell-crypto" | "sell-nft" | "trade" | "transfer" | "value-down" | "value-up" | "remove-liquidity" | "unstake" | "withdraw" | "withdraw-with-bond">;
|
|
81
81
|
}>;
|
|
82
82
|
export declare const textComponentSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
83
83
|
type: z.ZodLiteral<"service">;
|
|
@@ -346,7 +346,7 @@ export declare const parserSchema: z.ZodObject<{
|
|
|
346
346
|
type: "not-in";
|
|
347
347
|
};
|
|
348
348
|
}>, "many">;
|
|
349
|
-
action: z.ZodUnion<[z.ZodLiteral<"borrow">, z.ZodLiteral<"bridge-from">, z.ZodLiteral<"bridge-to">, z.ZodLiteral<"cross-replace">, z.ZodLiteral<"cross-trade">, z.ZodLiteral<"add-liquidity">, z.ZodLiteral<"deposit">, z.ZodLiteral<"deposit-with-bond">, z.ZodLiteral<"stake">, z.ZodLiteral<"fee">, z.ZodLiteral<"transaction-fee">, z.ZodLiteral<"approve">, z.ZodLiteral<"fail-tx">, z.ZodLiteral<"receive-from-cex">, z.ZodLiteral<"revoke">, z.ZodLiteral<"send-to-cex">, z.ZodLiteral<"spam">, z.ZodLiteral<"
|
|
349
|
+
action: z.ZodUnion<[z.ZodLiteral<"borrow">, z.ZodLiteral<"bridge-from">, z.ZodLiteral<"bridge-to">, z.ZodLiteral<"cross-replace">, z.ZodLiteral<"cross-trade">, z.ZodLiteral<"add-liquidity">, z.ZodLiteral<"deposit">, z.ZodLiteral<"deposit-with-bond">, z.ZodLiteral<"stake">, z.ZodLiteral<"burn">, z.ZodLiteral<"derivative-fee">, z.ZodLiteral<"fee">, z.ZodLiteral<"interest-fee">, z.ZodLiteral<"pay">, z.ZodLiteral<"realize-loss">, z.ZodLiteral<"stolen">, z.ZodLiteral<"transaction-fee">, z.ZodLiteral<"approve">, z.ZodLiteral<"fail-tx">, z.ZodLiteral<"ignore">, z.ZodLiteral<"move">, z.ZodLiteral<"receive-from-cex">, z.ZodLiteral<"revoke">, z.ZodLiteral<"send-to-cex">, z.ZodLiteral<"spam">, z.ZodLiteral<"airdrop">, z.ZodLiteral<"cash-back">, z.ZodLiteral<"derivative-profit">, z.ZodLiteral<"free-mint">, z.ZodLiteral<"game-reward">, z.ZodLiteral<"gift">, z.ZodLiteral<"hardfork">, z.ZodLiteral<"income">, z.ZodLiteral<"interest">, z.ZodLiteral<"mining">, z.ZodLiteral<"nft-royalty">, z.ZodLiteral<"realize-profit">, z.ZodLiteral<"staking-reward">, z.ZodLiteral<"liquidation">, z.ZodLiteral<"reduce">, z.ZodLiteral<"repayment">, z.ZodLiteral<"replace">, z.ZodLiteral<"swap-nft">, z.ZodLiteral<"unwrap">, z.ZodLiteral<"wrap">, z.ZodLiteral<"atomic-arbitrage">, z.ZodLiteral<"buy-crypto">, z.ZodLiteral<"buy-nft">, z.ZodLiteral<"mint-nft">, z.ZodLiteral<"sell-crypto">, z.ZodLiteral<"sell-nft">, z.ZodLiteral<"trade">, z.ZodLiteral<"transfer">, z.ZodLiteral<"value-down">, z.ZodLiteral<"value-up">, z.ZodLiteral<"remove-liquidity">, z.ZodLiteral<"unstake">, z.ZodLiteral<"withdraw">, z.ZodLiteral<"withdraw-with-bond">]>;
|
|
350
350
|
/** 指定した値群を結合して作成したテキストを代入 */
|
|
351
351
|
source: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
352
352
|
type: z.ZodLiteral<"service">;
|
|
@@ -567,7 +567,7 @@ export declare const parserSchema: z.ZodObject<{
|
|
|
567
567
|
type: "not-in";
|
|
568
568
|
};
|
|
569
569
|
}[];
|
|
570
|
-
action: "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "fee" | "transaction-fee" | "approve" | "fail-tx" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "
|
|
570
|
+
action: "reduce" | "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "burn" | "derivative-fee" | "fee" | "interest-fee" | "pay" | "realize-loss" | "stolen" | "transaction-fee" | "approve" | "fail-tx" | "ignore" | "move" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "airdrop" | "cash-back" | "derivative-profit" | "free-mint" | "game-reward" | "gift" | "hardfork" | "income" | "interest" | "mining" | "nft-royalty" | "realize-profit" | "staking-reward" | "liquidation" | "repayment" | "replace" | "swap-nft" | "unwrap" | "wrap" | "atomic-arbitrage" | "buy-crypto" | "buy-nft" | "mint-nft" | "sell-crypto" | "sell-nft" | "trade" | "transfer" | "value-down" | "value-up" | "remove-liquidity" | "unstake" | "withdraw" | "withdraw-with-bond";
|
|
571
571
|
source: (string | {
|
|
572
572
|
type: "column";
|
|
573
573
|
column: string;
|
|
@@ -638,7 +638,7 @@ export declare const parserSchema: z.ZodObject<{
|
|
|
638
638
|
type: "not-in";
|
|
639
639
|
};
|
|
640
640
|
}[];
|
|
641
|
-
action: "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "fee" | "transaction-fee" | "approve" | "fail-tx" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "
|
|
641
|
+
action: "reduce" | "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "burn" | "derivative-fee" | "fee" | "interest-fee" | "pay" | "realize-loss" | "stolen" | "transaction-fee" | "approve" | "fail-tx" | "ignore" | "move" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "airdrop" | "cash-back" | "derivative-profit" | "free-mint" | "game-reward" | "gift" | "hardfork" | "income" | "interest" | "mining" | "nft-royalty" | "realize-profit" | "staking-reward" | "liquidation" | "repayment" | "replace" | "swap-nft" | "unwrap" | "wrap" | "atomic-arbitrage" | "buy-crypto" | "buy-nft" | "mint-nft" | "sell-crypto" | "sell-nft" | "trade" | "transfer" | "value-down" | "value-up" | "remove-liquidity" | "unstake" | "withdraw" | "withdraw-with-bond";
|
|
642
642
|
source: (string | {
|
|
643
643
|
type: "column";
|
|
644
644
|
column: string;
|
|
@@ -756,7 +756,7 @@ export declare const parsersSchema: z.ZodArray<z.ZodObject<{
|
|
|
756
756
|
type: "not-in";
|
|
757
757
|
};
|
|
758
758
|
}>, "many">;
|
|
759
|
-
action: z.ZodUnion<[z.ZodLiteral<"borrow">, z.ZodLiteral<"bridge-from">, z.ZodLiteral<"bridge-to">, z.ZodLiteral<"cross-replace">, z.ZodLiteral<"cross-trade">, z.ZodLiteral<"add-liquidity">, z.ZodLiteral<"deposit">, z.ZodLiteral<"deposit-with-bond">, z.ZodLiteral<"stake">, z.ZodLiteral<"fee">, z.ZodLiteral<"transaction-fee">, z.ZodLiteral<"approve">, z.ZodLiteral<"fail-tx">, z.ZodLiteral<"receive-from-cex">, z.ZodLiteral<"revoke">, z.ZodLiteral<"send-to-cex">, z.ZodLiteral<"spam">, z.ZodLiteral<"
|
|
759
|
+
action: z.ZodUnion<[z.ZodLiteral<"borrow">, z.ZodLiteral<"bridge-from">, z.ZodLiteral<"bridge-to">, z.ZodLiteral<"cross-replace">, z.ZodLiteral<"cross-trade">, z.ZodLiteral<"add-liquidity">, z.ZodLiteral<"deposit">, z.ZodLiteral<"deposit-with-bond">, z.ZodLiteral<"stake">, z.ZodLiteral<"burn">, z.ZodLiteral<"derivative-fee">, z.ZodLiteral<"fee">, z.ZodLiteral<"interest-fee">, z.ZodLiteral<"pay">, z.ZodLiteral<"realize-loss">, z.ZodLiteral<"stolen">, z.ZodLiteral<"transaction-fee">, z.ZodLiteral<"approve">, z.ZodLiteral<"fail-tx">, z.ZodLiteral<"ignore">, z.ZodLiteral<"move">, z.ZodLiteral<"receive-from-cex">, z.ZodLiteral<"revoke">, z.ZodLiteral<"send-to-cex">, z.ZodLiteral<"spam">, z.ZodLiteral<"airdrop">, z.ZodLiteral<"cash-back">, z.ZodLiteral<"derivative-profit">, z.ZodLiteral<"free-mint">, z.ZodLiteral<"game-reward">, z.ZodLiteral<"gift">, z.ZodLiteral<"hardfork">, z.ZodLiteral<"income">, z.ZodLiteral<"interest">, z.ZodLiteral<"mining">, z.ZodLiteral<"nft-royalty">, z.ZodLiteral<"realize-profit">, z.ZodLiteral<"staking-reward">, z.ZodLiteral<"liquidation">, z.ZodLiteral<"reduce">, z.ZodLiteral<"repayment">, z.ZodLiteral<"replace">, z.ZodLiteral<"swap-nft">, z.ZodLiteral<"unwrap">, z.ZodLiteral<"wrap">, z.ZodLiteral<"atomic-arbitrage">, z.ZodLiteral<"buy-crypto">, z.ZodLiteral<"buy-nft">, z.ZodLiteral<"mint-nft">, z.ZodLiteral<"sell-crypto">, z.ZodLiteral<"sell-nft">, z.ZodLiteral<"trade">, z.ZodLiteral<"transfer">, z.ZodLiteral<"value-down">, z.ZodLiteral<"value-up">, z.ZodLiteral<"remove-liquidity">, z.ZodLiteral<"unstake">, z.ZodLiteral<"withdraw">, z.ZodLiteral<"withdraw-with-bond">]>;
|
|
760
760
|
/** 指定した値群を結合して作成したテキストを代入 */
|
|
761
761
|
source: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
762
762
|
type: z.ZodLiteral<"service">;
|
|
@@ -977,7 +977,7 @@ export declare const parsersSchema: z.ZodArray<z.ZodObject<{
|
|
|
977
977
|
type: "not-in";
|
|
978
978
|
};
|
|
979
979
|
}[];
|
|
980
|
-
action: "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "fee" | "transaction-fee" | "approve" | "fail-tx" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "
|
|
980
|
+
action: "reduce" | "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "burn" | "derivative-fee" | "fee" | "interest-fee" | "pay" | "realize-loss" | "stolen" | "transaction-fee" | "approve" | "fail-tx" | "ignore" | "move" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "airdrop" | "cash-back" | "derivative-profit" | "free-mint" | "game-reward" | "gift" | "hardfork" | "income" | "interest" | "mining" | "nft-royalty" | "realize-profit" | "staking-reward" | "liquidation" | "repayment" | "replace" | "swap-nft" | "unwrap" | "wrap" | "atomic-arbitrage" | "buy-crypto" | "buy-nft" | "mint-nft" | "sell-crypto" | "sell-nft" | "trade" | "transfer" | "value-down" | "value-up" | "remove-liquidity" | "unstake" | "withdraw" | "withdraw-with-bond";
|
|
981
981
|
source: (string | {
|
|
982
982
|
type: "column";
|
|
983
983
|
column: string;
|
|
@@ -1048,7 +1048,7 @@ export declare const parsersSchema: z.ZodArray<z.ZodObject<{
|
|
|
1048
1048
|
type: "not-in";
|
|
1049
1049
|
};
|
|
1050
1050
|
}[];
|
|
1051
|
-
action: "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "fee" | "transaction-fee" | "approve" | "fail-tx" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "
|
|
1051
|
+
action: "reduce" | "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "burn" | "derivative-fee" | "fee" | "interest-fee" | "pay" | "realize-loss" | "stolen" | "transaction-fee" | "approve" | "fail-tx" | "ignore" | "move" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "airdrop" | "cash-back" | "derivative-profit" | "free-mint" | "game-reward" | "gift" | "hardfork" | "income" | "interest" | "mining" | "nft-royalty" | "realize-profit" | "staking-reward" | "liquidation" | "repayment" | "replace" | "swap-nft" | "unwrap" | "wrap" | "atomic-arbitrage" | "buy-crypto" | "buy-nft" | "mint-nft" | "sell-crypto" | "sell-nft" | "trade" | "transfer" | "value-down" | "value-up" | "remove-liquidity" | "unstake" | "withdraw" | "withdraw-with-bond";
|
|
1052
1052
|
source: (string | {
|
|
1053
1053
|
type: "column";
|
|
1054
1054
|
column: string;
|
|
@@ -64,7 +64,7 @@ export declare const csvFormatSchema: z.ZodObject<{
|
|
|
64
64
|
type: "not-in";
|
|
65
65
|
};
|
|
66
66
|
}>, "many">;
|
|
67
|
-
action: z.ZodUnion<[z.ZodLiteral<"borrow">, z.ZodLiteral<"bridge-from">, z.ZodLiteral<"bridge-to">, z.ZodLiteral<"cross-replace">, z.ZodLiteral<"cross-trade">, z.ZodLiteral<"add-liquidity">, z.ZodLiteral<"deposit">, z.ZodLiteral<"deposit-with-bond">, z.ZodLiteral<"stake">, z.ZodLiteral<"fee">, z.ZodLiteral<"transaction-fee">, z.ZodLiteral<"approve">, z.ZodLiteral<"fail-tx">, z.ZodLiteral<"receive-from-cex">, z.ZodLiteral<"revoke">, z.ZodLiteral<"send-to-cex">, z.ZodLiteral<"spam">, z.ZodLiteral<"
|
|
67
|
+
action: z.ZodUnion<[z.ZodLiteral<"borrow">, z.ZodLiteral<"bridge-from">, z.ZodLiteral<"bridge-to">, z.ZodLiteral<"cross-replace">, z.ZodLiteral<"cross-trade">, z.ZodLiteral<"add-liquidity">, z.ZodLiteral<"deposit">, z.ZodLiteral<"deposit-with-bond">, z.ZodLiteral<"stake">, z.ZodLiteral<"burn">, z.ZodLiteral<"derivative-fee">, z.ZodLiteral<"fee">, z.ZodLiteral<"interest-fee">, z.ZodLiteral<"pay">, z.ZodLiteral<"realize-loss">, z.ZodLiteral<"stolen">, z.ZodLiteral<"transaction-fee">, z.ZodLiteral<"approve">, z.ZodLiteral<"fail-tx">, z.ZodLiteral<"ignore">, z.ZodLiteral<"move">, z.ZodLiteral<"receive-from-cex">, z.ZodLiteral<"revoke">, z.ZodLiteral<"send-to-cex">, z.ZodLiteral<"spam">, z.ZodLiteral<"airdrop">, z.ZodLiteral<"cash-back">, z.ZodLiteral<"derivative-profit">, z.ZodLiteral<"free-mint">, z.ZodLiteral<"game-reward">, z.ZodLiteral<"gift">, z.ZodLiteral<"hardfork">, z.ZodLiteral<"income">, z.ZodLiteral<"interest">, z.ZodLiteral<"mining">, z.ZodLiteral<"nft-royalty">, z.ZodLiteral<"realize-profit">, z.ZodLiteral<"staking-reward">, z.ZodLiteral<"liquidation">, z.ZodLiteral<"reduce">, z.ZodLiteral<"repayment">, z.ZodLiteral<"replace">, z.ZodLiteral<"swap-nft">, z.ZodLiteral<"unwrap">, z.ZodLiteral<"wrap">, z.ZodLiteral<"atomic-arbitrage">, z.ZodLiteral<"buy-crypto">, z.ZodLiteral<"buy-nft">, z.ZodLiteral<"mint-nft">, z.ZodLiteral<"sell-crypto">, z.ZodLiteral<"sell-nft">, z.ZodLiteral<"trade">, z.ZodLiteral<"transfer">, z.ZodLiteral<"value-down">, z.ZodLiteral<"value-up">, z.ZodLiteral<"remove-liquidity">, z.ZodLiteral<"unstake">, z.ZodLiteral<"withdraw">, z.ZodLiteral<"withdraw-with-bond">]>;
|
|
68
68
|
source: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
69
69
|
type: z.ZodLiteral<"service">;
|
|
70
70
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -279,7 +279,7 @@ export declare const csvFormatSchema: z.ZodObject<{
|
|
|
279
279
|
type: "not-in";
|
|
280
280
|
};
|
|
281
281
|
}[];
|
|
282
|
-
action: "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "fee" | "transaction-fee" | "approve" | "fail-tx" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "
|
|
282
|
+
action: "reduce" | "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "burn" | "derivative-fee" | "fee" | "interest-fee" | "pay" | "realize-loss" | "stolen" | "transaction-fee" | "approve" | "fail-tx" | "ignore" | "move" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "airdrop" | "cash-back" | "derivative-profit" | "free-mint" | "game-reward" | "gift" | "hardfork" | "income" | "interest" | "mining" | "nft-royalty" | "realize-profit" | "staking-reward" | "liquidation" | "repayment" | "replace" | "swap-nft" | "unwrap" | "wrap" | "atomic-arbitrage" | "buy-crypto" | "buy-nft" | "mint-nft" | "sell-crypto" | "sell-nft" | "trade" | "transfer" | "value-down" | "value-up" | "remove-liquidity" | "unstake" | "withdraw" | "withdraw-with-bond";
|
|
283
283
|
source: (string | {
|
|
284
284
|
type: "column";
|
|
285
285
|
column: string;
|
|
@@ -350,7 +350,7 @@ export declare const csvFormatSchema: z.ZodObject<{
|
|
|
350
350
|
type: "not-in";
|
|
351
351
|
};
|
|
352
352
|
}[];
|
|
353
|
-
action: "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "fee" | "transaction-fee" | "approve" | "fail-tx" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "
|
|
353
|
+
action: "reduce" | "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "burn" | "derivative-fee" | "fee" | "interest-fee" | "pay" | "realize-loss" | "stolen" | "transaction-fee" | "approve" | "fail-tx" | "ignore" | "move" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "airdrop" | "cash-back" | "derivative-profit" | "free-mint" | "game-reward" | "gift" | "hardfork" | "income" | "interest" | "mining" | "nft-royalty" | "realize-profit" | "staking-reward" | "liquidation" | "repayment" | "replace" | "swap-nft" | "unwrap" | "wrap" | "atomic-arbitrage" | "buy-crypto" | "buy-nft" | "mint-nft" | "sell-crypto" | "sell-nft" | "trade" | "transfer" | "value-down" | "value-up" | "remove-liquidity" | "unstake" | "withdraw" | "withdraw-with-bond";
|
|
354
354
|
source: (string | {
|
|
355
355
|
type: "column";
|
|
356
356
|
column: string;
|
|
@@ -427,7 +427,7 @@ export declare const csvFormatSchema: z.ZodObject<{
|
|
|
427
427
|
type: "not-in";
|
|
428
428
|
};
|
|
429
429
|
}[];
|
|
430
|
-
action: "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "fee" | "transaction-fee" | "approve" | "fail-tx" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "
|
|
430
|
+
action: "reduce" | "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "burn" | "derivative-fee" | "fee" | "interest-fee" | "pay" | "realize-loss" | "stolen" | "transaction-fee" | "approve" | "fail-tx" | "ignore" | "move" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "airdrop" | "cash-back" | "derivative-profit" | "free-mint" | "game-reward" | "gift" | "hardfork" | "income" | "interest" | "mining" | "nft-royalty" | "realize-profit" | "staking-reward" | "liquidation" | "repayment" | "replace" | "swap-nft" | "unwrap" | "wrap" | "atomic-arbitrage" | "buy-crypto" | "buy-nft" | "mint-nft" | "sell-crypto" | "sell-nft" | "trade" | "transfer" | "value-down" | "value-up" | "remove-liquidity" | "unstake" | "withdraw" | "withdraw-with-bond";
|
|
431
431
|
source: (string | {
|
|
432
432
|
type: "column";
|
|
433
433
|
column: string;
|
|
@@ -504,7 +504,7 @@ export declare const csvFormatSchema: z.ZodObject<{
|
|
|
504
504
|
type: "not-in";
|
|
505
505
|
};
|
|
506
506
|
}[];
|
|
507
|
-
action: "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "fee" | "transaction-fee" | "approve" | "fail-tx" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "
|
|
507
|
+
action: "reduce" | "borrow" | "bridge-from" | "bridge-to" | "cross-replace" | "cross-trade" | "add-liquidity" | "deposit" | "deposit-with-bond" | "stake" | "burn" | "derivative-fee" | "fee" | "interest-fee" | "pay" | "realize-loss" | "stolen" | "transaction-fee" | "approve" | "fail-tx" | "ignore" | "move" | "receive-from-cex" | "revoke" | "send-to-cex" | "spam" | "airdrop" | "cash-back" | "derivative-profit" | "free-mint" | "game-reward" | "gift" | "hardfork" | "income" | "interest" | "mining" | "nft-royalty" | "realize-profit" | "staking-reward" | "liquidation" | "repayment" | "replace" | "swap-nft" | "unwrap" | "wrap" | "atomic-arbitrage" | "buy-crypto" | "buy-nft" | "mint-nft" | "sell-crypto" | "sell-nft" | "trade" | "transfer" | "value-down" | "value-up" | "remove-liquidity" | "unstake" | "withdraw" | "withdraw-with-bond";
|
|
508
508
|
source: (string | {
|
|
509
509
|
type: "column";
|
|
510
510
|
column: string;
|
package/_types/test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,SAA8C,CAAA;AAExE,eAAO,MAAM,cAAc,SAA8C,CAAA;AAEzE,eAAO,MAAM,aAAa,SAA8C,CAAA;AAExE,eAAO,MAAM,QAAQ,SAAuC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xtorch/csv",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Cryptorch CSV extension",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cryptorch",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@0xtorch/big-decimal": "^0.0.10",
|
|
38
|
-
"@0xtorch/core": "^0.0.
|
|
38
|
+
"@0xtorch/core": "^0.0.39",
|
|
39
39
|
"encoding-japanese": "^2.1.0",
|
|
40
40
|
"papaparse": "^5.4.1",
|
|
41
41
|
"zod": "^3.23.8"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
CryptoCurrency,
|
|
4
|
-
CryptoCurrencyDataSource,
|
|
5
|
-
FiatCurrency,
|
|
1
|
+
import {
|
|
2
|
+
type Action,
|
|
3
|
+
type CryptoCurrency,
|
|
4
|
+
type CryptoCurrencyDataSource,
|
|
5
|
+
type FiatCurrency,
|
|
6
|
+
setActionPrices,
|
|
6
7
|
} from '@0xtorch/core'
|
|
7
|
-
import { setAccountActionPrices } from '@0xtorch/core'
|
|
8
8
|
import { formatCsvRows } from './formatCsvRows'
|
|
9
9
|
import { parseCsvFileToText } from './parseCsvFileToText'
|
|
10
|
-
import {
|
|
10
|
+
import { parseCsvRowsToActions } from './parseCsvRowsToActions'
|
|
11
11
|
import { parseCsvText } from './parseCsvText'
|
|
12
12
|
import type { CsvFormat } from './types'
|
|
13
13
|
|
|
@@ -29,15 +29,13 @@ export const parseCsvFileToAccountActions = async ({
|
|
|
29
29
|
fiatCurrencies,
|
|
30
30
|
fiat,
|
|
31
31
|
cryptoCurrencyDataSource,
|
|
32
|
-
}: ParseCsvFileToAccountActionsParameters): Promise<
|
|
33
|
-
readonly AccountAction[]
|
|
34
|
-
> => {
|
|
32
|
+
}: ParseCsvFileToAccountActionsParameters): Promise<readonly Action[]> => {
|
|
35
33
|
const text = await parseCsvFileToText(file)
|
|
36
34
|
const rows = formatCsvRows({
|
|
37
35
|
rows: parseCsvText(text),
|
|
38
36
|
formatter,
|
|
39
37
|
})
|
|
40
|
-
const actions =
|
|
38
|
+
const actions = parseCsvRowsToActions({
|
|
41
39
|
rows,
|
|
42
40
|
service,
|
|
43
41
|
parsers,
|
|
@@ -46,9 +44,9 @@ export const parseCsvFileToAccountActions = async ({
|
|
|
46
44
|
cryptoCurrencies,
|
|
47
45
|
fiatCurrencies,
|
|
48
46
|
})
|
|
49
|
-
return await
|
|
47
|
+
return await setActionPrices({
|
|
48
|
+
dataSource: cryptoCurrencyDataSource,
|
|
50
49
|
actions,
|
|
51
50
|
fiat,
|
|
52
|
-
cryptoCurrencyDataSource,
|
|
53
51
|
})
|
|
54
52
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { parseCsvRowToAction } from './parseCsvRowToAction'
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
BaseNormalAction,
|
|
3
|
-
CryptoCurrency,
|
|
4
|
-
FiatCurrency,
|
|
5
|
-
NormalAction,
|
|
6
|
-
} from '@0xtorch/core'
|
|
7
|
-
import { parseBaseNormalActionToNormalAction } from '@0xtorch/core'
|
|
1
|
+
import type { Action, CryptoCurrency, FiatCurrency } from '@0xtorch/core'
|
|
8
2
|
import type { FormattedRow, Parser } from '../types'
|
|
9
3
|
import { matchCondition } from './condition'
|
|
10
4
|
import { createNftByNftComponent } from './nft'
|
|
@@ -12,7 +6,7 @@ import { createTextByComponent } from './text'
|
|
|
12
6
|
import { createTimestampByRow } from './timestamp'
|
|
13
7
|
import { createTransferByComponent } from './transfer'
|
|
14
8
|
|
|
15
|
-
type
|
|
9
|
+
type ParseCsvRowToActionParameters = {
|
|
16
10
|
readonly row: FormattedRow
|
|
17
11
|
readonly service: string
|
|
18
12
|
readonly parsers: readonly Parser[]
|
|
@@ -22,14 +16,7 @@ type ParseCsvRowToNormalActionParameters = {
|
|
|
22
16
|
readonly fiatCurrencies: readonly FiatCurrency[]
|
|
23
17
|
}
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
| {
|
|
27
|
-
readonly action: NormalAction
|
|
28
|
-
readonly source: string
|
|
29
|
-
}
|
|
30
|
-
| undefined
|
|
31
|
-
|
|
32
|
-
export const parseCsvRowToNormalAction = ({
|
|
19
|
+
export const parseCsvRowToAction = ({
|
|
33
20
|
row,
|
|
34
21
|
service,
|
|
35
22
|
parsers,
|
|
@@ -37,10 +24,10 @@ export const parseCsvRowToNormalAction = ({
|
|
|
37
24
|
accountId,
|
|
38
25
|
cryptoCurrencies,
|
|
39
26
|
fiatCurrencies,
|
|
40
|
-
}:
|
|
27
|
+
}: ParseCsvRowToActionParameters): Action | undefined => {
|
|
41
28
|
for (const parser of parsers) {
|
|
42
29
|
try {
|
|
43
|
-
const action =
|
|
30
|
+
const action = parseCsvRowToActionByParser({
|
|
44
31
|
row,
|
|
45
32
|
service,
|
|
46
33
|
parser,
|
|
@@ -55,13 +42,12 @@ export const parseCsvRowToNormalAction = ({
|
|
|
55
42
|
} catch (error) {
|
|
56
43
|
// TODO 意図しないエラーは別途記録できるようにしたい
|
|
57
44
|
console.debug(error)
|
|
58
|
-
continue
|
|
59
45
|
}
|
|
60
46
|
}
|
|
61
47
|
return undefined
|
|
62
48
|
}
|
|
63
49
|
|
|
64
|
-
type
|
|
50
|
+
type ParseCsvRowToActionByParserParameters = {
|
|
65
51
|
readonly row: FormattedRow
|
|
66
52
|
readonly service: string
|
|
67
53
|
readonly parser: Parser
|
|
@@ -71,7 +57,7 @@ type ParseCsvRowToNormalActionByParserParameters = {
|
|
|
71
57
|
readonly fiatCurrencies: readonly FiatCurrency[]
|
|
72
58
|
}
|
|
73
59
|
|
|
74
|
-
const
|
|
60
|
+
const parseCsvRowToActionByParser = ({
|
|
75
61
|
row,
|
|
76
62
|
service,
|
|
77
63
|
parser,
|
|
@@ -79,7 +65,7 @@ const parseCsvRowToNormalActionByParser = ({
|
|
|
79
65
|
accountId,
|
|
80
66
|
cryptoCurrencies,
|
|
81
67
|
fiatCurrencies,
|
|
82
|
-
}:
|
|
68
|
+
}: ParseCsvRowToActionByParserParameters): Action | undefined => {
|
|
83
69
|
// 合致しない condition がある場合は undefined を返す
|
|
84
70
|
for (const condition of parser.conditions) {
|
|
85
71
|
if (!matchCondition({ row, component: condition })) {
|
|
@@ -87,8 +73,12 @@ const parseCsvRowToNormalActionByParser = ({
|
|
|
87
73
|
}
|
|
88
74
|
}
|
|
89
75
|
|
|
90
|
-
|
|
91
|
-
|
|
76
|
+
return {
|
|
77
|
+
source: parser.source
|
|
78
|
+
.map((component) => createTextByComponent({ row, service, component }))
|
|
79
|
+
.join(''),
|
|
80
|
+
order: 0,
|
|
81
|
+
type: parser.action,
|
|
92
82
|
evidence: 'system-rule',
|
|
93
83
|
timestamp: createTimestampByRow({ row, column: parser.timestamp }),
|
|
94
84
|
comment:
|
|
@@ -133,14 +123,4 @@ const parseCsvRowToNormalActionByParser = ({
|
|
|
133
123
|
? undefined
|
|
134
124
|
: createNftByNftComponent({ row, service, component: parser.target }),
|
|
135
125
|
}
|
|
136
|
-
|
|
137
|
-
const action = parseBaseNormalActionToNormalAction(baseAction)
|
|
138
|
-
const source = parser.source
|
|
139
|
-
.map((component) => createTextByComponent({ row, service, component }))
|
|
140
|
-
.join('')
|
|
141
|
-
|
|
142
|
-
return {
|
|
143
|
-
action,
|
|
144
|
-
source,
|
|
145
|
-
}
|
|
146
126
|
}
|
|
@@ -25,13 +25,14 @@ export const createTextByComponent = ({
|
|
|
25
25
|
const value = row[component.column]
|
|
26
26
|
if (value === undefined) {
|
|
27
27
|
return ''
|
|
28
|
-
}
|
|
28
|
+
}
|
|
29
|
+
if (typeof value === 'string') {
|
|
29
30
|
return value
|
|
30
|
-
}
|
|
31
|
+
}
|
|
32
|
+
if (typeof value === 'number') {
|
|
31
33
|
return value.toString()
|
|
32
|
-
} else {
|
|
33
|
-
return toStringBigDecimal(value)
|
|
34
34
|
}
|
|
35
|
+
return toStringBigDecimal(value)
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { parseNormalActionToAccountActions } from '@0xtorch/core'
|
|
4
|
-
import { parseCsvRowToNormalAction } from './parseCsvRowToNormalAction'
|
|
1
|
+
import type { Action, CryptoCurrency, FiatCurrency } from '@0xtorch/core'
|
|
2
|
+
import { parseCsvRowToAction } from './parseCsvRowToAction'
|
|
5
3
|
import type { FormattedRow, Parser } from './types'
|
|
6
4
|
|
|
7
|
-
type
|
|
5
|
+
type ParseCsvRowsToActionsParameters = {
|
|
8
6
|
readonly rows: readonly FormattedRow[]
|
|
9
7
|
readonly service: string
|
|
10
8
|
readonly parsers: readonly Parser[]
|
|
@@ -14,7 +12,7 @@ type ParseCsvRowsToAccountActionsParameters = {
|
|
|
14
12
|
readonly fiatCurrencies: readonly FiatCurrency[]
|
|
15
13
|
}
|
|
16
14
|
|
|
17
|
-
export const
|
|
15
|
+
export const parseCsvRowsToActions = ({
|
|
18
16
|
rows,
|
|
19
17
|
service,
|
|
20
18
|
parsers,
|
|
@@ -22,19 +20,13 @@ export const parseCsvRowsToAccountActions = ({
|
|
|
22
20
|
accountId,
|
|
23
21
|
cryptoCurrencies,
|
|
24
22
|
fiatCurrencies,
|
|
25
|
-
}:
|
|
23
|
+
}: ParseCsvRowsToActionsParameters): readonly Action[] => {
|
|
26
24
|
// marketCap で降順 sort
|
|
27
|
-
const sortedCryptoCurrencies = cryptoCurrencies.toSorted(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
if (b.market.marketCapUsd === undefined) {
|
|
32
|
-
return 1
|
|
33
|
-
}
|
|
34
|
-
return greaterThan(a.market.marketCapUsd, b.market.marketCapUsd) ? -1 : 1
|
|
35
|
-
})
|
|
25
|
+
const sortedCryptoCurrencies = cryptoCurrencies.toSorted(
|
|
26
|
+
(a, b) => (b.market?.marketCapUsd ?? -1) - (a.market?.marketCapUsd ?? -1),
|
|
27
|
+
)
|
|
36
28
|
const actions = rows.flatMap((row) => {
|
|
37
|
-
const
|
|
29
|
+
const action = parseCsvRowToAction({
|
|
38
30
|
row,
|
|
39
31
|
service,
|
|
40
32
|
parsers,
|
|
@@ -43,19 +35,14 @@ export const parseCsvRowsToAccountActions = ({
|
|
|
43
35
|
cryptoCurrencies: sortedCryptoCurrencies,
|
|
44
36
|
fiatCurrencies,
|
|
45
37
|
})
|
|
46
|
-
if (
|
|
38
|
+
if (action === undefined) {
|
|
47
39
|
// TODO action が生成できなかった行を記録したい
|
|
48
40
|
return []
|
|
49
41
|
}
|
|
50
|
-
|
|
51
|
-
return parseNormalActionToAccountActions({
|
|
52
|
-
action,
|
|
53
|
-
accountIds: new Set([accountId]),
|
|
54
|
-
source,
|
|
55
|
-
})
|
|
42
|
+
return action
|
|
56
43
|
})
|
|
57
44
|
const mut_sources: string[] = []
|
|
58
|
-
const mut_actions:
|
|
45
|
+
const mut_actions: Action[] = []
|
|
59
46
|
for (const action of actions) {
|
|
60
47
|
mut_actions.push({
|
|
61
48
|
...action,
|
package/schemas/parser.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { actionTypeUnionSchema } from '@0xtorch/core'
|
|
2
2
|
import { z } from 'zod'
|
|
3
3
|
|
|
4
4
|
export const conditionComponentSchema = z.object({
|
|
@@ -36,7 +36,7 @@ export const columnComponentSchema = z.object({
|
|
|
36
36
|
|
|
37
37
|
export const actionComponentSchema = z.object({
|
|
38
38
|
column: z.string(),
|
|
39
|
-
patterns: z.record(
|
|
39
|
+
patterns: z.record(actionTypeUnionSchema),
|
|
40
40
|
})
|
|
41
41
|
|
|
42
42
|
const serviceComponentSchema = z.object({
|
|
@@ -86,7 +86,7 @@ export const transferComponentSchema = z.object({
|
|
|
86
86
|
|
|
87
87
|
export const parserSchema = z.object({
|
|
88
88
|
conditions: z.array(conditionComponentSchema),
|
|
89
|
-
action:
|
|
89
|
+
action: actionTypeUnionSchema,
|
|
90
90
|
/** 指定した値群を結合して作成したテキストを代入 */
|
|
91
91
|
source: z.array(textComponentSchema),
|
|
92
92
|
/** 指定した column の値を timestamp に代入 */
|
package/test.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const IS_SMALL_TEST = (process.env.TEST_SIZE ?? '').includes('S')
|
|
2
|
+
|
|
3
|
+
export const IS_MEDIUM_TEST = (process.env.TEST_SIZE ?? '').includes('M')
|
|
4
|
+
|
|
5
|
+
export const IS_LARGE_TEST = (process.env.TEST_SIZE ?? '').includes('L')
|
|
6
|
+
|
|
7
|
+
export const IS_DEBUG = (process.env.DEBUG ?? '').length > 0
|