@argent/x-shared 1.75.3 → 1.75.4
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/src/chains/starknet/getAddressFromArgentName.cjs +1 -1
- package/dist/src/chains/starknet/getAddressFromArgentName.js +7 -7
- package/dist/src/chains/starknet/services/address/StarknetAddressService.cjs +1 -1
- package/dist/src/chains/starknet/services/address/StarknetAddressService.js +9 -9
- package/dist/src/features/paymaster/types.cjs +1 -1
- package/dist/src/features/paymaster/types.js +1 -1
- package/dist/src/features/simulation/activity/schema.cjs +1 -1
- package/dist/src/features/simulation/activity/schema.d.ts +159 -0
- package/dist/src/features/simulation/activity/schema.js +47 -47
- package/dist/src/transactions/txv3.cjs +1 -1
- package/dist/src/transactions/txv3.js +4 -4
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("url-join"),s=require("zod"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("url-join"),s=require("zod"),d=require("./address.cjs"),m=require("./argentName.cjs"),o=require("../../errors/address.cjs"),w=require("../../http/HttpError.cjs"),E=s.z.object({walletAddress:d.addressSchemaArgentBackend,ens:m.argentNameSchema,chain:s.z.enum(["ethereum","starknet"]),deleted:s.z.boolean(),walletDeployed:s.z.boolean()}).or(s.z.object({status:s.z.string()}));async function N(t,n,a,c="starknet"){const i={ens:t,chain:c},l=new URLSearchParams(i),A=u(a,"wallet",`?${l}`);try{const e=await n.get(A),r=e&&"walletAddress"in e?e.walletAddress:void 0;if(!r)throw new o.AddressError({code:"NO_ADDRESS_FROM_ARGENT_NAME"});if(d.isZeroAddress(r))throw new o.AddressError({code:"ARGENT_NAME_NOT_FOUND",message:`${t} not found`});if(!d.isValidAddress(r))throw new o.AddressError({code:"ARGENT_NAME_INVALID_ADDRESS",message:`${t} resolved to an invalid address (${r})`});return d.normalizeAddress(r)}catch(e){throw e instanceof w.HttpError&&e.status===404?new o.AddressError({code:"ARGENT_NAME_NOT_FOUND",message:`${t} not found`}):e}}exports.apiWalletResponseSchema=E;exports.getAddressFromArgentName=N;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import m from "url-join";
|
|
2
2
|
import { z as s } from "zod";
|
|
3
|
+
import { addressSchemaArgentBackend as A, isZeroAddress as w, isValidAddress as f, normalizeAddress as N } from "./address.js";
|
|
4
|
+
import { argentNameSchema as h } from "./argentName.js";
|
|
3
5
|
import { AddressError as t } from "../../errors/address.js";
|
|
4
|
-
import { argentNameSchema as A } from "./argentName.js";
|
|
5
|
-
import { addressSchemaArgentBackend as w, isZeroAddress as f, isValidAddress as N, normalizeAddress as h } from "./address.js";
|
|
6
6
|
import { HttpError as _ } from "../../http/HttpError.js";
|
|
7
7
|
const O = s.object({
|
|
8
|
-
walletAddress:
|
|
9
|
-
ens:
|
|
8
|
+
walletAddress: A,
|
|
9
|
+
ens: h,
|
|
10
10
|
chain: s.enum(["ethereum", "starknet"]),
|
|
11
11
|
deleted: s.boolean(),
|
|
12
12
|
walletDeployed: s.boolean()
|
|
@@ -24,17 +24,17 @@ async function T(o, n, a, d = "starknet") {
|
|
|
24
24
|
throw new t({
|
|
25
25
|
code: "NO_ADDRESS_FROM_ARGENT_NAME"
|
|
26
26
|
});
|
|
27
|
-
if (
|
|
27
|
+
if (w(r))
|
|
28
28
|
throw new t({
|
|
29
29
|
code: "ARGENT_NAME_NOT_FOUND",
|
|
30
30
|
message: `${o} not found`
|
|
31
31
|
});
|
|
32
|
-
if (!
|
|
32
|
+
if (!f(r))
|
|
33
33
|
throw new t({
|
|
34
34
|
code: "ARGENT_NAME_INVALID_ADDRESS",
|
|
35
35
|
message: `${o} resolved to an invalid address (${r})`
|
|
36
36
|
});
|
|
37
|
-
return
|
|
37
|
+
return N(r);
|
|
38
38
|
} catch (e) {
|
|
39
39
|
throw e instanceof _ && e.status === 404 ? new t({
|
|
40
40
|
code: "ARGENT_NAME_NOT_FOUND",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../../address.cjs"),a=require("../../argentName.cjs"),o=require("../../getAddressFromArgentName.cjs"),n=require("../../getAddressFromStarkName.cjs"),i=require("../../starknetId.cjs"),s=require("../../../../errors/address.cjs");class A{constructor(e,r,t){this.httpService=e,this.baseUrl=r,this.allowedArgentNameNetworkId=t}async parseAddressOrDomain(e,r,t){if(d.isAddress(e))return d.normalizeAddress(e);try{return await this.getAddressFromDomainName(e,r,t)}catch{throw new s.AddressError({code:"NOT_VALID"})}}async getAddressFromDomainName(e,r,t){if(i.isStarknetId(e))return n.getAddressFromStarkName(e,r,t);if(a.isArgentName(e)){if(r!==this.allowedArgentNameNetworkId)throw new s.AddressError({code:"ARGENT_NAME_INVALID_NETWORK",message:`Argent name is only enabled on "${this.allowedArgentNameNetworkId}"`});return o.getAddressFromArgentName(e,this.httpService,this.baseUrl)}throw new s.AddressError({code:"NO_ADDRESS_FROM_DOMAIN"})}}exports.StarknetAddressService=A;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AddressError as s } from "../../../../errors/address.js";
|
|
2
1
|
import { isAddress as o, normalizeAddress as i } from "../../address.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { isArgentName as m } from "../../argentName.js";
|
|
3
|
+
import { getAddressFromArgentName as a } from "../../getAddressFromArgentName.js";
|
|
4
|
+
import { getAddressFromStarkName as d } from "../../getAddressFromStarkName.js";
|
|
5
|
+
import { isStarknetId as n } from "../../starknetId.js";
|
|
6
|
+
import { AddressError as s } from "../../../../errors/address.js";
|
|
7
7
|
class p {
|
|
8
8
|
constructor(e, r, t) {
|
|
9
9
|
this.httpService = e, this.baseUrl = r, this.allowedArgentNameNetworkId = t;
|
|
@@ -18,15 +18,15 @@ class p {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
async getAddressFromDomainName(e, r, t) {
|
|
21
|
-
if (
|
|
22
|
-
return
|
|
23
|
-
if (
|
|
21
|
+
if (n(e))
|
|
22
|
+
return d(e, r, t);
|
|
23
|
+
if (m(e)) {
|
|
24
24
|
if (r !== this.allowedArgentNameNetworkId)
|
|
25
25
|
throw new s({
|
|
26
26
|
code: "ARGENT_NAME_INVALID_NETWORK",
|
|
27
27
|
message: `Argent name is only enabled on "${this.allowedArgentNameNetworkId}"`
|
|
28
28
|
});
|
|
29
|
-
return
|
|
29
|
+
return a(e, this.httpService, this.baseUrl);
|
|
30
30
|
}
|
|
31
31
|
throw new s({
|
|
32
32
|
code: "NO_ADDRESS_FROM_DOMAIN"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("zod"),t=require("../../
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("zod"),t=require("../../chains/starknet/address.cjs"),r=require("../../utils/starknet/starknet.cjs"),e=require("../../backend/schema.cjs"),s=a.z.object({calls:a.z.array(r.callSchema),accountAddress:t.addressSchema,networkId:e.argentNetworkIdSchema.or(e.argentBackendNetworkIdSchema).optional(),feeTokenAddress:t.addressSchema,maxFee:r.bigNumberishSchema,accountClassHash:a.z.string().optional()}),o=a.z.object({signature:a.z.string().array(),accountAddress:t.addressSchema,typedData:r.typedDataSchema,networkId:e.argentNetworkIdSchema.or(e.argentBackendNetworkIdSchema).optional(),deploymentData:a.z.object({class_hash:a.z.string().optional(),salt:a.z.string().or(a.z.number()).or(a.z.bigint()).optional(),unique:a.z.string(),calldata:a.z.array(a.z.string())}).optional()}),n=a.z.object({transactionHash:a.z.string()});exports.paymasterExecuteParams=o;exports.paymasterExecuteResponse=n;exports.paymasterExecutionDataParams=s;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z as a } from "zod";
|
|
2
|
+
import { addressSchema as t } from "../../chains/starknet/address.js";
|
|
2
3
|
import { bigNumberishSchema as o, callSchema as s, typedDataSchema as n } from "../../utils/starknet/starknet.js";
|
|
3
4
|
import { argentNetworkIdSchema as e, argentBackendNetworkIdSchema as r } from "../../backend/schema.js";
|
|
4
|
-
import { addressSchema as t } from "../../chains/starknet/address.js";
|
|
5
5
|
const d = a.object({
|
|
6
6
|
calls: a.array(s),
|
|
7
7
|
accountAddress: t,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("zod"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("zod"),l=require("../transactionReview/schema.cjs"),c=require("../../../staking/schema.cjs"),e=require("../../../chains/starknet/address.cjs"),u=t.z.object({network:t.z.string(),hash:t.z.string(),status:t.z.string(),blockNumber:t.z.number().optional(),transactionIndex:t.z.number()}),n=t.z.object({type:t.z.enum(["token","nft"]),tokenAddress:e.addressSchemaArgentBackend,amount:t.z.string().optional(),fiatAmount:t.z.object({currency:t.z.string(),currencyAmount:t.z.number()}).optional().nullable()}),i=t.z.enum(["ethereum","starknet","zksync","zksync2"]),d=t.z.object({type:t.z.enum(["payment","gasFee"]),leg:t.z.enum(["credit","debit"]),asset:n,counterParty:e.addressSchemaArgentBackend.optional(),counterPartyNetwork:i.optional()}),f=t.z.object({address:e.addressSchemaArgentBackend,network:i,type:t.z.enum(["wallet","token"])}),N=t.z.object({chainId:t.z.enum(["TESTNET","MAINNET","SEPOLIA"]),ethereumNetwork:t.z.enum(["mainnet","sepolia"])}),w=t.z.enum(["approval","changePubKey","dappInteraction","deploy","gift","multicall","payment","security","trade","staking"]),m=t.z.enum(["triggerEscapeGuardian","triggerEscapeSigner","escapeGuardian","escapeSigner","guardianChanged","guardianBackupChanged","signerChanged","cancelEscape","accountUpgraded","multisigConfigurationUpdated"]),B=t.z.object({name:t.z.string(),parameters:t.z.array(t.z.unknown()).optional()}),I=t.z.object({guid:t.z.string().optional(),signerType:t.z.string().optional(),signer:t.z.object({publicKey:t.z.string().optional()}).optional()}),T=t.z.object({activeAt:t.z.string().optional(),newGuardian:t.z.string().optional(),newImplementation:t.z.string().optional(),newVersion:t.z.string().optional(),signerGuid:t.z.string().optional(),signers:t.z.array(I).optional()}),D=t.z.object({isLootboxReward:t.z.boolean().optional()}),p=t.z.discriminatedUnion("type",[t.z.object({type:t.z.literal("deploy"),deployer:e.addressSchemaArgentBackend,contractAddress:e.addressSchemaArgentBackend}),t.z.object({type:t.z.literal("approval"),spender:e.addressSchemaArgentBackend,asset:n,approvalType:t.z.string()}),t.z.object({type:t.z.literal("payment"),counterparty:e.addressSchemaArgentBackend,leg:t.z.string(),asset:n,counterpartyNetwork:i.optional(),context:D.optional()}),t.z.object({type:t.z.literal("trade"),srcAsset:n,destAsset:n}),t.z.object({type:t.z.literal("security"),action:m,context:T.optional()}),t.z.object({type:t.z.literal("dappInteraction"),dappAddress:e.addressSchemaArgentBackend,function:B.optional().nullable()}),t.z.object({type:t.z.literal("staking"),stakingAction:c.stakingActionSchema,counterparty:e.addressSchemaArgentBackend,asset:n,stakerInfo:c.stakerInfoSchema}),t.z.object({type:t.z.literal("gift"),counterparty:e.addressSchemaArgentBackend.optional(),leg:t.z.string(),asset:n,counterpartyNetwork:i.optional()})]),x=t.z.object({details:p}),z=t.z.union([p,t.z.object({type:t.z.literal("multicall"),calls:t.z.array(x)})]),y=t.z.object({dappId:t.z.string(),name:t.z.string().optional().nullable()}),s=t.z.object({sent:t.z.boolean(),asset:t.z.discriminatedUnion("type",[t.z.object({type:t.z.literal("nft"),tokenAddress:e.addressSchemaArgentBackend,tokenId:t.z.coerce.number().optional(),amount:t.z.string().optional(),collectionName:t.z.string().optional(),collectionPreviewImage:t.z.string().optional().nullable(),nftName:t.z.string().optional().nullable(),nftPreviewImage:t.z.string().optional().nullable()}),t.z.object({type:t.z.literal("token"),tokenAddress:e.addressSchemaArgentBackend,amount:t.z.string().optional(),fiatAmount:t.z.object({currency:t.z.string(),currencyAmount:t.z.coerce.string()}).optional().nullable()})])}),g=t.z.object({type:t.z.string(),to:e.addressSchemaArgentBackend,actualFee:t.z.object({type:t.z.string(),tokenAddress:e.addressSchemaArgentBackend,amount:t.z.string().optional(),fiatAmount:t.z.object({currency:t.z.string(),currencyAmount:t.z.number()}).optional().nullable()})}),S=t.z.enum(["pending","success","failure"]),o=t.z.object({compositeId:t.z.string(),id:t.z.string().uuid(),status:S,wallet:e.addressSchemaArgentBackend,txSender:e.addressSchemaArgentBackend,source:t.z.string(),type:w,group:t.z.enum(["finance","security"]),submitted:t.z.number(),lastModified:t.z.number(),transaction:u,transfers:t.z.array(d),fees:t.z.array(g).optional(),relatedAddresses:t.z.array(f).nullable(),network:t.z.string(),networkDetails:N.optional(),details:z,transferSummary:t.z.array(s).optional(),dapp:y.optional(),actions:t.z.array(l.actionSchema).optional(),title:t.z.string().optional(),multisigDetails:t.z.object({signers:t.z.array(e.addressSchemaArgentBackend)}).optional()}),h=t.z.object({title:t.z.string().optional(),shortTitle:t.z.string().optional(),subtitle:t.z.string().optional(),icon:t.z.string().optional(),investment:c.investmentMetaSchema.optional(),isExecuteFromOutside:t.z.boolean().optional()}),b="native",v="rejected",A="cancelled",k="queued",E=o.pick({status:!0,actions:!0,submitted:!0,lastModified:!0,transferSummary:!0,fees:!0,multisigDetails:!0}).extend({status:t.z.union([S,t.z.enum([v,A,k])]),type:t.z.literal(b),transaction:u.pick({hash:!0}),dapp:l.targetedDappSchema.optional(),meta:h.optional()}),j=t.z.array(o),P=t.z.object({activities:j,page:t.z.number(),pageSize:t.z.number(),totalElements:t.z.number(),totalPages:t.z.number()});function C(a){return m.safeParse(a).success}const r=a=>s.safeParse(a).success,M=a=>r(a)&&a.asset.type==="token",q=a=>r(a)&&a.asset.type==="nft";exports.NativeActivityStatusCancelled=A;exports.NativeActivityStatusQueued=k;exports.NativeActivityStatusRejected=v;exports.NativeActivityTypeNative=b;exports.activitiesSchema=j;exports.activityDappSchema=y;exports.activityDetailsSchema=z;exports.activityResponseSchema=P;exports.activitySchema=o;exports.activitySummarySchema=s;exports.activityTransferSchema=d;exports.feeSchema=g;exports.isActivityDetailsAction=C;exports.isActivitySummary=r;exports.isNftActivitySummary=q;exports.isTokenActivitySummary=M;exports.nativeActivityMetaSchema=h;exports.nativeActivitySchema=E;
|
|
@@ -40,6 +40,165 @@ declare const detailsActionSchema: z.ZodEnum<{
|
|
|
40
40
|
accountUpgraded: "accountUpgraded";
|
|
41
41
|
multisigConfigurationUpdated: "multisigConfigurationUpdated";
|
|
42
42
|
}>;
|
|
43
|
+
declare const activityDetailsCallSchema: z.ZodObject<{
|
|
44
|
+
details: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
45
|
+
type: z.ZodLiteral<"deploy">;
|
|
46
|
+
deployer: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
47
|
+
contractAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
48
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
49
|
+
type: z.ZodLiteral<"approval">;
|
|
50
|
+
spender: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
51
|
+
asset: z.ZodObject<{
|
|
52
|
+
type: z.ZodEnum<{
|
|
53
|
+
nft: "nft";
|
|
54
|
+
token: "token";
|
|
55
|
+
}>;
|
|
56
|
+
tokenAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
57
|
+
amount: z.ZodOptional<z.ZodString>;
|
|
58
|
+
fiatAmount: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
59
|
+
currency: z.ZodString;
|
|
60
|
+
currencyAmount: z.ZodNumber;
|
|
61
|
+
}, z.core.$strip>>>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
approvalType: z.ZodString;
|
|
64
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
65
|
+
type: z.ZodLiteral<"payment">;
|
|
66
|
+
counterparty: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
67
|
+
leg: z.ZodString;
|
|
68
|
+
asset: z.ZodObject<{
|
|
69
|
+
type: z.ZodEnum<{
|
|
70
|
+
nft: "nft";
|
|
71
|
+
token: "token";
|
|
72
|
+
}>;
|
|
73
|
+
tokenAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
74
|
+
amount: z.ZodOptional<z.ZodString>;
|
|
75
|
+
fiatAmount: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
76
|
+
currency: z.ZodString;
|
|
77
|
+
currencyAmount: z.ZodNumber;
|
|
78
|
+
}, z.core.$strip>>>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
counterpartyNetwork: z.ZodOptional<z.ZodEnum<{
|
|
81
|
+
ethereum: "ethereum";
|
|
82
|
+
zksync: "zksync";
|
|
83
|
+
zksync2: "zksync2";
|
|
84
|
+
starknet: "starknet";
|
|
85
|
+
}>>;
|
|
86
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
87
|
+
isLootboxReward: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
+
}, z.core.$strip>>;
|
|
89
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
90
|
+
type: z.ZodLiteral<"trade">;
|
|
91
|
+
srcAsset: z.ZodObject<{
|
|
92
|
+
type: z.ZodEnum<{
|
|
93
|
+
nft: "nft";
|
|
94
|
+
token: "token";
|
|
95
|
+
}>;
|
|
96
|
+
tokenAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
97
|
+
amount: z.ZodOptional<z.ZodString>;
|
|
98
|
+
fiatAmount: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
99
|
+
currency: z.ZodString;
|
|
100
|
+
currencyAmount: z.ZodNumber;
|
|
101
|
+
}, z.core.$strip>>>;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
destAsset: z.ZodObject<{
|
|
104
|
+
type: z.ZodEnum<{
|
|
105
|
+
nft: "nft";
|
|
106
|
+
token: "token";
|
|
107
|
+
}>;
|
|
108
|
+
tokenAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
109
|
+
amount: z.ZodOptional<z.ZodString>;
|
|
110
|
+
fiatAmount: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
111
|
+
currency: z.ZodString;
|
|
112
|
+
currencyAmount: z.ZodNumber;
|
|
113
|
+
}, z.core.$strip>>>;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
116
|
+
type: z.ZodLiteral<"security">;
|
|
117
|
+
action: z.ZodEnum<{
|
|
118
|
+
triggerEscapeGuardian: "triggerEscapeGuardian";
|
|
119
|
+
triggerEscapeSigner: "triggerEscapeSigner";
|
|
120
|
+
escapeGuardian: "escapeGuardian";
|
|
121
|
+
escapeSigner: "escapeSigner";
|
|
122
|
+
guardianChanged: "guardianChanged";
|
|
123
|
+
guardianBackupChanged: "guardianBackupChanged";
|
|
124
|
+
signerChanged: "signerChanged";
|
|
125
|
+
cancelEscape: "cancelEscape";
|
|
126
|
+
accountUpgraded: "accountUpgraded";
|
|
127
|
+
multisigConfigurationUpdated: "multisigConfigurationUpdated";
|
|
128
|
+
}>;
|
|
129
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
130
|
+
activeAt: z.ZodOptional<z.ZodString>;
|
|
131
|
+
newGuardian: z.ZodOptional<z.ZodString>;
|
|
132
|
+
newImplementation: z.ZodOptional<z.ZodString>;
|
|
133
|
+
newVersion: z.ZodOptional<z.ZodString>;
|
|
134
|
+
signerGuid: z.ZodOptional<z.ZodString>;
|
|
135
|
+
signers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
136
|
+
guid: z.ZodOptional<z.ZodString>;
|
|
137
|
+
signerType: z.ZodOptional<z.ZodString>;
|
|
138
|
+
signer: z.ZodOptional<z.ZodObject<{
|
|
139
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, z.core.$strip>>;
|
|
141
|
+
}, z.core.$strip>>>;
|
|
142
|
+
}, z.core.$strip>>;
|
|
143
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
144
|
+
type: z.ZodLiteral<"dappInteraction">;
|
|
145
|
+
dappAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
146
|
+
function: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
147
|
+
name: z.ZodString;
|
|
148
|
+
parameters: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
149
|
+
}, z.core.$strip>>>;
|
|
150
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
151
|
+
type: z.ZodLiteral<"staking">;
|
|
152
|
+
stakingAction: z.ZodEnum<{
|
|
153
|
+
deposit: "deposit";
|
|
154
|
+
stake: "stake";
|
|
155
|
+
initiateWithdraw: "initiateWithdraw";
|
|
156
|
+
withdraw: "withdraw";
|
|
157
|
+
claim: "claim";
|
|
158
|
+
}>;
|
|
159
|
+
counterparty: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
160
|
+
asset: z.ZodObject<{
|
|
161
|
+
type: z.ZodEnum<{
|
|
162
|
+
nft: "nft";
|
|
163
|
+
token: "token";
|
|
164
|
+
}>;
|
|
165
|
+
tokenAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
166
|
+
amount: z.ZodOptional<z.ZodString>;
|
|
167
|
+
fiatAmount: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
168
|
+
currency: z.ZodString;
|
|
169
|
+
currencyAmount: z.ZodNumber;
|
|
170
|
+
}, z.core.$strip>>>;
|
|
171
|
+
}, z.core.$strip>;
|
|
172
|
+
stakerInfo: z.ZodObject<{
|
|
173
|
+
name: z.ZodOptional<z.ZodString>;
|
|
174
|
+
iconUrl: z.ZodOptional<z.ZodString>;
|
|
175
|
+
address: z.ZodOptional<z.ZodString>;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
178
|
+
type: z.ZodLiteral<"gift">;
|
|
179
|
+
counterparty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
180
|
+
leg: z.ZodString;
|
|
181
|
+
asset: z.ZodObject<{
|
|
182
|
+
type: z.ZodEnum<{
|
|
183
|
+
nft: "nft";
|
|
184
|
+
token: "token";
|
|
185
|
+
}>;
|
|
186
|
+
tokenAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
187
|
+
amount: z.ZodOptional<z.ZodString>;
|
|
188
|
+
fiatAmount: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
189
|
+
currency: z.ZodString;
|
|
190
|
+
currencyAmount: z.ZodNumber;
|
|
191
|
+
}, z.core.$strip>>>;
|
|
192
|
+
}, z.core.$strip>;
|
|
193
|
+
counterpartyNetwork: z.ZodOptional<z.ZodEnum<{
|
|
194
|
+
ethereum: "ethereum";
|
|
195
|
+
zksync: "zksync";
|
|
196
|
+
zksync2: "zksync2";
|
|
197
|
+
starknet: "starknet";
|
|
198
|
+
}>>;
|
|
199
|
+
}, z.core.$strip>], "type">;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
export type ActivityDetailsCall = z.infer<typeof activityDetailsCallSchema>;
|
|
43
202
|
export declare const activityDetailsSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
44
203
|
type: z.ZodLiteral<"deploy">;
|
|
45
204
|
deployer: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z as t } from "zod";
|
|
2
|
-
import { actionSchema as m, targetedDappSchema as
|
|
3
|
-
import { investmentMetaSchema as
|
|
2
|
+
import { actionSchema as m, targetedDappSchema as y } from "../transactionReview/schema.js";
|
|
3
|
+
import { investmentMetaSchema as d, stakerInfoSchema as g, stakingActionSchema as b } from "../../../staking/schema.js";
|
|
4
4
|
import { addressSchemaArgentBackend as e } from "../../../chains/starknet/address.js";
|
|
5
|
-
const
|
|
5
|
+
const i = t.object({
|
|
6
6
|
network: t.string(),
|
|
7
7
|
hash: t.string(),
|
|
8
8
|
status: t.string(),
|
|
@@ -26,10 +26,10 @@ const r = t.object({
|
|
|
26
26
|
address: e,
|
|
27
27
|
network: o,
|
|
28
28
|
type: t.enum(["wallet", "token"])
|
|
29
|
-
}),
|
|
29
|
+
}), v = t.object({
|
|
30
30
|
chainId: t.enum(["TESTNET", "MAINNET", "SEPOLIA"]),
|
|
31
31
|
ethereumNetwork: t.enum(["mainnet", "sepolia"])
|
|
32
|
-
}),
|
|
32
|
+
}), j = t.enum([
|
|
33
33
|
"approval",
|
|
34
34
|
"changePubKey",
|
|
35
35
|
"dappInteraction",
|
|
@@ -40,7 +40,7 @@ const r = t.object({
|
|
|
40
40
|
"security",
|
|
41
41
|
"trade",
|
|
42
42
|
"staking"
|
|
43
|
-
]),
|
|
43
|
+
]), r = t.enum([
|
|
44
44
|
"triggerEscapeGuardian",
|
|
45
45
|
"triggerEscapeSigner",
|
|
46
46
|
"escapeGuardian",
|
|
@@ -51,7 +51,7 @@ const r = t.object({
|
|
|
51
51
|
"cancelEscape",
|
|
52
52
|
"accountUpgraded",
|
|
53
53
|
"multisigConfigurationUpdated"
|
|
54
|
-
]),
|
|
54
|
+
]), k = t.object({
|
|
55
55
|
name: t.string(),
|
|
56
56
|
parameters: t.array(t.unknown()).optional()
|
|
57
57
|
}), f = t.object({
|
|
@@ -70,7 +70,7 @@ const r = t.object({
|
|
|
70
70
|
signers: t.array(f).optional()
|
|
71
71
|
}), w = t.object({
|
|
72
72
|
isLootboxReward: t.boolean().optional()
|
|
73
|
-
}),
|
|
73
|
+
}), s = t.discriminatedUnion("type", [
|
|
74
74
|
t.object({
|
|
75
75
|
type: t.literal("deploy"),
|
|
76
76
|
deployer: e,
|
|
@@ -97,13 +97,13 @@ const r = t.object({
|
|
|
97
97
|
}),
|
|
98
98
|
t.object({
|
|
99
99
|
type: t.literal("security"),
|
|
100
|
-
action:
|
|
100
|
+
action: r,
|
|
101
101
|
context: A.optional()
|
|
102
102
|
}),
|
|
103
103
|
t.object({
|
|
104
104
|
type: t.literal("dappInteraction"),
|
|
105
105
|
dappAddress: e,
|
|
106
|
-
function:
|
|
106
|
+
function: k.optional().nullable()
|
|
107
107
|
// This object is often null. It happens when we were unable to get the ABI or failed decoding the function call
|
|
108
108
|
}),
|
|
109
109
|
t.object({
|
|
@@ -111,7 +111,7 @@ const r = t.object({
|
|
|
111
111
|
stakingAction: b,
|
|
112
112
|
counterparty: e,
|
|
113
113
|
asset: a,
|
|
114
|
-
stakerInfo:
|
|
114
|
+
stakerInfo: g
|
|
115
115
|
}),
|
|
116
116
|
t.object({
|
|
117
117
|
type: t.literal("gift"),
|
|
@@ -120,15 +120,15 @@ const r = t.object({
|
|
|
120
120
|
asset: a,
|
|
121
121
|
counterpartyNetwork: o.optional()
|
|
122
122
|
})
|
|
123
|
-
]), N = t.
|
|
124
|
-
|
|
123
|
+
]), N = t.object({
|
|
124
|
+
details: s
|
|
125
|
+
}), I = t.union([
|
|
126
|
+
s,
|
|
125
127
|
t.object({
|
|
126
128
|
type: t.literal("multicall"),
|
|
127
|
-
calls: t.array(
|
|
128
|
-
details: i
|
|
129
|
-
}))
|
|
129
|
+
calls: t.array(N)
|
|
130
130
|
})
|
|
131
|
-
]),
|
|
131
|
+
]), x = t.object({
|
|
132
132
|
dappId: t.string(),
|
|
133
133
|
name: t.string().optional().nullable()
|
|
134
134
|
}), c = t.object({
|
|
@@ -154,7 +154,7 @@ const r = t.object({
|
|
|
154
154
|
}).optional().nullable()
|
|
155
155
|
})
|
|
156
156
|
])
|
|
157
|
-
}),
|
|
157
|
+
}), D = t.object({
|
|
158
158
|
type: t.string(),
|
|
159
159
|
// "gas" for example
|
|
160
160
|
to: e,
|
|
@@ -174,20 +174,20 @@ const r = t.object({
|
|
|
174
174
|
wallet: e,
|
|
175
175
|
txSender: e,
|
|
176
176
|
source: t.string(),
|
|
177
|
-
type:
|
|
177
|
+
type: j,
|
|
178
178
|
group: t.enum(["finance", "security"]),
|
|
179
179
|
submitted: t.number(),
|
|
180
180
|
lastModified: t.number(),
|
|
181
|
-
transaction:
|
|
181
|
+
transaction: i,
|
|
182
182
|
transfers: t.array(S),
|
|
183
183
|
// to be clarified
|
|
184
|
-
fees: t.array(
|
|
184
|
+
fees: t.array(D).optional(),
|
|
185
185
|
relatedAddresses: t.array(h).nullable(),
|
|
186
186
|
network: t.string(),
|
|
187
|
-
networkDetails:
|
|
188
|
-
details:
|
|
187
|
+
networkDetails: v.optional(),
|
|
188
|
+
details: I,
|
|
189
189
|
transferSummary: t.array(c).optional(),
|
|
190
|
-
dapp:
|
|
190
|
+
dapp: x.optional(),
|
|
191
191
|
actions: t.array(m).optional(),
|
|
192
192
|
title: t.string().optional(),
|
|
193
193
|
multisigDetails: t.object({
|
|
@@ -199,9 +199,9 @@ const r = t.object({
|
|
|
199
199
|
subtitle: t.string().optional(),
|
|
200
200
|
/** let's not import the keys from x-ui here */
|
|
201
201
|
icon: t.string().optional(),
|
|
202
|
-
investment:
|
|
202
|
+
investment: d.optional(),
|
|
203
203
|
isExecuteFromOutside: t.boolean().optional()
|
|
204
|
-
}), T = "native",
|
|
204
|
+
}), T = "native", P = "rejected", C = "cancelled", M = "queued", B = p.pick({
|
|
205
205
|
status: !0,
|
|
206
206
|
actions: !0,
|
|
207
207
|
submitted: !0,
|
|
@@ -213,45 +213,45 @@ const r = t.object({
|
|
|
213
213
|
status: t.union([
|
|
214
214
|
l,
|
|
215
215
|
t.enum([
|
|
216
|
-
D,
|
|
217
216
|
P,
|
|
218
|
-
C
|
|
217
|
+
C,
|
|
218
|
+
M
|
|
219
219
|
])
|
|
220
220
|
]),
|
|
221
221
|
type: t.literal(T),
|
|
222
|
-
transaction:
|
|
222
|
+
transaction: i.pick({
|
|
223
223
|
hash: !0
|
|
224
224
|
}),
|
|
225
|
-
dapp:
|
|
225
|
+
dapp: y.optional(),
|
|
226
226
|
meta: E.optional()
|
|
227
|
-
}),
|
|
228
|
-
activities:
|
|
227
|
+
}), z = t.array(p), K = t.object({
|
|
228
|
+
activities: z,
|
|
229
229
|
page: t.number(),
|
|
230
230
|
pageSize: t.number(),
|
|
231
231
|
totalElements: t.number(),
|
|
232
232
|
totalPages: t.number()
|
|
233
233
|
});
|
|
234
|
-
function
|
|
235
|
-
return
|
|
234
|
+
function L(n) {
|
|
235
|
+
return r.safeParse(n).success;
|
|
236
236
|
}
|
|
237
|
-
const u = (n) => c.safeParse(n).success,
|
|
237
|
+
const u = (n) => c.safeParse(n).success, O = (n) => u(n) && n.asset.type === "token", q = (n) => u(n) && n.asset.type === "nft";
|
|
238
238
|
export {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
239
|
+
C as NativeActivityStatusCancelled,
|
|
240
|
+
M as NativeActivityStatusQueued,
|
|
241
|
+
P as NativeActivityStatusRejected,
|
|
242
242
|
T as NativeActivityTypeNative,
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
243
|
+
z as activitiesSchema,
|
|
244
|
+
x as activityDappSchema,
|
|
245
|
+
I as activityDetailsSchema,
|
|
246
|
+
K as activityResponseSchema,
|
|
247
247
|
p as activitySchema,
|
|
248
248
|
c as activitySummarySchema,
|
|
249
249
|
S as activityTransferSchema,
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
D as feeSchema,
|
|
251
|
+
L as isActivityDetailsAction,
|
|
252
252
|
u as isActivitySummary,
|
|
253
|
-
|
|
254
|
-
|
|
253
|
+
q as isNftActivitySummary,
|
|
254
|
+
O as isTokenActivitySummary,
|
|
255
255
|
E as nativeActivityMetaSchema,
|
|
256
|
-
|
|
256
|
+
B as nativeActivitySchema
|
|
257
257
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../chains/starknet/address.cjs"),r=require("../chains/starknet/constants.cjs"),o=require("../chains/starknet/services/deploymentData/getAccountClassHash.cjs"),u=[r.STRK_TOKEN_ADDRESS];function n({address:e}){return u.some(s=>t.isEqualAddress(e,s))}function a(e){return e?o.getArgentAccountClassHashesWithTxV3Support().some(s=>t.isEqualAddress(s,e)):!1}exports.classHashSupportsTxV3=a;exports.feeTokenNeedsTxV3Support=n;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { getArgentAccountClassHashesWithTxV3Support as t } from "../chains/starknet/services/deploymentData/getAccountClassHash.js";
|
|
2
|
-
import { STRK_TOKEN_ADDRESS as s } from "../chains/starknet/constants.js";
|
|
3
1
|
import { isEqualAddress as o } from "../chains/starknet/address.js";
|
|
4
|
-
|
|
2
|
+
import { STRK_TOKEN_ADDRESS as t } from "../chains/starknet/constants.js";
|
|
3
|
+
import { getArgentAccountClassHashesWithTxV3Support as s } from "../chains/starknet/services/deploymentData/getAccountClassHash.js";
|
|
4
|
+
const n = [t];
|
|
5
5
|
function f({ address: r }) {
|
|
6
6
|
return n.some((e) => o(r, e));
|
|
7
7
|
}
|
|
8
8
|
function m(r) {
|
|
9
|
-
return r ?
|
|
9
|
+
return r ? s().some((e) => o(e, r)) : !1;
|
|
10
10
|
}
|
|
11
11
|
export {
|
|
12
12
|
m as classHashSupportsTxV3,
|