@privy-io/api-types 0.7.0 → 0.8.0
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/CHANGELOG.md +43 -0
- package/client.d.mts +37 -28
- package/client.d.mts.map +1 -1
- package/client.d.ts +37 -28
- package/client.d.ts.map +1 -1
- package/client.js +9 -0
- package/client.js.map +1 -1
- package/client.mjs +9 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/accounts.d.mts +79 -106
- package/resources/accounts.d.mts.map +1 -1
- package/resources/accounts.d.ts +79 -106
- package/resources/accounts.d.ts.map +1 -1
- package/resources/accounts.js.map +1 -1
- package/resources/accounts.mjs.map +1 -1
- package/resources/aggregations.d.mts +18 -392
- package/resources/aggregations.d.mts.map +1 -1
- package/resources/aggregations.d.ts +18 -392
- package/resources/aggregations.d.ts.map +1 -1
- package/resources/aggregations.js.map +1 -1
- package/resources/aggregations.mjs.map +1 -1
- package/resources/apps.d.mts +139 -70
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +139 -70
- package/resources/apps.d.ts.map +1 -1
- package/resources/apps.js.map +1 -1
- package/resources/apps.mjs.map +1 -1
- package/resources/client-auth.d.mts +796 -427
- package/resources/client-auth.d.mts.map +1 -1
- package/resources/client-auth.d.ts +796 -427
- package/resources/client-auth.d.ts.map +1 -1
- package/resources/client-auth.js.map +1 -1
- package/resources/client-auth.mjs.map +1 -1
- package/resources/cross-app.d.mts +14 -13
- package/resources/cross-app.d.mts.map +1 -1
- package/resources/cross-app.d.ts +14 -13
- package/resources/cross-app.d.ts.map +1 -1
- package/resources/embedded-wallets.d.mts +165 -81
- package/resources/embedded-wallets.d.mts.map +1 -1
- package/resources/embedded-wallets.d.ts +165 -81
- package/resources/embedded-wallets.d.ts.map +1 -1
- package/resources/embedded-wallets.js.map +1 -1
- package/resources/embedded-wallets.mjs.map +1 -1
- package/resources/funding.d.mts +150 -64
- package/resources/funding.d.mts.map +1 -1
- package/resources/funding.d.ts +150 -64
- package/resources/funding.d.ts.map +1 -1
- package/resources/funding.js.map +1 -1
- package/resources/funding.mjs.map +1 -1
- package/resources/index.d.mts +17 -14
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +17 -14
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/intents.d.mts +224 -1757
- package/resources/intents.d.mts.map +1 -1
- package/resources/intents.d.ts +224 -1757
- package/resources/intents.d.ts.map +1 -1
- package/resources/intents.js.map +1 -1
- package/resources/intents.mjs.map +1 -1
- package/resources/key-quorums.d.mts +74 -26
- package/resources/key-quorums.d.mts.map +1 -1
- package/resources/key-quorums.d.ts +74 -26
- package/resources/key-quorums.d.ts.map +1 -1
- package/resources/key-quorums.js +8 -8
- package/resources/key-quorums.js.map +1 -1
- package/resources/key-quorums.mjs +8 -8
- package/resources/key-quorums.mjs.map +1 -1
- package/resources/policies.d.mts +335 -926
- package/resources/policies.d.mts.map +1 -1
- package/resources/policies.d.ts +335 -926
- package/resources/policies.d.ts.map +1 -1
- package/resources/policies.js +48 -41
- package/resources/policies.js.map +1 -1
- package/resources/policies.mjs +48 -41
- package/resources/policies.mjs.map +1 -1
- package/resources/shared.d.mts +59 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +59 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +9 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +5 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/swaps.d.mts +108 -0
- package/resources/swaps.d.mts.map +1 -0
- package/resources/swaps.d.ts +108 -0
- package/resources/swaps.d.ts.map +1 -0
- package/resources/swaps.js +9 -0
- package/resources/swaps.js.map +1 -0
- package/resources/swaps.mjs +5 -0
- package/resources/swaps.mjs.map +1 -0
- package/resources/transactions.d.mts +155 -93
- package/resources/transactions.d.mts.map +1 -1
- package/resources/transactions.d.ts +155 -93
- package/resources/transactions.d.ts.map +1 -1
- package/resources/users.d.mts +61 -94
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +61 -94
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js.map +1 -1
- package/resources/users.mjs.map +1 -1
- package/resources/wallet-actions.d.mts +187 -0
- package/resources/wallet-actions.d.mts.map +1 -0
- package/resources/wallet-actions.d.ts +187 -0
- package/resources/wallet-actions.d.ts.map +1 -0
- package/resources/wallet-actions.js +9 -0
- package/resources/wallet-actions.js.map +1 -0
- package/resources/wallet-actions.mjs +5 -0
- package/resources/wallet-actions.mjs.map +1 -0
- package/resources/wallets/index.d.mts +1 -1
- package/resources/wallets/index.d.mts.map +1 -1
- package/resources/wallets/index.d.ts +1 -1
- package/resources/wallets/index.d.ts.map +1 -1
- package/resources/wallets/index.js.map +1 -1
- package/resources/wallets/index.mjs.map +1 -1
- package/resources/wallets/transactions.d.mts +1 -0
- package/resources/wallets/transactions.d.mts.map +1 -1
- package/resources/wallets/transactions.d.ts +1 -0
- package/resources/wallets/transactions.d.ts.map +1 -1
- package/resources/wallets/wallets.d.mts +2377 -971
- package/resources/wallets/wallets.d.mts.map +1 -1
- package/resources/wallets/wallets.d.ts +2377 -971
- package/resources/wallets/wallets.d.ts.map +1 -1
- package/resources/wallets/wallets.js +18 -6
- package/resources/wallets/wallets.js.map +1 -1
- package/resources/wallets/wallets.mjs +18 -6
- package/resources/wallets/wallets.mjs.map +1 -1
- package/resources/webhooks.d.mts +438 -33
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +438 -33
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs.map +1 -1
- package/resources/yield.d.mts +25 -1
- package/resources/yield.d.mts.map +1 -1
- package/resources/yield.d.ts +25 -1
- package/resources/yield.d.ts.map +1 -1
- package/src/client.ts +721 -72
- package/src/resources/accounts.ts +93 -120
- package/src/resources/aggregations.ts +18 -702
- package/src/resources/apps.ts +187 -110
- package/src/resources/client-auth.ts +1358 -893
- package/src/resources/cross-app.ts +19 -15
- package/src/resources/embedded-wallets.ts +219 -123
- package/src/resources/funding.ts +263 -173
- package/src/resources/index.ts +368 -47
- package/src/resources/intents.ts +370 -3100
- package/src/resources/key-quorums.ts +100 -32
- package/src/resources/policies.ts +583 -1558
- package/src/resources/shared.ts +79 -0
- package/src/resources/swaps.ts +136 -0
- package/src/resources/transactions.ts +185 -91
- package/src/resources/users.ts +79 -132
- package/src/resources/wallet-actions.ts +251 -0
- package/src/resources/wallets/index.ts +144 -16
- package/src/resources/wallets/transactions.ts +2 -0
- package/src/resources/wallets/wallets.ts +2893 -1023
- package/src/resources/webhooks.ts +547 -47
- package/src/resources/yield.ts +29 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/resources/users.ts
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
4
|
import * as UsersAPI from './users';
|
|
5
5
|
import * as ClientAuthAPI from './client-auth';
|
|
6
|
+
import * as EmbeddedWalletsAPI from './embedded-wallets';
|
|
7
|
+
import * as SharedAPI from './shared';
|
|
6
8
|
import * as WalletsAPI from './wallets/wallets';
|
|
7
9
|
import { APIPromise } from '../core/api-promise';
|
|
8
10
|
import { Cursor, type CursorParams, PagePromise } from '../core/pagination';
|
|
@@ -389,17 +391,6 @@ export interface LinkedAccountEthereum {
|
|
|
389
391
|
wallet_client_type?: string;
|
|
390
392
|
}
|
|
391
393
|
|
|
392
|
-
/**
|
|
393
|
-
* The provider for a smart wallet.
|
|
394
|
-
*/
|
|
395
|
-
export type SmartWalletType =
|
|
396
|
-
| 'safe'
|
|
397
|
-
| 'kernel'
|
|
398
|
-
| 'light_account'
|
|
399
|
-
| 'biconomy'
|
|
400
|
-
| 'coinbase_smart_wallet'
|
|
401
|
-
| 'thirdweb';
|
|
402
|
-
|
|
403
394
|
/**
|
|
404
395
|
* A smart wallet account linked to the user.
|
|
405
396
|
*/
|
|
@@ -411,9 +402,9 @@ export interface LinkedAccountSmartWallet {
|
|
|
411
402
|
latest_verified_at: number | null;
|
|
412
403
|
|
|
413
404
|
/**
|
|
414
|
-
* The
|
|
405
|
+
* The supported smart wallet providers.
|
|
415
406
|
*/
|
|
416
|
-
smart_wallet_type: SmartWalletType;
|
|
407
|
+
smart_wallet_type: EmbeddedWalletsAPI.SmartWalletType;
|
|
417
408
|
|
|
418
409
|
type: 'smart_wallet';
|
|
419
410
|
|
|
@@ -1170,11 +1161,74 @@ export type LinkedAccountType =
|
|
|
1170
1161
|
| 'authorization_key'
|
|
1171
1162
|
| ClientAuthAPI.CustomOAuthProviderID;
|
|
1172
1163
|
|
|
1164
|
+
/**
|
|
1165
|
+
* A SMS MFA method.
|
|
1166
|
+
*/
|
|
1167
|
+
export interface SMSMfaMethod {
|
|
1168
|
+
type: 'sms';
|
|
1169
|
+
|
|
1170
|
+
verified_at: number;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
/**
|
|
1174
|
+
* A TOTP MFA method.
|
|
1175
|
+
*/
|
|
1176
|
+
export interface TotpMfaMethod {
|
|
1177
|
+
type: 'totp';
|
|
1178
|
+
|
|
1179
|
+
verified_at: number;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* A Passkey MFA method.
|
|
1184
|
+
*/
|
|
1185
|
+
export interface PasskeyMfaMethod {
|
|
1186
|
+
type: 'passkey';
|
|
1187
|
+
|
|
1188
|
+
verified_at: number;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
/**
|
|
1192
|
+
* A multi-factor authentication method linked to the user.
|
|
1193
|
+
*/
|
|
1194
|
+
export type LinkedMfaMethod = SMSMfaMethod | TotpMfaMethod | PasskeyMfaMethod;
|
|
1195
|
+
|
|
1173
1196
|
/**
|
|
1174
1197
|
* Custom metadata associated with the user.
|
|
1175
1198
|
*/
|
|
1176
1199
|
export type CustomMetadata = { [key: string]: string | number | boolean };
|
|
1177
1200
|
|
|
1201
|
+
/**
|
|
1202
|
+
* A Privy user object.
|
|
1203
|
+
*/
|
|
1204
|
+
export interface User {
|
|
1205
|
+
id: string;
|
|
1206
|
+
|
|
1207
|
+
/**
|
|
1208
|
+
* Unix timestamp of when the user was created in seconds.
|
|
1209
|
+
*/
|
|
1210
|
+
created_at: number;
|
|
1211
|
+
|
|
1212
|
+
/**
|
|
1213
|
+
* Indicates if the user has accepted the terms of service.
|
|
1214
|
+
*/
|
|
1215
|
+
has_accepted_terms: boolean;
|
|
1216
|
+
|
|
1217
|
+
/**
|
|
1218
|
+
* Indicates if the user is a guest account user.
|
|
1219
|
+
*/
|
|
1220
|
+
is_guest: boolean;
|
|
1221
|
+
|
|
1222
|
+
linked_accounts: Array<LinkedAccount>;
|
|
1223
|
+
|
|
1224
|
+
mfa_methods: Array<LinkedMfaMethod>;
|
|
1225
|
+
|
|
1226
|
+
/**
|
|
1227
|
+
* Custom metadata associated with the user.
|
|
1228
|
+
*/
|
|
1229
|
+
custom_metadata?: CustomMetadata;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1178
1232
|
/**
|
|
1179
1233
|
* The payload for importing a wallet account.
|
|
1180
1234
|
*/
|
|
@@ -1462,96 +1516,13 @@ export namespace UserBatchCreateInput {
|
|
|
1462
1516
|
*/
|
|
1463
1517
|
custom_metadata?: UsersAPI.CustomMetadata;
|
|
1464
1518
|
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
export interface Wallet {
|
|
1470
|
-
/**
|
|
1471
|
-
* The wallet chain types.
|
|
1472
|
-
*/
|
|
1473
|
-
chain_type: WalletsAPI.WalletChainType;
|
|
1474
|
-
|
|
1475
|
-
additional_signers?: Array<Wallet.AdditionalSigner>;
|
|
1476
|
-
|
|
1477
|
-
create_smart_wallet?: boolean;
|
|
1478
|
-
|
|
1479
|
-
policy_ids?: Array<string>;
|
|
1480
|
-
}
|
|
1481
|
-
|
|
1482
|
-
export namespace Wallet {
|
|
1483
|
-
export interface AdditionalSigner {
|
|
1484
|
-
signer_id: string;
|
|
1485
|
-
|
|
1486
|
-
override_policy_ids?: Array<string>;
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Wallets to create.
|
|
1521
|
+
*/
|
|
1522
|
+
wallets?: Array<EmbeddedWalletsAPI.WalletCreationInput>;
|
|
1489
1523
|
}
|
|
1490
1524
|
}
|
|
1491
1525
|
|
|
1492
|
-
/**
|
|
1493
|
-
* A SMS MFA method.
|
|
1494
|
-
*/
|
|
1495
|
-
export interface SMSMfaMethod {
|
|
1496
|
-
type: 'sms';
|
|
1497
|
-
|
|
1498
|
-
verified_at: number;
|
|
1499
|
-
}
|
|
1500
|
-
|
|
1501
|
-
/**
|
|
1502
|
-
* A TOTP MFA method.
|
|
1503
|
-
*/
|
|
1504
|
-
export interface TotpMfaMethod {
|
|
1505
|
-
type: 'totp';
|
|
1506
|
-
|
|
1507
|
-
verified_at: number;
|
|
1508
|
-
}
|
|
1509
|
-
|
|
1510
|
-
/**
|
|
1511
|
-
* A Passkey MFA method.
|
|
1512
|
-
*/
|
|
1513
|
-
export interface PasskeyMfaMethod {
|
|
1514
|
-
type: 'passkey';
|
|
1515
|
-
|
|
1516
|
-
verified_at: number;
|
|
1517
|
-
}
|
|
1518
|
-
|
|
1519
|
-
/**
|
|
1520
|
-
* A multi-factor authentication method linked to the user.
|
|
1521
|
-
*/
|
|
1522
|
-
export type LinkedMfaMethod = SMSMfaMethod | TotpMfaMethod | PasskeyMfaMethod;
|
|
1523
|
-
|
|
1524
|
-
/**
|
|
1525
|
-
* A Privy user object.
|
|
1526
|
-
*/
|
|
1527
|
-
export interface User {
|
|
1528
|
-
id: string;
|
|
1529
|
-
|
|
1530
|
-
/**
|
|
1531
|
-
* Unix timestamp of when the user was created in milliseconds.
|
|
1532
|
-
*/
|
|
1533
|
-
created_at: number;
|
|
1534
|
-
|
|
1535
|
-
/**
|
|
1536
|
-
* Indicates if the user has accepted the terms of service.
|
|
1537
|
-
*/
|
|
1538
|
-
has_accepted_terms: boolean;
|
|
1539
|
-
|
|
1540
|
-
/**
|
|
1541
|
-
* Indicates if the user is a guest account user.
|
|
1542
|
-
*/
|
|
1543
|
-
is_guest: boolean;
|
|
1544
|
-
|
|
1545
|
-
linked_accounts: Array<LinkedAccount>;
|
|
1546
|
-
|
|
1547
|
-
mfa_methods: Array<LinkedMfaMethod>;
|
|
1548
|
-
|
|
1549
|
-
/**
|
|
1550
|
-
* Custom metadata associated with the user.
|
|
1551
|
-
*/
|
|
1552
|
-
custom_metadata?: CustomMetadata;
|
|
1553
|
-
}
|
|
1554
|
-
|
|
1555
1526
|
/**
|
|
1556
1527
|
* OAuth tokens associated with the user.
|
|
1557
1528
|
*/
|
|
@@ -1653,9 +1624,9 @@ export namespace UserCreateParams {
|
|
|
1653
1624
|
export namespace Wallet {
|
|
1654
1625
|
export interface AdditionalSigner {
|
|
1655
1626
|
/**
|
|
1656
|
-
*
|
|
1627
|
+
* A unique identifier for a key quorum.
|
|
1657
1628
|
*/
|
|
1658
|
-
signer_id:
|
|
1629
|
+
signer_id: SharedAPI.KeyQuorumID;
|
|
1659
1630
|
|
|
1660
1631
|
/**
|
|
1661
1632
|
* The array of policy IDs that will be applied to wallet requests. If specified,
|
|
@@ -1718,30 +1689,7 @@ export interface UserGetByWalletAddressParams {
|
|
|
1718
1689
|
}
|
|
1719
1690
|
|
|
1720
1691
|
export interface UserPregenerateWalletsParams {
|
|
1721
|
-
wallets: Array<
|
|
1722
|
-
}
|
|
1723
|
-
|
|
1724
|
-
export namespace UserPregenerateWalletsParams {
|
|
1725
|
-
export interface Wallet {
|
|
1726
|
-
/**
|
|
1727
|
-
* The wallet chain types.
|
|
1728
|
-
*/
|
|
1729
|
-
chain_type: WalletsAPI.WalletChainType;
|
|
1730
|
-
|
|
1731
|
-
additional_signers?: Array<Wallet.AdditionalSigner>;
|
|
1732
|
-
|
|
1733
|
-
create_smart_wallet?: boolean;
|
|
1734
|
-
|
|
1735
|
-
policy_ids?: Array<string>;
|
|
1736
|
-
}
|
|
1737
|
-
|
|
1738
|
-
export namespace Wallet {
|
|
1739
|
-
export interface AdditionalSigner {
|
|
1740
|
-
signer_id: string;
|
|
1741
|
-
|
|
1742
|
-
override_policy_ids?: Array<string>;
|
|
1743
|
-
}
|
|
1744
|
-
}
|
|
1692
|
+
wallets: Array<EmbeddedWalletsAPI.WalletCreationInput>;
|
|
1745
1693
|
}
|
|
1746
1694
|
|
|
1747
1695
|
export type UserSearchParams = UserSearchParams.Variant0 | UserSearchParams.Variant1;
|
|
@@ -1784,7 +1732,6 @@ export declare namespace Users {
|
|
|
1784
1732
|
type LinkedAccountPhone as LinkedAccountPhone,
|
|
1785
1733
|
type LinkedAccountBaseWallet as LinkedAccountBaseWallet,
|
|
1786
1734
|
type LinkedAccountEthereum as LinkedAccountEthereum,
|
|
1787
|
-
type SmartWalletType as SmartWalletType,
|
|
1788
1735
|
type LinkedAccountSmartWallet as LinkedAccountSmartWallet,
|
|
1789
1736
|
type LinkedAccountSolana as LinkedAccountSolana,
|
|
1790
1737
|
type LinkedAccountFarcaster as LinkedAccountFarcaster,
|
|
@@ -1817,7 +1764,12 @@ export declare namespace Users {
|
|
|
1817
1764
|
type LinkedAccountAuthorizationKey as LinkedAccountAuthorizationKey,
|
|
1818
1765
|
type LinkedAccount as LinkedAccount,
|
|
1819
1766
|
type LinkedAccountType as LinkedAccountType,
|
|
1767
|
+
type SMSMfaMethod as SMSMfaMethod,
|
|
1768
|
+
type TotpMfaMethod as TotpMfaMethod,
|
|
1769
|
+
type PasskeyMfaMethod as PasskeyMfaMethod,
|
|
1770
|
+
type LinkedMfaMethod as LinkedMfaMethod,
|
|
1820
1771
|
type CustomMetadata as CustomMetadata,
|
|
1772
|
+
type User as User,
|
|
1821
1773
|
type LinkedAccountWalletInput as LinkedAccountWalletInput,
|
|
1822
1774
|
type LinkedAccountEmailInput as LinkedAccountEmailInput,
|
|
1823
1775
|
type LinkedAccountPhoneInput as LinkedAccountPhoneInput,
|
|
@@ -1838,11 +1790,6 @@ export declare namespace Users {
|
|
|
1838
1790
|
type LinkedAccountPasskeyInput as LinkedAccountPasskeyInput,
|
|
1839
1791
|
type LinkedAccountInput as LinkedAccountInput,
|
|
1840
1792
|
type UserBatchCreateInput as UserBatchCreateInput,
|
|
1841
|
-
type SMSMfaMethod as SMSMfaMethod,
|
|
1842
|
-
type TotpMfaMethod as TotpMfaMethod,
|
|
1843
|
-
type PasskeyMfaMethod as PasskeyMfaMethod,
|
|
1844
|
-
type LinkedMfaMethod as LinkedMfaMethod,
|
|
1845
|
-
type User as User,
|
|
1846
1793
|
type OAuthTokens as OAuthTokens,
|
|
1847
1794
|
type UserWithIdentityToken as UserWithIdentityToken,
|
|
1848
1795
|
type AuthenticatedUser as AuthenticatedUser,
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
|
|
5
|
+
export class WalletActions extends APIResource {}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Type of wallet action
|
|
9
|
+
*/
|
|
10
|
+
export type WalletActionType = 'swap' | 'transfer';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Status of a wallet action.
|
|
14
|
+
*/
|
|
15
|
+
export type WalletActionStatus = 'pending' | 'succeeded' | 'rejected' | 'failed';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Type of a wallet action step.
|
|
19
|
+
*/
|
|
20
|
+
export type WalletActionStepType = 'evm_transaction' | 'evm_user_operation';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Status of an EVM step in a wallet action.
|
|
24
|
+
*/
|
|
25
|
+
export type EvmWalletActionStepStatus =
|
|
26
|
+
| 'preparing'
|
|
27
|
+
| 'queued'
|
|
28
|
+
| 'pending'
|
|
29
|
+
| 'retrying'
|
|
30
|
+
| 'confirmed'
|
|
31
|
+
| 'rejected'
|
|
32
|
+
| 'reverted'
|
|
33
|
+
| 'replaced'
|
|
34
|
+
| 'abandoned';
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A description of why a wallet action (or a step within a wallet action) failed.
|
|
38
|
+
*/
|
|
39
|
+
export interface FailureReason {
|
|
40
|
+
/**
|
|
41
|
+
* Human-readable failure message.
|
|
42
|
+
*/
|
|
43
|
+
message: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Additional error details, if available.
|
|
47
|
+
*/
|
|
48
|
+
details?: unknown;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A wallet action step consisting of an EVM transaction.
|
|
53
|
+
*/
|
|
54
|
+
export interface EvmTransactionWalletActionStep {
|
|
55
|
+
/**
|
|
56
|
+
* CAIP-2 chain identifier of the transaction, containing the chain ID.
|
|
57
|
+
*/
|
|
58
|
+
caip2: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Status of an EVM step in a wallet action.
|
|
62
|
+
*/
|
|
63
|
+
status: EvmWalletActionStepStatus;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The transaction hash for this step. May change while the step status is
|
|
67
|
+
* non-terminal.
|
|
68
|
+
*/
|
|
69
|
+
transaction_hash: string | null;
|
|
70
|
+
|
|
71
|
+
type: 'evm_transaction';
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* A description of why a wallet action (or a step within a wallet action) failed.
|
|
75
|
+
*/
|
|
76
|
+
failure_reason?: FailureReason;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* A wallet action step consisting of an EVM user operation.
|
|
81
|
+
*/
|
|
82
|
+
export interface EvmUserOperationWalletActionStep {
|
|
83
|
+
/**
|
|
84
|
+
* Transaction hash of the bundle in which this user operation was included. Null
|
|
85
|
+
* until included by a bundler.
|
|
86
|
+
*/
|
|
87
|
+
bundle_transaction_hash: string | null;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* CAIP-2 network identifier, containing the chain ID of the user operation.
|
|
91
|
+
*/
|
|
92
|
+
caip2: string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The entrypoint version of the user operation.
|
|
96
|
+
*/
|
|
97
|
+
entrypoint_version: '0.6' | '0.7' | '0.8' | '0.9';
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Status of an EVM step in a wallet action.
|
|
101
|
+
*/
|
|
102
|
+
status: EvmWalletActionStepStatus;
|
|
103
|
+
|
|
104
|
+
type: 'evm_user_operation';
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The user operation hash for this step. May change while the step status is
|
|
108
|
+
* non-terminal.
|
|
109
|
+
*/
|
|
110
|
+
user_operation_hash: string | null;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* A description of why a wallet action (or a step within a wallet action) failed.
|
|
114
|
+
*/
|
|
115
|
+
failure_reason?: FailureReason;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* A step within a wallet action, representing a single onchain action.
|
|
120
|
+
*/
|
|
121
|
+
export type WalletActionStep = EvmTransactionWalletActionStep | EvmUserOperationWalletActionStep;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Response for a swap action.
|
|
125
|
+
*/
|
|
126
|
+
export interface SwapActionResponse {
|
|
127
|
+
/**
|
|
128
|
+
* The ID of the wallet action.
|
|
129
|
+
*/
|
|
130
|
+
id: string;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* CAIP-2 chain identifier for the swap.
|
|
134
|
+
*/
|
|
135
|
+
caip2: string;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* ISO 8601 timestamp of when the wallet action was created.
|
|
139
|
+
*/
|
|
140
|
+
created_at: string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Exact base-unit amount of input token. Populated after on-chain confirmation.
|
|
144
|
+
*/
|
|
145
|
+
input_amount: string | null;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Token address or "native" for the token being sold.
|
|
149
|
+
*/
|
|
150
|
+
input_token: string;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Exact base-unit amount of output token. Populated after on-chain confirmation.
|
|
154
|
+
*/
|
|
155
|
+
output_amount: string | null;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Token address or "native" for the token being bought.
|
|
159
|
+
*/
|
|
160
|
+
output_token: string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Status of a wallet action.
|
|
164
|
+
*/
|
|
165
|
+
status: WalletActionStatus;
|
|
166
|
+
|
|
167
|
+
type: 'swap';
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* The ID of the wallet involved in the action.
|
|
171
|
+
*/
|
|
172
|
+
wallet_id: string;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* The steps of the wallet action. Only returned if `?include=steps` is provided.
|
|
176
|
+
*/
|
|
177
|
+
steps?: Array<WalletActionStep>;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Response for a transfer action.
|
|
182
|
+
*/
|
|
183
|
+
export interface TransferActionResponse {
|
|
184
|
+
/**
|
|
185
|
+
* The ID of the wallet action.
|
|
186
|
+
*/
|
|
187
|
+
id: string;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* ISO 8601 timestamp of when the wallet action was created.
|
|
191
|
+
*/
|
|
192
|
+
created_at: string;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Recipient address.
|
|
196
|
+
*/
|
|
197
|
+
destination_address: string;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Decimal amount as the user provided (e.g. "1.5").
|
|
201
|
+
*/
|
|
202
|
+
source_amount: string;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Asset identifier (e.g. "usdc", "eth").
|
|
206
|
+
*/
|
|
207
|
+
source_asset: string;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Chain name (e.g. "base", "ethereum").
|
|
211
|
+
*/
|
|
212
|
+
source_chain: string;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Status of a wallet action.
|
|
216
|
+
*/
|
|
217
|
+
status: WalletActionStatus;
|
|
218
|
+
|
|
219
|
+
type: 'transfer';
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* The ID of the wallet involved in the action.
|
|
223
|
+
*/
|
|
224
|
+
wallet_id: string;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* The steps of the wallet action. Only returned if `?include=steps` is provided.
|
|
228
|
+
*/
|
|
229
|
+
steps?: Array<WalletActionStep>;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Response for a wallet action, discriminated on type.
|
|
234
|
+
*/
|
|
235
|
+
export type WalletActionResponse = SwapActionResponse | TransferActionResponse;
|
|
236
|
+
|
|
237
|
+
export declare namespace WalletActions {
|
|
238
|
+
export {
|
|
239
|
+
type WalletActionType as WalletActionType,
|
|
240
|
+
type WalletActionStatus as WalletActionStatus,
|
|
241
|
+
type WalletActionStepType as WalletActionStepType,
|
|
242
|
+
type EvmWalletActionStepStatus as EvmWalletActionStepStatus,
|
|
243
|
+
type FailureReason as FailureReason,
|
|
244
|
+
type EvmTransactionWalletActionStep as EvmTransactionWalletActionStep,
|
|
245
|
+
type EvmUserOperationWalletActionStep as EvmUserOperationWalletActionStep,
|
|
246
|
+
type WalletActionStep as WalletActionStep,
|
|
247
|
+
type SwapActionResponse as SwapActionResponse,
|
|
248
|
+
type TransferActionResponse as TransferActionResponse,
|
|
249
|
+
type WalletActionResponse as WalletActionResponse,
|
|
250
|
+
};
|
|
251
|
+
}
|