@dynamic-labs/sdk-api 0.0.1062 → 0.0.1064

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-api",
3
- "version": "0.0.1062",
3
+ "version": "0.0.1064",
4
4
  "author": "Dynamic Labs",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -316,7 +316,7 @@ var WalletTransactionsResponse = require('../models/WalletTransactionsResponse.c
316
316
  */
317
317
  class SDKApi extends runtime.BaseAPI {
318
318
  /**
319
- * Sets the source wallet address and chain on an initiated flow and mints the capability sessionToken used to drive the rest of the lifecycle. No API key or token is required (the browser has neither at this point) — the endpoint is gated by the flow still being initiated and by CORS. At most one live token exists per flow at a time.
319
+ * Sets the source wallet address and chain on an initiated flow and mints the capability sessionToken used to drive the rest of the lifecycle. No API key or token is required (the browser has neither at this point) — the endpoint is gated by the flow still being initiated and by CORS. At most one live token exists per flow at a time. When re-attaching from the signing state, the existing session token must be supplied to prove the caller is the original signer.
320
320
  * Attach a source to a flow and mint a session token
321
321
  */
322
322
  async attachFlowSourceRaw(requestParameters, initOverrides) {
@@ -332,6 +332,9 @@ class SDKApi extends runtime.BaseAPI {
332
332
  const queryParameters = {};
333
333
  const headerParameters = {};
334
334
  headerParameters['Content-Type'] = 'application/json';
335
+ if (requestParameters.xDynamicFlowSessionToken !== undefined && requestParameters.xDynamicFlowSessionToken !== null) {
336
+ headerParameters['X-Dynamic-Flow-Session-Token'] = String(requestParameters.xDynamicFlowSessionToken);
337
+ }
335
338
  const response = await this.request({
336
339
  path: `/sdk/{environmentId}/flow/{flowId}/source`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"flowId"}}`, encodeURIComponent(String(requestParameters.flowId))),
337
340
  method: 'POST',
@@ -342,7 +345,7 @@ class SDKApi extends runtime.BaseAPI {
342
345
  return new runtime.JSONApiResponse(response, (jsonValue) => FlowSourceResponse.FlowSourceResponseFromJSON(jsonValue));
343
346
  }
344
347
  /**
345
- * Sets the source wallet address and chain on an initiated flow and mints the capability sessionToken used to drive the rest of the lifecycle. No API key or token is required (the browser has neither at this point) — the endpoint is gated by the flow still being initiated and by CORS. At most one live token exists per flow at a time.
348
+ * Sets the source wallet address and chain on an initiated flow and mints the capability sessionToken used to drive the rest of the lifecycle. No API key or token is required (the browser has neither at this point) — the endpoint is gated by the flow still being initiated and by CORS. At most one live token exists per flow at a time. When re-attaching from the signing state, the existing session token must be supplied to prove the caller is the original signer.
346
349
  * Attach a source to a flow and mint a session token
347
350
  */
348
351
  async attachFlowSource(requestParameters, initOverrides) {
@@ -15,6 +15,7 @@ export interface AttachFlowSourceRequest {
15
15
  environmentId: string;
16
16
  flowId: string;
17
17
  flowAttachSourceRequest: FlowAttachSourceRequest;
18
+ xDynamicFlowSessionToken?: string;
18
19
  }
19
20
  export interface AttachFlowSourceOptionsRequest {
20
21
  environmentId: string;
@@ -1380,12 +1381,12 @@ export interface WalletsVerifyOptionsRequest {
1380
1381
  */
1381
1382
  export declare class SDKApi extends runtime.BaseAPI {
1382
1383
  /**
1383
- * Sets the source wallet address and chain on an initiated flow and mints the capability sessionToken used to drive the rest of the lifecycle. No API key or token is required (the browser has neither at this point) — the endpoint is gated by the flow still being initiated and by CORS. At most one live token exists per flow at a time.
1384
+ * Sets the source wallet address and chain on an initiated flow and mints the capability sessionToken used to drive the rest of the lifecycle. No API key or token is required (the browser has neither at this point) — the endpoint is gated by the flow still being initiated and by CORS. At most one live token exists per flow at a time. When re-attaching from the signing state, the existing session token must be supplied to prove the caller is the original signer.
1384
1385
  * Attach a source to a flow and mint a session token
1385
1386
  */
1386
1387
  attachFlowSourceRaw(requestParameters: AttachFlowSourceRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<FlowSourceResponse>>;
1387
1388
  /**
1388
- * Sets the source wallet address and chain on an initiated flow and mints the capability sessionToken used to drive the rest of the lifecycle. No API key or token is required (the browser has neither at this point) — the endpoint is gated by the flow still being initiated and by CORS. At most one live token exists per flow at a time.
1389
+ * Sets the source wallet address and chain on an initiated flow and mints the capability sessionToken used to drive the rest of the lifecycle. No API key or token is required (the browser has neither at this point) — the endpoint is gated by the flow still being initiated and by CORS. At most one live token exists per flow at a time. When re-attaching from the signing state, the existing session token must be supplied to prove the caller is the original signer.
1389
1390
  * Attach a source to a flow and mint a session token
1390
1391
  */
1391
1392
  attachFlowSource(requestParameters: AttachFlowSourceRequest, initOverrides?: RequestInit): Promise<FlowSourceResponse>;
@@ -312,7 +312,7 @@ import { WalletTransactionsResponseFromJSON } from '../models/WalletTransactions
312
312
  */
313
313
  class SDKApi extends BaseAPI {
314
314
  /**
315
- * Sets the source wallet address and chain on an initiated flow and mints the capability sessionToken used to drive the rest of the lifecycle. No API key or token is required (the browser has neither at this point) — the endpoint is gated by the flow still being initiated and by CORS. At most one live token exists per flow at a time.
315
+ * Sets the source wallet address and chain on an initiated flow and mints the capability sessionToken used to drive the rest of the lifecycle. No API key or token is required (the browser has neither at this point) — the endpoint is gated by the flow still being initiated and by CORS. At most one live token exists per flow at a time. When re-attaching from the signing state, the existing session token must be supplied to prove the caller is the original signer.
316
316
  * Attach a source to a flow and mint a session token
317
317
  */
318
318
  async attachFlowSourceRaw(requestParameters, initOverrides) {
@@ -328,6 +328,9 @@ class SDKApi extends BaseAPI {
328
328
  const queryParameters = {};
329
329
  const headerParameters = {};
330
330
  headerParameters['Content-Type'] = 'application/json';
331
+ if (requestParameters.xDynamicFlowSessionToken !== undefined && requestParameters.xDynamicFlowSessionToken !== null) {
332
+ headerParameters['X-Dynamic-Flow-Session-Token'] = String(requestParameters.xDynamicFlowSessionToken);
333
+ }
331
334
  const response = await this.request({
332
335
  path: `/sdk/{environmentId}/flow/{flowId}/source`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"flowId"}}`, encodeURIComponent(String(requestParameters.flowId))),
333
336
  method: 'POST',
@@ -338,7 +341,7 @@ class SDKApi extends BaseAPI {
338
341
  return new JSONApiResponse(response, (jsonValue) => FlowSourceResponseFromJSON(jsonValue));
339
342
  }
340
343
  /**
341
- * Sets the source wallet address and chain on an initiated flow and mints the capability sessionToken used to drive the rest of the lifecycle. No API key or token is required (the browser has neither at this point) — the endpoint is gated by the flow still being initiated and by CORS. At most one live token exists per flow at a time.
344
+ * Sets the source wallet address and chain on an initiated flow and mints the capability sessionToken used to drive the rest of the lifecycle. No API key or token is required (the browser has neither at this point) — the endpoint is gated by the flow still being initiated and by CORS. At most one live token exists per flow at a time. When re-attaching from the signing state, the existing session token must be supplied to prove the caller is the original signer.
342
345
  * Attach a source to a flow and mint a session token
343
346
  */
344
347
  async attachFlowSource(requestParameters, initOverrides) {
@@ -21,6 +21,7 @@ function FlowAttachSourceRequestFromJSONTyped(json, ignoreDiscriminator) {
21
21
  'fromChainId': !runtime.exists(json, 'fromChainId') ? undefined : json['fromChainId'],
22
22
  'fromChainName': !runtime.exists(json, 'fromChainName') ? undefined : ChainEnum.ChainEnumFromJSON(json['fromChainName']),
23
23
  'exchangeProvider': !runtime.exists(json, 'exchangeProvider') ? undefined : ExchangeKeyEnum.ExchangeKeyEnumFromJSON(json['exchangeProvider']),
24
+ 'refundAddress': !runtime.exists(json, 'refundAddress') ? undefined : json['refundAddress'],
24
25
  };
25
26
  }
26
27
  function FlowAttachSourceRequestToJSON(value) {
@@ -36,6 +37,7 @@ function FlowAttachSourceRequestToJSON(value) {
36
37
  'fromChainId': value.fromChainId,
37
38
  'fromChainName': ChainEnum.ChainEnumToJSON(value.fromChainName),
38
39
  'exchangeProvider': ExchangeKeyEnum.ExchangeKeyEnumToJSON(value.exchangeProvider),
40
+ 'refundAddress': value.refundAddress,
39
41
  };
40
42
  }
41
43
 
@@ -13,7 +13,7 @@ import { ChainEnum } from './ChainEnum';
13
13
  import { ExchangeKeyEnum } from './ExchangeKeyEnum';
14
14
  import { FlowSourceTypeEnum } from './FlowSourceTypeEnum';
15
15
  /**
16
- * fromAddress, fromChainId, and fromChainName are required when sourceType is 'wallet'. When sourceType is 'exchange', they are optional; pass exchangeProvider to generate the buy URL and create the exchange source record server-side. When sourceType is 'deposit_address', fromChainId and fromChainName are required so the bridge provider knows the source chain; fromAddress is optional (omit when the customer pays from a CEX with no connected wallet).
16
+ * fromAddress, fromChainId, and fromChainName are required when sourceType is 'wallet'. When sourceType is 'exchange', they are optional; pass exchangeProvider to generate the buy URL and create the exchange source record server-side. When sourceType is 'deposit_address', fromChainId and fromChainName are required; fromAddress is not accepted (use refundAddress instead to specify where funds should be returned if the deposit fails).
17
17
  * @export
18
18
  * @interface FlowAttachSourceRequest
19
19
  */
@@ -48,6 +48,12 @@ export interface FlowAttachSourceRequest {
48
48
  * @memberof FlowAttachSourceRequest
49
49
  */
50
50
  exchangeProvider?: ExchangeKeyEnum;
51
+ /**
52
+ * Valid blockchain wallet address, must be an alphanumeric string (underscores allowed for chains like Midnight, hyphens allowed for chains using base64url-encoded addresses like TON)
53
+ * @type {string}
54
+ * @memberof FlowAttachSourceRequest
55
+ */
56
+ refundAddress?: string;
51
57
  }
52
58
  export declare function FlowAttachSourceRequestFromJSON(json: any): FlowAttachSourceRequest;
53
59
  export declare function FlowAttachSourceRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): FlowAttachSourceRequest;
@@ -17,6 +17,7 @@ function FlowAttachSourceRequestFromJSONTyped(json, ignoreDiscriminator) {
17
17
  'fromChainId': !exists(json, 'fromChainId') ? undefined : json['fromChainId'],
18
18
  'fromChainName': !exists(json, 'fromChainName') ? undefined : ChainEnumFromJSON(json['fromChainName']),
19
19
  'exchangeProvider': !exists(json, 'exchangeProvider') ? undefined : ExchangeKeyEnumFromJSON(json['exchangeProvider']),
20
+ 'refundAddress': !exists(json, 'refundAddress') ? undefined : json['refundAddress'],
20
21
  };
21
22
  }
22
23
  function FlowAttachSourceRequestToJSON(value) {
@@ -32,6 +33,7 @@ function FlowAttachSourceRequestToJSON(value) {
32
33
  'fromChainId': value.fromChainId,
33
34
  'fromChainName': ChainEnumToJSON(value.fromChainName),
34
35
  'exchangeProvider': ExchangeKeyEnumToJSON(value.exchangeProvider),
36
+ 'refundAddress': value.refundAddress,
35
37
  };
36
38
  }
37
39