@argent/x-shared 1.65.0 → 1.66.1
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 +1 -1
- package/dist/index.js +407 -402
- package/dist/node_modules/.pnpm/@starknet-io_types-js@0.7.7/node_modules/@starknet-io/types-js/dist/esm/api/nonspec.cjs +1 -0
- package/dist/node_modules/.pnpm/@starknet-io_types-js@0.7.7/node_modules/@starknet-io/types-js/dist/esm/api/nonspec.js +6 -0
- package/dist/src/accountNameGenerator/x-names.json.js +1 -1
- package/dist/src/chains/starknet/network.cjs +1 -1
- package/dist/src/chains/starknet/network.d.ts +1 -0
- package/dist/src/chains/starknet/network.js +18 -10
- package/dist/src/features/paymaster/PaymasterService.cjs +1 -1
- package/dist/src/features/paymaster/PaymasterService.d.ts +0 -1
- package/dist/src/features/paymaster/PaymasterService.js +19 -25
- package/dist/src/features/swap/models/execute.model.d.ts +35 -0
- package/dist/src/features/swap/models/index.d.ts +1 -0
- package/dist/src/features/swap/services/ISwapTransactionService.d.ts +10 -0
- package/dist/src/features/swap/services/{implementation.d.ts → SwapSharedService.d.ts} +1 -1
- package/dist/src/features/swap/services/SwapTransactionService.cjs +1 -0
- package/dist/src/features/swap/services/SwapTransactionService.d.ts +15 -0
- package/dist/src/features/swap/services/SwapTransactionService.js +60 -0
- package/dist/src/features/swap/services/index.d.ts +4 -2
- package/dist/src/transactions/estimate/utilsV2.cjs +1 -1
- package/dist/src/transactions/estimate/utilsV2.js +1 -1
- package/dist/src/transactions/getTransactionVersion.cjs +1 -1
- package/dist/src/transactions/getTransactionVersion.js +16 -16
- package/dist/src/transactions/index.d.ts +1 -0
- package/dist/src/transactions/transactionExecuteTypes.cjs +1 -0
- package/dist/src/transactions/transactionExecuteTypes.d.ts +114 -0
- package/dist/src/transactions/transactionExecuteTypes.js +23 -0
- package/dist/swap.cjs +1 -1
- package/dist/swap.js +20 -18
- package/package.json +11 -11
- /package/dist/src/features/swap/services/{interface.d.ts → ISwapSharedService.d.ts} +0 -0
- /package/dist/src/features/swap/services/{implementation.cjs → SwapSharedService.cjs} +0 -0
- /package/dist/src/features/swap/services/{implementation.js → SwapSharedService.js} +0 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const transactionPromotionPrizeSchema: z.ZodObject<{
|
|
3
|
+
tokenType: z.ZodString;
|
|
4
|
+
tokenAddress: z.ZodString;
|
|
5
|
+
tokenAmount: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
tokenAddress: string;
|
|
8
|
+
tokenType: string;
|
|
9
|
+
tokenAmount: string;
|
|
10
|
+
}, {
|
|
11
|
+
tokenAddress: string;
|
|
12
|
+
tokenType: string;
|
|
13
|
+
tokenAmount: string;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const transactionPromotionSchema: z.ZodObject<{
|
|
16
|
+
type: z.ZodEnum<["lootbox"]>;
|
|
17
|
+
status: z.ZodEnum<["notEligible", "win", "loss", "disabled"]>;
|
|
18
|
+
prizes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
19
|
+
tokenType: z.ZodString;
|
|
20
|
+
tokenAddress: z.ZodString;
|
|
21
|
+
tokenAmount: z.ZodString;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
tokenAddress: string;
|
|
24
|
+
tokenType: string;
|
|
25
|
+
tokenAmount: string;
|
|
26
|
+
}, {
|
|
27
|
+
tokenAddress: string;
|
|
28
|
+
tokenType: string;
|
|
29
|
+
tokenAmount: string;
|
|
30
|
+
}>, "many">>>;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
type: "lootbox";
|
|
33
|
+
status: "notEligible" | "win" | "loss" | "disabled";
|
|
34
|
+
prizes?: {
|
|
35
|
+
tokenAddress: string;
|
|
36
|
+
tokenType: string;
|
|
37
|
+
tokenAmount: string;
|
|
38
|
+
}[] | null | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
type: "lootbox";
|
|
41
|
+
status: "notEligible" | "win" | "loss" | "disabled";
|
|
42
|
+
prizes?: {
|
|
43
|
+
tokenAddress: string;
|
|
44
|
+
tokenType: string;
|
|
45
|
+
tokenAmount: string;
|
|
46
|
+
}[] | null | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
export declare const transactionExecutionResponseSchema: z.ZodObject<{
|
|
49
|
+
transactionState: z.ZodOptional<z.ZodEnum<["submitted", "rejected"]>>;
|
|
50
|
+
transactionHash: z.ZodString;
|
|
51
|
+
rejectReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
52
|
+
promotions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
53
|
+
type: z.ZodEnum<["lootbox"]>;
|
|
54
|
+
status: z.ZodEnum<["notEligible", "win", "loss", "disabled"]>;
|
|
55
|
+
prizes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
56
|
+
tokenType: z.ZodString;
|
|
57
|
+
tokenAddress: z.ZodString;
|
|
58
|
+
tokenAmount: z.ZodString;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
tokenAddress: string;
|
|
61
|
+
tokenType: string;
|
|
62
|
+
tokenAmount: string;
|
|
63
|
+
}, {
|
|
64
|
+
tokenAddress: string;
|
|
65
|
+
tokenType: string;
|
|
66
|
+
tokenAmount: string;
|
|
67
|
+
}>, "many">>>;
|
|
68
|
+
}, "strip", z.ZodTypeAny, {
|
|
69
|
+
type: "lootbox";
|
|
70
|
+
status: "notEligible" | "win" | "loss" | "disabled";
|
|
71
|
+
prizes?: {
|
|
72
|
+
tokenAddress: string;
|
|
73
|
+
tokenType: string;
|
|
74
|
+
tokenAmount: string;
|
|
75
|
+
}[] | null | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
type: "lootbox";
|
|
78
|
+
status: "notEligible" | "win" | "loss" | "disabled";
|
|
79
|
+
prizes?: {
|
|
80
|
+
tokenAddress: string;
|
|
81
|
+
tokenType: string;
|
|
82
|
+
tokenAmount: string;
|
|
83
|
+
}[] | null | undefined;
|
|
84
|
+
}>, "many">>>;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
transactionHash: string;
|
|
87
|
+
promotions?: {
|
|
88
|
+
type: "lootbox";
|
|
89
|
+
status: "notEligible" | "win" | "loss" | "disabled";
|
|
90
|
+
prizes?: {
|
|
91
|
+
tokenAddress: string;
|
|
92
|
+
tokenType: string;
|
|
93
|
+
tokenAmount: string;
|
|
94
|
+
}[] | null | undefined;
|
|
95
|
+
}[] | null | undefined;
|
|
96
|
+
transactionState?: "rejected" | "submitted" | undefined;
|
|
97
|
+
rejectReason?: string | null | undefined;
|
|
98
|
+
}, {
|
|
99
|
+
transactionHash: string;
|
|
100
|
+
promotions?: {
|
|
101
|
+
type: "lootbox";
|
|
102
|
+
status: "notEligible" | "win" | "loss" | "disabled";
|
|
103
|
+
prizes?: {
|
|
104
|
+
tokenAddress: string;
|
|
105
|
+
tokenType: string;
|
|
106
|
+
tokenAmount: string;
|
|
107
|
+
}[] | null | undefined;
|
|
108
|
+
}[] | null | undefined;
|
|
109
|
+
transactionState?: "rejected" | "submitted" | undefined;
|
|
110
|
+
rejectReason?: string | null | undefined;
|
|
111
|
+
}>;
|
|
112
|
+
export type TransactionExecutionResponse = z.infer<typeof transactionExecutionResponseSchema>;
|
|
113
|
+
export type TransactionPromotion = z.infer<typeof transactionPromotionSchema>;
|
|
114
|
+
export type TransactionPromotionPrize = z.infer<typeof transactionPromotionPrizeSchema>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z as t } from "zod";
|
|
2
|
+
const o = t.object({
|
|
3
|
+
tokenType: t.string(),
|
|
4
|
+
tokenAddress: t.string(),
|
|
5
|
+
tokenAmount: t.string()
|
|
6
|
+
}), n = t.object({
|
|
7
|
+
type: t.enum(["lootbox"]),
|
|
8
|
+
status: t.enum(["notEligible", "win", "loss", "disabled"]),
|
|
9
|
+
prizes: t.array(o).nullable().optional()
|
|
10
|
+
// need to support null values too
|
|
11
|
+
}), a = t.object({
|
|
12
|
+
transactionState: t.enum(["submitted", "rejected"]).optional(),
|
|
13
|
+
transactionHash: t.string(),
|
|
14
|
+
rejectReason: t.string().nullable().optional(),
|
|
15
|
+
// need to support null values too
|
|
16
|
+
promotions: t.array(n).nullable().optional()
|
|
17
|
+
// need to support null values too
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
a as transactionExecutionResponseSchema,
|
|
21
|
+
o as transactionPromotionPrizeSchema,
|
|
22
|
+
n as transactionPromotionSchema
|
|
23
|
+
};
|
package/dist/swap.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./src/features/swap/services/SwapSharedService.cjs"),S=require("./src/features/swap/services/SwapTransactionService.cjs"),r=require("./src/features/swap/models/order.model.cjs"),e=require("./src/features/swap/models/quote.model.cjs"),a=require("./src/features/swap/models/trade.model.cjs"),c=require("./src/features/swap/utils/totalFee.cjs"),t=require("./src/features/swap/utils/slippage.cjs");exports.SharedSwapService=o.SharedSwapService;exports.SwapTransactionService=S.SwapTransactionService;exports.SwapOrderRequestSchema=r.SwapOrderRequestSchema;exports.SwapOrderResponseSchema=r.SwapOrderResponseSchema;exports.SwapDataSchema=e.SwapDataSchema;exports.SwapQuoteResponseSchema=e.SwapQuoteResponseSchema;exports.SwapQuoteRouteSchema=e.SwapQuoteRouteSchema;exports.TradeSchema=a.TradeSchema;Object.defineProperty(exports,"TradeType",{enumerable:!0,get:()=>a.TradeType});exports.TradeTypeSchema=a.TradeTypeSchema;exports.calculateTotalFee=c.calculateTotalFee;exports.maximumAmountInForTrade=t.maximumAmountInForTrade;exports.minimumAmountOutFromTrade=t.minimumAmountOutFromTrade;
|
package/dist/swap.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { SharedSwapService as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { SharedSwapService as a } from "./src/features/swap/services/SwapSharedService.js";
|
|
2
|
+
import { SwapTransactionService as m } from "./src/features/swap/services/SwapTransactionService.js";
|
|
3
|
+
import { SwapOrderRequestSchema as t, SwapOrderResponseSchema as S } from "./src/features/swap/models/order.model.js";
|
|
4
|
+
import { SwapDataSchema as u, SwapQuoteResponseSchema as T, SwapQuoteRouteSchema as d } from "./src/features/swap/models/quote.model.js";
|
|
5
|
+
import { TradeSchema as n, TradeType as x, TradeTypeSchema as f } from "./src/features/swap/models/trade.model.js";
|
|
6
|
+
import { calculateTotalFee as i } from "./src/features/swap/utils/totalFee.js";
|
|
7
|
+
import { maximumAmountInForTrade as R, minimumAmountOutFromTrade as l } from "./src/features/swap/utils/slippage.js";
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
x as
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
a as SharedSwapService,
|
|
10
|
+
u as SwapDataSchema,
|
|
11
|
+
t as SwapOrderRequestSchema,
|
|
12
|
+
S as SwapOrderResponseSchema,
|
|
13
|
+
T as SwapQuoteResponseSchema,
|
|
14
|
+
d as SwapQuoteRouteSchema,
|
|
15
|
+
m as SwapTransactionService,
|
|
16
|
+
n as TradeSchema,
|
|
17
|
+
x as TradeType,
|
|
18
|
+
f as TradeTypeSchema,
|
|
19
|
+
i as calculateTotalFee,
|
|
20
|
+
R as maximumAmountInForTrade,
|
|
21
|
+
l as minimumAmountOutFromTrade
|
|
20
22
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argent/x-shared",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.66.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/argentlabs/x-shared.git"
|
|
@@ -54,28 +54,28 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@amplitude/analytics-types": "2.8.4",
|
|
57
|
-
"@commitlint/cli": "19.
|
|
58
|
-
"@commitlint/config-conventional": "19.
|
|
57
|
+
"@commitlint/cli": "19.7.1",
|
|
58
|
+
"@commitlint/config-conventional": "19.7.1",
|
|
59
59
|
"@rollup/plugin-typescript": "12.1.2",
|
|
60
60
|
"@semantic-release/git": "10.0.1",
|
|
61
61
|
"@types/async-retry": "1.4.9",
|
|
62
62
|
"@types/lodash-es": "4.17.12",
|
|
63
63
|
"@types/numeral": "2.0.5",
|
|
64
64
|
"@types/ua-parser-js": "0.7.39",
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
66
|
-
"@typescript-eslint/parser": "8.
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "8.23.0",
|
|
66
|
+
"@typescript-eslint/parser": "8.23.0",
|
|
67
67
|
"eslint": "8.57.1",
|
|
68
68
|
"eslint-config-prettier": "10.0.1",
|
|
69
69
|
"eslint-plugin-import": "2.31.0",
|
|
70
70
|
"husky": "9.1.7",
|
|
71
|
-
"lint-staged": "15.
|
|
72
|
-
"msw": "2.
|
|
71
|
+
"lint-staged": "15.4.3",
|
|
72
|
+
"msw": "2.7.0",
|
|
73
73
|
"prettier": "3.4.2",
|
|
74
|
-
"semantic-release": "24.2.
|
|
74
|
+
"semantic-release": "24.2.1",
|
|
75
75
|
"ts-to-zod": "3.15.0",
|
|
76
|
-
"typescript": "5.7.
|
|
77
|
-
"vite": "6.0.
|
|
78
|
-
"vite-plugin-dts": "4.
|
|
76
|
+
"typescript": "5.7.3",
|
|
77
|
+
"vite": "6.0.11",
|
|
78
|
+
"vite-plugin-dts": "4.5.0",
|
|
79
79
|
"vitest": "3.0.5"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|