@funkit/api-base 1.5.4 → 1.5.6

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/index.js +192 -210
  3. package/dist/index.js.map +2 -2
  4. package/dist/src/consts/request.d.ts +12 -3
  5. package/dist/src/services/assets/endpoints.d.ts +10 -10
  6. package/dist/src/services/assets/types.d.ts +1 -4
  7. package/dist/src/services/checkout/endpoints.d.ts +11 -18
  8. package/dist/src/services/checkout/types.d.ts +17 -18
  9. package/dist/src/services/faucet/endpoints.d.ts +1 -1
  10. package/dist/src/services/faucet/types.d.ts +2 -2
  11. package/dist/src/services/fw-access/endpoints.d.ts +2 -2
  12. package/dist/src/services/fw-access/types.d.ts +3 -4
  13. package/dist/src/services/fw-group/endpoints.d.ts +1 -1
  14. package/dist/src/services/fw-group/types.d.ts +2 -2
  15. package/dist/src/services/fw-info/endpoints.d.ts +2 -2
  16. package/dist/src/services/fw-info/types.d.ts +3 -4
  17. package/dist/src/services/fw-operation/endpoints.d.ts +10 -10
  18. package/dist/src/services/fw-operation/types.d.ts +9 -16
  19. package/dist/src/services/fw-paymaster/endpoints.d.ts +1 -1
  20. package/dist/src/services/fw-paymaster/types.d.ts +2 -2
  21. package/dist/src/services/fw-user/endpoints.d.ts +5 -5
  22. package/dist/src/services/fw-user/types.d.ts +6 -10
  23. package/dist/src/services/mesh/endpoints.d.ts +13 -14
  24. package/dist/src/services/mesh/types.d.ts +7 -11
  25. package/dist/src/services/moonpay/endpoints.d.ts +2 -2
  26. package/dist/src/services/moonpay/types.d.ts +3 -4
  27. package/dist/src/services/stripe/endpoints.d.ts +4 -4
  28. package/dist/src/services/stripe/types.d.ts +2 -2
  29. package/dist/src/services/support/endpoints.d.ts +1 -1
  30. package/dist/src/services/support/types.d.ts +2 -2
  31. package/dist/src/utils/request.d.ts +5 -5
  32. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import type { Address } from 'viem';
2
+ import { type BaseApiRequest } from '../../consts';
2
3
  import { type CheckoutDeactivateParams, type CheckoutHistoryItem, type CheckoutInitParams, type CheckoutInitResponse, type CheckoutInitTokenTransferAddressParams, type CheckoutQuoteParams, type CheckoutQuoteResponse, type CheckoutTransferSponsorshipParams, type CheckoutTransferSponsorshipResponse, type RiskAssessmentParams, type RiskAssessmentResponse } from './types';
3
4
  /**
4
5
  * Gets a checkout quote (estimation).
@@ -14,7 +15,7 @@ import { type CheckoutDeactivateParams, type CheckoutHistoryItem, type CheckoutI
14
15
  * @param signal AbortSignal to cancel the request when no longer needed
15
16
  * @return {Promise<CheckoutCoreQuoteResponse>} The formatted quote object
16
17
  */
17
- export declare function getCheckoutQuote({ fromChainId, fromTokenAddress, fromTokenDecimals, toChainId, toTokenAddress, toTokenDecimals, toTokenAmount, expirationTimestampMs, sponsorInitialTransferGasLimit, recipientAddr, needsRefuel, userId, apiKey, signal, }: CheckoutQuoteParams): Promise<CheckoutQuoteResponse>;
18
+ export declare function getCheckoutQuote({ fromChainId, fromTokenAddress, fromTokenDecimals, toChainId, toTokenAddress, toTokenDecimals, toTokenAmount, expirationTimestampMs, sponsorInitialTransferGasLimit, recipientAddr, needsRefuel, userId, ...options }: CheckoutQuoteParams): Promise<CheckoutQuoteResponse>;
18
19
  /**
19
20
  * Initializes a checkout
20
21
  * @param userOp The checkout UserOp, signed.
@@ -22,8 +23,8 @@ export declare function getCheckoutQuote({ fromChainId, fromTokenAddress, fromTo
22
23
  * @param apiKey A valid fun api key.
23
24
  * @return {Address} The generated deposit address
24
25
  */
25
- export declare function initializeCheckout({ userOp, quoteId, sourceOfFund, apiKey, clientMetadata, }: CheckoutInitParams): Promise<Address>;
26
- export declare function deactivateCheckout({ depositAddress, apiKey, }: CheckoutDeactivateParams): Promise<boolean>;
26
+ export declare function initializeCheckout({ userOp, quoteId, sourceOfFund, clientMetadata, ...options }: CheckoutInitParams): Promise<Address>;
27
+ export declare function deactivateCheckout({ depositAddress, ...options }: CheckoutDeactivateParams): Promise<boolean>;
27
28
  /**
28
29
  * Gets a checkout given a depositAddress
29
30
  * @param depositAddress A unique deposit address associated with a backend checkout item.
@@ -31,10 +32,8 @@ export declare function deactivateCheckout({ depositAddress, apiKey, }: Checkout
31
32
  * @param signal AbortSignal to cancel the request when no longer needed
32
33
  * @returns The checkout object if exists. Otherwise, null.
33
34
  */
34
- export declare function getCheckoutByDepositAddress({ depositAddress, apiKey, signal, }: {
35
+ export declare function getCheckoutByDepositAddress({ depositAddress, ...options }: BaseApiRequest & {
35
36
  depositAddress: Address;
36
- apiKey: string;
37
- signal?: AbortSignal;
38
37
  }): Promise<CheckoutHistoryItem | null>;
39
38
  /**
40
39
  * Gets all checkouts associated with a funWallet
@@ -43,10 +42,8 @@ export declare function getCheckoutByDepositAddress({ depositAddress, apiKey, si
43
42
  * @param signal AbortSignal to cancel the request when no longer needed
44
43
  * @returns A list of checkout objects if exists. Otherwise, an empty array.
45
44
  */
46
- export declare function getCheckoutsByFunWalletAddress({ funWalletAddress, apiKey, signal, }: {
45
+ export declare function getCheckoutsByFunWalletAddress({ funWalletAddress, ...options }: BaseApiRequest & {
47
46
  funWalletAddress: Address;
48
- apiKey: string;
49
- signal?: AbortSignal;
50
47
  }): Promise<CheckoutHistoryItem[]>;
51
48
  /**
52
49
  * Gets all checkouts associated with a recipient address
@@ -55,10 +52,8 @@ export declare function getCheckoutsByFunWalletAddress({ funWalletAddress, apiKe
55
52
  * @param signal AbortSignal to cancel the request when no longer needed
56
53
  * @returns A list of checkout objects if exists. Otherwise, an empty array.
57
54
  */
58
- export declare function getCheckoutsByRecipientAddress({ recipientAddress, apiKey, signal, }: {
55
+ export declare function getCheckoutsByRecipientAddress({ recipientAddress, ...options }: BaseApiRequest & {
59
56
  recipientAddress: Address;
60
- apiKey: string;
61
- signal?: AbortSignal;
62
57
  }): Promise<CheckoutHistoryItem[]>;
63
58
  /**
64
59
  * Gets all checkouts associated with a funkit userId string
@@ -67,11 +62,9 @@ export declare function getCheckoutsByRecipientAddress({ recipientAddress, apiKe
67
62
  * @param signal AbortSignal to cancel the request when no longer needed
68
63
  * @returns A list of checkout objects if exists. Otherwise, an empty array.
69
64
  */
70
- export declare function getCheckoutsByUserId({ userId, apiKey, signal, }: {
65
+ export declare function getCheckoutsByUserId({ userId, ...options }: BaseApiRequest & {
71
66
  userId: string;
72
- apiKey: string;
73
- signal?: AbortSignal;
74
67
  }): Promise<CheckoutHistoryItem[]>;
75
- export declare function getPaymasterDataForCheckoutSponsoredTransfer({ depositAddress, transferUserOp, apiKey, }: CheckoutTransferSponsorshipParams): Promise<CheckoutTransferSponsorshipResponse>;
76
- export declare function getRiskAssessmentForAddress({ address, apiKey, }: RiskAssessmentParams): Promise<RiskAssessmentResponse>;
77
- export declare function initializeCheckoutTokenTransferAddress({ apiKey, ...body }: CheckoutInitTokenTransferAddressParams): Promise<CheckoutInitResponse>;
68
+ export declare function getPaymasterDataForCheckoutSponsoredTransfer({ depositAddress, transferUserOp, ...options }: CheckoutTransferSponsorshipParams): Promise<CheckoutTransferSponsorshipResponse>;
69
+ export declare function getRiskAssessmentForAddress({ address, ...options }: RiskAssessmentParams): Promise<RiskAssessmentResponse>;
70
+ export declare function initializeCheckoutTokenTransferAddress({ apiKey, logger, signal, ...body }: CheckoutInitTokenTransferAddressParams): Promise<CheckoutInitResponse>;
@@ -1,7 +1,5 @@
1
- /**===============*
2
- * CHECKOUT QUOTE *
3
- *================*/
4
- import type { Address, Hex } from 'viem';
1
+ import type { Abi, Address, Hex } from 'viem';
2
+ import type { BaseApiRequest } from '../../consts';
5
3
  type UserOperation = any;
6
4
  export type CheckoutApiQuoteParams = {
7
5
  fromChainId: string;
@@ -15,14 +13,12 @@ export type CheckoutApiQuoteParams = {
15
13
  userId: string;
16
14
  recipientAddr?: Address;
17
15
  };
18
- export type CheckoutQuoteParams = Omit<CheckoutApiQuoteParams, 'toAmountBaseUnit' | 'checkoutExpirationTimestampSeconds' | 'refuel'> & {
16
+ export type CheckoutQuoteParams = BaseApiRequest & Omit<CheckoutApiQuoteParams, 'toAmountBaseUnit' | 'checkoutExpirationTimestampSeconds' | 'refuel'> & {
19
17
  fromTokenDecimals: number;
20
18
  toTokenDecimals: number;
21
19
  toTokenAmount: number;
22
20
  expirationTimestampMs: number;
23
21
  needsRefuel: boolean;
24
- apiKey: string;
25
- signal?: AbortSignal;
26
22
  };
27
23
  export type CheckoutApiQuoteResponse = {
28
24
  quoteId: string;
@@ -53,16 +49,13 @@ export type CheckoutApiInitParams = {
53
49
  salt: Hex;
54
50
  clientMetadata: object;
55
51
  };
56
- export type CheckoutInitParams = Omit<CheckoutApiInitParams, 'salt'> & {
57
- apiKey: string;
58
- };
52
+ export type CheckoutInitParams = BaseApiRequest & Omit<CheckoutApiInitParams, 'salt'>;
59
53
  export type CheckoutInitResponse = Address;
60
54
  /**=====================*
61
55
  * CHECKOUT DEACTIVATE *
62
56
  *======================*/
63
- export type CheckoutDeactivateParams = {
57
+ export type CheckoutDeactivateParams = BaseApiRequest & {
64
58
  depositAddress: Address;
65
- apiKey: string;
66
59
  };
67
60
  export declare enum CheckoutState {
68
61
  FROM_UNFUNDED = "FROM_UNFUNDED",
@@ -105,10 +98,9 @@ export type CheckoutHistoryItem = {
105
98
  /**===============================*
106
99
  * CHECKOUT TRANSFER SPONSORSHIP *
107
100
  *================================*/
108
- export type CheckoutTransferSponsorshipParams = {
101
+ export type CheckoutTransferSponsorshipParams = BaseApiRequest & {
109
102
  transferUserOp: UserOperation;
110
103
  depositAddress: Address;
111
- apiKey: string;
112
104
  };
113
105
  export type CheckoutTransferSponsorshipApiParams = {
114
106
  userOp: UserOperation;
@@ -123,9 +115,8 @@ export type CheckoutTransferSponsorshipResponse = {
123
115
  /**===============================*
124
116
  * RISK ASSESSMENT *
125
117
  *================================*/
126
- export type RiskAssessmentParams = {
118
+ export type RiskAssessmentParams = BaseApiRequest & {
127
119
  address: FunAddress;
128
- apiKey: string;
129
120
  };
130
121
  type AddressIdentification = {
131
122
  name: string;
@@ -178,8 +169,7 @@ export type RiskAssessmentResponse = {
178
169
  status: string;
179
170
  poolMetadata: PoolMetadata;
180
171
  };
181
- export type CheckoutInitTokenTransferAddressParams = {
182
- apiKey: string;
172
+ export type CheckoutInitTokenTransferAddressParams = BaseApiRequest & {
183
173
  toChainId: string;
184
174
  toTokenAddress: Address;
185
175
  userId: string;
@@ -245,6 +235,13 @@ export interface ApiSelectedPaymentMethodInfo {
245
235
  description: string;
246
236
  meta?: object;
247
237
  }
238
+ export interface ApiFunkitCheckoutActionParams {
239
+ contractAbi: Abi;
240
+ contractAddress: Address;
241
+ functionName: string;
242
+ functionArgs: unknown[];
243
+ value?: bigint;
244
+ }
248
245
  export interface ApiCheckoutClientMetadata {
249
246
  /** Unique identifier for frontend use only. */
250
247
  id: string;
@@ -264,5 +261,7 @@ export interface ApiCheckoutClientMetadata {
264
261
  chainId: string;
265
262
  iconSrc: string | null;
266
263
  };
264
+ /** The evaluated result of initSettings.config.generateActionsParams at the point of checkout */
265
+ evaluatedActionsParams?: ApiFunkitCheckoutActionParams[];
267
266
  }
268
267
  export {};
@@ -1,2 +1,2 @@
1
1
  import type { GetAssetFromFaucetRequest } from './types';
2
- export declare function getAssetFromFaucet({ token, chain, walletAddress, apiKey, }: GetAssetFromFaucetRequest): Promise<unknown>;
2
+ export declare function getAssetFromFaucet({ token, chain, walletAddress, ...options }: GetAssetFromFaucetRequest): Promise<unknown>;
@@ -1,6 +1,6 @@
1
- export interface GetAssetFromFaucetRequest {
1
+ import type { BaseApiRequest } from '../../consts';
2
+ export interface GetAssetFromFaucetRequest extends BaseApiRequest {
2
3
  token: string;
3
4
  chain: string;
4
5
  walletAddress: string;
5
- apiKey: string;
6
6
  }
@@ -1,3 +1,3 @@
1
1
  import type { CheckWalletAccessInitializationRequest, InitializeWalletAccessRequest } from './types';
2
- export declare function initializeWalletAccess({ walletAddr, creatorAddr, apiKey, }: InitializeWalletAccessRequest): Promise<void>;
3
- export declare function checkWalletAccessInitialization({ walletAddr, apiKey, }: CheckWalletAccessInitializationRequest): Promise<boolean>;
2
+ export declare function initializeWalletAccess({ walletAddr, creatorAddr, ...options }: InitializeWalletAccessRequest): Promise<void>;
3
+ export declare function checkWalletAccessInitialization({ walletAddr, ...options }: CheckWalletAccessInitializationRequest): Promise<boolean>;
@@ -1,10 +1,9 @@
1
1
  import type { Address } from 'viem';
2
- export interface InitializeWalletAccessRequest {
2
+ import type { BaseApiRequest } from '../../consts';
3
+ export interface InitializeWalletAccessRequest extends BaseApiRequest {
3
4
  walletAddr: Address;
4
5
  creatorAddr: Address;
5
- apiKey: string;
6
6
  }
7
- export interface CheckWalletAccessInitializationRequest {
7
+ export interface CheckWalletAccessInitializationRequest extends BaseApiRequest {
8
8
  walletAddr: Address;
9
- apiKey: string;
10
9
  }
@@ -1,2 +1,2 @@
1
1
  import type { GetGroupsRequest, GroupMetadata } from './types';
2
- export declare function getGroups({ groupIds, chainId, apiKey, }: GetGroupsRequest): Promise<GroupMetadata[]>;
2
+ export declare function getGroups({ groupIds, chainId, ...options }: GetGroupsRequest): Promise<GroupMetadata[]>;
@@ -1,4 +1,5 @@
1
1
  import type { Address, Hex } from 'viem';
2
+ import type { BaseApiRequest } from '../../consts';
2
3
  export type GroupMetadata = {
3
4
  groupId: Hex;
4
5
  chainId: string;
@@ -6,8 +7,7 @@ export type GroupMetadata = {
6
7
  walletAddr: Address;
7
8
  memberIds: Hex[];
8
9
  };
9
- export interface GetGroupsRequest {
10
+ export interface GetGroupsRequest extends BaseApiRequest {
10
11
  groupIds: Hex[];
11
12
  chainId: string;
12
- apiKey: string;
13
13
  }
@@ -1,3 +1,3 @@
1
1
  import type { GetChainFromIdRequest, GetChainFromNameRequest, ServerChainInfo } from './types';
2
- export declare function getChainFromId({ chainId, apiKey, }: GetChainFromIdRequest): Promise<ServerChainInfo>;
3
- export declare function getChainFromName({ name, apiKey, }: GetChainFromNameRequest): Promise<ServerChainInfo>;
2
+ export declare function getChainFromId({ chainId, ...options }: GetChainFromIdRequest): Promise<ServerChainInfo>;
3
+ export declare function getChainFromName({ name, ...options }: GetChainFromNameRequest): Promise<ServerChainInfo>;
@@ -1,10 +1,9 @@
1
- export interface GetChainFromIdRequest {
1
+ import type { BaseApiRequest } from '../../consts';
2
+ export interface GetChainFromIdRequest extends BaseApiRequest {
2
3
  chainId: string;
3
- apiKey: string;
4
4
  }
5
- export interface GetChainFromNameRequest {
5
+ export interface GetChainFromNameRequest extends BaseApiRequest {
6
6
  name: string;
7
- apiKey: string;
8
7
  }
9
8
  export type ServerChainInfo = {
10
9
  id: string;
@@ -1,11 +1,11 @@
1
1
  import type { CreateOpRequest, DeleteOpRequest, EstimateOpInput, EstimatedGas, ExecuteOpInput, ExecutionReceipt, GetFullReceiptRequest, GetOpsOfWalletRequest, GetOpsRequest, GetUserOpGasPriceRequest, OpRequest, OperationData, ScheduleOpInput, SignOpRequest, UserOperationGasPrice } from './types';
2
- export declare function createOp({ op, apiKey, }: CreateOpRequest): Promise<string>;
3
- export declare function getOpsOfWallet({ walletAddr, chainId, apiKey, status, }: GetOpsOfWalletRequest): Promise<OperationData[]>;
4
- export declare function getOps({ opIds, chainId, apiKey, }: GetOpsRequest): Promise<OperationData[]>;
5
- export declare function deleteOp({ opId, chainId, apiKey, }: DeleteOpRequest): Promise<void>;
6
- export declare function signOp({ opId, chainId, signature, signedBy, apiKey, threshold, }: SignOpRequest): Promise<void>;
7
- export declare function executeOp({ input, apiKey, }: OpRequest<ExecuteOpInput>): Promise<ExecutionReceipt>;
8
- export declare function estimateOp({ apiKey, input, }: OpRequest<EstimateOpInput>): Promise<EstimatedGas>;
9
- export declare function scheduleOp({ input, apiKey, }: OpRequest<ScheduleOpInput>): Promise<void>;
10
- export declare const getFullReceipt: ({ opId, chainId, userOpHash, apiKey, }: GetFullReceiptRequest) => Promise<ExecutionReceipt>;
11
- export declare const getUserOpGasPrice: ({ chainId, apiKey, }: GetUserOpGasPriceRequest) => Promise<UserOperationGasPrice>;
2
+ export declare function createOp({ op, ...options }: CreateOpRequest): Promise<string>;
3
+ export declare function getOpsOfWallet({ walletAddr, chainId, status, ...options }: GetOpsOfWalletRequest): Promise<OperationData[]>;
4
+ export declare function getOps({ opIds, chainId, ...options }: GetOpsRequest): Promise<OperationData[]>;
5
+ export declare function deleteOp({ opId, chainId, ...options }: DeleteOpRequest): Promise<void>;
6
+ export declare function signOp({ opId, chainId, signature, signedBy, threshold, ...options }: SignOpRequest): Promise<void>;
7
+ export declare function executeOp({ input, ...options }: OpRequest<ExecuteOpInput>): Promise<ExecutionReceipt>;
8
+ export declare function estimateOp({ input, ...options }: OpRequest<EstimateOpInput>): Promise<EstimatedGas>;
9
+ export declare function scheduleOp({ input, ...options }: OpRequest<ScheduleOpInput>): Promise<void>;
10
+ export declare const getFullReceipt: ({ opId, chainId, userOpHash, ...options }: GetFullReceiptRequest) => Promise<ExecutionReceipt>;
11
+ export declare const getUserOpGasPrice: ({ chainId, ...options }: GetUserOpGasPriceRequest) => Promise<UserOperationGasPrice>;
@@ -1,4 +1,5 @@
1
1
  import type { Address, Hex } from 'viem';
2
+ import type { BaseApiRequest } from '../../consts';
2
3
  export declare enum OperationStatus {
3
4
  ALL = "",
4
5
  PENDING_APPROVED = "PENDING_APPROVED",
@@ -76,37 +77,31 @@ export type EstimatedGas = {
76
77
  callGasLimit: bigint;
77
78
  verificationGasLimit: bigint;
78
79
  };
79
- export interface CreateOpRequest {
80
+ export interface CreateOpRequest extends BaseApiRequest {
80
81
  op: OperationData;
81
- apiKey: string;
82
82
  }
83
- export interface GetOpsOfWalletRequest {
83
+ export interface GetOpsOfWalletRequest extends BaseApiRequest {
84
84
  walletAddr: Address;
85
85
  chainId: string;
86
- apiKey: string;
87
86
  status?: OperationStatus;
88
87
  }
89
- export interface GetOpsRequest {
88
+ export interface GetOpsRequest extends BaseApiRequest {
90
89
  opIds: Hex[];
91
90
  chainId: string;
92
- apiKey: string;
93
91
  }
94
- export interface DeleteOpRequest {
92
+ export interface DeleteOpRequest extends BaseApiRequest {
95
93
  opId: Hex;
96
94
  chainId: string;
97
- apiKey: string;
98
95
  }
99
- export interface SignOpRequest {
96
+ export interface SignOpRequest extends BaseApiRequest {
100
97
  opId: Hex;
101
98
  chainId: string;
102
99
  signature: Hex;
103
100
  signedBy: Address;
104
- apiKey: string;
105
101
  threshold?: number;
106
102
  }
107
- export type OpRequest<T> = {
103
+ export type OpRequest<T> = BaseApiRequest & {
108
104
  input: T;
109
- apiKey: string;
110
105
  };
111
106
  export type ExecuteOpInput = {
112
107
  opId: Hex;
@@ -133,15 +128,13 @@ export type ScheduleOpInput = {
133
128
  userOp?: UserOperation;
134
129
  groupInfo?: GroupInfo;
135
130
  };
136
- export interface GetFullReceiptRequest {
131
+ export interface GetFullReceiptRequest extends BaseApiRequest {
137
132
  opId: string;
138
133
  chainId: string;
139
134
  userOpHash: string;
140
- apiKey: string;
141
135
  }
142
- export interface GetUserOpGasPriceRequest {
136
+ export interface GetUserOpGasPriceRequest extends BaseApiRequest {
143
137
  chainId: string;
144
- apiKey: string;
145
138
  }
146
139
  export type UserOperationGasPrice = {
147
140
  maxFeePerGas: bigint;
@@ -1,2 +1,2 @@
1
1
  import type { AddPaymasterTransactionRequest } from './types';
2
- export declare function addTransaction({ chainId, timestamp, txid, transaction, paymasterType, sponsorAddress, apiKey, }: AddPaymasterTransactionRequest): Promise<any>;
2
+ export declare function addTransaction({ chainId, timestamp, txid, transaction, paymasterType, sponsorAddress, ...options }: AddPaymasterTransactionRequest): Promise<any>;
@@ -1,3 +1,4 @@
1
+ import type { BaseApiRequest } from '../../consts';
1
2
  import type { ExecutionReceipt } from '../fw-operation';
2
3
  export interface PaymasterTransaction {
3
4
  action: string;
@@ -7,14 +8,13 @@ export interface PaymasterTransaction {
7
8
  token: string;
8
9
  txid?: string;
9
10
  }
10
- export interface AddPaymasterTransactionRequest {
11
+ export interface AddPaymasterTransactionRequest extends BaseApiRequest {
11
12
  chainId: string;
12
13
  timestamp: number;
13
14
  txid: ExecutionReceipt['txId'] | string;
14
15
  transaction: PaymasterTransaction;
15
16
  paymasterType: PaymasterType;
16
17
  sponsorAddress: string;
17
- apiKey: string;
18
18
  }
19
19
  export declare enum PaymasterType {
20
20
  BaseSponsor = "base",
@@ -1,10 +1,10 @@
1
1
  import { type Hex } from 'viem';
2
2
  import type { AddUserToWalletRequest, CreateUserRequest, GetUserUniqueIdRequest, GetUserWalletIdentitiesRequest, GetUserWalletsByAddrRequest, Wallet } from './types';
3
- export declare function createUser({ authId, addr, method, userUniqueId, apiKey, }: CreateUserRequest): Promise<void>;
4
- export declare function getUserUniqueId({ authId, apiKey, }: GetUserUniqueIdRequest): Promise<string>;
5
- export declare function getUserWalletsByAddr({ addr, apiKey, chainId, }: GetUserWalletsByAddrRequest): Promise<Wallet[]>;
6
- export declare function addUserToWallet({ authId, chainId, walletAddr, userIds, apiKey, walletUniqueId, }: AddUserToWalletRequest): Promise<void>;
3
+ export declare function createUser({ authId, addr, method, userUniqueId, ...options }: CreateUserRequest): Promise<void>;
4
+ export declare function getUserUniqueId({ authId, ...options }: GetUserUniqueIdRequest): Promise<string>;
5
+ export declare function getUserWalletsByAddr({ addr, chainId, ...options }: GetUserWalletsByAddrRequest): Promise<Wallet[]>;
6
+ export declare function addUserToWallet({ authId, chainId, walletAddr, userIds, walletUniqueId, ...options }: AddUserToWalletRequest): Promise<void>;
7
7
  /**
8
8
  * @returns userIds of the specified Wallet.
9
9
  */
10
- export declare function getUserWalletIdentities({ authId, chainId, walletAddr, apiKey, }: GetUserWalletIdentitiesRequest): Promise<Hex[]>;
10
+ export declare function getUserWalletIdentities({ authId, chainId, walletAddr, ...options }: GetUserWalletIdentitiesRequest): Promise<Hex[]>;
@@ -1,36 +1,32 @@
1
1
  import type { Address, Hex } from 'viem';
2
+ import type { BaseApiRequest } from '../../consts';
2
3
  export type Wallet = {
3
4
  walletUniqueId?: string;
4
5
  walletAddr: Address;
5
6
  userIds: Hex[];
6
7
  };
7
- export interface CreateUserRequest {
8
+ export interface CreateUserRequest extends BaseApiRequest {
8
9
  authId: string;
9
10
  addr: string;
10
11
  method: string;
11
12
  userUniqueId: string;
12
- apiKey: string;
13
13
  }
14
- export interface GetUserUniqueIdRequest {
14
+ export interface GetUserUniqueIdRequest extends BaseApiRequest {
15
15
  authId: string;
16
- apiKey: string;
17
16
  }
18
- export interface GetUserWalletsByAddrRequest {
17
+ export interface GetUserWalletsByAddrRequest extends BaseApiRequest {
19
18
  addr: string;
20
- apiKey: string;
21
19
  chainId?: string;
22
20
  }
23
- export interface AddUserToWalletRequest {
21
+ export interface AddUserToWalletRequest extends BaseApiRequest {
24
22
  authId: string;
25
23
  chainId: string;
26
24
  walletAddr: Address;
27
25
  userIds: Hex[];
28
- apiKey: string;
29
26
  walletUniqueId?: string;
30
27
  }
31
- export interface GetUserWalletIdentitiesRequest {
28
+ export interface GetUserWalletIdentitiesRequest extends BaseApiRequest {
32
29
  authId: string;
33
30
  chainId: string;
34
31
  walletAddr: Address;
35
- apiKey: string;
36
32
  }
@@ -1,15 +1,16 @@
1
+ import { type BaseApiRequest } from '../../consts';
1
2
  import type { GetCryptocurrencyHoldingsRequest, GetCryptocurrencyHoldingsRequestProxy, GetCryptocurrencyHoldingsResponse, GetLinkTokenRequest, GetLinkTokenResponse, GetTransferIntegrationsRequest, GetTransferIntegrationsResponse, MeshExecuteTransferRequest, MeshExecuteTransferRequestProxy, MeshExecuteTransferResponse, PreviewTransferRequest, PreviewTransferRequestProxy, PreviewTransferResponse } from './types';
2
3
  /**
3
4
  * @param authToken The authentication token to send the asset from.
4
5
  * @param type The type of the integration to send the asset from.
5
6
  * @return https://docs.meshconnect.com/api-reference/portfolio/get-holdings
6
7
  */
7
- export declare function meshGetCryptocurrencyHoldings({ authToken, type, apiKey, }: GetCryptocurrencyHoldingsRequest): Promise<GetCryptocurrencyHoldingsResponse>;
8
- export declare function meshGetCryptocurrencyHoldingsProxy({ apiKey, ...props }: GetCryptocurrencyHoldingsRequestProxy): Promise<GetCryptocurrencyHoldingsResponse>;
8
+ export declare function meshGetCryptocurrencyHoldings({ authToken, type, ...options }: GetCryptocurrencyHoldingsRequest): Promise<GetCryptocurrencyHoldingsResponse>;
9
+ export declare function meshGetCryptocurrencyHoldingsProxy({ brokerType, deviceId, ...options }: GetCryptocurrencyHoldingsRequestProxy): Promise<GetCryptocurrencyHoldingsResponse>;
9
10
  /**
10
11
  * @return https://docs.meshconnect.com/api-reference/managed-transfers/get-integrations
11
12
  */
12
- export declare function meshGetTransferIntegrations({ apiKey, }: GetTransferIntegrationsRequest): Promise<GetTransferIntegrationsResponse>;
13
+ export declare function meshGetTransferIntegrations(options: GetTransferIntegrationsRequest): Promise<GetTransferIntegrationsResponse>;
13
14
  /**
14
15
  * @param userId A unique Id representing the end user. Typically this will be a user Id from the
15
16
  client application. Personally identifiable information, such as an email address or phone number,
@@ -20,7 +21,7 @@ If this param is present then this button will be hidden.
20
21
  * @param transferOptions Encapsulates transaction-related parameters, including destination addresses and the amount to transfer in fiat currency.
21
22
  * @return https://docs.meshconnect.com/api-reference/managed-account-authentication/get-link-token-with-parameters
22
23
  */
23
- export declare function meshGetLinkToken({ userId, integrationId, restrictMultipleAccounts, transferOptions, apiKey, }: GetLinkTokenRequest): Promise<GetLinkTokenResponse>;
24
+ export declare function meshGetLinkToken({ userId, integrationId, restrictMultipleAccounts, transferOptions, ...options }: GetLinkTokenRequest): Promise<GetLinkTokenResponse>;
24
25
  /**
25
26
  * @param fromAuthToken The authentication token to send the asset from.
26
27
  * @param fromType The type of the integration to send the asset from.
@@ -34,8 +35,8 @@ export declare function meshGetLinkToken({ userId, integrationId, restrictMultip
34
35
  * @param fiatCurrency Fiat currency that is to get corresponding converted fiat values of transfer and fee amounts. If not provided, defaults to USD.
35
36
  * @returns https://docs.meshconnect.com/api-reference/managed-transfers/preview-transfer
36
37
  */
37
- export declare function meshPreviewTransfer({ fromAuthToken, fromType, toAuthToken, toType, networkId, symbol, toAddress, amount, amountInFiat, fiatCurrency, apiKey, }: PreviewTransferRequest): Promise<PreviewTransferResponse>;
38
- export declare function meshPreviewTransferProxy({ apiKey, ...props }: PreviewTransferRequestProxy): Promise<PreviewTransferResponse>;
38
+ export declare function meshPreviewTransfer({ fromAuthToken, fromType, toAuthToken, toType, networkId, symbol, toAddress, amount, amountInFiat, fiatCurrency, ...options }: PreviewTransferRequest): Promise<PreviewTransferResponse>;
39
+ export declare function meshPreviewTransferProxy({ apiKey, logger, signal, ...props }: PreviewTransferRequestProxy): Promise<PreviewTransferResponse>;
39
40
  /**
40
41
  *
41
42
  * @param fromAuthToken The authentication token to send the asset from.
@@ -44,9 +45,9 @@ export declare function meshPreviewTransferProxy({ apiKey, ...props }: PreviewTr
44
45
  * @param mfaCode Multi-factor auth code that should be provided if the status of the transfer was MfaRequired.
45
46
  * @returns https://docs.meshconnect.com/api-reference/managed-transfers/execute-transfer
46
47
  */
47
- export declare function meshExecuteTransfer({ fromAuthToken, fromType, previewId, mfaCode, apiKey, }: MeshExecuteTransferRequest): Promise<MeshExecuteTransferResponse>;
48
- export declare function meshExecuteTransferProxy({ apiKey, ...props }: MeshExecuteTransferRequestProxy): Promise<MeshExecuteTransferResponse>;
49
- interface SaveTokensToMeshProxyRequestBody {
48
+ export declare function meshExecuteTransfer({ fromAuthToken, fromType, previewId, mfaCode, ...options }: MeshExecuteTransferRequest): Promise<MeshExecuteTransferResponse>;
49
+ export declare function meshExecuteTransferProxy({ apiKey, logger, signal, ...props }: MeshExecuteTransferRequestProxy): Promise<MeshExecuteTransferResponse>;
50
+ interface SaveTokensToMeshProxyRequestBody extends BaseApiRequest {
50
51
  deviceId?: string | null;
51
52
  brokerType: string;
52
53
  accessToken: string;
@@ -54,7 +55,6 @@ interface SaveTokensToMeshProxyRequestBody {
54
55
  accessTokenExpiresIn: number;
55
56
  accessTokenExpiresAt: string;
56
57
  refreshTokenExpiresAt?: string | null;
57
- apiKey: string;
58
58
  }
59
59
  interface SaveTokensToMeshProxyResponseBody {
60
60
  id: number;
@@ -68,11 +68,10 @@ interface SaveTokensToMeshProxyResponseBody {
68
68
  refreshToken: string | null;
69
69
  refreshTokenExpiresAt: Date | null;
70
70
  }
71
- export declare function saveTokensToMeshProxy({ apiKey, ...props }: SaveTokensToMeshProxyRequestBody): Promise<SaveTokensToMeshProxyResponseBody>;
72
- interface RemoveTokensFromMeshProxyRequestBody {
71
+ export declare function saveTokensToMeshProxy({ apiKey, logger, signal, ...props }: SaveTokensToMeshProxyRequestBody): Promise<SaveTokensToMeshProxyResponseBody>;
72
+ interface RemoveTokensFromMeshProxyRequestBody extends BaseApiRequest {
73
73
  deviceId: string;
74
74
  brokerType: string;
75
- apiKey: string;
76
75
  }
77
- export declare function removeTokensFromMeshProxy({ apiKey, ...props }: RemoveTokensFromMeshProxyRequestBody): Promise<void>;
76
+ export declare function removeTokensFromMeshProxy({ deviceId, brokerType, ...options }: RemoveTokensFromMeshProxyRequestBody): Promise<void>;
78
77
  export {};
@@ -1,14 +1,13 @@
1
- export interface GetCryptocurrencyHoldingsRequest {
1
+ import type { BaseApiRequest } from '../../consts';
2
+ export interface GetCryptocurrencyHoldingsRequest extends BaseApiRequest {
2
3
  authToken: string;
3
4
  type: string;
4
- apiKey: string;
5
5
  }
6
- export interface GetCryptocurrencyHoldingsRequestProxy extends Omit<GetCryptocurrencyHoldingsRequest, 'authToken' | 'type'> {
6
+ export interface GetCryptocurrencyHoldingsRequestProxy extends BaseApiRequest {
7
7
  deviceId: string;
8
8
  brokerType: string;
9
9
  }
10
- export interface GetTransferIntegrationsRequest {
11
- apiKey: string;
10
+ export interface GetTransferIntegrationsRequest extends BaseApiRequest {
12
11
  }
13
12
  export interface IntegrationNetworkInfo {
14
13
  chainId: string;
@@ -27,18 +26,16 @@ export interface TransferIntegration {
27
26
  export interface GetTransferIntegrationsResponse {
28
27
  integrations: TransferIntegration[];
29
28
  }
30
- export interface GetLinkTokenRequest {
29
+ export interface GetLinkTokenRequest extends BaseApiRequest {
31
30
  userId: string;
32
31
  integrationId?: string | null;
33
32
  restrictMultipleAccounts?: boolean;
34
33
  transferOptions?: Record<string, unknown> | null;
35
- apiKey: string;
36
34
  }
37
35
  export interface GetLinkTokenResponse {
38
36
  linkToken: string;
39
37
  }
40
- export interface PreviewTransferRequest {
41
- apiKey: string;
38
+ export interface PreviewTransferRequest extends BaseApiRequest {
42
39
  fromAuthToken: string;
43
40
  fromType: string;
44
41
  toAuthToken?: string | null;
@@ -54,8 +51,7 @@ export interface PreviewTransferRequestProxy extends Omit<PreviewTransferRequest
54
51
  deviceId: string;
55
52
  brokerType: string;
56
53
  }
57
- export interface MeshExecuteTransferRequest {
58
- apiKey: string;
54
+ export interface MeshExecuteTransferRequest extends BaseApiRequest {
59
55
  fromAuthToken: string;
60
56
  fromType: string;
61
57
  previewId: string;
@@ -1,3 +1,3 @@
1
1
  import type { GetMoonpayBuyQuoteForCreditCardRequest, GetMoonpayBuyQuoteForCreditCardResponse, GetMoonpayUrlSignatureRequest } from './types';
2
- export declare function getMoonpayUrlSignature({ url, isSandbox, apiKey, }: GetMoonpayUrlSignatureRequest): Promise<string>;
3
- export declare function getMoonpayBuyQuoteForCreditCard({ currencyCode, baseCurrencyCode, quoteCurrencyAmount, baseCurrencyAmount, extraFeePercentage, areFeesIncluded, apiKey, }: GetMoonpayBuyQuoteForCreditCardRequest): Promise<GetMoonpayBuyQuoteForCreditCardResponse>;
2
+ export declare function getMoonpayUrlSignature({ url, isSandbox, ...options }: GetMoonpayUrlSignatureRequest): Promise<string>;
3
+ export declare function getMoonpayBuyQuoteForCreditCard({ currencyCode, baseCurrencyCode, quoteCurrencyAmount, baseCurrencyAmount, extraFeePercentage, areFeesIncluded, ...options }: GetMoonpayBuyQuoteForCreditCardRequest): Promise<GetMoonpayBuyQuoteForCreditCardResponse>;
@@ -1,10 +1,9 @@
1
- export interface GetMoonpayUrlSignatureRequest {
2
- apiKey: string;
1
+ import type { BaseApiRequest } from '../../consts';
2
+ export interface GetMoonpayUrlSignatureRequest extends BaseApiRequest {
3
3
  url: string;
4
4
  isSandbox?: boolean;
5
5
  }
6
- export interface GetMoonpayBuyQuoteForCreditCardRequest {
7
- apiKey: string;
6
+ export interface GetMoonpayBuyQuoteForCreditCardRequest extends BaseApiRequest {
8
7
  currencyCode: string;
9
8
  baseCurrencyCode: string;
10
9
  quoteCurrencyAmount: string;
@@ -1,7 +1,7 @@
1
+ import { type BaseApiRequest } from '../../consts';
1
2
  import type { CreateStripeBuySessionBody, CreateStripeBuySessionResponse, GetStripeBuyQuoteRequest, GetStripeBuyQuoteResponse } from './types';
2
- export declare function getStripeBuyQuote({ sourceCurrency, destinationAmount, destinationCurrency, destinationNetwork, isSandbox, apiKey, }: GetStripeBuyQuoteRequest): Promise<GetStripeBuyQuoteResponse>;
3
- export declare function createStripeBuySession({ sourceCurrency, destinationAmount, destinationCurrency, destinationNetwork, walletAddress, customerIpAddress, isSandbox, apiKey, }: CreateStripeBuySessionBody): Promise<CreateStripeBuySessionResponse>;
4
- export declare function getStripeBuySession({ sessionId, apiKey, }: {
3
+ export declare function getStripeBuyQuote({ sourceCurrency, destinationAmount, destinationCurrency, destinationNetwork, isSandbox, ...options }: GetStripeBuyQuoteRequest): Promise<GetStripeBuyQuoteResponse>;
4
+ export declare function createStripeBuySession({ sourceCurrency, destinationAmount, destinationCurrency, destinationNetwork, walletAddress, customerIpAddress, isSandbox, ...options }: CreateStripeBuySessionBody): Promise<CreateStripeBuySessionResponse>;
5
+ export declare function getStripeBuySession({ sessionId, ...options }: BaseApiRequest & {
5
6
  sessionId: string;
6
- apiKey: string;
7
7
  }): Promise<CreateStripeBuySessionResponse>;
@@ -1,9 +1,9 @@
1
- export interface GetStripeBuyQuoteRequest {
1
+ import type { BaseApiRequest } from '../../consts';
2
+ export interface GetStripeBuyQuoteRequest extends BaseApiRequest {
2
3
  sourceCurrency: 'usd' | 'eur';
3
4
  destinationAmount: number;
4
5
  destinationCurrency: string;
5
6
  destinationNetwork: string;
6
- apiKey: string;
7
7
  isSandbox: boolean;
8
8
  }
9
9
  export interface NetworkQuoteItem {
@@ -1,2 +1,2 @@
1
1
  import type { SendSupportMessageRequest } from './types';
2
- export declare function sendSupportMessage({ title, description, userEmail, apiKey, }: SendSupportMessageRequest): Promise<boolean>;
2
+ export declare function sendSupportMessage({ title, description, userEmail, ...options }: SendSupportMessageRequest): Promise<boolean>;
@@ -1,6 +1,6 @@
1
- export interface SendSupportMessageRequest {
1
+ import type { BaseApiRequest } from '../../consts';
2
+ export interface SendSupportMessageRequest extends BaseApiRequest {
2
3
  title: string;
3
4
  description: string;
4
5
  userEmail: string;
5
- apiKey: string;
6
6
  }