@dfns/sdk 0.0.0-prealpha.9

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 +96 -0
  2. package/baseAuthApi.js +73 -0
  3. package/codegen/Assets/AssetsClient.d.ts +13 -0
  4. package/codegen/Assets/AssetsClient.js +94 -0
  5. package/codegen/Assets/DelegatedAssetsClient.d.ts +16 -0
  6. package/codegen/Assets/DelegatedAssetsClient.js +125 -0
  7. package/codegen/Assets/index.d.ts +3 -0
  8. package/codegen/Assets/index.js +19 -0
  9. package/codegen/Assets/types.d.ts +37 -0
  10. package/codegen/Assets/types.js +2 -0
  11. package/codegen/Auth/AuthClient.d.ts +48 -0
  12. package/codegen/Auth/AuthClient.js +494 -0
  13. package/codegen/Auth/DelegatedAuthClient.d.ts +74 -0
  14. package/codegen/Auth/DelegatedAuthClient.js +882 -0
  15. package/codegen/Auth/index.d.ts +3 -0
  16. package/codegen/Auth/index.js +19 -0
  17. package/codegen/Auth/types.d.ts +169 -0
  18. package/codegen/Auth/types.js +2 -0
  19. package/codegen/Blockchains/BlockchainsClient.d.ts +7 -0
  20. package/codegen/Blockchains/BlockchainsClient.js +23 -0
  21. package/codegen/Blockchains/DelegatedBlockchainsClient.d.ts +7 -0
  22. package/codegen/Blockchains/DelegatedBlockchainsClient.js +23 -0
  23. package/codegen/Blockchains/index.d.ts +3 -0
  24. package/codegen/Blockchains/index.js +19 -0
  25. package/codegen/Blockchains/types.d.ts +6 -0
  26. package/codegen/Blockchains/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 +27 -0
  36. package/codegen/Permissions/DelegatedPermissionsClient.js +285 -0
  37. package/codegen/Permissions/PermissionsClient.d.ts +18 -0
  38. package/codegen/Permissions/PermissionsClient.js +157 -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 +62 -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 +18 -0
  50. package/codegen/PolicyExecution/types.js +2 -0
  51. package/codegen/PolicyManagement/DelegatedPolicyManagementClient.d.ts +25 -0
  52. package/codegen/PolicyManagement/DelegatedPolicyManagementClient.js +241 -0
  53. package/codegen/PolicyManagement/PolicyManagementClient.d.ts +18 -0
  54. package/codegen/PolicyManagement/PolicyManagementClient.js +147 -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 +51 -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/Assets/errors.d.ts +11 -0
  76. package/codegen/datamodel/Assets/errors.js +17 -0
  77. package/codegen/datamodel/Assets/index.d.ts +3 -0
  78. package/codegen/datamodel/Assets/index.js +19 -0
  79. package/codegen/datamodel/Assets/responses.d.ts +47 -0
  80. package/codegen/datamodel/Assets/responses.js +2 -0
  81. package/codegen/datamodel/Assets/types.d.ts +225 -0
  82. package/codegen/datamodel/Assets/types.js +75 -0
  83. package/codegen/datamodel/Auth/index.d.ts +2 -0
  84. package/codegen/datamodel/Auth/index.js +18 -0
  85. package/codegen/datamodel/Auth/responses.d.ts +348 -0
  86. package/codegen/datamodel/Auth/responses.js +2 -0
  87. package/codegen/datamodel/Auth/types.d.ts +610 -0
  88. package/codegen/datamodel/Auth/types.js +127 -0
  89. package/codegen/datamodel/Blockchains/index.d.ts +2 -0
  90. package/codegen/datamodel/Blockchains/index.js +18 -0
  91. package/codegen/datamodel/Blockchains/responses.d.ts +12 -0
  92. package/codegen/datamodel/Blockchains/responses.js +2 -0
  93. package/codegen/datamodel/Blockchains/types.d.ts +269 -0
  94. package/codegen/datamodel/Blockchains/types.js +53 -0
  95. package/codegen/datamodel/Callbacks/index.d.ts +2 -0
  96. package/codegen/datamodel/Callbacks/index.js +18 -0
  97. package/codegen/datamodel/Callbacks/responses.d.ts +36 -0
  98. package/codegen/datamodel/Callbacks/responses.js +2 -0
  99. package/codegen/datamodel/Callbacks/types.d.ts +43 -0
  100. package/codegen/datamodel/Callbacks/types.js +39 -0
  101. package/codegen/datamodel/Foundations/errors.d.ts +121 -0
  102. package/codegen/datamodel/Foundations/errors.js +169 -0
  103. package/codegen/datamodel/Foundations/index.d.ts +2 -0
  104. package/codegen/datamodel/Foundations/index.js +18 -0
  105. package/codegen/datamodel/Foundations/types.d.ts +9756 -0
  106. package/codegen/datamodel/Foundations/types.js +57753 -0
  107. package/codegen/datamodel/Permissions/index.d.ts +2 -0
  108. package/codegen/datamodel/Permissions/index.js +18 -0
  109. package/codegen/datamodel/Permissions/responses.d.ts +75 -0
  110. package/codegen/datamodel/Permissions/responses.js +2 -0
  111. package/codegen/datamodel/Permissions/types.d.ts +93 -0
  112. package/codegen/datamodel/Permissions/types.js +43 -0
  113. package/codegen/datamodel/PolicyExecution/errors.d.ts +11 -0
  114. package/codegen/datamodel/PolicyExecution/errors.js +17 -0
  115. package/codegen/datamodel/PolicyExecution/index.d.ts +3 -0
  116. package/codegen/datamodel/PolicyExecution/index.js +19 -0
  117. package/codegen/datamodel/PolicyExecution/responses.d.ts +19 -0
  118. package/codegen/datamodel/PolicyExecution/responses.js +2 -0
  119. package/codegen/datamodel/PolicyExecution/types.d.ts +45 -0
  120. package/codegen/datamodel/PolicyExecution/types.js +15 -0
  121. package/codegen/datamodel/PolicyManagement/index.d.ts +2 -0
  122. package/codegen/datamodel/PolicyManagement/index.js +18 -0
  123. package/codegen/datamodel/PolicyManagement/responses.d.ts +83 -0
  124. package/codegen/datamodel/PolicyManagement/responses.js +2 -0
  125. package/codegen/datamodel/PolicyManagement/types.d.ts +212 -0
  126. package/codegen/datamodel/PolicyManagement/types.js +77 -0
  127. package/codegen/datamodel/PublicKeys/index.d.ts +2 -0
  128. package/codegen/datamodel/PublicKeys/index.js +18 -0
  129. package/codegen/datamodel/PublicKeys/responses.d.ts +56 -0
  130. package/codegen/datamodel/PublicKeys/responses.js +2 -0
  131. package/codegen/datamodel/PublicKeys/types.d.ts +222 -0
  132. package/codegen/datamodel/PublicKeys/types.js +59 -0
  133. package/codegen/datamodel/Wallets/index.d.ts +2 -0
  134. package/codegen/datamodel/Wallets/index.js +18 -0
  135. package/codegen/datamodel/Wallets/responses.d.ts +77 -0
  136. package/codegen/datamodel/Wallets/responses.js +2 -0
  137. package/codegen/datamodel/Wallets/types.d.ts +277 -0
  138. package/codegen/datamodel/Wallets/types.js +123 -0
  139. package/dfnsApiClient.d.ts +27 -0
  140. package/dfnsApiClient.js +45 -0
  141. package/dfnsAuthenticator.d.ts +17 -0
  142. package/dfnsAuthenticator.js +29 -0
  143. package/dfnsDelegatedApiClient.d.ts +24 -0
  144. package/dfnsDelegatedApiClient.js +41 -0
  145. package/dfnsError.d.ts +5 -0
  146. package/dfnsError.js +11 -0
  147. package/index.d.ts +7 -0
  148. package/index.js +23 -0
  149. package/package.json +11 -0
  150. package/signer.d.ts +42 -0
  151. package/signer.js +2 -0
  152. package/store.d.ts +79 -0
  153. package/store.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,191 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DelegatedPublicKeysClient = void 0;
4
+ const baseAuthApi_1 = require("../../baseAuthApi");
5
+ const fetch_1 = require("../../utils/fetch");
6
+ const url_1 = require("../../utils/url");
7
+ class DelegatedPublicKeysClient {
8
+ constructor(apiOptions) {
9
+ this.apiOptions = apiOptions;
10
+ }
11
+ async getPublicKeyById(request) {
12
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/:publicKeyId', {
13
+ path: { publicKeyId: request.publicKeyId },
14
+ query: {},
15
+ });
16
+ const response = await (0, fetch_1.simpleFetch)(path, {
17
+ method: 'GET',
18
+ apiOptions: this.apiOptions,
19
+ });
20
+ return response.json();
21
+ }
22
+ async createPublicKeyInit(request) {
23
+ const path = (0, url_1.buildPathAndQuery)('/public-keys', {
24
+ path: {},
25
+ query: {},
26
+ });
27
+ const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
28
+ userActionHttpMethod: 'POST',
29
+ userActionHttpPath: path,
30
+ userActionPayload: JSON.stringify(request.body),
31
+ userActionServerKind: 'Api',
32
+ }, this.apiOptions);
33
+ return challenge;
34
+ }
35
+ async createPublicKeyComplete(request, signedChallenge) {
36
+ const path = (0, url_1.buildPathAndQuery)('/public-keys', {
37
+ path: {},
38
+ query: {},
39
+ });
40
+ const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
41
+ const response = await (0, fetch_1.simpleFetch)(path, {
42
+ method: 'POST',
43
+ body: request.body,
44
+ headers: { 'x-dfns-useraction': userAction },
45
+ apiOptions: this.apiOptions,
46
+ });
47
+ return response.json();
48
+ }
49
+ async listPublicKeys() {
50
+ const path = (0, url_1.buildPathAndQuery)('/public-keys', {
51
+ path: {},
52
+ query: {},
53
+ });
54
+ const response = await (0, fetch_1.simpleFetch)(path, {
55
+ method: 'GET',
56
+ apiOptions: this.apiOptions,
57
+ });
58
+ return response.json();
59
+ }
60
+ async getAddressForNetwork(request) {
61
+ var _a;
62
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/:publicKeyId/address', {
63
+ path: { publicKeyId: request.publicKeyId },
64
+ query: (_a = request.query) !== null && _a !== void 0 ? _a : {},
65
+ });
66
+ const response = await (0, fetch_1.simpleFetch)(path, {
67
+ method: 'GET',
68
+ apiOptions: this.apiOptions,
69
+ });
70
+ return response.json();
71
+ }
72
+ async getSignatureById(request) {
73
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/:publicKeyId/signatures/:signatureId', {
74
+ path: {
75
+ publicKeyId: request.publicKeyId,
76
+ signatureId: request.signatureId,
77
+ },
78
+ query: {},
79
+ });
80
+ const response = await (0, fetch_1.simpleFetch)(path, {
81
+ method: 'GET',
82
+ apiOptions: this.apiOptions,
83
+ });
84
+ return response.json();
85
+ }
86
+ async createSignatureInit(request) {
87
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/:publicKeyId/signatures', {
88
+ path: { publicKeyId: request.publicKeyId },
89
+ query: {},
90
+ });
91
+ const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
92
+ userActionHttpMethod: 'POST',
93
+ userActionHttpPath: path,
94
+ userActionPayload: JSON.stringify(request.body),
95
+ userActionServerKind: 'Api',
96
+ }, this.apiOptions);
97
+ return challenge;
98
+ }
99
+ async createSignatureComplete(request, signedChallenge) {
100
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/:publicKeyId/signatures', {
101
+ path: { publicKeyId: request.publicKeyId },
102
+ query: {},
103
+ });
104
+ const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
105
+ const response = await (0, fetch_1.simpleFetch)(path, {
106
+ method: 'POST',
107
+ body: request.body,
108
+ headers: { 'x-dfns-useraction': userAction },
109
+ apiOptions: this.apiOptions,
110
+ });
111
+ return response.json();
112
+ }
113
+ async startWalletConnectSessionInit(request) {
114
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/:publicKeyId/walletconnect-session', {
115
+ path: { publicKeyId: request.publicKeyId },
116
+ query: {},
117
+ });
118
+ const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
119
+ userActionHttpMethod: 'POST',
120
+ userActionHttpPath: path,
121
+ userActionPayload: JSON.stringify(request.body),
122
+ userActionServerKind: 'Api',
123
+ }, this.apiOptions);
124
+ return challenge;
125
+ }
126
+ async startWalletConnectSessionComplete(request, signedChallenge) {
127
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/:publicKeyId/walletconnect-session', {
128
+ path: { publicKeyId: request.publicKeyId },
129
+ query: {},
130
+ });
131
+ const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
132
+ const response = await (0, fetch_1.simpleFetch)(path, {
133
+ method: 'POST',
134
+ body: request.body,
135
+ headers: { 'x-dfns-useraction': userAction },
136
+ apiOptions: this.apiOptions,
137
+ });
138
+ return response.json();
139
+ }
140
+ async listTransactions(request) {
141
+ var _a;
142
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/:publicKeyId/transactions', {
143
+ path: { publicKeyId: request.publicKeyId },
144
+ query: (_a = request.query) !== null && _a !== void 0 ? _a : {},
145
+ });
146
+ const response = await (0, fetch_1.simpleFetch)(path, {
147
+ method: 'GET',
148
+ apiOptions: this.apiOptions,
149
+ });
150
+ return response.json();
151
+ }
152
+ async createTransactionInit(request) {
153
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/transactions', {
154
+ path: {},
155
+ query: {},
156
+ });
157
+ const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
158
+ userActionHttpMethod: 'POST',
159
+ userActionHttpPath: path,
160
+ userActionPayload: JSON.stringify(request.body),
161
+ userActionServerKind: 'Api',
162
+ }, this.apiOptions);
163
+ return challenge;
164
+ }
165
+ async createTransactionComplete(request, signedChallenge) {
166
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/transactions', {
167
+ path: {},
168
+ query: {},
169
+ });
170
+ const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
171
+ const response = await (0, fetch_1.simpleFetch)(path, {
172
+ method: 'POST',
173
+ body: request.body,
174
+ headers: { 'x-dfns-useraction': userAction },
175
+ apiOptions: this.apiOptions,
176
+ });
177
+ return response.json();
178
+ }
179
+ async getTransactionById(request) {
180
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/transactions/:transactionId', {
181
+ path: { transactionId: request.transactionId },
182
+ query: {},
183
+ });
184
+ const response = await (0, fetch_1.simpleFetch)(path, {
185
+ method: 'GET',
186
+ apiOptions: this.apiOptions,
187
+ });
188
+ return response.json();
189
+ }
190
+ }
191
+ exports.DelegatedPublicKeysClient = DelegatedPublicKeysClient;
@@ -0,0 +1,16 @@
1
+ import { DfnsApiClientOptions } from '../../dfnsApiClient';
2
+ import * as T from './types';
3
+ export declare class PublicKeysClient {
4
+ private apiOptions;
5
+ constructor(apiOptions: DfnsApiClientOptions);
6
+ getPublicKeyById(request: T.GetPublicKeyByIdRequest): Promise<T.GetPublicKeyByIdResponse>;
7
+ createPublicKey(request: T.CreatePublicKeyRequest): Promise<T.CreatePublicKeyResponse>;
8
+ listPublicKeys(): Promise<T.ListPublicKeysResponse>;
9
+ getAddressForNetwork(request: T.GetAddressForNetworkRequest): Promise<T.GetAddressForNetworkResponse>;
10
+ getSignatureById(request: T.GetSignatureByIdRequest): Promise<T.GetSignatureByIdResponse>;
11
+ createSignature(request: T.CreateSignatureRequest): Promise<T.CreateSignatureResponse>;
12
+ startWalletConnectSession(request: T.StartWalletConnectSessionRequest): Promise<T.StartWalletConnectSessionResponse>;
13
+ listTransactions(request: T.ListTransactionsRequest): Promise<T.ListTransactionsResponse>;
14
+ createTransaction(request: T.CreateTransactionRequest): Promise<T.CreateTransactionResponse>;
15
+ getTransactionById(request: T.GetTransactionByIdRequest): Promise<T.GetTransactionByIdResponse>;
16
+ }
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PublicKeysClient = void 0;
4
+ const fetch_1 = require("../../utils/fetch");
5
+ const url_1 = require("../../utils/url");
6
+ class PublicKeysClient {
7
+ constructor(apiOptions) {
8
+ this.apiOptions = apiOptions;
9
+ }
10
+ async getPublicKeyById(request) {
11
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/:publicKeyId', {
12
+ path: { publicKeyId: request.publicKeyId },
13
+ query: {},
14
+ });
15
+ const response = await (0, fetch_1.simpleFetch)(path, {
16
+ method: 'GET',
17
+ apiOptions: this.apiOptions,
18
+ });
19
+ return response.json();
20
+ }
21
+ async createPublicKey(request) {
22
+ const path = (0, url_1.buildPathAndQuery)('/public-keys', {
23
+ path: {},
24
+ query: {},
25
+ });
26
+ const response = await (0, fetch_1.userActionFetch)(path, {
27
+ method: 'POST',
28
+ body: request.body,
29
+ apiOptions: this.apiOptions,
30
+ });
31
+ return response.json();
32
+ }
33
+ async listPublicKeys() {
34
+ const path = (0, url_1.buildPathAndQuery)('/public-keys', {
35
+ path: {},
36
+ query: {},
37
+ });
38
+ const response = await (0, fetch_1.simpleFetch)(path, {
39
+ method: 'GET',
40
+ apiOptions: this.apiOptions,
41
+ });
42
+ return response.json();
43
+ }
44
+ async getAddressForNetwork(request) {
45
+ var _a;
46
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/:publicKeyId/address', {
47
+ path: { publicKeyId: request.publicKeyId },
48
+ query: (_a = request.query) !== null && _a !== void 0 ? _a : {},
49
+ });
50
+ const response = await (0, fetch_1.simpleFetch)(path, {
51
+ method: 'GET',
52
+ apiOptions: this.apiOptions,
53
+ });
54
+ return response.json();
55
+ }
56
+ async getSignatureById(request) {
57
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/:publicKeyId/signatures/:signatureId', {
58
+ path: {
59
+ publicKeyId: request.publicKeyId,
60
+ signatureId: request.signatureId,
61
+ },
62
+ query: {},
63
+ });
64
+ const response = await (0, fetch_1.simpleFetch)(path, {
65
+ method: 'GET',
66
+ apiOptions: this.apiOptions,
67
+ });
68
+ return response.json();
69
+ }
70
+ async createSignature(request) {
71
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/:publicKeyId/signatures', {
72
+ path: { publicKeyId: request.publicKeyId },
73
+ query: {},
74
+ });
75
+ const response = await (0, fetch_1.userActionFetch)(path, {
76
+ method: 'POST',
77
+ body: request.body,
78
+ apiOptions: this.apiOptions,
79
+ });
80
+ return response.json();
81
+ }
82
+ async startWalletConnectSession(request) {
83
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/:publicKeyId/walletconnect-session', {
84
+ path: { publicKeyId: request.publicKeyId },
85
+ query: {},
86
+ });
87
+ const response = await (0, fetch_1.userActionFetch)(path, {
88
+ method: 'POST',
89
+ body: request.body,
90
+ apiOptions: this.apiOptions,
91
+ });
92
+ return response.json();
93
+ }
94
+ async listTransactions(request) {
95
+ var _a;
96
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/:publicKeyId/transactions', {
97
+ path: { publicKeyId: request.publicKeyId },
98
+ query: (_a = request.query) !== null && _a !== void 0 ? _a : {},
99
+ });
100
+ const response = await (0, fetch_1.simpleFetch)(path, {
101
+ method: 'GET',
102
+ apiOptions: this.apiOptions,
103
+ });
104
+ return response.json();
105
+ }
106
+ async createTransaction(request) {
107
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/transactions', {
108
+ path: {},
109
+ query: {},
110
+ });
111
+ const response = await (0, fetch_1.userActionFetch)(path, {
112
+ method: 'POST',
113
+ body: request.body,
114
+ apiOptions: this.apiOptions,
115
+ });
116
+ return response.json();
117
+ }
118
+ async getTransactionById(request) {
119
+ const path = (0, url_1.buildPathAndQuery)('/public-keys/transactions/:transactionId', {
120
+ path: { transactionId: request.transactionId },
121
+ query: {},
122
+ });
123
+ const response = await (0, fetch_1.simpleFetch)(path, {
124
+ method: 'GET',
125
+ apiOptions: this.apiOptions,
126
+ });
127
+ return response.json();
128
+ }
129
+ }
130
+ exports.PublicKeysClient = PublicKeysClient;
@@ -0,0 +1,3 @@
1
+ export * from './DelegatedPublicKeysClient';
2
+ export * from './PublicKeysClient';
3
+ export * from './types';
@@ -0,0 +1,19 @@
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("./DelegatedPublicKeysClient"), exports);
18
+ __exportStar(require("./PublicKeysClient"), exports);
19
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,51 @@
1
+ import * as PublicKeys from '../datamodel/PublicKeys';
2
+ export type GetPublicKeyByIdRequest = {
3
+ publicKeyId: string;
4
+ };
5
+ export type GetPublicKeyByIdResponse = PublicKeys.GetPublicKeyResponse;
6
+ export type CreatePublicKeyRequest = {
7
+ body: PublicKeys.CreatePublicKeyInput;
8
+ };
9
+ export type CreatePublicKeyResponse = PublicKeys.PublicKeyRecord;
10
+ export type ListPublicKeysResponse = {
11
+ items: PublicKeys.GetPublicKeyResponse[];
12
+ };
13
+ export type GetAddressForNetworkRequest = {
14
+ publicKeyId: string;
15
+ query?: {
16
+ network: string;
17
+ };
18
+ };
19
+ export type GetAddressForNetworkResponse = PublicKeys.GetPublicKeyAddressResponse;
20
+ export type GetSignatureByIdRequest = {
21
+ publicKeyId: string;
22
+ signatureId: string;
23
+ };
24
+ export type GetSignatureByIdResponse = PublicKeys.Signature;
25
+ export type CreateSignatureRequest = {
26
+ publicKeyId: string;
27
+ body: PublicKeys.CreateSignatureInput;
28
+ };
29
+ export type CreateSignatureResponse = PublicKeys.SignatureResponse;
30
+ export type StartWalletConnectSessionRequest = {
31
+ publicKeyId: string;
32
+ body: PublicKeys.StartWalletConnectSessionInput;
33
+ };
34
+ export type StartWalletConnectSessionResponse = PublicKeys.StartWalletConnectSessionOutput;
35
+ export type ListTransactionsRequest = {
36
+ publicKeyId: string;
37
+ query?: {
38
+ assets: string;
39
+ };
40
+ };
41
+ export type ListTransactionsResponse = {
42
+ items: PublicKeys.BroadcastedTransaction[];
43
+ };
44
+ export type CreateTransactionRequest = {
45
+ body: PublicKeys.TransactionPayload;
46
+ };
47
+ export type CreateTransactionResponse = PublicKeys.BroadcastedTransaction;
48
+ export type GetTransactionByIdRequest = {
49
+ transactionId: string;
50
+ };
51
+ export type GetTransactionByIdResponse = PublicKeys.BroadcastedTransaction;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,26 @@
1
+ import { SignUserActionChallengeRequest, UserActionChallengeResponse } from '../../baseAuthApi';
2
+ import { DfnsDelegatedApiClientOptions } from '../../dfnsDelegatedApiClient';
3
+ import * as T from './types';
4
+ export declare class DelegatedWalletsClient {
5
+ private apiOptions;
6
+ constructor(apiOptions: DfnsDelegatedApiClientOptions);
7
+ createWalletInit(request: T.CreateWalletRequest): Promise<UserActionChallengeResponse>;
8
+ createWalletComplete(request: T.CreateWalletRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreateWalletResponse>;
9
+ getWallet(request: T.GetWalletRequest): Promise<T.GetWalletResponse>;
10
+ getWalletAssets(request: T.GetWalletAssetsRequest): Promise<T.GetWalletAssetsResponse>;
11
+ getWalletNfts(request: T.GetWalletNftsRequest): Promise<T.GetWalletNftsResponse>;
12
+ listWallets(request: T.ListWalletsRequest): Promise<T.ListWalletsResponse>;
13
+ getWalletHistory(request: T.GetWalletHistoryRequest): Promise<T.GetWalletHistoryResponse>;
14
+ transferAssetInit(request: T.TransferAssetRequest): Promise<UserActionChallengeResponse>;
15
+ transferAssetComplete(request: T.TransferAssetRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.TransferAssetResponse>;
16
+ getTransfer(request: T.GetTransferRequest): Promise<T.GetTransferResponse>;
17
+ listTransfers(request: T.ListTransfersRequest): Promise<T.ListTransfersResponse>;
18
+ broadcastTransactionInit(request: T.BroadcastTransactionRequest): Promise<UserActionChallengeResponse>;
19
+ broadcastTransactionComplete(request: T.BroadcastTransactionRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.BroadcastTransactionResponse>;
20
+ getTransaction(request: T.GetTransactionRequest): Promise<T.GetTransactionResponse>;
21
+ listTransactions(request: T.ListTransactionsRequest): Promise<T.ListTransactionsResponse>;
22
+ generateSignatureInit(request: T.GenerateSignatureRequest): Promise<UserActionChallengeResponse>;
23
+ generateSignatureComplete(request: T.GenerateSignatureRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.GenerateSignatureResponse>;
24
+ getSignature(request: T.GetSignatureRequest): Promise<T.GetSignatureResponse>;
25
+ listSignatures(request: T.ListSignaturesRequest): Promise<T.ListSignaturesResponse>;
26
+ }