@dfns/sdk 0.4.1 → 0.4.2

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.
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,23 +1,49 @@
1
1
  export type GetFeesQuery = {
2
- network: "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Bsc" | "BscTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Polygon" | "PolygonAmoy" | "PolygonMumbai";
2
+ network: ("Bitcoin" | "BitcoinTestnet3" | "Litecoin" | "LitecoinTestnet") | ("ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Bsc" | "BscTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Polygon" | "PolygonAmoy" | "PolygonMumbai") | ("Solana" | "SolanaDevnet");
3
3
  };
4
4
  export type GetFeesResponse = {
5
+ kind: "Bitcoin";
6
+ network: "Bitcoin" | "BitcoinTestnet3" | "Litecoin" | "LitecoinTestnet";
7
+ blockNumber: number;
8
+ slow: {
9
+ feeRate: string;
10
+ };
11
+ standard: {
12
+ feeRate: string;
13
+ };
14
+ fast: {
15
+ feeRate: string;
16
+ };
17
+ } | {
5
18
  kind: "Eip1559";
6
19
  network: "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Bsc" | "BscTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Polygon" | "PolygonAmoy" | "PolygonMumbai";
7
20
  blockNumber: number;
8
21
  slow: {
9
- maxPriorityFee: number;
10
- maxFee: number;
22
+ maxPriorityFeePerGas: string;
23
+ maxFeePerGas: string;
11
24
  };
12
25
  standard: {
13
- maxPriorityFee: number;
14
- maxFee: number;
26
+ maxPriorityFeePerGas: string;
27
+ maxFeePerGas: string;
15
28
  };
16
29
  fast: {
17
- maxPriorityFee: number;
18
- maxFee: number;
30
+ maxPriorityFeePerGas: string;
31
+ maxFeePerGas: string;
19
32
  };
20
33
  estimatedBaseFee: number;
34
+ } | {
35
+ kind: "Solana";
36
+ network: "Solana" | "SolanaDevnet";
37
+ blockNumber: number;
38
+ slow: {
39
+ computeUnitPrice: string;
40
+ };
41
+ standard: {
42
+ computeUnitPrice: string;
43
+ };
44
+ fast: {
45
+ computeUnitPrice: string;
46
+ };
21
47
  };
22
48
  export type GetFeesRequest = {
23
49
  query?: GetFeesQuery;
@@ -8,12 +8,10 @@ export type ArchivePermissionResponse = {
8
8
  id: string;
9
9
  name: string;
10
10
  operations: string[];
11
- resourceId?: (string | undefined) | null;
12
11
  status: "Active";
13
- predicateIds?: string[] | undefined;
14
12
  isImmutable: boolean;
15
- dateCreated?: string | undefined;
16
- dateUpdated?: string | undefined;
13
+ dateCreated: string;
14
+ dateUpdated: string;
17
15
  isArchived: boolean;
18
16
  };
19
17
  export type ArchivePermissionRequest = ArchivePermissionParams & {
@@ -30,26 +28,24 @@ export type CreateAssignmentResponse = {
30
28
  permissionId: string;
31
29
  identityId: string;
32
30
  isImmutable: boolean;
33
- dateCreated?: string | undefined;
34
- dateUpdated?: string | undefined;
31
+ dateCreated: string;
32
+ dateUpdated: string;
35
33
  };
36
34
  export type CreateAssignmentRequest = CreateAssignmentParams & {
37
35
  body: CreateAssignmentBody;
38
36
  };
39
37
  export type CreatePermissionBody = {
40
38
  name: string;
41
- operations: ("ApiKeys:Create" | "ApiKeys:Read" | "ApiKeys:Revoke" | "AssetAccounts:Archive" | "AssetAccounts:Create" | "AssetAccounts:Read" | "Auth:Action:Sign" | "Auth:Apps:Create" | "Auth:Apps:Read" | "Auth:Apps:Update" | "Auth:Creds:Create" | "Auth:Creds:Read" | "Auth:Creds:Update" | "Auth:Types:Application" | "Auth:Types:Employee" | "Auth:Types:EndUser" | "Auth:Types:Pat" | "Auth:Types:ServiceAccount" | "Auth:Users:Create" | "Auth:Users:Delegate" | "Auth:Users:Read" | "Auth:Users:Update" | "Balances:Read" | "CallbackEvents:Read" | "CallbackSubscriptions:Archive" | "CallbackSubscriptions:Create" | "CallbackSubscriptions:Read" | "Employees:Read" | "Payments:Create" | "Payments:Read" | "PermissionAssignments:Create" | "PermissionAssignments:Read" | "PermissionAssignments:Revoke" | "PermissionPredicates:Archive" | "PermissionPredicates:Create" | "PermissionPredicates:Read" | "PermissionPredicates:Update" | "Permissions:Archive" | "Permissions:Create" | "Permissions:Read" | "Permissions:Update" | "Policies:Archive" | "Policies:Create" | "Policies:Read" | "Policies:Update" | "Policies:Approvals:Read" | "Policies:Approvals:Approve" | "PolicyControlExecutions:Read" | "PolicyControlExecutions:Update" | "PolicyControls:Archive" | "PolicyControls:Create" | "PolicyControls:Read" | "PolicyControls:Update" | "PolicyRules:Archive" | "PolicyRules:Create" | "PolicyRules:Read" | "PolicyRules:Update" | "PublicKeyAddresses:Read" | "PublicKeys:Create" | "PublicKeys:Read" | "Signatures:Create" | "Signatures:Read" | "Signers:ListSigners" | "Transactions:Create" | "Transactions:Read" | "Wallets:BroadcastTransaction" | "Wallets:Create" | "Wallets:Delegate" | "Wallets:Export" | "Wallets:GenerateSignature" | "Wallets:Import" | "Wallets:Read" | "Wallets:ReadSignature" | "Wallets:ReadTransaction" | "Wallets:ReadTransfer" | "Wallets:TransferAsset" | "Wallets:Update" | "Webhooks:Create" | "Webhooks:Read" | "Webhooks:Update" | "Webhooks:Delete" | "Webhooks:Ping" | "Webhooks:Events:Read")[];
39
+ operations: ("ApiKeys:Create" | "ApiKeys:Read" | "ApiKeys:Revoke" | "AssetAccounts:Archive" | "AssetAccounts:Create" | "AssetAccounts:Read" | "Auth:Action:Sign" | "Auth:Apps:Create" | "Auth:Apps:Read" | "Auth:Apps:Update" | "Auth:Creds:Create" | "Auth:Creds:Read" | "Auth:Creds:Update" | "Auth:Creds:Code:Create" | "Auth:Types:Application" | "Auth:Types:Employee" | "Auth:Types:EndUser" | "Auth:Types:Pat" | "Auth:Types:ServiceAccount" | "Auth:Users:Create" | "Auth:Users:Delegate" | "Auth:Users:Read" | "Auth:Users:Update" | "Balances:Read" | "CallbackEvents:Read" | "CallbackSubscriptions:Archive" | "CallbackSubscriptions:Create" | "CallbackSubscriptions:Read" | "Employees:Read" | "Payments:Create" | "Payments:Read" | "PermissionAssignments:Create" | "PermissionAssignments:Read" | "PermissionAssignments:Revoke" | "PermissionPredicates:Archive" | "PermissionPredicates:Create" | "PermissionPredicates:Read" | "PermissionPredicates:Update" | "Permissions:Archive" | "Permissions:Create" | "Permissions:Read" | "Permissions:Update" | "Policies:Archive" | "Policies:Create" | "Policies:Read" | "Policies:Update" | "Policies:Approvals:Read" | "Policies:Approvals:Approve" | "PolicyControlExecutions:Read" | "PolicyControlExecutions:Update" | "PolicyControls:Archive" | "PolicyControls:Create" | "PolicyControls:Read" | "PolicyControls:Update" | "PolicyRules:Archive" | "PolicyRules:Create" | "PolicyRules:Read" | "PolicyRules:Update" | "PublicKeyAddresses:Read" | "PublicKeys:Create" | "PublicKeys:Read" | "Signatures:Create" | "Signatures:Read" | "Signers:ListSigners" | "Transactions:Create" | "Transactions:Read" | "Wallets:BroadcastTransaction" | "Wallets:Create" | "Wallets:Delegate" | "Wallets:Export" | "Wallets:GenerateSignature" | "Wallets:Import" | "Wallets:Read" | "Wallets:ReadSignature" | "Wallets:ReadTransaction" | "Wallets:ReadTransfer" | "Wallets:TransferAsset" | "Wallets:Update" | "Webhooks:Create" | "Webhooks:Read" | "Webhooks:Update" | "Webhooks:Delete" | "Webhooks:Ping" | "Webhooks:Events:Read")[];
42
40
  };
43
41
  export type CreatePermissionResponse = {
44
42
  id: string;
45
43
  name: string;
46
44
  operations: string[];
47
- resourceId?: (string | undefined) | null;
48
45
  status: "Active";
49
- predicateIds?: string[] | undefined;
50
46
  isImmutable: boolean;
51
- dateCreated?: string | undefined;
52
- dateUpdated?: string | undefined;
47
+ dateCreated: string;
48
+ dateUpdated: string;
53
49
  isArchived: boolean;
54
50
  };
55
51
  export type CreatePermissionRequest = {
@@ -68,12 +64,10 @@ export type GetPermissionResponse = {
68
64
  id: string;
69
65
  name: string;
70
66
  operations: string[];
71
- resourceId?: (string | undefined) | null;
72
67
  status: "Active";
73
- predicateIds?: string[] | undefined;
74
68
  isImmutable: boolean;
75
- dateCreated?: string | undefined;
76
- dateUpdated?: string | undefined;
69
+ dateCreated: string;
70
+ dateUpdated: string;
77
71
  isArchived: boolean;
78
72
  } & {
79
73
  pendingChangeRequest?: {
@@ -101,8 +95,8 @@ export type ListAssignmentsResponse = {
101
95
  permissionId: string;
102
96
  identityId: string;
103
97
  isImmutable: boolean;
104
- dateCreated?: string | undefined;
105
- dateUpdated?: string | undefined;
98
+ dateCreated: string;
99
+ dateUpdated: string;
106
100
  } & {
107
101
  pendingChangeRequest?: {
108
102
  id: string;
@@ -131,12 +125,10 @@ export type ListPermissionsResponse = {
131
125
  id: string;
132
126
  name: string;
133
127
  operations: string[];
134
- resourceId?: (string | undefined) | null;
135
128
  status: "Active";
136
- predicateIds?: string[] | undefined;
137
129
  isImmutable: boolean;
138
- dateCreated?: string | undefined;
139
- dateUpdated?: string | undefined;
130
+ dateCreated: string;
131
+ dateUpdated: string;
140
132
  isArchived: boolean;
141
133
  } & {
142
134
  pendingChangeRequest?: {
@@ -161,7 +153,7 @@ export type ListPermissionsRequest = {
161
153
  };
162
154
  export type UpdatePermissionBody = {
163
155
  name?: string | undefined;
164
- operations?: ("ApiKeys:Create" | "ApiKeys:Read" | "ApiKeys:Revoke" | "AssetAccounts:Archive" | "AssetAccounts:Create" | "AssetAccounts:Read" | "Auth:Action:Sign" | "Auth:Apps:Create" | "Auth:Apps:Read" | "Auth:Apps:Update" | "Auth:Creds:Create" | "Auth:Creds:Read" | "Auth:Creds:Update" | "Auth:Types:Application" | "Auth:Types:Employee" | "Auth:Types:EndUser" | "Auth:Types:Pat" | "Auth:Types:ServiceAccount" | "Auth:Users:Create" | "Auth:Users:Delegate" | "Auth:Users:Read" | "Auth:Users:Update" | "Balances:Read" | "CallbackEvents:Read" | "CallbackSubscriptions:Archive" | "CallbackSubscriptions:Create" | "CallbackSubscriptions:Read" | "Employees:Read" | "Payments:Create" | "Payments:Read" | "PermissionAssignments:Create" | "PermissionAssignments:Read" | "PermissionAssignments:Revoke" | "PermissionPredicates:Archive" | "PermissionPredicates:Create" | "PermissionPredicates:Read" | "PermissionPredicates:Update" | "Permissions:Archive" | "Permissions:Create" | "Permissions:Read" | "Permissions:Update" | "Policies:Archive" | "Policies:Create" | "Policies:Read" | "Policies:Update" | "Policies:Approvals:Read" | "Policies:Approvals:Approve" | "PolicyControlExecutions:Read" | "PolicyControlExecutions:Update" | "PolicyControls:Archive" | "PolicyControls:Create" | "PolicyControls:Read" | "PolicyControls:Update" | "PolicyRules:Archive" | "PolicyRules:Create" | "PolicyRules:Read" | "PolicyRules:Update" | "PublicKeyAddresses:Read" | "PublicKeys:Create" | "PublicKeys:Read" | "Signatures:Create" | "Signatures:Read" | "Signers:ListSigners" | "Transactions:Create" | "Transactions:Read" | "Wallets:BroadcastTransaction" | "Wallets:Create" | "Wallets:Delegate" | "Wallets:Export" | "Wallets:GenerateSignature" | "Wallets:Import" | "Wallets:Read" | "Wallets:ReadSignature" | "Wallets:ReadTransaction" | "Wallets:ReadTransfer" | "Wallets:TransferAsset" | "Wallets:Update" | "Webhooks:Create" | "Webhooks:Read" | "Webhooks:Update" | "Webhooks:Delete" | "Webhooks:Ping" | "Webhooks:Events:Read")[] | undefined;
156
+ operations?: ("ApiKeys:Create" | "ApiKeys:Read" | "ApiKeys:Revoke" | "AssetAccounts:Archive" | "AssetAccounts:Create" | "AssetAccounts:Read" | "Auth:Action:Sign" | "Auth:Apps:Create" | "Auth:Apps:Read" | "Auth:Apps:Update" | "Auth:Creds:Create" | "Auth:Creds:Read" | "Auth:Creds:Update" | "Auth:Creds:Code:Create" | "Auth:Types:Application" | "Auth:Types:Employee" | "Auth:Types:EndUser" | "Auth:Types:Pat" | "Auth:Types:ServiceAccount" | "Auth:Users:Create" | "Auth:Users:Delegate" | "Auth:Users:Read" | "Auth:Users:Update" | "Balances:Read" | "CallbackEvents:Read" | "CallbackSubscriptions:Archive" | "CallbackSubscriptions:Create" | "CallbackSubscriptions:Read" | "Employees:Read" | "Payments:Create" | "Payments:Read" | "PermissionAssignments:Create" | "PermissionAssignments:Read" | "PermissionAssignments:Revoke" | "PermissionPredicates:Archive" | "PermissionPredicates:Create" | "PermissionPredicates:Read" | "PermissionPredicates:Update" | "Permissions:Archive" | "Permissions:Create" | "Permissions:Read" | "Permissions:Update" | "Policies:Archive" | "Policies:Create" | "Policies:Read" | "Policies:Update" | "Policies:Approvals:Read" | "Policies:Approvals:Approve" | "PolicyControlExecutions:Read" | "PolicyControlExecutions:Update" | "PolicyControls:Archive" | "PolicyControls:Create" | "PolicyControls:Read" | "PolicyControls:Update" | "PolicyRules:Archive" | "PolicyRules:Create" | "PolicyRules:Read" | "PolicyRules:Update" | "PublicKeyAddresses:Read" | "PublicKeys:Create" | "PublicKeys:Read" | "Signatures:Create" | "Signatures:Read" | "Signers:ListSigners" | "Transactions:Create" | "Transactions:Read" | "Wallets:BroadcastTransaction" | "Wallets:Create" | "Wallets:Delegate" | "Wallets:Export" | "Wallets:GenerateSignature" | "Wallets:Import" | "Wallets:Read" | "Wallets:ReadSignature" | "Wallets:ReadTransaction" | "Wallets:ReadTransfer" | "Wallets:TransferAsset" | "Wallets:Update" | "Webhooks:Create" | "Webhooks:Read" | "Webhooks:Update" | "Webhooks:Delete" | "Webhooks:Ping" | "Webhooks:Events:Read")[] | undefined;
165
157
  };
166
158
  export type UpdatePermissionParams = {
167
159
  permissionId: string;
@@ -170,12 +162,10 @@ export type UpdatePermissionResponse = {
170
162
  id: string;
171
163
  name: string;
172
164
  operations: string[];
173
- resourceId?: (string | undefined) | null;
174
165
  status: "Active";
175
- predicateIds?: string[] | undefined;
176
166
  isImmutable: boolean;
177
- dateCreated?: string | undefined;
178
- dateUpdated?: string | undefined;
167
+ dateCreated: string;
168
+ dateUpdated: string;
179
169
  isArchived: boolean;
180
170
  };
181
171
  export type UpdatePermissionRequest = UpdatePermissionParams & {
@@ -88,7 +88,7 @@ export type CreateWalletBody = {
88
88
  network: "Algorand" | "AlgorandTestnet" | "ArbitrumOne" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Litecoin" | "LitecoinTestnet" | "Optimism" | "OptimismSepolia" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Tron" | "TronNile" | "ArbitrumGoerli" | "BaseGoerli" | "Cardano" | "CardanoPreprod" | "Kusama" | "OptimismGoerli" | "Polkadot" | "Westend" | "Solana" | "SolanaDevnet" | "Tezos" | "TezosGhostnet" | "XrpLedger" | "XrpLedgerTestnet" | "KeyEdDSA" | "KeyECDSA" | "KeyECDSAStark";
89
89
  name?: string | undefined;
90
90
  externalId?: string | undefined;
91
- tags?: string[] | undefined;
91
+ delegateTo?: string | undefined;
92
92
  delayDelegation?: boolean | undefined;
93
93
  };
94
94
  export type CreateWalletResponse = {
@@ -391,16 +391,19 @@ export type GetTransferResponse = {
391
391
  to: string | string | string | string | string | string | string | string | string | string;
392
392
  amount: string;
393
393
  memo?: string | undefined;
394
+ priority?: ("Slow" | "Standard" | "Fast") | undefined;
394
395
  } | {
395
396
  kind: "Erc20";
396
397
  contract: string;
397
398
  to: string;
398
399
  amount: string;
400
+ priority?: ("Slow" | "Standard" | "Fast") | undefined;
399
401
  } | {
400
402
  kind: "Erc721";
401
403
  contract: string;
402
404
  to: string;
403
405
  tokenId: string;
406
+ priority?: ("Slow" | "Standard" | "Fast") | undefined;
404
407
  } | {
405
408
  kind: "Trc10";
406
409
  tokenId: string;
@@ -988,16 +991,19 @@ export type ListTransfersResponse = {
988
991
  to: string | string | string | string | string | string | string | string | string | string;
989
992
  amount: string;
990
993
  memo?: string | undefined;
994
+ priority?: ("Slow" | "Standard" | "Fast") | undefined;
991
995
  } | {
992
996
  kind: "Erc20";
993
997
  contract: string;
994
998
  to: string;
995
999
  amount: string;
1000
+ priority?: ("Slow" | "Standard" | "Fast") | undefined;
996
1001
  } | {
997
1002
  kind: "Erc721";
998
1003
  contract: string;
999
1004
  to: string;
1000
1005
  tokenId: string;
1006
+ priority?: ("Slow" | "Standard" | "Fast") | undefined;
1001
1007
  } | {
1002
1008
  kind: "Trc10";
1003
1009
  tokenId: string;
@@ -1077,16 +1083,19 @@ export type TransferAssetBody = {
1077
1083
  to: string | string | string | string | string | string | string | string | string | string;
1078
1084
  amount: string;
1079
1085
  memo?: string | undefined;
1086
+ priority?: ("Slow" | "Standard" | "Fast") | undefined;
1080
1087
  } | {
1081
1088
  kind: "Erc20";
1082
1089
  contract: string;
1083
1090
  to: string;
1084
1091
  amount: string;
1092
+ priority?: ("Slow" | "Standard" | "Fast") | undefined;
1085
1093
  } | {
1086
1094
  kind: "Erc721";
1087
1095
  contract: string;
1088
1096
  to: string;
1089
1097
  tokenId: string;
1098
+ priority?: ("Slow" | "Standard" | "Fast") | undefined;
1090
1099
  } | {
1091
1100
  kind: "Trc10";
1092
1101
  tokenId: string;
@@ -1125,16 +1134,19 @@ export type TransferAssetResponse = {
1125
1134
  to: string | string | string | string | string | string | string | string | string | string;
1126
1135
  amount: string;
1127
1136
  memo?: string | undefined;
1137
+ priority?: ("Slow" | "Standard" | "Fast") | undefined;
1128
1138
  } | {
1129
1139
  kind: "Erc20";
1130
1140
  contract: string;
1131
1141
  to: string;
1132
1142
  amount: string;
1143
+ priority?: ("Slow" | "Standard" | "Fast") | undefined;
1133
1144
  } | {
1134
1145
  kind: "Erc721";
1135
1146
  contract: string;
1136
1147
  to: string;
1137
1148
  tokenId: string;
1149
+ priority?: ("Slow" | "Standard" | "Fast") | undefined;
1138
1150
  } | {
1139
1151
  kind: "Trc10";
1140
1152
  tokenId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dfns/sdk",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "dependencies": {
5
5
  "buffer": "6.0.3",
6
6
  "cross-fetch": "3.1.6",
package/signer.d.ts CHANGED
@@ -5,7 +5,6 @@ export type UserVerificationRequirement = 'required' | 'preferred' | 'discourage
5
5
  export type AllowCredential = {
6
6
  type: 'public-key';
7
7
  id: string;
8
- transports: CredentialTransport[];
9
8
  };
10
9
  export type SupportedCredential = {
11
10
  kind: CredentialKind;
@@ -43,7 +42,7 @@ export type Fido2Assertion = {
43
42
  clientData: string;
44
43
  authenticatorData: string;
45
44
  signature: string;
46
- userHandle: string;
45
+ userHandle?: string;
47
46
  };
48
47
  };
49
48
  export type PasswordAssertion = {
@@ -0,0 +1 @@
1
+ export * from '../generated/auth';
package/types/auth.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("../generated/auth"), exports);
package/utils/fetch.js CHANGED
@@ -5,9 +5,10 @@ const cross_fetch_1 = require("cross-fetch");
5
5
  const dfnsError_1 = require("../dfnsError");
6
6
  const baseAuthApi_1 = require("../baseAuthApi");
7
7
  const nonce_1 = require("./nonce");
8
+ const DEFAULT_DFNS_BASE_URL = 'https://api.dfns.io';
8
9
  const fullUrl = (fetch) => {
9
10
  return async (resource, options) => {
10
- const { baseUrl } = options.apiOptions;
11
+ const baseUrl = options.apiOptions.baseUrl || DEFAULT_DFNS_BASE_URL;
11
12
  resource = new URL(resource, baseUrl);
12
13
  return fetch(resource, options);
13
14
  };
@@ -83,6 +84,13 @@ const userAction = (fetch) => {
83
84
  ...options.apiOptions,
84
85
  baseUrl: options.apiOptions.baseAuthUrl || options.apiOptions.baseUrl,
85
86
  };
87
+ if (!apiOptions.signer) {
88
+ throw new dfnsError_1.DfnsError(-1, 'A "signer" needs to be passed to Dfns client.', {
89
+ detail: `Most non-readonly endpoints require "User Action Signing" flow.` +
90
+ ` During that flow, the credential "signer" that you passed will handle signing` +
91
+ ` the user action challenge, using your credential.`,
92
+ });
93
+ }
86
94
  const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
87
95
  userActionPayload: options.body ?? '',
88
96
  userActionHttpMethod: options.method,