Skip to content

Commit cf5b2d8

Browse files
feat(api): api update
Stainless-Generated-From: 0ac19c7d3ae4d98571327446f50c70bc063fe1bc
1 parent 6dd8830 commit cf5b2d8

13 files changed

Lines changed: 223 additions & 5 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 99
1+
configured_endpoints: 100

api.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,14 @@ Methods:
826826

827827
- <code title="post /v1/wallets/{wallet_id}/earn/ethereum/incentive/claim">client.wallets.earn.ethereum.incentive.<a href="./src/resources/wallets/earn/ethereum/incentive.ts">\_claim</a>(walletID, { ...params }) -> EarnIncentiveClaimActionResponse</code>
828828

829+
## Payout
830+
831+
### Fiat
832+
833+
Methods:
834+
835+
- <code title="post /v1/wallets/{wallet_id}/payout/fiat">client.wallets.payout.fiat.<a href="./src/resources/wallets/payout/fiat.ts">\_create</a>(walletID, { ...params }) -> PayoutResponse</code>
836+
829837
## Swap
830838

831839
Methods:

src/resources/cards.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ export type CardIssuingCancellationReason = 'lost' | 'stolen';
5656
export interface CardIssuingCardResponse {
5757
id: string;
5858

59+
/**
60+
* The asset the card funds from. 'usdc' on EVM and Solana, 'path_usd' on Tempo.
61+
*/
62+
asset: string;
63+
5964
/**
6065
* USD balance of the card funding wallet on the configured chain, or null when
6166
* unavailable.
@@ -157,6 +162,12 @@ export interface CardIssuingConfigResponse {
157162
* Input for creating a virtual Stripe Issuing card for a Privy wallet.
158163
*/
159164
export interface CardIssuingCreateCardInput {
165+
/**
166+
* The asset to fund the card. Must be 'usdc' on EVM and Solana, or 'path_usd' on
167+
* Tempo.
168+
*/
169+
asset: string;
170+
160171
/**
161172
* A valid CAIP-2 chain ID (e.g. 'eip155:4217' for Tempo, 'eip155:1' for Ethereum).
162173
*/

src/resources/intents.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ import { path } from '../internal/utils/path';
1717
*/
1818
export class Intents extends APIResource {
1919
/**
20-
* List intents for an app. Returns a paginated list of intents with their current
21-
* status and details.
20+
* List intents for an app. Returns a paginated list with each intent's current
21+
* status and details. Requests authenticated with an app secret can retrieve all
22+
* intents for the app. Requests authenticated with a user token return only
23+
* intents that the authenticated user created, must approve, or has signed. Query
24+
* parameters only narrow this scoped result set.
2225
*
2326
* @example
2427
* ```ts
@@ -101,8 +104,11 @@ export class Intents extends APIResource {
101104
}
102105

103106
/**
104-
* Retrieve an intent by ID. Returns the intent details including its current
105-
* status, authorization details, and execution result if applicable.
107+
* Retrieve an intent by ID. Returns its current status, authorization details, and
108+
* execution result when applicable. Requests authenticated with an app secret can
109+
* retrieve any intent for the app. Requests authenticated with a user token can
110+
* retrieve only intents that the authenticated user created, must approve, or has
111+
* signed. Unrelated intents return a 404 response.
106112
*
107113
* @example
108114
* ```ts
@@ -1015,6 +1021,10 @@ export namespace WalletIntentResponse {
10151021
}
10161022

10171023
export interface IntentListParams extends CursorParams {
1024+
/**
1025+
* Filter by creator user ID. For user-token requests, Privy uses the authenticated
1026+
* user ID to scope intent visibility. This filter only narrows that scoped result.
1027+
*/
10181028
created_by_id?: string;
10191029

10201030
current_user_has_signed?: 'true' | 'false';
@@ -1024,6 +1034,11 @@ export interface IntentListParams extends CursorParams {
10241034
*/
10251035
intent_type?: IntentType;
10261036

1037+
/**
1038+
* Filter by a user whose approval is still pending. For user-token requests, Privy
1039+
* uses the authenticated user ID to scope intent visibility. This filter only
1040+
* narrows that scoped result.
1041+
*/
10271042
pending_member_id?: string;
10281043

10291044
resource_id?: string;

src/resources/wallets/balance.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export interface BalanceGetParams {
114114
| 'tron'
115115
| 'zksync_era'
116116
| 'robinhood'
117+
| 'tempo_testnet'
117118
| 'hoodi'
118119
| 'sepolia'
119120
| 'arbitrum_sepolia'
@@ -122,6 +123,7 @@ export interface BalanceGetParams {
122123
| 'linea_testnet'
123124
| 'optimism_sepolia'
124125
| 'polygon_amoy'
126+
| 'bsc_testnet'
125127
| 'solana_devnet'
126128
| 'solana_testnet'
127129
| 'tron_nile'

src/resources/wallets/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export {
5252
export { Balance, type BalanceGetResponse, type BalanceGetParams } from './balance';
5353
export { DepositAccounts } from './deposit-accounts/index';
5454
export { Earn } from './earn/index';
55+
export { Payout } from './payout/index';
5556
export { Swap, type SwapExecuteParams, type SwapQuoteParams } from './swap';
5657
export { Transactions, type TransactionGetResponse, type TransactionGetParams } from './transactions';
5758
export {

src/resources/wallets/payout.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export * from './payout/index';
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import { APIResource } from '../../../core/resource';
4+
import * as FiatAPI from '../../fiat';
5+
import * as ActionsAPI from '../actions';
6+
import { APIPromise } from '../../../core/api-promise';
7+
import { buildHeaders } from '../../../internal/headers';
8+
import { RequestOptions } from '../../../internal/request-options';
9+
import { path } from '../../../internal/utils/path';
10+
11+
/**
12+
* Operations related to fiat onramping and offramping
13+
*/
14+
export class Fiat extends APIResource {
15+
/**
16+
* Initiates a payout (crypto to fiat offramp) from a wallet to a previously
17+
* registered external fiat account. Returns a pending wallet action; the crypto
18+
* transfer and fiat settlement are processed asynchronously.
19+
*
20+
* @example
21+
* ```ts
22+
* const payoutResponse =
23+
* await client.wallets.payout.fiat._create('wallet_id', {
24+
* destination: { fiat_account_id: 'fiat_account_id' },
25+
* source: {
26+
* amount: 'amount',
27+
* asset: 'asset',
28+
* chain: 'chain',
29+
* },
30+
* });
31+
* ```
32+
*/
33+
_create(
34+
walletID: string,
35+
params: FiatCreateParams,
36+
options?: RequestOptions,
37+
): APIPromise<ActionsAPI.PayoutResponse> {
38+
const {
39+
'privy-authorization-signature': privyAuthorizationSignature,
40+
'privy-idempotency-key': privyIdempotencyKey,
41+
'privy-request-expiry': privyRequestExpiry,
42+
...body
43+
} = params;
44+
return this._client.post(path`/v1/wallets/${walletID}/payout/fiat`, {
45+
body,
46+
...options,
47+
headers: buildHeaders([
48+
{
49+
...(privyAuthorizationSignature != null ?
50+
{ 'privy-authorization-signature': privyAuthorizationSignature }
51+
: undefined),
52+
...(privyIdempotencyKey != null ? { 'privy-idempotency-key': privyIdempotencyKey } : undefined),
53+
...(privyRequestExpiry != null ? { 'privy-request-expiry': privyRequestExpiry } : undefined),
54+
},
55+
options?.headers,
56+
]),
57+
});
58+
}
59+
}
60+
61+
export interface FiatCreateParams {
62+
/**
63+
* Body param: The destination bank account for a payout.
64+
*/
65+
destination: FiatAPI.PayoutDestination;
66+
67+
/**
68+
* Body param: The source crypto asset, chain, and amount for a payout.
69+
*/
70+
source: FiatAPI.PayoutSource;
71+
72+
/**
73+
* Header param: Request authorization signature. If multiple signatures are
74+
* required, they should be comma separated.
75+
*/
76+
'privy-authorization-signature'?: string;
77+
78+
/**
79+
* Header param: Idempotency keys ensure API requests are executed only once within
80+
* a 24-hour window.
81+
*/
82+
'privy-idempotency-key'?: string;
83+
84+
/**
85+
* Header param: Request expiry. Value is a Unix timestamp in milliseconds
86+
* representing the deadline by which the request must be processed.
87+
*/
88+
'privy-request-expiry'?: string;
89+
}
90+
91+
export declare namespace Fiat {
92+
export { type FiatCreateParams as FiatCreateParams };
93+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export { Fiat, type FiatCreateParams } from './fiat';
4+
export { Payout } from './payout';
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import { APIResource } from '../../../core/resource';
4+
import * as FiatAPI from './fiat';
5+
import { Fiat, FiatCreateParams } from './fiat';
6+
7+
export class Payout extends APIResource {
8+
fiat: FiatAPI.Fiat = new FiatAPI.Fiat(this._client);
9+
}
10+
11+
Payout.Fiat = Fiat;
12+
13+
export declare namespace Payout {
14+
export { Fiat as Fiat, type FiatCreateParams as FiatCreateParams };
15+
}

0 commit comments

Comments
 (0)