@dfns/sdk 0.8.23 → 0.8.25
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/allocations/types.d.ts +98 -8
- package/generated/auth/types.d.ts +30 -3
- package/generated/exchanges/types.d.ts +1 -1
- package/generated/feeSponsors/types.d.ts +6 -6
- package/generated/keys/types.d.ts +60 -60
- package/generated/networks/types.d.ts +6 -6
- package/generated/payins/client.d.ts +8 -0
- package/generated/payins/client.js +36 -0
- package/generated/payins/delegatedClient.d.ts +10 -0
- package/generated/payins/delegatedClient.js +50 -0
- package/generated/payins/index.d.ts +3 -0
- package/generated/payins/index.js +19 -0
- package/generated/payins/types.d.ts +45 -0
- package/generated/payins/types.js +2 -0
- package/generated/payouts/types.d.ts +309 -9
- package/generated/permissions/types.d.ts +2 -2
- package/generated/policies/types.d.ts +462 -234
- package/generated/signers/client.d.ts +5 -0
- package/generated/signers/client.js +25 -0
- package/generated/signers/delegatedClient.d.ts +2 -0
- package/generated/signers/delegatedClient.js +27 -0
- package/generated/signers/types.d.ts +99 -0
- package/generated/swaps/types.d.ts +10 -10
- package/generated/vaults/client.d.ts +17 -0
- package/generated/vaults/client.js +141 -0
- package/generated/vaults/delegatedClient.d.ts +25 -0
- package/generated/vaults/delegatedClient.js +245 -0
- package/generated/vaults/index.d.ts +3 -0
- package/generated/vaults/index.js +19 -0
- package/generated/vaults/types.d.ts +959 -0
- package/generated/vaults/types.js +2 -0
- package/generated/wallets/types.d.ts +325 -225
- package/generated/webhooks/types.d.ts +9 -9
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@ export type CreateCantonValidatorBody = {
|
|
|
38
38
|
kind: "Custom";
|
|
39
39
|
/** Configuration to reach your validator Signing API. We will call the validator External Signing API at the url (and using the credentials) defined below ; for instance `$URL/api/validator/v0/admin/external-party/topology/generate`. See the underlying calls details [here](https://docs.dev.sync.global/app_dev/validator_api/index.html#validator-api-external-signing). */
|
|
40
40
|
validator: {
|
|
41
|
-
/** URL to reach the API at this address. The calls will be originating from our IP addresses (see [Dfns Environments](https://docs.dfns.co/api-reference/
|
|
41
|
+
/** URL to reach the API at this address. The calls will be originating from our IP addresses (see [Dfns Environments](https://docs.dfns.co/api-reference/regions)) */
|
|
42
42
|
url: string;
|
|
43
43
|
/** How Dfns will authenticate into your validator/ledger. You should have setup authentication already (see details [here](https://docs.dev.sync.global/validator_operator/validator_helm.html#helm-validator-auth)), you can reuse the same Application details. See examples in this endpoint payload examples above. */
|
|
44
44
|
oauth2: {
|
|
@@ -56,7 +56,7 @@ export type CreateCantonValidatorBody = {
|
|
|
56
56
|
};
|
|
57
57
|
/** Configuration to reach your validator Ledger JSON API. We will call endpoints such as `/v2/state/ledger-end`, `/v2/state/active-contracts`, `/v2/parties/participant-id`, `/v2/interactive-submission/prepare`, `/v2/interactive-submission/execute`, `/v2/commands/completions`. See the underlying details [here](https://docs.dev.sync.global/app_dev/ledger_api/index.html). */
|
|
58
58
|
ledger: {
|
|
59
|
-
/** URL to reach the API at this address. The calls will be originating from our IP addresses (see [Dfns Environments](https://docs.dfns.co/api-reference/
|
|
59
|
+
/** URL to reach the API at this address. The calls will be originating from our IP addresses (see [Dfns Environments](https://docs.dfns.co/api-reference/regions)) */
|
|
60
60
|
url: string;
|
|
61
61
|
/** How Dfns will authenticate into your validator/ledger. You should have setup authentication already (see details [here](https://docs.dev.sync.global/validator_operator/validator_helm.html#helm-validator-auth)), you can reuse the same Application details. See examples in this endpoint payload examples above. */
|
|
62
62
|
oauth2: {
|
|
@@ -132,7 +132,7 @@ export type GetCantonValidatorResponse = {
|
|
|
132
132
|
};
|
|
133
133
|
export type GetCantonValidatorRequest = GetCantonValidatorParams;
|
|
134
134
|
export type GetFeesQuery = {
|
|
135
|
-
network: "Bitcoin" | "BitcoinSignet" | "BitcoinTestnet3" | "BitcoinTestnet4" | "Adi" | "AdiTestnet" | "AdiTestnetAb" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "ArcTestnet" | "Areum" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Bob" | "BobSepolia" | "Bsc" | "BscTestnet" | "Berachain" | "BerachainBArtio" | "BerachainBepolia" | "BesuTestnet" | "Celo" | "CeloAlfajores" | "Codex" | "CodexSepolia" | "Ethereum" | "EthereumClassic" | "EthereumClassicMordor" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "EthereumHoodi" | "FantomOpera" | "FantomTestnet" | "FlareC" | "FlareCCoston2" | "FlowEvm" | "FlowEvmTestnet" | "Ink" | "InkSepolia" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Plasma" | "PlasmaTestnet" | "Plume" | "PlumeSepolia" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Race" | "RaceSepolia" | "Rayls" | "RaylsTestnet" | "Sonic" | "SonicTestnet" | "Tempo" | "TempoAndantino" | "TempoModerato" | "Tsc" | "TscTestnet1" | "Xdc" | "XdcApothem" | "XLayer" | "XLayerSepolia" | "Solana" | "SolanaDevnet";
|
|
135
|
+
network: "Bitcoin" | "BitcoinSignet" | "BitcoinTestnet3" | "BitcoinTestnet4" | "Litecoin" | "LitecoinTestnet" | "Dogecoin" | "DogecoinTestnet" | "Adi" | "AdiTestnet" | "AdiTestnetAb" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "ArcTestnet" | "Areum" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Bob" | "BobSepolia" | "Bsc" | "BscTestnet" | "Berachain" | "BerachainBArtio" | "BerachainBepolia" | "BesuTestnet" | "BesuTestnet2" | "Celo" | "CeloAlfajores" | "Codex" | "CodexSepolia" | "Ethereum" | "EthereumClassic" | "EthereumClassicMordor" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "EthereumHoodi" | "FantomOpera" | "FantomTestnet" | "FlareC" | "FlareCCoston2" | "FlowEvm" | "FlowEvmTestnet" | "Ink" | "InkSepolia" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Plasma" | "PlasmaTestnet" | "Plume" | "PlumeSepolia" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Race" | "RaceSepolia" | "Rayls" | "RaylsTestnet" | "Robinhood" | "RobinhoodSepolia" | "SeiPacific1" | "SeiAtlantic2" | "Sonic" | "SonicTestnet" | "Tempo" | "TempoAndantino" | "TempoModerato" | "Tsc" | "TscTestnet1" | "Xdc" | "XdcApothem" | "XLayer" | "XLayerSepolia" | "Solana" | "SolanaDevnet";
|
|
136
136
|
};
|
|
137
137
|
export type GetFeesResponse = {
|
|
138
138
|
kind: "Bitcoin";
|
|
@@ -158,7 +158,7 @@ export type GetFeesResponse = {
|
|
|
158
158
|
};
|
|
159
159
|
} | {
|
|
160
160
|
kind: "Eip1559";
|
|
161
|
-
network: "Adi" | "AdiTestnet" | "AdiTestnetAb" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "ArcTestnet" | "Areum" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Bob" | "BobSepolia" | "Bsc" | "BscTestnet" | "Berachain" | "BerachainBArtio" | "BerachainBepolia" | "BesuTestnet" | "Celo" | "CeloAlfajores" | "Codex" | "CodexSepolia" | "Ethereum" | "EthereumClassic" | "EthereumClassicMordor" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "EthereumHoodi" | "FantomOpera" | "FantomTestnet" | "FlareC" | "FlareCCoston2" | "FlowEvm" | "FlowEvmTestnet" | "Ink" | "InkSepolia" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Plasma" | "PlasmaTestnet" | "Plume" | "PlumeSepolia" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Race" | "RaceSepolia" | "Rayls" | "RaylsTestnet" | "Sonic" | "SonicTestnet" | "Tempo" | "TempoAndantino" | "TempoModerato" | "Tsc" | "TscTestnet1" | "Xdc" | "XdcApothem" | "XLayer" | "XLayerSepolia";
|
|
161
|
+
network: "Adi" | "AdiTestnet" | "AdiTestnetAb" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "ArcTestnet" | "Areum" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Bob" | "BobSepolia" | "Bsc" | "BscTestnet" | "Berachain" | "BerachainBArtio" | "BerachainBepolia" | "BesuTestnet" | "BesuTestnet2" | "Celo" | "CeloAlfajores" | "Codex" | "CodexSepolia" | "Ethereum" | "EthereumClassic" | "EthereumClassicMordor" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "EthereumHoodi" | "FantomOpera" | "FantomTestnet" | "FlareC" | "FlareCCoston2" | "FlowEvm" | "FlowEvmTestnet" | "Ink" | "InkSepolia" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Plasma" | "PlasmaTestnet" | "Plume" | "PlumeSepolia" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Race" | "RaceSepolia" | "Rayls" | "RaylsTestnet" | "Robinhood" | "RobinhoodSepolia" | "SeiPacific1" | "SeiAtlantic2" | "Sonic" | "SonicTestnet" | "Tempo" | "TempoAndantino" | "TempoModerato" | "Tsc" | "TscTestnet1" | "Xdc" | "XdcApothem" | "XLayer" | "XLayerSepolia";
|
|
162
162
|
blockNumber: number;
|
|
163
163
|
slow: {
|
|
164
164
|
/** Maximum priority fee (tip) per unit of gas, denominated in wei (the lowest denomination). */
|
|
@@ -235,7 +235,7 @@ export type UpdateCantonValidatorBody = {
|
|
|
235
235
|
/** Nickname for this validator. */
|
|
236
236
|
name?: string | undefined;
|
|
237
237
|
validator?: {
|
|
238
|
-
/** URL to reach the API at this address. The calls will be originating from our IP addresses (see [Dfns Environments](https://docs.dfns.co/api-reference/
|
|
238
|
+
/** URL to reach the API at this address. The calls will be originating from our IP addresses (see [Dfns Environments](https://docs.dfns.co/api-reference/regions)) */
|
|
239
239
|
url: string;
|
|
240
240
|
/** How Dfns will authenticate into your validator/ledger. You should have setup authentication already (see details [here](https://docs.dev.sync.global/validator_operator/validator_helm.html#helm-validator-auth)), you can reuse the same Application details. See examples in this endpoint payload examples above. */
|
|
241
241
|
oauth2: {
|
|
@@ -252,7 +252,7 @@ export type UpdateCantonValidatorBody = {
|
|
|
252
252
|
};
|
|
253
253
|
} | undefined;
|
|
254
254
|
ledger?: {
|
|
255
|
-
/** URL to reach the API at this address. The calls will be originating from our IP addresses (see [Dfns Environments](https://docs.dfns.co/api-reference/
|
|
255
|
+
/** URL to reach the API at this address. The calls will be originating from our IP addresses (see [Dfns Environments](https://docs.dfns.co/api-reference/regions)) */
|
|
256
256
|
url: string;
|
|
257
257
|
/** How Dfns will authenticate into your validator/ledger. You should have setup authentication already (see details [here](https://docs.dev.sync.global/validator_operator/validator_helm.html#helm-validator-auth)), you can reuse the same Application details. See examples in this endpoint payload examples above. */
|
|
258
258
|
oauth2: {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DfnsApiClientOptions } from '../../types/generic';
|
|
2
|
+
import * as T from './types';
|
|
3
|
+
export declare class PayinsClient {
|
|
4
|
+
private apiOptions;
|
|
5
|
+
constructor(apiOptions: DfnsApiClientOptions);
|
|
6
|
+
createPayinRecipient(request: T.CreatePayinRecipientRequest): Promise<T.CreatePayinRecipientResponse>;
|
|
7
|
+
getPayinRecipient(request?: T.GetPayinRecipientRequest): Promise<T.GetPayinRecipientResponse>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint @typescript-eslint/no-unused-vars: 0 */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.PayinsClient = void 0;
|
|
5
|
+
const fetch_1 = require("../../utils/fetch");
|
|
6
|
+
const userActionFetch_1 = require("../../utils/userActionFetch");
|
|
7
|
+
const url_1 = require("../../utils/url");
|
|
8
|
+
class PayinsClient {
|
|
9
|
+
constructor(apiOptions) {
|
|
10
|
+
this.apiOptions = apiOptions;
|
|
11
|
+
}
|
|
12
|
+
async createPayinRecipient(request) {
|
|
13
|
+
const path = (0, url_1.buildPathAndQuery)('/payins/recipients', {
|
|
14
|
+
path: request ?? {},
|
|
15
|
+
query: {},
|
|
16
|
+
});
|
|
17
|
+
const response = await (0, userActionFetch_1.userActionFetch)(path, {
|
|
18
|
+
method: 'POST',
|
|
19
|
+
body: request.body,
|
|
20
|
+
apiOptions: this.apiOptions,
|
|
21
|
+
});
|
|
22
|
+
return response.json();
|
|
23
|
+
}
|
|
24
|
+
async getPayinRecipient(request) {
|
|
25
|
+
const path = (0, url_1.buildPathAndQuery)('/payins/recipients', {
|
|
26
|
+
path: request ?? {},
|
|
27
|
+
query: request?.query ?? {},
|
|
28
|
+
});
|
|
29
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
30
|
+
method: 'GET',
|
|
31
|
+
apiOptions: this.apiOptions,
|
|
32
|
+
});
|
|
33
|
+
return response.json();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.PayinsClient = PayinsClient;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SignUserActionChallengeRequest, UserActionChallengeResponse } from '../../baseAuthApi';
|
|
2
|
+
import { DfnsDelegatedApiClientOptions } from '../../dfnsDelegatedApiClient';
|
|
3
|
+
import * as T from './types';
|
|
4
|
+
export declare class DelegatedPayinsClient {
|
|
5
|
+
private apiOptions;
|
|
6
|
+
constructor(apiOptions: DfnsDelegatedApiClientOptions);
|
|
7
|
+
createPayinRecipientInit(request: T.CreatePayinRecipientRequest): Promise<UserActionChallengeResponse>;
|
|
8
|
+
createPayinRecipientComplete(request: T.CreatePayinRecipientRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreatePayinRecipientResponse>;
|
|
9
|
+
getPayinRecipient(request?: T.GetPayinRecipientRequest): Promise<T.GetPayinRecipientResponse>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DelegatedPayinsClient = void 0;
|
|
4
|
+
const baseAuthApi_1 = require("../../baseAuthApi");
|
|
5
|
+
const fetch_1 = require("../../utils/fetch");
|
|
6
|
+
const url_1 = require("../../utils/url");
|
|
7
|
+
class DelegatedPayinsClient {
|
|
8
|
+
constructor(apiOptions) {
|
|
9
|
+
this.apiOptions = apiOptions;
|
|
10
|
+
}
|
|
11
|
+
async createPayinRecipientInit(request) {
|
|
12
|
+
const path = (0, url_1.buildPathAndQuery)('/payins/recipients', {
|
|
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 createPayinRecipientComplete(request, signedChallenge) {
|
|
25
|
+
const path = (0, url_1.buildPathAndQuery)('/payins/recipients', {
|
|
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 getPayinRecipient(request) {
|
|
39
|
+
const path = (0, url_1.buildPathAndQuery)('/payins/recipients', {
|
|
40
|
+
path: request ?? {},
|
|
41
|
+
query: request?.query ?? {},
|
|
42
|
+
});
|
|
43
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
44
|
+
method: 'GET',
|
|
45
|
+
apiOptions: this.apiOptions,
|
|
46
|
+
});
|
|
47
|
+
return response.json();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.DelegatedPayinsClient = DelegatedPayinsClient;
|
|
@@ -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);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type CreatePayinRecipientBody = {
|
|
2
|
+
provider: "CircleMint";
|
|
3
|
+
/** The wallet to register as a Circle Mint recipient. */
|
|
4
|
+
walletId: string;
|
|
5
|
+
/** Fiat currency of the payin (determines the delivered stablecoin, e.g. USD → USDC, EUR → EURC). */
|
|
6
|
+
currency: "USD" | "EUR";
|
|
7
|
+
};
|
|
8
|
+
export type CreatePayinRecipientResponse = {
|
|
9
|
+
/** Payin provider. */
|
|
10
|
+
provider: "CircleMint";
|
|
11
|
+
/** The wallet whose address is (to be) registered as a recipient. */
|
|
12
|
+
walletId: string;
|
|
13
|
+
/** Fiat currency of the payin (determines the delivered stablecoin, e.g. USD → USDC, EUR → EURC). */
|
|
14
|
+
currency: "USD" | "EUR";
|
|
15
|
+
/** Recipient status. */
|
|
16
|
+
status: "NotRegistered" | "PendingVerification" | "Active";
|
|
17
|
+
/** The provider's recipient-registry id, once registered. */
|
|
18
|
+
recipientAddressId?: string | undefined;
|
|
19
|
+
};
|
|
20
|
+
export type CreatePayinRecipientRequest = {
|
|
21
|
+
body: CreatePayinRecipientBody;
|
|
22
|
+
};
|
|
23
|
+
export type GetPayinRecipientQuery = {
|
|
24
|
+
/** The payin provider to check the recipient with. */
|
|
25
|
+
provider: "CircleMint";
|
|
26
|
+
/** The wallet whose recipient status to check. */
|
|
27
|
+
walletId: string;
|
|
28
|
+
/** Fiat currency of the payin (determines the delivered stablecoin, e.g. USD → USDC, EUR → EURC). */
|
|
29
|
+
currency: "USD" | "EUR";
|
|
30
|
+
};
|
|
31
|
+
export type GetPayinRecipientResponse = {
|
|
32
|
+
/** Payin provider. */
|
|
33
|
+
provider: "CircleMint";
|
|
34
|
+
/** The wallet whose address is (to be) registered as a recipient. */
|
|
35
|
+
walletId: string;
|
|
36
|
+
/** Fiat currency of the payin (determines the delivered stablecoin, e.g. USD → USDC, EUR → EURC). */
|
|
37
|
+
currency: "USD" | "EUR";
|
|
38
|
+
/** Recipient status. */
|
|
39
|
+
status: "NotRegistered" | "PendingVerification" | "Active";
|
|
40
|
+
/** The provider's recipient-registry id, once registered. */
|
|
41
|
+
recipientAddressId?: string | undefined;
|
|
42
|
+
};
|
|
43
|
+
export type GetPayinRecipientRequest = {
|
|
44
|
+
query?: GetPayinRecipientQuery;
|
|
45
|
+
};
|