@dfns/sdk 0.5.3 → 0.5.5-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.
- package/dfnsApiClient.d.ts +2 -0
- package/dfnsApiClient.js +4 -0
- package/dfnsDelegatedApiClient.d.ts +2 -0
- package/dfnsDelegatedApiClient.js +4 -0
- package/generated/auth/client.d.ts +0 -1
- package/generated/auth/client.js +0 -12
- package/generated/auth/delegatedClient.d.ts +0 -1
- package/generated/auth/delegatedClient.js +0 -12
- package/generated/auth/types.d.ts +2 -17
- package/generated/exchanges/client.d.ts +13 -0
- package/generated/exchanges/client.js +91 -0
- package/generated/exchanges/delegatedClient.d.ts +17 -0
- package/generated/exchanges/delegatedClient.js +137 -0
- package/generated/exchanges/index.d.ts +3 -0
- package/generated/exchanges/index.js +19 -0
- package/generated/exchanges/types.d.ts +302 -0
- package/generated/exchanges/types.js +2 -0
- package/generated/permissions/types.d.ts +2 -2
- package/generated/policies/types.d.ts +156 -42
- package/generated/wallets/types.d.ts +97 -34
- package/package.json +1 -1
- package/types/exchanges.d.ts +1 -0
- package/types/exchanges.js +17 -0
package/dfnsApiClient.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DfnsBaseApiOptions } from './baseAuthApi';
|
|
2
2
|
import { AuthClient } from './generated/auth';
|
|
3
|
+
import { ExchangesClient } from './generated/exchanges';
|
|
3
4
|
import { NetworksClient } from './generated/networks';
|
|
4
5
|
import { PermissionsClient } from './generated/permissions';
|
|
5
6
|
import { PoliciesClient } from './generated/policies';
|
|
@@ -15,6 +16,7 @@ export declare class DfnsApiClient {
|
|
|
15
16
|
private apiOptions;
|
|
16
17
|
constructor(apiOptions: DfnsApiClientOptions);
|
|
17
18
|
get auth(): AuthClient;
|
|
19
|
+
get exchanges(): ExchangesClient;
|
|
18
20
|
get networks(): NetworksClient;
|
|
19
21
|
get permissions(): PermissionsClient;
|
|
20
22
|
get policies(): PoliciesClient;
|
package/dfnsApiClient.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DfnsApiClient = void 0;
|
|
4
4
|
const auth_1 = require("./generated/auth");
|
|
5
|
+
const exchanges_1 = require("./generated/exchanges");
|
|
5
6
|
const networks_1 = require("./generated/networks");
|
|
6
7
|
const permissions_1 = require("./generated/permissions");
|
|
7
8
|
const policies_1 = require("./generated/policies");
|
|
@@ -15,6 +16,9 @@ class DfnsApiClient {
|
|
|
15
16
|
get auth() {
|
|
16
17
|
return new auth_1.AuthClient(this.apiOptions);
|
|
17
18
|
}
|
|
19
|
+
get exchanges() {
|
|
20
|
+
return new exchanges_1.ExchangesClient(this.apiOptions);
|
|
21
|
+
}
|
|
18
22
|
get networks() {
|
|
19
23
|
return new networks_1.NetworksClient(this.apiOptions);
|
|
20
24
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DfnsBaseApiOptions } from './baseAuthApi';
|
|
2
2
|
import { DelegatedAuthClient } from './generated/auth';
|
|
3
|
+
import { DelegatedExchangesClient } from './generated/exchanges';
|
|
3
4
|
import { DelegatedNetworksClient } from './generated/networks';
|
|
4
5
|
import { DelegatedPermissionsClient } from './generated/permissions';
|
|
5
6
|
import { DelegatedPoliciesClient } from './generated/policies';
|
|
@@ -11,6 +12,7 @@ export declare class DfnsDelegatedApiClient {
|
|
|
11
12
|
private apiOptions;
|
|
12
13
|
constructor(apiOptions: DfnsDelegatedApiClientOptions);
|
|
13
14
|
get auth(): DelegatedAuthClient;
|
|
15
|
+
get exchanges(): DelegatedExchangesClient;
|
|
14
16
|
get networks(): DelegatedNetworksClient;
|
|
15
17
|
get permissions(): DelegatedPermissionsClient;
|
|
16
18
|
get policies(): DelegatedPoliciesClient;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DfnsDelegatedApiClient = void 0;
|
|
4
4
|
const auth_1 = require("./generated/auth");
|
|
5
|
+
const exchanges_1 = require("./generated/exchanges");
|
|
5
6
|
const networks_1 = require("./generated/networks");
|
|
6
7
|
const permissions_1 = require("./generated/permissions");
|
|
7
8
|
const policies_1 = require("./generated/policies");
|
|
@@ -15,6 +16,9 @@ class DfnsDelegatedApiClient {
|
|
|
15
16
|
get auth() {
|
|
16
17
|
return new auth_1.DelegatedAuthClient(this.apiOptions);
|
|
17
18
|
}
|
|
19
|
+
get exchanges() {
|
|
20
|
+
return new exchanges_1.DelegatedExchangesClient(this.apiOptions);
|
|
21
|
+
}
|
|
18
22
|
get networks() {
|
|
19
23
|
return new networks_1.DelegatedNetworksClient(this.apiOptions);
|
|
20
24
|
}
|
|
@@ -52,7 +52,6 @@ export declare class AuthClient {
|
|
|
52
52
|
getServiceAccount(request: T.GetServiceAccountRequest): Promise<T.GetServiceAccountResponse>;
|
|
53
53
|
getUser(request: T.GetUserRequest): Promise<T.GetUserResponse>;
|
|
54
54
|
listApplications(): Promise<T.ListApplicationsResponse>;
|
|
55
|
-
listAvailableOrgs(request: T.ListAvailableOrgsRequest): Promise<T.ListAvailableOrgsResponse>;
|
|
56
55
|
listCredentials(): Promise<T.ListCredentialsResponse>;
|
|
57
56
|
/** @deprecated, use listCredentials instead */
|
|
58
57
|
listUserCredentials(): Promise<T.ListCredentialsResponse>;
|
package/generated/auth/client.js
CHANGED
|
@@ -470,18 +470,6 @@ class AuthClient {
|
|
|
470
470
|
});
|
|
471
471
|
return response.json();
|
|
472
472
|
}
|
|
473
|
-
async listAvailableOrgs(request) {
|
|
474
|
-
const path = (0, url_1.buildPathAndQuery)('/auth/login/orgs', {
|
|
475
|
-
path: request ?? {},
|
|
476
|
-
query: {},
|
|
477
|
-
});
|
|
478
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
479
|
-
method: 'POST',
|
|
480
|
-
body: request.body,
|
|
481
|
-
apiOptions: this.apiOptions,
|
|
482
|
-
});
|
|
483
|
-
return response.json();
|
|
484
|
-
}
|
|
485
473
|
async listCredentials() {
|
|
486
474
|
const path = (0, url_1.buildPathAndQuery)('/auth/credentials', {
|
|
487
475
|
path: {},
|
|
@@ -68,7 +68,6 @@ export declare class DelegatedAuthClient {
|
|
|
68
68
|
getServiceAccount(request: T.GetServiceAccountRequest): Promise<T.GetServiceAccountResponse>;
|
|
69
69
|
getUser(request: T.GetUserRequest): Promise<T.GetUserResponse>;
|
|
70
70
|
listApplications(): Promise<T.ListApplicationsResponse>;
|
|
71
|
-
listAvailableOrgs(request: T.ListAvailableOrgsRequest): Promise<T.ListAvailableOrgsResponse>;
|
|
72
71
|
listCredentials(): Promise<T.ListCredentialsResponse>;
|
|
73
72
|
/** @deprecated, use listCredentials instead */
|
|
74
73
|
listUserCredentials(): Promise<T.ListCredentialsResponse>;
|
|
@@ -800,18 +800,6 @@ class DelegatedAuthClient {
|
|
|
800
800
|
});
|
|
801
801
|
return response.json();
|
|
802
802
|
}
|
|
803
|
-
async listAvailableOrgs(request) {
|
|
804
|
-
const path = (0, url_1.buildPathAndQuery)('/auth/login/orgs', {
|
|
805
|
-
path: request ?? {},
|
|
806
|
-
query: {},
|
|
807
|
-
});
|
|
808
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
809
|
-
method: 'POST',
|
|
810
|
-
body: request.body,
|
|
811
|
-
apiOptions: this.apiOptions,
|
|
812
|
-
});
|
|
813
|
-
return response.json();
|
|
814
|
-
}
|
|
815
803
|
async listCredentials() {
|
|
816
804
|
const path = (0, url_1.buildPathAndQuery)('/auth/credentials', {
|
|
817
805
|
path: {},
|
|
@@ -1494,21 +1494,6 @@ export type ListApplicationsResponse = {
|
|
|
1494
1494
|
}[];
|
|
1495
1495
|
}[];
|
|
1496
1496
|
};
|
|
1497
|
-
export type ListAvailableOrgsBody = {
|
|
1498
|
-
username: string;
|
|
1499
|
-
orgId?: string | undefined;
|
|
1500
|
-
permissions?: string[] | undefined;
|
|
1501
|
-
origin: string;
|
|
1502
|
-
};
|
|
1503
|
-
export type ListAvailableOrgsResponse = {
|
|
1504
|
-
items: {
|
|
1505
|
-
orgId: string;
|
|
1506
|
-
appId: string;
|
|
1507
|
-
}[];
|
|
1508
|
-
};
|
|
1509
|
-
export type ListAvailableOrgsRequest = {
|
|
1510
|
-
body: ListAvailableOrgsBody;
|
|
1511
|
-
};
|
|
1512
1497
|
export type ListCredentialsResponse = {
|
|
1513
1498
|
items: {
|
|
1514
1499
|
kind: "Fido2" | "Key" | "Password" | "Totp" | "RecoveryKey" | "PasswordProtectedKey";
|
|
@@ -1969,7 +1954,7 @@ export type RegisterEndUserBody = {
|
|
|
1969
1954
|
encryptedPrivateKey?: string | undefined;
|
|
1970
1955
|
} | undefined;
|
|
1971
1956
|
wallets: {
|
|
1972
|
-
network: "Algorand" | "AlgorandTestnet" | "ArbitrumOne" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Celo" | "CeloAlfajores" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "FantomOpera" | "FantomTestnet" | "Litecoin" | "LitecoinTestnet" | "Optimism" | "OptimismSepolia" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Solana" | "SolanaDevnet" | "Stellar" | "StellarTestnet" | "Tron" | "TronNile" | "ArbitrumGoerli" | "BaseGoerli" | "Cardano" | "CardanoPreprod" | "Kusama" | "OptimismGoerli" | "Polkadot" | "Westend" | "Tezos" | "TezosGhostnet" | "XrpLedger" | "XrpLedgerTestnet" | "KeyEdDSA" | "KeyECDSA" | "KeyECDSAStark";
|
|
1957
|
+
network: "Algorand" | "AlgorandTestnet" | "ArbitrumOne" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Celo" | "CeloAlfajores" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "FantomOpera" | "FantomTestnet" | "Litecoin" | "LitecoinTestnet" | "Optimism" | "OptimismSepolia" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Solana" | "SolanaDevnet" | "Stellar" | "StellarTestnet" | "Ton" | "TonTestnet" | "Tron" | "TronNile" | "ArbitrumGoerli" | "BaseGoerli" | "Cardano" | "CardanoPreprod" | "Kusama" | "OptimismGoerli" | "Polkadot" | "Westend" | "Tezos" | "TezosGhostnet" | "XrpLedger" | "XrpLedgerTestnet" | "KeyEdDSA" | "KeyECDSA" | "KeyECDSAStark";
|
|
1973
1958
|
name?: string | undefined;
|
|
1974
1959
|
}[];
|
|
1975
1960
|
};
|
|
@@ -1989,7 +1974,7 @@ export type RegisterEndUserResponse = {
|
|
|
1989
1974
|
};
|
|
1990
1975
|
wallets: {
|
|
1991
1976
|
id: string;
|
|
1992
|
-
network: "Algorand" | "AlgorandTestnet" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Cardano" | "CardanoPreprod" | "Celo" | "CeloAlfajores" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "FantomOpera" | "FantomTestnet" | "Kusama" | "Litecoin" | "LitecoinTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Polkadot" | "Westend" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Solana" | "SolanaDevnet" | "Stellar" | "StellarTestnet" | "Tezos" | "TezosGhostnet" | "Tron" | "TronNile" | "XrpLedger" | "XrpLedgerTestnet" | "KeyECDSA" | "KeyECDSAStark" | "KeyEdDSA";
|
|
1977
|
+
network: "Algorand" | "AlgorandTestnet" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Cardano" | "CardanoPreprod" | "Celo" | "CeloAlfajores" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "FantomOpera" | "FantomTestnet" | "Kusama" | "Litecoin" | "LitecoinTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Polkadot" | "Westend" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Solana" | "SolanaDevnet" | "Stellar" | "StellarTestnet" | "Tezos" | "TezosGhostnet" | "Tron" | "TronNile" | "Ton" | "TonTestnet" | "XrpLedger" | "XrpLedgerTestnet" | "KeyECDSA" | "KeyECDSAStark" | "KeyEdDSA";
|
|
1993
1978
|
address?: string | undefined;
|
|
1994
1979
|
signingKey: {
|
|
1995
1980
|
scheme: "ECDSA" | "EdDSA";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DfnsApiClientOptions } from '../../dfnsApiClient';
|
|
2
|
+
import * as T from './types';
|
|
3
|
+
export declare class ExchangesClient {
|
|
4
|
+
private apiOptions;
|
|
5
|
+
constructor(apiOptions: DfnsApiClientOptions);
|
|
6
|
+
createDeposit(request: T.CreateDepositRequest): Promise<T.CreateDepositResponse>;
|
|
7
|
+
createExchange(request: T.CreateExchangeRequest): Promise<T.CreateExchangeResponse>;
|
|
8
|
+
deleteExchange(request: T.DeleteExchangeRequest): Promise<T.DeleteExchangeResponse>;
|
|
9
|
+
getExchange(request: T.GetExchangeRequest): Promise<T.GetExchangeResponse>;
|
|
10
|
+
listAccountAssets(request?: T.ListAccountAssetsRequest): Promise<T.ListAccountAssetsResponse>;
|
|
11
|
+
listAccounts(request: T.ListAccountsRequest): Promise<T.ListAccountsResponse>;
|
|
12
|
+
listExchanges(request?: T.ListExchangesRequest): Promise<T.ListExchangesResponse>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExchangesClient = void 0;
|
|
4
|
+
const fetch_1 = require("../../utils/fetch");
|
|
5
|
+
const url_1 = require("../../utils/url");
|
|
6
|
+
class ExchangesClient {
|
|
7
|
+
constructor(apiOptions) {
|
|
8
|
+
this.apiOptions = apiOptions;
|
|
9
|
+
}
|
|
10
|
+
async createDeposit(request) {
|
|
11
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges/:exchangeId/accounts/:accountId/deposits', {
|
|
12
|
+
path: request ?? {},
|
|
13
|
+
query: {},
|
|
14
|
+
});
|
|
15
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
body: request.body,
|
|
18
|
+
apiOptions: this.apiOptions,
|
|
19
|
+
});
|
|
20
|
+
return response.json();
|
|
21
|
+
}
|
|
22
|
+
async createExchange(request) {
|
|
23
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges', {
|
|
24
|
+
path: request ?? {},
|
|
25
|
+
query: {},
|
|
26
|
+
});
|
|
27
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
28
|
+
method: 'POST',
|
|
29
|
+
body: request.body,
|
|
30
|
+
apiOptions: this.apiOptions,
|
|
31
|
+
});
|
|
32
|
+
return response.json();
|
|
33
|
+
}
|
|
34
|
+
async deleteExchange(request) {
|
|
35
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges/:exchangeId', {
|
|
36
|
+
path: request ?? {},
|
|
37
|
+
query: {},
|
|
38
|
+
});
|
|
39
|
+
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
40
|
+
method: 'DELETE',
|
|
41
|
+
body: {},
|
|
42
|
+
apiOptions: this.apiOptions,
|
|
43
|
+
});
|
|
44
|
+
return response.json();
|
|
45
|
+
}
|
|
46
|
+
async getExchange(request) {
|
|
47
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges/:exchangeId', {
|
|
48
|
+
path: request ?? {},
|
|
49
|
+
query: {},
|
|
50
|
+
});
|
|
51
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
52
|
+
method: 'GET',
|
|
53
|
+
apiOptions: this.apiOptions,
|
|
54
|
+
});
|
|
55
|
+
return response.json();
|
|
56
|
+
}
|
|
57
|
+
async listAccountAssets(request) {
|
|
58
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges/:exchangeId/accounts/:accountId/assets', {
|
|
59
|
+
path: request ?? {},
|
|
60
|
+
query: request?.query ?? {},
|
|
61
|
+
});
|
|
62
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
63
|
+
method: 'GET',
|
|
64
|
+
apiOptions: this.apiOptions,
|
|
65
|
+
});
|
|
66
|
+
return response.json();
|
|
67
|
+
}
|
|
68
|
+
async listAccounts(request) {
|
|
69
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges/:exchangeId/accounts', {
|
|
70
|
+
path: request ?? {},
|
|
71
|
+
query: request.query ?? {},
|
|
72
|
+
});
|
|
73
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
74
|
+
method: 'GET',
|
|
75
|
+
apiOptions: this.apiOptions,
|
|
76
|
+
});
|
|
77
|
+
return response.json();
|
|
78
|
+
}
|
|
79
|
+
async listExchanges(request) {
|
|
80
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges', {
|
|
81
|
+
path: request ?? {},
|
|
82
|
+
query: request?.query ?? {},
|
|
83
|
+
});
|
|
84
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
85
|
+
method: 'GET',
|
|
86
|
+
apiOptions: this.apiOptions,
|
|
87
|
+
});
|
|
88
|
+
return response.json();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.ExchangesClient = ExchangesClient;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SignUserActionChallengeRequest, UserActionChallengeResponse } from '../../baseAuthApi';
|
|
2
|
+
import { DfnsDelegatedApiClientOptions } from '../../dfnsDelegatedApiClient';
|
|
3
|
+
import * as T from './types';
|
|
4
|
+
export declare class DelegatedExchangesClient {
|
|
5
|
+
private apiOptions;
|
|
6
|
+
constructor(apiOptions: DfnsDelegatedApiClientOptions);
|
|
7
|
+
createDepositInit(request: T.CreateDepositRequest): Promise<UserActionChallengeResponse>;
|
|
8
|
+
createDepositComplete(request: T.CreateDepositRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreateDepositResponse>;
|
|
9
|
+
createExchangeInit(request: T.CreateExchangeRequest): Promise<UserActionChallengeResponse>;
|
|
10
|
+
createExchangeComplete(request: T.CreateExchangeRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreateExchangeResponse>;
|
|
11
|
+
deleteExchangeInit(request: T.DeleteExchangeRequest): Promise<UserActionChallengeResponse>;
|
|
12
|
+
deleteExchangeComplete(request: T.DeleteExchangeRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.DeleteExchangeResponse>;
|
|
13
|
+
getExchange(request: T.GetExchangeRequest): Promise<T.GetExchangeResponse>;
|
|
14
|
+
listAccountAssets(request?: T.ListAccountAssetsRequest): Promise<T.ListAccountAssetsResponse>;
|
|
15
|
+
listAccounts(request: T.ListAccountsRequest): Promise<T.ListAccountsResponse>;
|
|
16
|
+
listExchanges(request?: T.ListExchangesRequest): Promise<T.ListExchangesResponse>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DelegatedExchangesClient = void 0;
|
|
4
|
+
const baseAuthApi_1 = require("../../baseAuthApi");
|
|
5
|
+
const fetch_1 = require("../../utils/fetch");
|
|
6
|
+
const url_1 = require("../../utils/url");
|
|
7
|
+
class DelegatedExchangesClient {
|
|
8
|
+
constructor(apiOptions) {
|
|
9
|
+
this.apiOptions = apiOptions;
|
|
10
|
+
}
|
|
11
|
+
async createDepositInit(request) {
|
|
12
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges/:exchangeId/accounts/:accountId/deposits', {
|
|
13
|
+
path: request ?? {},
|
|
14
|
+
query: {},
|
|
15
|
+
});
|
|
16
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
17
|
+
userActionHttpMethod: 'POST',
|
|
18
|
+
userActionHttpPath: path,
|
|
19
|
+
userActionPayload: JSON.stringify(request.body),
|
|
20
|
+
userActionServerKind: 'Api',
|
|
21
|
+
}, this.apiOptions);
|
|
22
|
+
return challenge;
|
|
23
|
+
}
|
|
24
|
+
async createDepositComplete(request, signedChallenge) {
|
|
25
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges/:exchangeId/accounts/:accountId/deposits', {
|
|
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: 'POST',
|
|
32
|
+
body: request.body,
|
|
33
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
34
|
+
apiOptions: this.apiOptions,
|
|
35
|
+
});
|
|
36
|
+
return response.json();
|
|
37
|
+
}
|
|
38
|
+
async createExchangeInit(request) {
|
|
39
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges', {
|
|
40
|
+
path: request ?? {},
|
|
41
|
+
query: {},
|
|
42
|
+
});
|
|
43
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
44
|
+
userActionHttpMethod: 'POST',
|
|
45
|
+
userActionHttpPath: path,
|
|
46
|
+
userActionPayload: JSON.stringify(request.body),
|
|
47
|
+
userActionServerKind: 'Api',
|
|
48
|
+
}, this.apiOptions);
|
|
49
|
+
return challenge;
|
|
50
|
+
}
|
|
51
|
+
async createExchangeComplete(request, signedChallenge) {
|
|
52
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges', {
|
|
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: 'POST',
|
|
59
|
+
body: request.body,
|
|
60
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
61
|
+
apiOptions: this.apiOptions,
|
|
62
|
+
});
|
|
63
|
+
return response.json();
|
|
64
|
+
}
|
|
65
|
+
async deleteExchangeInit(request) {
|
|
66
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges/:exchangeId', {
|
|
67
|
+
path: request ?? {},
|
|
68
|
+
query: {},
|
|
69
|
+
});
|
|
70
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
71
|
+
userActionHttpMethod: 'DELETE',
|
|
72
|
+
userActionHttpPath: path,
|
|
73
|
+
userActionPayload: JSON.stringify({}),
|
|
74
|
+
userActionServerKind: 'Api',
|
|
75
|
+
}, this.apiOptions);
|
|
76
|
+
return challenge;
|
|
77
|
+
}
|
|
78
|
+
async deleteExchangeComplete(request, signedChallenge) {
|
|
79
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges/:exchangeId', {
|
|
80
|
+
path: request ?? {},
|
|
81
|
+
query: {},
|
|
82
|
+
});
|
|
83
|
+
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
84
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
85
|
+
method: 'DELETE',
|
|
86
|
+
body: {},
|
|
87
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
88
|
+
apiOptions: this.apiOptions,
|
|
89
|
+
});
|
|
90
|
+
return response.json();
|
|
91
|
+
}
|
|
92
|
+
async getExchange(request) {
|
|
93
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges/:exchangeId', {
|
|
94
|
+
path: request ?? {},
|
|
95
|
+
query: {},
|
|
96
|
+
});
|
|
97
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
98
|
+
method: 'GET',
|
|
99
|
+
apiOptions: this.apiOptions,
|
|
100
|
+
});
|
|
101
|
+
return response.json();
|
|
102
|
+
}
|
|
103
|
+
async listAccountAssets(request) {
|
|
104
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges/:exchangeId/accounts/:accountId/assets', {
|
|
105
|
+
path: request ?? {},
|
|
106
|
+
query: request?.query ?? {},
|
|
107
|
+
});
|
|
108
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
109
|
+
method: 'GET',
|
|
110
|
+
apiOptions: this.apiOptions,
|
|
111
|
+
});
|
|
112
|
+
return response.json();
|
|
113
|
+
}
|
|
114
|
+
async listAccounts(request) {
|
|
115
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges/:exchangeId/accounts', {
|
|
116
|
+
path: request ?? {},
|
|
117
|
+
query: request.query ?? {},
|
|
118
|
+
});
|
|
119
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
120
|
+
method: 'GET',
|
|
121
|
+
apiOptions: this.apiOptions,
|
|
122
|
+
});
|
|
123
|
+
return response.json();
|
|
124
|
+
}
|
|
125
|
+
async listExchanges(request) {
|
|
126
|
+
const path = (0, url_1.buildPathAndQuery)('/exchanges', {
|
|
127
|
+
path: request ?? {},
|
|
128
|
+
query: request?.query ?? {},
|
|
129
|
+
});
|
|
130
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
131
|
+
method: 'GET',
|
|
132
|
+
apiOptions: this.apiOptions,
|
|
133
|
+
});
|
|
134
|
+
return response.json();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.DelegatedExchangesClient = DelegatedExchangesClient;
|
|
@@ -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("./types"), exports);
|
|
18
|
+
__exportStar(require("./client"), exports);
|
|
19
|
+
__exportStar(require("./delegatedClient"), exports);
|