@dfns/sdk 0.1.0-alpha.1

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 (161) hide show
  1. package/baseAuthApi.d.ts +53 -0
  2. package/baseAuthApi.js +39 -0
  3. package/codegen/ApiKeys/ApiKeysClient.d.ts +10 -0
  4. package/codegen/ApiKeys/ApiKeysClient.js +56 -0
  5. package/codegen/ApiKeys/DelegatedApiKeysClient.d.ts +13 -0
  6. package/codegen/ApiKeys/DelegatedApiKeysClient.js +88 -0
  7. package/codegen/ApiKeys/index.d.ts +3 -0
  8. package/codegen/ApiKeys/index.js +19 -0
  9. package/codegen/ApiKeys/types.d.ts +16 -0
  10. package/codegen/ApiKeys/types.js +2 -0
  11. package/codegen/Assets/AssetsClient.d.ts +14 -0
  12. package/codegen/Assets/AssetsClient.js +105 -0
  13. package/codegen/Assets/DelegatedAssetsClient.d.ts +18 -0
  14. package/codegen/Assets/DelegatedAssetsClient.js +152 -0
  15. package/codegen/Assets/index.d.ts +3 -0
  16. package/codegen/Assets/index.js +19 -0
  17. package/codegen/Assets/types.d.ts +39 -0
  18. package/codegen/Assets/types.js +2 -0
  19. package/codegen/Auth/AuthClient.d.ts +62 -0
  20. package/codegen/Auth/AuthClient.js +667 -0
  21. package/codegen/Auth/DelegatedAuthClient.d.ts +98 -0
  22. package/codegen/Auth/DelegatedAuthClient.js +1223 -0
  23. package/codegen/Auth/index.d.ts +3 -0
  24. package/codegen/Auth/index.js +19 -0
  25. package/codegen/Auth/types.d.ts +243 -0
  26. package/codegen/Auth/types.js +2 -0
  27. package/codegen/Callbacks/CallbacksClient.d.ts +12 -0
  28. package/codegen/Callbacks/CallbacksClient.js +78 -0
  29. package/codegen/Callbacks/DelegatedCallbacksClient.d.ts +15 -0
  30. package/codegen/Callbacks/DelegatedCallbacksClient.js +110 -0
  31. package/codegen/Callbacks/index.d.ts +3 -0
  32. package/codegen/Callbacks/index.js +19 -0
  33. package/codegen/Callbacks/types.d.ts +23 -0
  34. package/codegen/Callbacks/types.js +2 -0
  35. package/codegen/Permissions/DelegatedPermissionsClient.d.ts +28 -0
  36. package/codegen/Permissions/DelegatedPermissionsClient.js +297 -0
  37. package/codegen/Permissions/PermissionsClient.d.ts +19 -0
  38. package/codegen/Permissions/PermissionsClient.js +169 -0
  39. package/codegen/Permissions/index.d.ts +3 -0
  40. package/codegen/Permissions/index.js +19 -0
  41. package/codegen/Permissions/types.d.ts +71 -0
  42. package/codegen/Permissions/types.js +2 -0
  43. package/codegen/PolicyExecution/DelegatedPolicyExecutionClient.d.ts +11 -0
  44. package/codegen/PolicyExecution/DelegatedPolicyExecutionClient.js +62 -0
  45. package/codegen/PolicyExecution/PolicyExecutionClient.d.ts +9 -0
  46. package/codegen/PolicyExecution/PolicyExecutionClient.js +46 -0
  47. package/codegen/PolicyExecution/index.d.ts +3 -0
  48. package/codegen/PolicyExecution/index.js +19 -0
  49. package/codegen/PolicyExecution/types.d.ts +16 -0
  50. package/codegen/PolicyExecution/types.js +2 -0
  51. package/codegen/PolicyManagement/DelegatedPolicyManagementClient.d.ts +31 -0
  52. package/codegen/PolicyManagement/DelegatedPolicyManagementClient.js +324 -0
  53. package/codegen/PolicyManagement/PolicyManagementClient.d.ts +21 -0
  54. package/codegen/PolicyManagement/PolicyManagementClient.js +185 -0
  55. package/codegen/PolicyManagement/index.d.ts +3 -0
  56. package/codegen/PolicyManagement/index.js +19 -0
  57. package/codegen/PolicyManagement/types.d.ts +91 -0
  58. package/codegen/PolicyManagement/types.js +2 -0
  59. package/codegen/PublicKeys/DelegatedPublicKeysClient.d.ts +21 -0
  60. package/codegen/PublicKeys/DelegatedPublicKeysClient.js +191 -0
  61. package/codegen/PublicKeys/PublicKeysClient.d.ts +16 -0
  62. package/codegen/PublicKeys/PublicKeysClient.js +130 -0
  63. package/codegen/PublicKeys/index.d.ts +3 -0
  64. package/codegen/PublicKeys/index.js +19 -0
  65. package/codegen/PublicKeys/types.d.ts +51 -0
  66. package/codegen/PublicKeys/types.js +2 -0
  67. package/codegen/Wallets/DelegatedWalletsClient.d.ts +26 -0
  68. package/codegen/Wallets/DelegatedWalletsClient.js +249 -0
  69. package/codegen/Wallets/WalletsClient.d.ts +21 -0
  70. package/codegen/Wallets/WalletsClient.js +188 -0
  71. package/codegen/Wallets/index.d.ts +3 -0
  72. package/codegen/Wallets/index.js +19 -0
  73. package/codegen/Wallets/types.d.ts +87 -0
  74. package/codegen/Wallets/types.js +2 -0
  75. package/codegen/datamodel/ApiKeys/errors.d.ts +6 -0
  76. package/codegen/datamodel/ApiKeys/errors.js +15 -0
  77. package/codegen/datamodel/ApiKeys/index.d.ts +3 -0
  78. package/codegen/datamodel/ApiKeys/index.js +19 -0
  79. package/codegen/datamodel/ApiKeys/responses.d.ts +25 -0
  80. package/codegen/datamodel/ApiKeys/responses.js +2 -0
  81. package/codegen/datamodel/ApiKeys/types.d.ts +32 -0
  82. package/codegen/datamodel/ApiKeys/types.js +11 -0
  83. package/codegen/datamodel/Assets/errors.d.ts +11 -0
  84. package/codegen/datamodel/Assets/errors.js +17 -0
  85. package/codegen/datamodel/Assets/index.d.ts +3 -0
  86. package/codegen/datamodel/Assets/index.js +19 -0
  87. package/codegen/datamodel/Assets/responses.d.ts +45 -0
  88. package/codegen/datamodel/Assets/responses.js +2 -0
  89. package/codegen/datamodel/Assets/types.d.ts +225 -0
  90. package/codegen/datamodel/Assets/types.js +75 -0
  91. package/codegen/datamodel/Auth/index.d.ts +2 -0
  92. package/codegen/datamodel/Auth/index.js +18 -0
  93. package/codegen/datamodel/Auth/responses.d.ts +348 -0
  94. package/codegen/datamodel/Auth/responses.js +2 -0
  95. package/codegen/datamodel/Auth/types.d.ts +610 -0
  96. package/codegen/datamodel/Auth/types.js +127 -0
  97. package/codegen/datamodel/Callbacks/index.d.ts +2 -0
  98. package/codegen/datamodel/Callbacks/index.js +18 -0
  99. package/codegen/datamodel/Callbacks/responses.d.ts +36 -0
  100. package/codegen/datamodel/Callbacks/responses.js +2 -0
  101. package/codegen/datamodel/Callbacks/types.d.ts +43 -0
  102. package/codegen/datamodel/Callbacks/types.js +39 -0
  103. package/codegen/datamodel/Foundations/errors.d.ts +121 -0
  104. package/codegen/datamodel/Foundations/errors.js +169 -0
  105. package/codegen/datamodel/Foundations/index.d.ts +2 -0
  106. package/codegen/datamodel/Foundations/index.js +18 -0
  107. package/codegen/datamodel/Foundations/types.d.ts +9754 -0
  108. package/codegen/datamodel/Foundations/types.js +57741 -0
  109. package/codegen/datamodel/Permissions/index.d.ts +2 -0
  110. package/codegen/datamodel/Permissions/index.js +18 -0
  111. package/codegen/datamodel/Permissions/responses.d.ts +75 -0
  112. package/codegen/datamodel/Permissions/responses.js +2 -0
  113. package/codegen/datamodel/Permissions/types.d.ts +106 -0
  114. package/codegen/datamodel/Permissions/types.js +65 -0
  115. package/codegen/datamodel/PolicyExecution/errors.d.ts +11 -0
  116. package/codegen/datamodel/PolicyExecution/errors.js +17 -0
  117. package/codegen/datamodel/PolicyExecution/index.d.ts +3 -0
  118. package/codegen/datamodel/PolicyExecution/index.js +19 -0
  119. package/codegen/datamodel/PolicyExecution/responses.d.ts +17 -0
  120. package/codegen/datamodel/PolicyExecution/responses.js +2 -0
  121. package/codegen/datamodel/PolicyExecution/types.d.ts +45 -0
  122. package/codegen/datamodel/PolicyExecution/types.js +15 -0
  123. package/codegen/datamodel/PolicyManagement/index.d.ts +2 -0
  124. package/codegen/datamodel/PolicyManagement/index.js +18 -0
  125. package/codegen/datamodel/PolicyManagement/responses.d.ts +83 -0
  126. package/codegen/datamodel/PolicyManagement/responses.js +2 -0
  127. package/codegen/datamodel/PolicyManagement/types.d.ts +252 -0
  128. package/codegen/datamodel/PolicyManagement/types.js +81 -0
  129. package/codegen/datamodel/PublicKeys/index.d.ts +2 -0
  130. package/codegen/datamodel/PublicKeys/index.js +18 -0
  131. package/codegen/datamodel/PublicKeys/responses.d.ts +56 -0
  132. package/codegen/datamodel/PublicKeys/responses.js +2 -0
  133. package/codegen/datamodel/PublicKeys/types.d.ts +222 -0
  134. package/codegen/datamodel/PublicKeys/types.js +59 -0
  135. package/codegen/datamodel/Wallets/index.d.ts +2 -0
  136. package/codegen/datamodel/Wallets/index.js +18 -0
  137. package/codegen/datamodel/Wallets/responses.d.ts +77 -0
  138. package/codegen/datamodel/Wallets/responses.js +2 -0
  139. package/codegen/datamodel/Wallets/types.d.ts +261 -0
  140. package/codegen/datamodel/Wallets/types.js +89 -0
  141. package/dfnsApiClient.d.ts +27 -0
  142. package/dfnsApiClient.js +45 -0
  143. package/dfnsAuthenticator.d.ts +11 -0
  144. package/dfnsAuthenticator.js +18 -0
  145. package/dfnsDelegatedApiClient.d.ts +24 -0
  146. package/dfnsDelegatedApiClient.js +41 -0
  147. package/dfnsError.d.ts +5 -0
  148. package/dfnsError.js +11 -0
  149. package/index.d.ts +3 -0
  150. package/index.js +19 -0
  151. package/package.json +11 -0
  152. package/signer.d.ts +47 -0
  153. package/signer.js +2 -0
  154. package/utils/base64.d.ts +3 -0
  155. package/utils/base64.js +20 -0
  156. package/utils/fetch.d.ts +12 -0
  157. package/utils/fetch.js +89 -0
  158. package/utils/nonce.d.ts +1 -0
  159. package/utils/nonce.js +12 -0
  160. package/utils/url.d.ts +4 -0
  161. package/utils/url.js +15 -0
@@ -0,0 +1,252 @@
1
+ import { Amount, AssetSymbol, EntityId, IntegerPositiveStrict, IsoDatetime, Tag, Username } from '../Foundations';
2
+ export type Policy = {
3
+ id: EntityId;
4
+ version: string;
5
+ activityKind: PolicyActivityKind;
6
+ tags?: Tag[];
7
+ dateCreated: IsoDatetime;
8
+ orgId: EntityId;
9
+ description?: string;
10
+ author: Username;
11
+ name?: string;
12
+ status: PolicyStatus;
13
+ controlIds: EntityId[];
14
+ ruleIds: EntityId[];
15
+ filter?: PolicyObjectFilter;
16
+ };
17
+ export type NotifyAndAuditPcConf = {
18
+ kind: PolicyControlKind.NotifyAndAudit;
19
+ usernames?: string[];
20
+ groups?: string[];
21
+ };
22
+ export type RequestApprovalPcConf = {
23
+ kind: PolicyControlKind.RequestApproval;
24
+ approverGroups?: string[];
25
+ approverUsernames?: string[];
26
+ numApprovals: number;
27
+ timeoutInMinutes?: IntegerPositiveStrict;
28
+ };
29
+ export type PolicyRule = {
30
+ id: EntityId;
31
+ version: string;
32
+ kind: PolicyRuleKind;
33
+ tags?: Tag[];
34
+ dateCreated: IsoDatetime;
35
+ orgId: EntityId;
36
+ author: Username;
37
+ description?: string;
38
+ name?: string;
39
+ configuration: PolicyRuleConfiguration;
40
+ status: PolicyRuleStatus;
41
+ };
42
+ export type PolicyControl = {
43
+ id: EntityId;
44
+ version: string;
45
+ kind: PolicyControlKind;
46
+ tags?: Tag[];
47
+ dateCreated: IsoDatetime;
48
+ orgId: EntityId;
49
+ author: Username;
50
+ description?: string;
51
+ name?: string;
52
+ /**
53
+ * Indicates whether control should merge with same one (compared by values).
54
+ * This property should not be set to true, unless outcomes are understood. For example: Let's say we have 3 policies:
55
+ *
56
+ * 1. policy to require approval for payments over €5000
57
+ * 1. policy to require approval for payments done out of office hours
58
+ * 1. policy to require approval for payments done out of Geofence.
59
+ *
60
+ * In this case policies will require 3 approvals combined, which might not be an intent, and only one approval is required.
61
+ */
62
+ shouldMergeWithSameControl: boolean;
63
+ configuration: PolicyControlConfiguration;
64
+ status: PolicyControlStatus;
65
+ };
66
+ export type CreateAmountLimitPrConf = {
67
+ kind: PolicyRuleKind.PaymentAmountLimit;
68
+ limit: Amount;
69
+ assetSymbol: AssetSymbol;
70
+ shouldIgnoreAssetsWithoutMarketValue: boolean;
71
+ };
72
+ export type UpdateAmountLimitPrConf = {
73
+ limit?: Amount;
74
+ assetSymbol?: AssetSymbol;
75
+ shouldIgnoreAssetsWithoutMarketValue?: boolean;
76
+ };
77
+ export type CreateOutgoingVelocityPrConf = {
78
+ kind: PolicyRuleKind.PaymentAmountOutgoingVelocity;
79
+ velocity: Amount;
80
+ assetSymbol: AssetSymbol;
81
+ intervalInMinutes: number;
82
+ shouldIgnoreAssetsWithoutMarketValue: boolean;
83
+ };
84
+ export type CreateSiphoningPrConf = {
85
+ kind: PolicyRuleKind.Siphoning;
86
+ maxTxCount: number;
87
+ intervalInMinutes: number;
88
+ };
89
+ export type SiphoningPrConf = {
90
+ maxTxCount: number;
91
+ intervalInMinutes: number;
92
+ };
93
+ export type UpdateSiphoningPrConf = {
94
+ maxTxCount?: number;
95
+ intervalInMinutes?: number;
96
+ };
97
+ export type AmountLimitPrConf = {
98
+ limit: Amount;
99
+ assetSymbol: AssetSymbol;
100
+ shouldIgnoreAssetsWithoutMarketValue: boolean;
101
+ };
102
+ export type UpdateOutgoingVelocityPrConf = {
103
+ velocity?: Amount;
104
+ assetSymbol?: AssetSymbol;
105
+ intervalInMinutes?: number;
106
+ shouldIgnoreAssetsWithoutMarketValue?: boolean;
107
+ };
108
+ export type OutgoingVelocityPrConf = {
109
+ velocity: Amount;
110
+ assetSymbol: AssetSymbol;
111
+ intervalInMinutes: number;
112
+ shouldIgnoreAssetsWithoutMarketValue: boolean;
113
+ };
114
+ export type CreateRequestApprovalPcConf = {
115
+ kind: PolicyControlKind.RequestApproval;
116
+ approverUsernames?: string[];
117
+ approverGroups?: string[];
118
+ timeoutInMinutes?: IntegerPositiveStrict;
119
+ numApprovals: number;
120
+ };
121
+ export type UpdateRequestApprovalPcConf = {
122
+ approverUsernames?: string[];
123
+ approverGroups?: string[];
124
+ timeoutInMinutes?: number;
125
+ numApprovals?: number;
126
+ };
127
+ export type CreateNotifyAndAuditPcConf = {
128
+ kind: PolicyControlKind.NotifyAndAudit;
129
+ usernames?: string[];
130
+ groups?: string[];
131
+ };
132
+ export type UpdateNotifyAndAuditPcConf = {
133
+ groups?: string[];
134
+ usernames?: string[];
135
+ };
136
+ export type PolicyManagementPreferences = {
137
+ /**
138
+ * Sets default `AssetSymbol` for the policy rules that use it, such as Limit, Velocity, Siphoning, and others.
139
+ */
140
+ policyRuleAssetSymbol?: boolean;
141
+ /**
142
+ * Sets default interval in minutes for policy rules that use intervals, such as Velocity and Siphoning.
143
+ *
144
+ * This setting does not update existing rules. This will only impact rules that are created after this setting is set.
145
+ */
146
+ policyRuleVelocityIntervalInMinutes?: number;
147
+ };
148
+ export type Create = {};
149
+ export type EmptyConfiguration = {};
150
+ export type CreateAlwaysActivatedPrConf = {
151
+ kind: PolicyRuleKind.AlwaysActivated;
152
+ };
153
+ export type UpdateAlwaysActivatedPrConf = {};
154
+ export type AssetAccountFilter = {
155
+ kind: PolicyObjectFilterKind.AssetAccount;
156
+ assetAccountIds?: EntityId[];
157
+ tags?: Tag[];
158
+ assetSymbols?: string[];
159
+ };
160
+ export type PublicKeyFilter = {
161
+ kind: PolicyObjectFilterKind.PublicKey;
162
+ publicKeyIds?: EntityId[];
163
+ tags?: string[];
164
+ };
165
+ export type CreatePolicyInput = {
166
+ activityKind: PolicyActivityKind;
167
+ description: string;
168
+ name?: string;
169
+ controlIds: EntityId[];
170
+ ruleIds: EntityId[];
171
+ status: PolicyStatus;
172
+ filter?: PolicyObjectFilter;
173
+ isImmutable?: boolean;
174
+ };
175
+ export type UpdatePolicyInput = {
176
+ description?: string;
177
+ controlIds?: EntityId[];
178
+ ruleIds?: EntityId[];
179
+ status?: PolicyStatus;
180
+ filter?: PolicyObjectFilter;
181
+ };
182
+ export type CreatePolicyControlInput = {
183
+ description?: string;
184
+ name?: string;
185
+ configuration: CreatePolicyControlConfiguration;
186
+ isImmutable?: boolean;
187
+ };
188
+ export type UpdatePolicyControlInput = {
189
+ description?: string;
190
+ name?: string;
191
+ configuration?: UpdatePolicyControlConfiguration;
192
+ };
193
+ export type CreatePolicyRuleInput = {
194
+ description?: string;
195
+ name?: string;
196
+ configuration: CreatePolicyRuleConfiguration;
197
+ isImmutable?: boolean;
198
+ };
199
+ export type UpdatePolicyRuleInput = {
200
+ description?: string;
201
+ name?: string;
202
+ configuration: UpdatePolicyRuleConfiguration;
203
+ };
204
+ export type CreatePolicyRuleConfiguration = CreateAmountLimitPrConf | CreateOutgoingVelocityPrConf | CreateSiphoningPrConf | CreateAlwaysActivatedPrConf;
205
+ export type UpdatePolicyRuleConfiguration = UpdateAmountLimitPrConf | UpdateSiphoningPrConf | UpdateOutgoingVelocityPrConf | UpdateAlwaysActivatedPrConf;
206
+ export type UpdatePolicyControlConfiguration = UpdateRequestApprovalPcConf | UpdateNotifyAndAuditPcConf;
207
+ export type CreatePolicyControlConfiguration = CreateRequestApprovalPcConf | CreateNotifyAndAuditPcConf;
208
+ export type PolicyRuleConfiguration = SiphoningPrConf | AmountLimitPrConf | OutgoingVelocityPrConf | OutgoingVelocityPrConf | EmptyConfiguration;
209
+ export type PolicyControlConfiguration = NotifyAndAuditPcConf | RequestApprovalPcConf;
210
+ export type PolicyObjectFilter = AssetAccountFilter | PublicKeyFilter;
211
+ export declare enum PolicyActivityKind {
212
+ PaymentInitiation = "PaymentInitiation",
213
+ AddingEmployee = "AddingEmployee",
214
+ UpdatingEmployeeDetails = "UpdatingEmployeeDetails",
215
+ RemovingEmployee = "RemovingEmployee",
216
+ CreatingSignature = "CreatingSignature",
217
+ TransactionInitiation = "TransactionInitiation"
218
+ }
219
+ export declare enum PolicyStatus {
220
+ Enabled = "Enabled",
221
+ Disabled = "Disabled",
222
+ Archived = "Archived"
223
+ }
224
+ /**
225
+ * enumm:
226
+ * * NotifyAndAudit
227
+ * * RequestApproval
228
+ */
229
+ export declare enum PolicyControlKind {
230
+ NotifyAndAudit = "NotifyAndAudit",
231
+ RequestApproval = "RequestApproval"
232
+ }
233
+ export declare enum PolicyRuleKind {
234
+ PaymentAmountLimit = "PaymentAmountLimit",
235
+ EmployeeAdded = "EmployeeAdded",
236
+ EmployeeDetailsUpdated = "EmployeeDetailsUpdated",
237
+ Siphoning = "Siphoning",
238
+ AlwaysActivated = "AlwaysActivated",
239
+ PaymentAmountOutgoingVelocity = "PaymentAmountOutgoingVelocity"
240
+ }
241
+ export declare enum PolicyControlStatus {
242
+ Enabled = "Enabled",
243
+ Archived = "Archived"
244
+ }
245
+ export declare enum PolicyRuleStatus {
246
+ Enabled = "Enabled",
247
+ Archived = "Archived"
248
+ }
249
+ export declare enum PolicyObjectFilterKind {
250
+ AssetAccount = "AssetAccount",
251
+ PublicKey = "PublicKey"
252
+ }
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PolicyObjectFilterKind = exports.PolicyRuleStatus = exports.PolicyControlStatus = exports.PolicyRuleKind = exports.PolicyControlKind = exports.PolicyStatus = exports.PolicyActivityKind = void 0;
4
+ // FIXME: Missing documentation for PolicyActivityKind
5
+ var PolicyActivityKind;
6
+ (function (PolicyActivityKind) {
7
+ // FIXME: Missing documentation for PaymentInitiation
8
+ PolicyActivityKind["PaymentInitiation"] = "PaymentInitiation";
9
+ // FIXME: Missing documentation for AddingEmployee
10
+ PolicyActivityKind["AddingEmployee"] = "AddingEmployee";
11
+ // FIXME: Missing documentation for UpdatingEmployeeDetails
12
+ PolicyActivityKind["UpdatingEmployeeDetails"] = "UpdatingEmployeeDetails";
13
+ // FIXME: Missing documentation for RemovingEmployee
14
+ PolicyActivityKind["RemovingEmployee"] = "RemovingEmployee";
15
+ // FIXME: Missing documentation for CreatingSignature
16
+ PolicyActivityKind["CreatingSignature"] = "CreatingSignature";
17
+ // FIXME: Missing documentation for TransactionInitiation
18
+ PolicyActivityKind["TransactionInitiation"] = "TransactionInitiation";
19
+ })(PolicyActivityKind = exports.PolicyActivityKind || (exports.PolicyActivityKind = {}));
20
+ // FIXME: Missing documentation for PolicyStatus
21
+ var PolicyStatus;
22
+ (function (PolicyStatus) {
23
+ // FIXME: Missing documentation for Enabled
24
+ PolicyStatus["Enabled"] = "Enabled";
25
+ // FIXME: Missing documentation for Disabled
26
+ PolicyStatus["Disabled"] = "Disabled";
27
+ // FIXME: Missing documentation for Archived
28
+ PolicyStatus["Archived"] = "Archived";
29
+ })(PolicyStatus = exports.PolicyStatus || (exports.PolicyStatus = {}));
30
+ /**
31
+ * enumm:
32
+ * * NotifyAndAudit
33
+ * * RequestApproval
34
+ */
35
+ var PolicyControlKind;
36
+ (function (PolicyControlKind) {
37
+ // FIXME: Missing documentation for NotifyAndAudit
38
+ PolicyControlKind["NotifyAndAudit"] = "NotifyAndAudit";
39
+ // FIXME: Missing documentation for RequestApproval
40
+ PolicyControlKind["RequestApproval"] = "RequestApproval";
41
+ })(PolicyControlKind = exports.PolicyControlKind || (exports.PolicyControlKind = {}));
42
+ // FIXME: Missing documentation for PolicyRuleKind
43
+ var PolicyRuleKind;
44
+ (function (PolicyRuleKind) {
45
+ // FIXME: Missing documentation for PaymentAmountLimit
46
+ PolicyRuleKind["PaymentAmountLimit"] = "PaymentAmountLimit";
47
+ // FIXME: Missing documentation for EmployeeAdded
48
+ PolicyRuleKind["EmployeeAdded"] = "EmployeeAdded";
49
+ // FIXME: Missing documentation for EmployeeDetailsUpdated
50
+ PolicyRuleKind["EmployeeDetailsUpdated"] = "EmployeeDetailsUpdated";
51
+ // FIXME: Missing documentation for Siphoning
52
+ PolicyRuleKind["Siphoning"] = "Siphoning";
53
+ // FIXME: Missing documentation for AlwaysActivated
54
+ PolicyRuleKind["AlwaysActivated"] = "AlwaysActivated";
55
+ // FIXME: Missing documentation for PaymentAmountOutgoingVelocity
56
+ PolicyRuleKind["PaymentAmountOutgoingVelocity"] = "PaymentAmountOutgoingVelocity";
57
+ })(PolicyRuleKind = exports.PolicyRuleKind || (exports.PolicyRuleKind = {}));
58
+ // FIXME: Missing documentation for PolicyControlStatus
59
+ var PolicyControlStatus;
60
+ (function (PolicyControlStatus) {
61
+ // FIXME: Missing documentation for Enabled
62
+ PolicyControlStatus["Enabled"] = "Enabled";
63
+ // FIXME: Missing documentation for Archived
64
+ PolicyControlStatus["Archived"] = "Archived";
65
+ })(PolicyControlStatus = exports.PolicyControlStatus || (exports.PolicyControlStatus = {}));
66
+ // FIXME: Missing documentation for PolicyRuleStatus
67
+ var PolicyRuleStatus;
68
+ (function (PolicyRuleStatus) {
69
+ // FIXME: Missing documentation for Enabled
70
+ PolicyRuleStatus["Enabled"] = "Enabled";
71
+ // FIXME: Missing documentation for Archived
72
+ PolicyRuleStatus["Archived"] = "Archived";
73
+ })(PolicyRuleStatus = exports.PolicyRuleStatus || (exports.PolicyRuleStatus = {}));
74
+ // FIXME: Missing documentation for PolicyObjectFilterKind
75
+ var PolicyObjectFilterKind;
76
+ (function (PolicyObjectFilterKind) {
77
+ // FIXME: Missing documentation for AssetAccount
78
+ PolicyObjectFilterKind["AssetAccount"] = "AssetAccount";
79
+ // FIXME: Missing documentation for PublicKey
80
+ PolicyObjectFilterKind["PublicKey"] = "PublicKey";
81
+ })(PolicyObjectFilterKind = exports.PolicyObjectFilterKind || (exports.PolicyObjectFilterKind = {}));
@@ -0,0 +1,2 @@
1
+ export * from './responses';
2
+ export * from './types';
@@ -0,0 +1,18 @@
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("./responses"), exports);
18
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,56 @@
1
+ import { BadRequestError, EntityNotFoundError, ForbiddenError, PaymentRequiredError, UnauthorizedError } from '../Foundations';
2
+ import { BroadcastedTransaction, GetPublicKeyAddressResponse, GetPublicKeyResponse, PublicKeyRecord, Signature, SignatureResponse, StartWalletConnectSessionOutput } from './types';
3
+ export type GetPublicKeyByIdSuccess = GetPublicKeyResponse;
4
+ export type GetPublicKeyByIdError = {
5
+ error: EntityNotFoundError | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
6
+ };
7
+ export type GetPublicKeyByIdResponse = GetPublicKeyByIdSuccess | GetPublicKeyByIdError;
8
+ export type CreatePublicKeySuccess = PublicKeyRecord;
9
+ export type CreatePublicKeyError = {
10
+ error: UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
11
+ };
12
+ export type CreatePublicKeyResponse = CreatePublicKeySuccess | CreatePublicKeyError;
13
+ export type ListPublicKeysSuccess = {
14
+ items: GetPublicKeyResponse[];
15
+ };
16
+ export type ListPublicKeysError = {
17
+ error: EntityNotFoundError | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
18
+ };
19
+ export type ListPublicKeysResponse = ListPublicKeysSuccess | ListPublicKeysError;
20
+ export type GetAddressForNetworkSuccess = GetPublicKeyAddressResponse;
21
+ export type GetAddressForNetworkError = {
22
+ error: EntityNotFoundError | BadRequestError | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
23
+ };
24
+ export type GetAddressForNetworkResponse = GetAddressForNetworkSuccess | GetAddressForNetworkError;
25
+ export type GetSignatureByIdSuccess = Signature;
26
+ export type GetSignatureByIdError = {
27
+ error: EntityNotFoundError | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
28
+ };
29
+ export type GetSignatureByIdResponse = GetSignatureByIdSuccess | GetSignatureByIdError;
30
+ export type CreateSignatureSuccess = SignatureResponse;
31
+ export type CreateSignatureError = {
32
+ error: EntityNotFoundError | PaymentRequiredError | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
33
+ };
34
+ export type CreateSignatureResponse = CreateSignatureSuccess | CreateSignatureError;
35
+ export type StartWalletConnectSessionSuccess = StartWalletConnectSessionOutput;
36
+ export type StartWalletConnectSessionError = {
37
+ error: UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
38
+ };
39
+ export type StartWalletConnectSessionResponse = StartWalletConnectSessionSuccess | StartWalletConnectSessionError;
40
+ export type ListTransactionsSuccess = {
41
+ items: BroadcastedTransaction[];
42
+ };
43
+ export type ListTransactionsError = {
44
+ error: EntityNotFoundError | BadRequestError | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
45
+ };
46
+ export type ListTransactionsResponse = ListTransactionsSuccess | ListTransactionsError;
47
+ export type CreateTransactionSuccess = BroadcastedTransaction;
48
+ export type CreateTransactionError = {
49
+ error: EntityNotFoundError | BadRequestError | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
50
+ };
51
+ export type CreateTransactionResponse = CreateTransactionSuccess | CreateTransactionError;
52
+ export type GetTransactionByIdSuccess = BroadcastedTransaction;
53
+ export type GetTransactionByIdError = {
54
+ error: EntityNotFoundError | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
55
+ };
56
+ export type GetTransactionByIdResponse = GetTransactionByIdSuccess | GetTransactionByIdError;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,222 @@
1
+ import { Amount, BlockchainAddress, BlockchainNetwork, DocumentSnapshot, EntityId, Initiator, IntegerPositiveStrict, IsoDatetime, PublicKey, Tag } from '../Foundations';
2
+ export type SignatureResponse = {
3
+ r: string;
4
+ s: string;
5
+ recid: number;
6
+ };
7
+ export type PublicKeyRecord = {
8
+ id: EntityId;
9
+ externalId?: string;
10
+ orgId: EntityId;
11
+ publicKey: PublicKey;
12
+ signerIds: string[];
13
+ groupThreshold: number;
14
+ groupSize: number;
15
+ tags?: Tag[];
16
+ isEddsa: boolean;
17
+ };
18
+ export type GetPublicKeyAddressResponse = {
19
+ publicKeyId: string;
20
+ network: string;
21
+ address: BlockchainAddress;
22
+ };
23
+ export type Signature = {
24
+ id: EntityId;
25
+ orgId: EntityId;
26
+ publicKeyId: string;
27
+ hash: string;
28
+ r: string;
29
+ s: string;
30
+ recid: number;
31
+ status: SignatureStatus;
32
+ initiator: Initiator;
33
+ dateCreated: IsoDatetime;
34
+ };
35
+ export type CosmosDenomAmount = {
36
+ denom: string;
37
+ amount: string;
38
+ };
39
+ export type CosmosTimeoutHeight = {
40
+ revisionNumber: string;
41
+ revisionHeight: string;
42
+ };
43
+ export type EvmGenericTx = {
44
+ templateKind: TransactionTemplateKind.EvmGenericTx;
45
+ to: string;
46
+ gasLimit: Amount;
47
+ gasPrice: Amount;
48
+ nonce?: string;
49
+ value?: string;
50
+ data?: string;
51
+ publicKeyId?: string;
52
+ network: BlockchainNetwork;
53
+ /**
54
+ * the maximum amount of gas to be included as a tip to the miner
55
+ */
56
+ maxPriorityFeePerGas?: Amount;
57
+ /**
58
+ * the maximum amount of gas willing to be paid for the transaction (inclusive of baseFeePerGas and maxPriorityFeePerGas)
59
+ */
60
+ maxFeePerGas?: Amount;
61
+ typedData?: Eip712TypedData;
62
+ };
63
+ export type CosmosIbcTransferTx = {
64
+ templateKind: TransactionTemplateKind.CosmosIbcTransfer;
65
+ sourcePort: string;
66
+ sourceChannel: string;
67
+ token: CosmosDenomAmount;
68
+ sender: string;
69
+ receiver: string;
70
+ timeoutHeight: CosmosTimeoutHeight;
71
+ timeoutTimestamp: string;
72
+ publicKeyId?: string;
73
+ network: BlockchainNetwork;
74
+ };
75
+ export type Eip712TypedData = {
76
+ types: Record<string, unknown>;
77
+ values: Record<string, unknown>;
78
+ domain?: Eip712TypedDataDomain;
79
+ };
80
+ export type Eip712TypedDataDomain = {
81
+ name?: string;
82
+ chainId?: string;
83
+ version?: string;
84
+ verifyingContract?: string;
85
+ salt?: string;
86
+ };
87
+ export type SolanaTxInstruction = {
88
+ data: string;
89
+ programId: string;
90
+ keys: SolanaTxAccountMeta[];
91
+ };
92
+ export type SolanaTx = {
93
+ feePayer?: string;
94
+ blockhash?: string;
95
+ lastValidBlockHeight?: IntegerPositiveStrict;
96
+ minNonceContextSlot?: IntegerPositiveStrict;
97
+ instructions: SolanaTxInstruction[];
98
+ signatures?: SolanaTxSignature[];
99
+ templateKind: TransactionTemplateKind.SolanaTx;
100
+ };
101
+ export type SolanaTxSignature = {
102
+ signature: string;
103
+ publicKey: string;
104
+ };
105
+ export type SolanaTxAccountMeta = {
106
+ pubkey: string;
107
+ isSigner: boolean;
108
+ isWritable: boolean;
109
+ };
110
+ export type TronTx = {
111
+ visible?: boolean;
112
+ txID?: string;
113
+ contract_address?: string;
114
+ raw_data_hex?: string;
115
+ raw_data: Record<string, unknown>;
116
+ templateKind: TransactionTemplateKind.TronTx;
117
+ };
118
+ export type TezosTx = {
119
+ protocol?: string;
120
+ chain?: string;
121
+ block?: string;
122
+ payload: TezosTxPayload;
123
+ templateKind: TransactionTemplateKind.TezosTx;
124
+ };
125
+ export type TezosTxPayload = {
126
+ branch?: string;
127
+ contents: Record<string, unknown>[];
128
+ };
129
+ export type BroadcastedTransaction = {
130
+ id: EntityId;
131
+ transaction: TransactionPayload;
132
+ snapshot: DocumentSnapshot;
133
+ network: BlockchainNetwork;
134
+ dateCreated: IsoDatetime;
135
+ dateUpdated: IsoDatetime;
136
+ status: TransactionStatus;
137
+ txHash?: string;
138
+ networkResponse?: string;
139
+ dateBroadcasted?: IsoDatetime;
140
+ dateConfirmed?: IsoDatetime;
141
+ initiator: Initiator;
142
+ publicKeyId: string;
143
+ orgId: EntityId;
144
+ fee?: Amount;
145
+ };
146
+ export type GetPublicKeyResponse = {
147
+ id: EntityId;
148
+ externalId?: string;
149
+ publicKey: PublicKey;
150
+ groupThreshold: number;
151
+ groupSize: number;
152
+ tags?: Tag[];
153
+ isEddsa: boolean;
154
+ };
155
+ export type StartWalletConnectSessionOutput = {
156
+ session: WalletConnectSession;
157
+ };
158
+ export type WalletConnectClientMeta = {
159
+ name: string;
160
+ description: string;
161
+ icons: string[];
162
+ };
163
+ export type WalletConnectSession = {
164
+ accounts: string[];
165
+ chainId: IntegerPositiveStrict;
166
+ bridge: string;
167
+ key: string;
168
+ clientId: string;
169
+ clientMeta?: WalletConnectClientMeta;
170
+ peerId: string;
171
+ peerMeta?: WalletConnectClientMeta;
172
+ handshakeId: IntegerPositiveStrict;
173
+ handshakeTopic: string;
174
+ };
175
+ export type CreateSignatureInput = {
176
+ hash: string;
177
+ };
178
+ export type CreatePublicKeyInput = {
179
+ externalId?: string;
180
+ assetAccountId?: EntityId;
181
+ groupSize?: number;
182
+ groupThreshold?: number;
183
+ isEddsa: boolean;
184
+ tags?: Tag[];
185
+ };
186
+ export type CreateWalletTxInput = {
187
+ to: BlockchainAddress;
188
+ amount: Amount;
189
+ asset: string;
190
+ };
191
+ export type StartWalletConnectSessionInput = {
192
+ wcUri: string;
193
+ };
194
+ export type TransactionPayload = EvmGenericTx | CosmosIbcTransferTx | SolanaTx | TronTx | TezosTx;
195
+ export declare enum PublicKeyStatus {
196
+ Active = "Active",
197
+ Disabled = "Disabled",
198
+ Compromised = "Compromised"
199
+ }
200
+ export declare enum SignatureStatus {
201
+ Pending = "Pending",
202
+ Executed = "Executed",
203
+ Rejected = "Rejected",
204
+ Failed = "Failed"
205
+ }
206
+ export declare enum TransactionTemplateKind {
207
+ EvmGenericTx = "EvmGenericTx",
208
+ CosmosIbcTransfer = "CosmosIbcTransfer",
209
+ SolanaTx = "SolanaTx",
210
+ TronTx = "TronTx",
211
+ TezosTx = "TezosTx"
212
+ }
213
+ export declare enum TransactionStatus {
214
+ Initiated = "Initiated",
215
+ PolicyAccepted = "PolicyAccepted",
216
+ PolicyRejected = "PolicyRejected",
217
+ BroadcastPending = "BroadcastPending",
218
+ BroadcastRejected = "BroadcastRejected",
219
+ Broadcasted = "Broadcasted",
220
+ Confirmed = "Confirmed",
221
+ Failed = "Failed"
222
+ }