@dfns/sdk 0.8.12 → 0.8.14-beta-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.
- package/generated/networks/types.d.ts +14 -1
- package/generated/payouts/client.d.ts +1 -0
- package/generated/payouts/client.js +11 -0
- package/generated/payouts/delegatedClient.d.ts +1 -0
- package/generated/payouts/delegatedClient.js +11 -0
- package/generated/payouts/types.d.ts +103 -0
- package/generated/permissions/client.js +1 -1
- package/generated/permissions/delegatedClient.js +1 -1
- package/generated/permissions/types.d.ts +95 -4
- package/generated/policies/types.d.ts +54 -0
- package/generated/swaps/types.d.ts +6 -0
- package/generated/wallets/client.d.ts +2 -0
- package/generated/wallets/client.js +24 -0
- package/generated/wallets/delegatedClient.d.ts +4 -0
- package/generated/wallets/delegatedClient.js +54 -0
- package/generated/wallets/types.d.ts +792 -0
- package/package.json +1 -1
- package/utils/url.d.ts +1 -1
- package/utils/url.js +11 -2
|
@@ -1441,6 +1441,8 @@ export type CreateApprovalDecisionResponse = {
|
|
|
1441
1441
|
/** Token id. */
|
|
1442
1442
|
tokenId?: string | undefined;
|
|
1443
1443
|
};
|
|
1444
|
+
/** The failure reason, if any. Only present when status is Failed. */
|
|
1445
|
+
failureReason?: string | undefined;
|
|
1444
1446
|
} | undefined;
|
|
1445
1447
|
} | {
|
|
1446
1448
|
kind: "Wallets:IncomingTransaction";
|
|
@@ -2734,6 +2736,7 @@ export type CreateApprovalDecisionResponse = {
|
|
|
2734
2736
|
} | {
|
|
2735
2737
|
kind: "Permissions:Modify";
|
|
2736
2738
|
changeRequest: {
|
|
2739
|
+
/** ID of the change request. */
|
|
2737
2740
|
id: string;
|
|
2738
2741
|
/** The user who initiated the change request. */
|
|
2739
2742
|
requester: {
|
|
@@ -2741,7 +2744,9 @@ export type CreateApprovalDecisionResponse = {
|
|
|
2741
2744
|
tokenId?: string | undefined;
|
|
2742
2745
|
appId?: string | undefined;
|
|
2743
2746
|
};
|
|
2747
|
+
/** Current status of the change request. */
|
|
2744
2748
|
status: "Applied" | "Failed" | "Pending" | "Rejected";
|
|
2749
|
+
/** ID of the entity being changed. */
|
|
2745
2750
|
entityId: string;
|
|
2746
2751
|
dateCreated: string;
|
|
2747
2752
|
dateResolved?: string | undefined;
|
|
@@ -2749,17 +2754,24 @@ export type CreateApprovalDecisionResponse = {
|
|
|
2749
2754
|
kind: "Permission";
|
|
2750
2755
|
operationKind: "Update";
|
|
2751
2756
|
body: {
|
|
2757
|
+
/** ID of the permission (also referred to as "role" in the dashboard). */
|
|
2752
2758
|
id: string;
|
|
2759
|
+
/** Human-readable name of the permission (role). */
|
|
2753
2760
|
name: string;
|
|
2761
|
+
/** Current status of the permission. */
|
|
2754
2762
|
status: "Active";
|
|
2763
|
+
/** List of API operations this permission grants access to. See [Permissions List](https://docs.dfns.co/core-concepts/roles-and-permissions#list-of-permissions) for available operations. */
|
|
2755
2764
|
operations: string[];
|
|
2765
|
+
/** Whether this permission is system-managed and cannot be modified. */
|
|
2756
2766
|
isImmutable: boolean;
|
|
2767
|
+
/** Whether this permission has been archived (soft-deleted). */
|
|
2757
2768
|
isArchived: boolean;
|
|
2758
2769
|
};
|
|
2759
2770
|
};
|
|
2760
2771
|
} | {
|
|
2761
2772
|
kind: "Permissions:Assign";
|
|
2762
2773
|
changeRequest: {
|
|
2774
|
+
/** ID of the change request. */
|
|
2763
2775
|
id: string;
|
|
2764
2776
|
/** The user who initiated the change request. */
|
|
2765
2777
|
requester: {
|
|
@@ -2767,7 +2779,9 @@ export type CreateApprovalDecisionResponse = {
|
|
|
2767
2779
|
tokenId?: string | undefined;
|
|
2768
2780
|
appId?: string | undefined;
|
|
2769
2781
|
};
|
|
2782
|
+
/** Current status of the change request. */
|
|
2770
2783
|
status: "Applied" | "Failed" | "Pending" | "Rejected";
|
|
2784
|
+
/** ID of the entity being changed. */
|
|
2771
2785
|
entityId: string;
|
|
2772
2786
|
dateCreated: string;
|
|
2773
2787
|
dateResolved?: string | undefined;
|
|
@@ -2775,9 +2789,13 @@ export type CreateApprovalDecisionResponse = {
|
|
|
2775
2789
|
kind: "Assignment";
|
|
2776
2790
|
operationKind: "Create" | "Delete";
|
|
2777
2791
|
body: {
|
|
2792
|
+
/** ID of the permission assignment. */
|
|
2778
2793
|
id: string;
|
|
2794
|
+
/** ID of the permission (also referred to as "role" in the dashboard). */
|
|
2779
2795
|
permissionId: string;
|
|
2796
|
+
/** ID of the identity the permission is assigned to. Can be a user ID, a service account ID, or a personal access token (PAT) ID. */
|
|
2780
2797
|
identityId: string;
|
|
2798
|
+
/** Whether this assignment is system-managed and cannot be modified. */
|
|
2781
2799
|
isImmutable: boolean;
|
|
2782
2800
|
};
|
|
2783
2801
|
};
|
|
@@ -4594,6 +4612,8 @@ export type GetApprovalResponse = {
|
|
|
4594
4612
|
/** Token id. */
|
|
4595
4613
|
tokenId?: string | undefined;
|
|
4596
4614
|
};
|
|
4615
|
+
/** The failure reason, if any. Only present when status is Failed. */
|
|
4616
|
+
failureReason?: string | undefined;
|
|
4597
4617
|
} | undefined;
|
|
4598
4618
|
} | {
|
|
4599
4619
|
kind: "Wallets:IncomingTransaction";
|
|
@@ -5887,6 +5907,7 @@ export type GetApprovalResponse = {
|
|
|
5887
5907
|
} | {
|
|
5888
5908
|
kind: "Permissions:Modify";
|
|
5889
5909
|
changeRequest: {
|
|
5910
|
+
/** ID of the change request. */
|
|
5890
5911
|
id: string;
|
|
5891
5912
|
/** The user who initiated the change request. */
|
|
5892
5913
|
requester: {
|
|
@@ -5894,7 +5915,9 @@ export type GetApprovalResponse = {
|
|
|
5894
5915
|
tokenId?: string | undefined;
|
|
5895
5916
|
appId?: string | undefined;
|
|
5896
5917
|
};
|
|
5918
|
+
/** Current status of the change request. */
|
|
5897
5919
|
status: "Applied" | "Failed" | "Pending" | "Rejected";
|
|
5920
|
+
/** ID of the entity being changed. */
|
|
5898
5921
|
entityId: string;
|
|
5899
5922
|
dateCreated: string;
|
|
5900
5923
|
dateResolved?: string | undefined;
|
|
@@ -5902,17 +5925,24 @@ export type GetApprovalResponse = {
|
|
|
5902
5925
|
kind: "Permission";
|
|
5903
5926
|
operationKind: "Update";
|
|
5904
5927
|
body: {
|
|
5928
|
+
/** ID of the permission (also referred to as "role" in the dashboard). */
|
|
5905
5929
|
id: string;
|
|
5930
|
+
/** Human-readable name of the permission (role). */
|
|
5906
5931
|
name: string;
|
|
5932
|
+
/** Current status of the permission. */
|
|
5907
5933
|
status: "Active";
|
|
5934
|
+
/** List of API operations this permission grants access to. See [Permissions List](https://docs.dfns.co/core-concepts/roles-and-permissions#list-of-permissions) for available operations. */
|
|
5908
5935
|
operations: string[];
|
|
5936
|
+
/** Whether this permission is system-managed and cannot be modified. */
|
|
5909
5937
|
isImmutable: boolean;
|
|
5938
|
+
/** Whether this permission has been archived (soft-deleted). */
|
|
5910
5939
|
isArchived: boolean;
|
|
5911
5940
|
};
|
|
5912
5941
|
};
|
|
5913
5942
|
} | {
|
|
5914
5943
|
kind: "Permissions:Assign";
|
|
5915
5944
|
changeRequest: {
|
|
5945
|
+
/** ID of the change request. */
|
|
5916
5946
|
id: string;
|
|
5917
5947
|
/** The user who initiated the change request. */
|
|
5918
5948
|
requester: {
|
|
@@ -5920,7 +5950,9 @@ export type GetApprovalResponse = {
|
|
|
5920
5950
|
tokenId?: string | undefined;
|
|
5921
5951
|
appId?: string | undefined;
|
|
5922
5952
|
};
|
|
5953
|
+
/** Current status of the change request. */
|
|
5923
5954
|
status: "Applied" | "Failed" | "Pending" | "Rejected";
|
|
5955
|
+
/** ID of the entity being changed. */
|
|
5924
5956
|
entityId: string;
|
|
5925
5957
|
dateCreated: string;
|
|
5926
5958
|
dateResolved?: string | undefined;
|
|
@@ -5928,9 +5960,13 @@ export type GetApprovalResponse = {
|
|
|
5928
5960
|
kind: "Assignment";
|
|
5929
5961
|
operationKind: "Create" | "Delete";
|
|
5930
5962
|
body: {
|
|
5963
|
+
/** ID of the permission assignment. */
|
|
5931
5964
|
id: string;
|
|
5965
|
+
/** ID of the permission (also referred to as "role" in the dashboard). */
|
|
5932
5966
|
permissionId: string;
|
|
5967
|
+
/** ID of the identity the permission is assigned to. Can be a user ID, a service account ID, or a personal access token (PAT) ID. */
|
|
5933
5968
|
identityId: string;
|
|
5969
|
+
/** Whether this assignment is system-managed and cannot be modified. */
|
|
5934
5970
|
isImmutable: boolean;
|
|
5935
5971
|
};
|
|
5936
5972
|
};
|
|
@@ -7796,6 +7832,8 @@ export type ListApprovalsResponse = {
|
|
|
7796
7832
|
/** Token id. */
|
|
7797
7833
|
tokenId?: string | undefined;
|
|
7798
7834
|
};
|
|
7835
|
+
/** The failure reason, if any. Only present when status is Failed. */
|
|
7836
|
+
failureReason?: string | undefined;
|
|
7799
7837
|
} | undefined;
|
|
7800
7838
|
} | {
|
|
7801
7839
|
kind: "Wallets:IncomingTransaction";
|
|
@@ -9089,6 +9127,7 @@ export type ListApprovalsResponse = {
|
|
|
9089
9127
|
} | {
|
|
9090
9128
|
kind: "Permissions:Modify";
|
|
9091
9129
|
changeRequest: {
|
|
9130
|
+
/** ID of the change request. */
|
|
9092
9131
|
id: string;
|
|
9093
9132
|
/** The user who initiated the change request. */
|
|
9094
9133
|
requester: {
|
|
@@ -9096,7 +9135,9 @@ export type ListApprovalsResponse = {
|
|
|
9096
9135
|
tokenId?: string | undefined;
|
|
9097
9136
|
appId?: string | undefined;
|
|
9098
9137
|
};
|
|
9138
|
+
/** Current status of the change request. */
|
|
9099
9139
|
status: "Applied" | "Failed" | "Pending" | "Rejected";
|
|
9140
|
+
/** ID of the entity being changed. */
|
|
9100
9141
|
entityId: string;
|
|
9101
9142
|
dateCreated: string;
|
|
9102
9143
|
dateResolved?: string | undefined;
|
|
@@ -9104,17 +9145,24 @@ export type ListApprovalsResponse = {
|
|
|
9104
9145
|
kind: "Permission";
|
|
9105
9146
|
operationKind: "Update";
|
|
9106
9147
|
body: {
|
|
9148
|
+
/** ID of the permission (also referred to as "role" in the dashboard). */
|
|
9107
9149
|
id: string;
|
|
9150
|
+
/** Human-readable name of the permission (role). */
|
|
9108
9151
|
name: string;
|
|
9152
|
+
/** Current status of the permission. */
|
|
9109
9153
|
status: "Active";
|
|
9154
|
+
/** List of API operations this permission grants access to. See [Permissions List](https://docs.dfns.co/core-concepts/roles-and-permissions#list-of-permissions) for available operations. */
|
|
9110
9155
|
operations: string[];
|
|
9156
|
+
/** Whether this permission is system-managed and cannot be modified. */
|
|
9111
9157
|
isImmutable: boolean;
|
|
9158
|
+
/** Whether this permission has been archived (soft-deleted). */
|
|
9112
9159
|
isArchived: boolean;
|
|
9113
9160
|
};
|
|
9114
9161
|
};
|
|
9115
9162
|
} | {
|
|
9116
9163
|
kind: "Permissions:Assign";
|
|
9117
9164
|
changeRequest: {
|
|
9165
|
+
/** ID of the change request. */
|
|
9118
9166
|
id: string;
|
|
9119
9167
|
/** The user who initiated the change request. */
|
|
9120
9168
|
requester: {
|
|
@@ -9122,7 +9170,9 @@ export type ListApprovalsResponse = {
|
|
|
9122
9170
|
tokenId?: string | undefined;
|
|
9123
9171
|
appId?: string | undefined;
|
|
9124
9172
|
};
|
|
9173
|
+
/** Current status of the change request. */
|
|
9125
9174
|
status: "Applied" | "Failed" | "Pending" | "Rejected";
|
|
9175
|
+
/** ID of the entity being changed. */
|
|
9126
9176
|
entityId: string;
|
|
9127
9177
|
dateCreated: string;
|
|
9128
9178
|
dateResolved?: string | undefined;
|
|
@@ -9130,9 +9180,13 @@ export type ListApprovalsResponse = {
|
|
|
9130
9180
|
kind: "Assignment";
|
|
9131
9181
|
operationKind: "Create" | "Delete";
|
|
9132
9182
|
body: {
|
|
9183
|
+
/** ID of the permission assignment. */
|
|
9133
9184
|
id: string;
|
|
9185
|
+
/** ID of the permission (also referred to as "role" in the dashboard). */
|
|
9134
9186
|
permissionId: string;
|
|
9187
|
+
/** ID of the identity the permission is assigned to. Can be a user ID, a service account ID, or a personal access token (PAT) ID. */
|
|
9135
9188
|
identityId: string;
|
|
9189
|
+
/** Whether this assignment is system-managed and cannot be modified. */
|
|
9136
9190
|
isImmutable: boolean;
|
|
9137
9191
|
};
|
|
9138
9192
|
};
|
|
@@ -123,6 +123,8 @@ export type CreateSwapResponse = {
|
|
|
123
123
|
/** Token id. */
|
|
124
124
|
tokenId?: string | undefined;
|
|
125
125
|
};
|
|
126
|
+
/** The failure reason, if any. Only present when status is Failed. */
|
|
127
|
+
failureReason?: string | undefined;
|
|
126
128
|
};
|
|
127
129
|
export type CreateSwapRequest = {
|
|
128
130
|
body: CreateSwapBody;
|
|
@@ -335,6 +337,8 @@ export type GetSwapResponse = {
|
|
|
335
337
|
/** Token id. */
|
|
336
338
|
tokenId?: string | undefined;
|
|
337
339
|
};
|
|
340
|
+
/** The failure reason, if any. Only present when status is Failed. */
|
|
341
|
+
failureReason?: string | undefined;
|
|
338
342
|
};
|
|
339
343
|
export type GetSwapRequest = GetSwapParams;
|
|
340
344
|
export type GetSwapQuoteParams = {
|
|
@@ -525,6 +529,8 @@ export type ListSwapsResponse = {
|
|
|
525
529
|
/** Token id. */
|
|
526
530
|
tokenId?: string | undefined;
|
|
527
531
|
};
|
|
532
|
+
/** The failure reason, if any. Only present when status is Failed. */
|
|
533
|
+
failureReason?: string | undefined;
|
|
528
534
|
}[];
|
|
529
535
|
/** token to use as `paginationToken` to request the next page. */
|
|
530
536
|
nextPageToken?: string | undefined;
|
|
@@ -3,6 +3,8 @@ import * as T from './types';
|
|
|
3
3
|
export declare class WalletsClient {
|
|
4
4
|
private apiOptions;
|
|
5
5
|
constructor(apiOptions: DfnsApiClientOptions);
|
|
6
|
+
abortTransaction(request: T.AbortTransactionRequest): Promise<T.AbortTransactionResponse>;
|
|
7
|
+
abortTransfer(request: T.AbortTransferRequest): Promise<T.AbortTransferResponse>;
|
|
6
8
|
acceptOffer(request: T.AcceptOfferRequest): Promise<T.AcceptOfferResponse>;
|
|
7
9
|
activateWallet(request: T.ActivateWalletRequest): Promise<T.ActivateWalletResponse>;
|
|
8
10
|
broadcastTransaction(request: T.BroadcastTransactionRequest): Promise<T.BroadcastTransactionResponse>;
|
|
@@ -9,6 +9,30 @@ class WalletsClient {
|
|
|
9
9
|
constructor(apiOptions) {
|
|
10
10
|
this.apiOptions = apiOptions;
|
|
11
11
|
}
|
|
12
|
+
async abortTransaction(request) {
|
|
13
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions/:transactionId/abort', {
|
|
14
|
+
path: request ?? {},
|
|
15
|
+
query: {},
|
|
16
|
+
});
|
|
17
|
+
const response = await (0, userActionFetch_1.userActionFetch)(path, {
|
|
18
|
+
method: 'PUT',
|
|
19
|
+
body: {},
|
|
20
|
+
apiOptions: this.apiOptions,
|
|
21
|
+
});
|
|
22
|
+
return response.json();
|
|
23
|
+
}
|
|
24
|
+
async abortTransfer(request) {
|
|
25
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers/:transferId/abort', {
|
|
26
|
+
path: request ?? {},
|
|
27
|
+
query: {},
|
|
28
|
+
});
|
|
29
|
+
const response = await (0, userActionFetch_1.userActionFetch)(path, {
|
|
30
|
+
method: 'PUT',
|
|
31
|
+
body: {},
|
|
32
|
+
apiOptions: this.apiOptions,
|
|
33
|
+
});
|
|
34
|
+
return response.json();
|
|
35
|
+
}
|
|
12
36
|
async acceptOffer(request) {
|
|
13
37
|
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/offers/:offerId/accept', {
|
|
14
38
|
path: request ?? {},
|
|
@@ -4,6 +4,10 @@ import * as T from './types';
|
|
|
4
4
|
export declare class DelegatedWalletsClient {
|
|
5
5
|
private apiOptions;
|
|
6
6
|
constructor(apiOptions: DfnsDelegatedApiClientOptions);
|
|
7
|
+
abortTransactionInit(request: T.AbortTransactionRequest): Promise<UserActionChallengeResponse>;
|
|
8
|
+
abortTransactionComplete(request: T.AbortTransactionRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.AbortTransactionResponse>;
|
|
9
|
+
abortTransferInit(request: T.AbortTransferRequest): Promise<UserActionChallengeResponse>;
|
|
10
|
+
abortTransferComplete(request: T.AbortTransferRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.AbortTransferResponse>;
|
|
7
11
|
acceptOfferInit(request: T.AcceptOfferRequest): Promise<UserActionChallengeResponse>;
|
|
8
12
|
acceptOfferComplete(request: T.AcceptOfferRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.AcceptOfferResponse>;
|
|
9
13
|
activateWalletInit(request: T.ActivateWalletRequest): Promise<UserActionChallengeResponse>;
|
|
@@ -8,6 +8,60 @@ class DelegatedWalletsClient {
|
|
|
8
8
|
constructor(apiOptions) {
|
|
9
9
|
this.apiOptions = apiOptions;
|
|
10
10
|
}
|
|
11
|
+
async abortTransactionInit(request) {
|
|
12
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions/:transactionId/abort', {
|
|
13
|
+
path: request ?? {},
|
|
14
|
+
query: {},
|
|
15
|
+
});
|
|
16
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
17
|
+
userActionHttpMethod: 'PUT',
|
|
18
|
+
userActionHttpPath: path,
|
|
19
|
+
userActionPayload: JSON.stringify({}),
|
|
20
|
+
userActionServerKind: 'Api',
|
|
21
|
+
}, this.apiOptions);
|
|
22
|
+
return challenge;
|
|
23
|
+
}
|
|
24
|
+
async abortTransactionComplete(request, signedChallenge) {
|
|
25
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions/:transactionId/abort', {
|
|
26
|
+
path: request ?? {},
|
|
27
|
+
query: {},
|
|
28
|
+
});
|
|
29
|
+
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
30
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
31
|
+
method: 'PUT',
|
|
32
|
+
body: {},
|
|
33
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
34
|
+
apiOptions: this.apiOptions,
|
|
35
|
+
});
|
|
36
|
+
return response.json();
|
|
37
|
+
}
|
|
38
|
+
async abortTransferInit(request) {
|
|
39
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers/:transferId/abort', {
|
|
40
|
+
path: request ?? {},
|
|
41
|
+
query: {},
|
|
42
|
+
});
|
|
43
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
44
|
+
userActionHttpMethod: 'PUT',
|
|
45
|
+
userActionHttpPath: path,
|
|
46
|
+
userActionPayload: JSON.stringify({}),
|
|
47
|
+
userActionServerKind: 'Api',
|
|
48
|
+
}, this.apiOptions);
|
|
49
|
+
return challenge;
|
|
50
|
+
}
|
|
51
|
+
async abortTransferComplete(request, signedChallenge) {
|
|
52
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers/:transferId/abort', {
|
|
53
|
+
path: request ?? {},
|
|
54
|
+
query: {},
|
|
55
|
+
});
|
|
56
|
+
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
57
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
58
|
+
method: 'PUT',
|
|
59
|
+
body: {},
|
|
60
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
61
|
+
apiOptions: this.apiOptions,
|
|
62
|
+
});
|
|
63
|
+
return response.json();
|
|
64
|
+
}
|
|
11
65
|
async acceptOfferInit(request) {
|
|
12
66
|
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/offers/:offerId/accept', {
|
|
13
67
|
path: request ?? {},
|