@dfns/sdk 0.7.14-rc.0 → 0.7.14
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/auth/types.d.ts +47 -15
- package/generated/exchanges/types.d.ts +12 -0
- package/generated/keys/types.d.ts +8 -0
- package/generated/networks/types.d.ts +9 -0
- package/generated/permissions/types.d.ts +2 -2
- package/generated/policies/types.d.ts +66 -0
- package/generated/signers/client.d.ts +1 -0
- package/generated/signers/client.js +11 -0
- package/generated/signers/delegatedClient.d.ts +1 -0
- package/generated/signers/delegatedClient.js +11 -0
- package/generated/signers/types.d.ts +7 -0
- package/generated/staking/types.d.ts +6 -0
- package/generated/swaps/types.d.ts +118 -0
- package/generated/wallets/types.d.ts +40 -0
- package/package.json +1 -1
|
@@ -1005,13 +1005,21 @@ export type CreateApprovalDecisionResponse = {
|
|
|
1005
1005
|
externalId?: string | undefined;
|
|
1006
1006
|
} | undefined;
|
|
1007
1007
|
swapRequest?: {
|
|
1008
|
+
/** Swap id. */
|
|
1008
1009
|
id: string;
|
|
1010
|
+
/** Id of the quote this swap is based on. */
|
|
1009
1011
|
quoteId: string;
|
|
1012
|
+
/** Optional user-defined reference for this Swap. */
|
|
1010
1013
|
reference: string | null;
|
|
1014
|
+
/** Id of the Dfns wallet spending the sourceAsset. */
|
|
1011
1015
|
walletId: string;
|
|
1016
|
+
/** Id of the Dfns wallet receiving the target asset. Currently this value must be the same as the `walletId`. */
|
|
1012
1017
|
targetWalletId: string;
|
|
1018
|
+
/** Swap status. */
|
|
1013
1019
|
status: "PendingPolicyApproval" | "InProgress" | "Completed" | "Failed" | "Rejected";
|
|
1020
|
+
/** Swap provider. */
|
|
1014
1021
|
provider: "UniswapX" | "UniswapClassic";
|
|
1022
|
+
/** The source asset for this swap transaction. */
|
|
1015
1023
|
quotedSourceAsset: ({
|
|
1016
1024
|
kind: "Native";
|
|
1017
1025
|
amount: string;
|
|
@@ -1028,6 +1036,7 @@ export type CreateApprovalDecisionResponse = {
|
|
|
1028
1036
|
tid?: string | undefined;
|
|
1029
1037
|
};
|
|
1030
1038
|
};
|
|
1039
|
+
/** The target asset for this swap transaction. */
|
|
1031
1040
|
quotedTargetAsset: ({
|
|
1032
1041
|
kind: "Native";
|
|
1033
1042
|
amount: string;
|
|
@@ -1044,15 +1053,25 @@ export type CreateApprovalDecisionResponse = {
|
|
|
1044
1053
|
tid?: string | undefined;
|
|
1045
1054
|
};
|
|
1046
1055
|
};
|
|
1056
|
+
/** The slippage tolerance for this trade in [basis point](https://en.wikipedia.org/wiki/Basis_point) (BPS). Slippage tolerance defines the maximum price difference you are willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%. */
|
|
1047
1057
|
slippageBps: number;
|
|
1058
|
+
/** [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date (must be UTC). When the swap was initiated. */
|
|
1048
1059
|
dateCreated: string;
|
|
1060
|
+
/** The full request used for initiating this swap. */
|
|
1049
1061
|
requestBody: {
|
|
1062
|
+
/** Quote to use for this swap. */
|
|
1050
1063
|
quoteId: string;
|
|
1064
|
+
/** An optional reference for this Swap. */
|
|
1051
1065
|
reference?: string | undefined;
|
|
1066
|
+
/** Provided for this swap. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
1052
1067
|
provider: "UniswapX" | "UniswapClassic";
|
|
1068
|
+
/** Id of the Dfns wallet spending the sourceAsset. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
1053
1069
|
walletId: string;
|
|
1070
|
+
/** Id of the Dfns wallet receiving the target asset. Currently this value must be the same as the `walletId`. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
1054
1071
|
targetWalletId?: string | undefined;
|
|
1072
|
+
/** The slippage tolerance for this trade in [basis point](https://en.wikipedia.org/wiki/Basis_point) (BPS). Slippage tolerance defines the maximum price difference you are willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
1055
1073
|
slippageBps: number;
|
|
1074
|
+
/** The source asset that will be spent on the Swap transaction. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
1056
1075
|
sourceAsset: {
|
|
1057
1076
|
kind: "Native";
|
|
1058
1077
|
amount: string;
|
|
@@ -1061,6 +1080,7 @@ export type CreateApprovalDecisionResponse = {
|
|
|
1061
1080
|
contract: string;
|
|
1062
1081
|
amount: string;
|
|
1063
1082
|
};
|
|
1083
|
+
/** The target asset that will be received with the Swap transaction. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
1064
1084
|
targetAsset: {
|
|
1065
1085
|
kind: "Native";
|
|
1066
1086
|
amount: string;
|
|
@@ -1071,7 +1091,9 @@ export type CreateApprovalDecisionResponse = {
|
|
|
1071
1091
|
};
|
|
1072
1092
|
} | {};
|
|
1073
1093
|
requester: {
|
|
1094
|
+
/** User (could be a service account) who requested the quote. */
|
|
1074
1095
|
userId: string;
|
|
1096
|
+
/** Service Account token or Personal Access token used when requesting the quote. */
|
|
1075
1097
|
tokenId?: string | undefined;
|
|
1076
1098
|
};
|
|
1077
1099
|
} | undefined;
|
|
@@ -3324,13 +3346,21 @@ export type GetApprovalResponse = {
|
|
|
3324
3346
|
externalId?: string | undefined;
|
|
3325
3347
|
} | undefined;
|
|
3326
3348
|
swapRequest?: {
|
|
3349
|
+
/** Swap id. */
|
|
3327
3350
|
id: string;
|
|
3351
|
+
/** Id of the quote this swap is based on. */
|
|
3328
3352
|
quoteId: string;
|
|
3353
|
+
/** Optional user-defined reference for this Swap. */
|
|
3329
3354
|
reference: string | null;
|
|
3355
|
+
/** Id of the Dfns wallet spending the sourceAsset. */
|
|
3330
3356
|
walletId: string;
|
|
3357
|
+
/** Id of the Dfns wallet receiving the target asset. Currently this value must be the same as the `walletId`. */
|
|
3331
3358
|
targetWalletId: string;
|
|
3359
|
+
/** Swap status. */
|
|
3332
3360
|
status: "PendingPolicyApproval" | "InProgress" | "Completed" | "Failed" | "Rejected";
|
|
3361
|
+
/** Swap provider. */
|
|
3333
3362
|
provider: "UniswapX" | "UniswapClassic";
|
|
3363
|
+
/** The source asset for this swap transaction. */
|
|
3334
3364
|
quotedSourceAsset: ({
|
|
3335
3365
|
kind: "Native";
|
|
3336
3366
|
amount: string;
|
|
@@ -3347,6 +3377,7 @@ export type GetApprovalResponse = {
|
|
|
3347
3377
|
tid?: string | undefined;
|
|
3348
3378
|
};
|
|
3349
3379
|
};
|
|
3380
|
+
/** The target asset for this swap transaction. */
|
|
3350
3381
|
quotedTargetAsset: ({
|
|
3351
3382
|
kind: "Native";
|
|
3352
3383
|
amount: string;
|
|
@@ -3363,15 +3394,25 @@ export type GetApprovalResponse = {
|
|
|
3363
3394
|
tid?: string | undefined;
|
|
3364
3395
|
};
|
|
3365
3396
|
};
|
|
3397
|
+
/** The slippage tolerance for this trade in [basis point](https://en.wikipedia.org/wiki/Basis_point) (BPS). Slippage tolerance defines the maximum price difference you are willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%. */
|
|
3366
3398
|
slippageBps: number;
|
|
3399
|
+
/** [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date (must be UTC). When the swap was initiated. */
|
|
3367
3400
|
dateCreated: string;
|
|
3401
|
+
/** The full request used for initiating this swap. */
|
|
3368
3402
|
requestBody: {
|
|
3403
|
+
/** Quote to use for this swap. */
|
|
3369
3404
|
quoteId: string;
|
|
3405
|
+
/** An optional reference for this Swap. */
|
|
3370
3406
|
reference?: string | undefined;
|
|
3407
|
+
/** Provided for this swap. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
3371
3408
|
provider: "UniswapX" | "UniswapClassic";
|
|
3409
|
+
/** Id of the Dfns wallet spending the sourceAsset. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
3372
3410
|
walletId: string;
|
|
3411
|
+
/** Id of the Dfns wallet receiving the target asset. Currently this value must be the same as the `walletId`. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
3373
3412
|
targetWalletId?: string | undefined;
|
|
3413
|
+
/** The slippage tolerance for this trade in [basis point](https://en.wikipedia.org/wiki/Basis_point) (BPS). Slippage tolerance defines the maximum price difference you are willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
3374
3414
|
slippageBps: number;
|
|
3415
|
+
/** The source asset that will be spent on the Swap transaction. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
3375
3416
|
sourceAsset: {
|
|
3376
3417
|
kind: "Native";
|
|
3377
3418
|
amount: string;
|
|
@@ -3380,6 +3421,7 @@ export type GetApprovalResponse = {
|
|
|
3380
3421
|
contract: string;
|
|
3381
3422
|
amount: string;
|
|
3382
3423
|
};
|
|
3424
|
+
/** The target asset that will be received with the Swap transaction. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
3383
3425
|
targetAsset: {
|
|
3384
3426
|
kind: "Native";
|
|
3385
3427
|
amount: string;
|
|
@@ -3390,7 +3432,9 @@ export type GetApprovalResponse = {
|
|
|
3390
3432
|
};
|
|
3391
3433
|
} | {};
|
|
3392
3434
|
requester: {
|
|
3435
|
+
/** User (could be a service account) who requested the quote. */
|
|
3393
3436
|
userId: string;
|
|
3437
|
+
/** Service Account token or Personal Access token used when requesting the quote. */
|
|
3394
3438
|
tokenId?: string | undefined;
|
|
3395
3439
|
};
|
|
3396
3440
|
} | undefined;
|
|
@@ -5687,13 +5731,21 @@ export type ListApprovalsResponse = {
|
|
|
5687
5731
|
externalId?: string | undefined;
|
|
5688
5732
|
} | undefined;
|
|
5689
5733
|
swapRequest?: {
|
|
5734
|
+
/** Swap id. */
|
|
5690
5735
|
id: string;
|
|
5736
|
+
/** Id of the quote this swap is based on. */
|
|
5691
5737
|
quoteId: string;
|
|
5738
|
+
/** Optional user-defined reference for this Swap. */
|
|
5692
5739
|
reference: string | null;
|
|
5740
|
+
/** Id of the Dfns wallet spending the sourceAsset. */
|
|
5693
5741
|
walletId: string;
|
|
5742
|
+
/** Id of the Dfns wallet receiving the target asset. Currently this value must be the same as the `walletId`. */
|
|
5694
5743
|
targetWalletId: string;
|
|
5744
|
+
/** Swap status. */
|
|
5695
5745
|
status: "PendingPolicyApproval" | "InProgress" | "Completed" | "Failed" | "Rejected";
|
|
5746
|
+
/** Swap provider. */
|
|
5696
5747
|
provider: "UniswapX" | "UniswapClassic";
|
|
5748
|
+
/** The source asset for this swap transaction. */
|
|
5697
5749
|
quotedSourceAsset: ({
|
|
5698
5750
|
kind: "Native";
|
|
5699
5751
|
amount: string;
|
|
@@ -5710,6 +5762,7 @@ export type ListApprovalsResponse = {
|
|
|
5710
5762
|
tid?: string | undefined;
|
|
5711
5763
|
};
|
|
5712
5764
|
};
|
|
5765
|
+
/** The target asset for this swap transaction. */
|
|
5713
5766
|
quotedTargetAsset: ({
|
|
5714
5767
|
kind: "Native";
|
|
5715
5768
|
amount: string;
|
|
@@ -5726,15 +5779,25 @@ export type ListApprovalsResponse = {
|
|
|
5726
5779
|
tid?: string | undefined;
|
|
5727
5780
|
};
|
|
5728
5781
|
};
|
|
5782
|
+
/** The slippage tolerance for this trade in [basis point](https://en.wikipedia.org/wiki/Basis_point) (BPS). Slippage tolerance defines the maximum price difference you are willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%. */
|
|
5729
5783
|
slippageBps: number;
|
|
5784
|
+
/** [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date (must be UTC). When the swap was initiated. */
|
|
5730
5785
|
dateCreated: string;
|
|
5786
|
+
/** The full request used for initiating this swap. */
|
|
5731
5787
|
requestBody: {
|
|
5788
|
+
/** Quote to use for this swap. */
|
|
5732
5789
|
quoteId: string;
|
|
5790
|
+
/** An optional reference for this Swap. */
|
|
5733
5791
|
reference?: string | undefined;
|
|
5792
|
+
/** Provided for this swap. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
5734
5793
|
provider: "UniswapX" | "UniswapClassic";
|
|
5794
|
+
/** Id of the Dfns wallet spending the sourceAsset. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
5735
5795
|
walletId: string;
|
|
5796
|
+
/** Id of the Dfns wallet receiving the target asset. Currently this value must be the same as the `walletId`. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
5736
5797
|
targetWalletId?: string | undefined;
|
|
5798
|
+
/** The slippage tolerance for this trade in [basis point](https://en.wikipedia.org/wiki/Basis_point) (BPS). Slippage tolerance defines the maximum price difference you are willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
5737
5799
|
slippageBps: number;
|
|
5800
|
+
/** The source asset that will be spent on the Swap transaction. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
5738
5801
|
sourceAsset: {
|
|
5739
5802
|
kind: "Native";
|
|
5740
5803
|
amount: string;
|
|
@@ -5743,6 +5806,7 @@ export type ListApprovalsResponse = {
|
|
|
5743
5806
|
contract: string;
|
|
5744
5807
|
amount: string;
|
|
5745
5808
|
};
|
|
5809
|
+
/** The target asset that will be received with the Swap transaction. Used for attesting that the swap is being created with the same parameters as the quote. */
|
|
5746
5810
|
targetAsset: {
|
|
5747
5811
|
kind: "Native";
|
|
5748
5812
|
amount: string;
|
|
@@ -5753,7 +5817,9 @@ export type ListApprovalsResponse = {
|
|
|
5753
5817
|
};
|
|
5754
5818
|
} | {};
|
|
5755
5819
|
requester: {
|
|
5820
|
+
/** User (could be a service account) who requested the quote. */
|
|
5756
5821
|
userId: string;
|
|
5822
|
+
/** Service Account token or Personal Access token used when requesting the quote. */
|
|
5757
5823
|
tokenId?: string | undefined;
|
|
5758
5824
|
};
|
|
5759
5825
|
} | undefined;
|
|
@@ -8,6 +8,17 @@ class SignersClient {
|
|
|
8
8
|
constructor(apiOptions) {
|
|
9
9
|
this.apiOptions = apiOptions;
|
|
10
10
|
}
|
|
11
|
+
async listKeyStores() {
|
|
12
|
+
const path = (0, url_1.buildPathAndQuery)('/key-stores', {
|
|
13
|
+
path: {},
|
|
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
|
+
}
|
|
11
22
|
async listSigners() {
|
|
12
23
|
const path = (0, url_1.buildPathAndQuery)('/signers', {
|
|
13
24
|
path: {},
|
|
@@ -7,6 +7,17 @@ class DelegatedSignersClient {
|
|
|
7
7
|
constructor(apiOptions) {
|
|
8
8
|
this.apiOptions = apiOptions;
|
|
9
9
|
}
|
|
10
|
+
async listKeyStores() {
|
|
11
|
+
const path = (0, url_1.buildPathAndQuery)('/key-stores', {
|
|
12
|
+
path: {},
|
|
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
|
+
}
|
|
10
21
|
async listSigners() {
|
|
11
22
|
const path = (0, url_1.buildPathAndQuery)('/signers', {
|
|
12
23
|
path: {},
|
|
@@ -476,7 +476,9 @@ export type GetStakesParams = {
|
|
|
476
476
|
stakeId: string;
|
|
477
477
|
};
|
|
478
478
|
export type GetStakesQuery = {
|
|
479
|
+
/** Maximum number of items to return. */
|
|
479
480
|
limit?: number | undefined;
|
|
481
|
+
/** Opaque token used to retrieve the next page. Returned as `nextPageToken` from the previous request. */
|
|
480
482
|
paginationToken?: string | undefined;
|
|
481
483
|
};
|
|
482
484
|
export type GetStakesResponse = ({
|
|
@@ -690,7 +692,9 @@ export type ListStakeActionsParams = {
|
|
|
690
692
|
stakeId: string;
|
|
691
693
|
};
|
|
692
694
|
export type ListStakeActionsQuery = {
|
|
695
|
+
/** Maximum number of items to return. */
|
|
693
696
|
limit?: number | undefined;
|
|
697
|
+
/** Opaque token used to retrieve the next page. Returned as `nextPageToken` from the previous request. */
|
|
694
698
|
paginationToken?: string | undefined;
|
|
695
699
|
};
|
|
696
700
|
export type ListStakeActionsResponse = {
|
|
@@ -761,7 +765,9 @@ export type ListStakeActionsRequest = ListStakeActionsParams & {
|
|
|
761
765
|
query?: ListStakeActionsQuery;
|
|
762
766
|
};
|
|
763
767
|
export type ListStakesQuery = {
|
|
768
|
+
/** Maximum number of items to return. */
|
|
764
769
|
limit?: number | undefined;
|
|
770
|
+
/** Opaque token used to retrieve the next page. Returned as `nextPageToken` from the previous request. */
|
|
765
771
|
paginationToken?: string | undefined;
|
|
766
772
|
};
|
|
767
773
|
export type ListStakesResponse = {
|