@unifold/core 0.1.24 → 0.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -133,6 +133,21 @@ interface QueryExecutionsResponse {
133
133
  * @param publishableKey - Optional publishable key, defaults to configured key
134
134
  */
135
135
  declare function queryExecutions(externalUserId: string, publishableKey?: string): Promise<QueryExecutionsResponse>;
136
+ interface PollExecutionsRequest {
137
+ deposit_wallet_id: string;
138
+ }
139
+ interface PollExecutionsResponse {
140
+ success: boolean;
141
+ message: string;
142
+ workflow_id: string;
143
+ already_running: boolean;
144
+ }
145
+ /**
146
+ * Start a poll workflow for direct executions on a deposit wallet
147
+ * @param request - Poll request with deposit_wallet_id
148
+ * @param publishableKey - Optional publishable key, defaults to configured key
149
+ */
150
+ declare function pollDirectExecutions(request: PollExecutionsRequest, publishableKey?: string): Promise<PollExecutionsResponse>;
136
151
  interface SupportedChain {
137
152
  chain_id: string;
138
153
  chain_name: string;
@@ -568,4 +583,4 @@ declare const i18n: {
568
583
  };
569
584
  type I18nStrings = typeof i18n;
570
585
 
571
- export { type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, type AutoSwapRequest, type AutoSwapResponse, type CreateDepositAddressRequest, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddressResponse, ExecutionStatus, type FeaturedToken, type FiatCurrenciesResponse, type FiatCurrency, type I18nStrings, type IconUrl, type IpAddressResponse, type OnrampQuote, type OnrampQuotesRequest, type OnrampQuotesResponse, type OnrampSessionRequest, type OnrampSessionResponse, type PaymentNetwork, type ProjectConfigResponse, type QueryExecutionsRequest, type QueryExecutionsResponse, SOLANA_USDC_ADDRESS, type SupportedChain, type SupportedDepositTokensResponse, type SupportedToken, type TokenBalance, type TokenChain, type TokenChainIconUrl, type TokenChainsResponse, type TokenIconUrl, type TokenInfo, type TokenMetadata, type UserIpInfo, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, createDepositAddress, createOnrampSession, getAddressBalance, getAddressBalances, getApiBaseUrl, getChainName, getDefaultOnrampToken, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getTokenChains, getTokenMetadata, getWalletByChainType, i18n, queryExecutions, setApiConfig, useUserIp, verifyRecipientAddress };
586
+ export { type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, type AutoSwapRequest, type AutoSwapResponse, type CreateDepositAddressRequest, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddressResponse, ExecutionStatus, type FeaturedToken, type FiatCurrenciesResponse, type FiatCurrency, type I18nStrings, type IconUrl, type IpAddressResponse, type OnrampQuote, type OnrampQuotesRequest, type OnrampQuotesResponse, type OnrampSessionRequest, type OnrampSessionResponse, type PaymentNetwork, type PollExecutionsRequest, type PollExecutionsResponse, type ProjectConfigResponse, type QueryExecutionsRequest, type QueryExecutionsResponse, SOLANA_USDC_ADDRESS, type SupportedChain, type SupportedDepositTokensResponse, type SupportedToken, type TokenBalance, type TokenChain, type TokenChainIconUrl, type TokenChainsResponse, type TokenIconUrl, type TokenInfo, type TokenMetadata, type UserIpInfo, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, createDepositAddress, createOnrampSession, getAddressBalance, getAddressBalances, getApiBaseUrl, getChainName, getDefaultOnrampToken, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getTokenChains, getTokenMetadata, getWalletByChainType, i18n, pollDirectExecutions, queryExecutions, setApiConfig, useUserIp, verifyRecipientAddress };
package/dist/index.d.ts CHANGED
@@ -133,6 +133,21 @@ interface QueryExecutionsResponse {
133
133
  * @param publishableKey - Optional publishable key, defaults to configured key
134
134
  */
135
135
  declare function queryExecutions(externalUserId: string, publishableKey?: string): Promise<QueryExecutionsResponse>;
136
+ interface PollExecutionsRequest {
137
+ deposit_wallet_id: string;
138
+ }
139
+ interface PollExecutionsResponse {
140
+ success: boolean;
141
+ message: string;
142
+ workflow_id: string;
143
+ already_running: boolean;
144
+ }
145
+ /**
146
+ * Start a poll workflow for direct executions on a deposit wallet
147
+ * @param request - Poll request with deposit_wallet_id
148
+ * @param publishableKey - Optional publishable key, defaults to configured key
149
+ */
150
+ declare function pollDirectExecutions(request: PollExecutionsRequest, publishableKey?: string): Promise<PollExecutionsResponse>;
136
151
  interface SupportedChain {
137
152
  chain_id: string;
138
153
  chain_name: string;
@@ -568,4 +583,4 @@ declare const i18n: {
568
583
  };
569
584
  type I18nStrings = typeof i18n;
570
585
 
571
- export { type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, type AutoSwapRequest, type AutoSwapResponse, type CreateDepositAddressRequest, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddressResponse, ExecutionStatus, type FeaturedToken, type FiatCurrenciesResponse, type FiatCurrency, type I18nStrings, type IconUrl, type IpAddressResponse, type OnrampQuote, type OnrampQuotesRequest, type OnrampQuotesResponse, type OnrampSessionRequest, type OnrampSessionResponse, type PaymentNetwork, type ProjectConfigResponse, type QueryExecutionsRequest, type QueryExecutionsResponse, SOLANA_USDC_ADDRESS, type SupportedChain, type SupportedDepositTokensResponse, type SupportedToken, type TokenBalance, type TokenChain, type TokenChainIconUrl, type TokenChainsResponse, type TokenIconUrl, type TokenInfo, type TokenMetadata, type UserIpInfo, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, createDepositAddress, createOnrampSession, getAddressBalance, getAddressBalances, getApiBaseUrl, getChainName, getDefaultOnrampToken, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getTokenChains, getTokenMetadata, getWalletByChainType, i18n, queryExecutions, setApiConfig, useUserIp, verifyRecipientAddress };
586
+ export { type AddressBalanceResponse, type AddressBalancesResponse, type AddressValidationFailureCode, type AddressValidationMetadata, type AutoSwapRequest, type AutoSwapResponse, type CreateDepositAddressRequest, type DefaultTokenChain, type DefaultTokenMetadata, type DefaultTokenResponse, type DepositAddressResponse, ExecutionStatus, type FeaturedToken, type FiatCurrenciesResponse, type FiatCurrency, type I18nStrings, type IconUrl, type IpAddressResponse, type OnrampQuote, type OnrampQuotesRequest, type OnrampQuotesResponse, type OnrampSessionRequest, type OnrampSessionResponse, type PaymentNetwork, type PollExecutionsRequest, type PollExecutionsResponse, type ProjectConfigResponse, type QueryExecutionsRequest, type QueryExecutionsResponse, SOLANA_USDC_ADDRESS, type SupportedChain, type SupportedDepositTokensResponse, type SupportedToken, type TokenBalance, type TokenChain, type TokenChainIconUrl, type TokenChainsResponse, type TokenIconUrl, type TokenInfo, type TokenMetadata, type UserIpInfo, type VerifyAddressRequest, type VerifyAddressResponse, type Wallet, createDepositAddress, createOnrampSession, getAddressBalance, getAddressBalances, getApiBaseUrl, getChainName, getDefaultOnrampToken, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getOnrampSessionStartUrl, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getTokenChains, getTokenMetadata, getWalletByChainType, i18n, pollDirectExecutions, queryExecutions, setApiConfig, useUserIp, verifyRecipientAddress };
package/dist/index.js CHANGED
@@ -42,6 +42,7 @@ __export(index_exports, {
42
42
  getTokenMetadata: () => getTokenMetadata,
43
43
  getWalletByChainType: () => getWalletByChainType,
44
44
  i18n: () => i18n,
45
+ pollDirectExecutions: () => pollDirectExecutions,
45
46
  queryExecutions: () => queryExecutions,
46
47
  setApiConfig: () => setApiConfig,
47
48
  useUserIp: () => useUserIp,
@@ -164,6 +165,26 @@ async function queryExecutions(externalUserId, publishableKey) {
164
165
  }
165
166
  return response.json();
166
167
  }
168
+ async function pollDirectExecutions(request, publishableKey) {
169
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
170
+ validatePublishableKey(pk);
171
+ const response = await fetch(
172
+ `${API_BASE_URL}/v1/public/direct_executions/poll`,
173
+ {
174
+ method: "POST",
175
+ headers: {
176
+ accept: "application/json",
177
+ "x-publishable-key": pk,
178
+ "Content-Type": "application/json"
179
+ },
180
+ body: JSON.stringify(request)
181
+ }
182
+ );
183
+ if (!response.ok) {
184
+ throw new Error(`Failed to poll direct executions: ${response.statusText}`);
185
+ }
186
+ return response.json();
187
+ }
167
188
  async function getSupportedDepositTokens(publishableKey, options) {
168
189
  const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
169
190
  validatePublishableKey(pk);
@@ -567,6 +588,7 @@ var i18n = en_default;
567
588
  getTokenMetadata,
568
589
  getWalletByChainType,
569
590
  i18n,
591
+ pollDirectExecutions,
570
592
  queryExecutions,
571
593
  setApiConfig,
572
594
  useUserIp,
package/dist/index.mjs CHANGED
@@ -113,6 +113,26 @@ async function queryExecutions(externalUserId, publishableKey) {
113
113
  }
114
114
  return response.json();
115
115
  }
116
+ async function pollDirectExecutions(request, publishableKey) {
117
+ const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
118
+ validatePublishableKey(pk);
119
+ const response = await fetch(
120
+ `${API_BASE_URL}/v1/public/direct_executions/poll`,
121
+ {
122
+ method: "POST",
123
+ headers: {
124
+ accept: "application/json",
125
+ "x-publishable-key": pk,
126
+ "Content-Type": "application/json"
127
+ },
128
+ body: JSON.stringify(request)
129
+ }
130
+ );
131
+ if (!response.ok) {
132
+ throw new Error(`Failed to poll direct executions: ${response.statusText}`);
133
+ }
134
+ return response.json();
135
+ }
116
136
  async function getSupportedDepositTokens(publishableKey, options) {
117
137
  const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
118
138
  validatePublishableKey(pk);
@@ -515,6 +535,7 @@ export {
515
535
  getTokenMetadata,
516
536
  getWalletByChainType,
517
537
  i18n,
538
+ pollDirectExecutions,
518
539
  queryExecutions,
519
540
  setApiConfig,
520
541
  useUserIp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifold/core",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "Unifold Core SDK - Core types, API client, and business logic",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",