@dfns/sdk 0.8.6 → 0.8.7
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/client.d.ts +1 -1
- package/generated/networks/client.js +12 -12
- package/generated/networks/delegatedClient.d.ts +1 -1
- package/generated/networks/delegatedClient.js +12 -12
- package/generated/networks/types.d.ts +30 -16
- package/generated/policies/types.d.ts +492 -0
- package/generated/wallets/types.d.ts +276 -0
- package/package.json +1 -1
|
@@ -3,11 +3,11 @@ import * as T from './types';
|
|
|
3
3
|
export declare class NetworksClient {
|
|
4
4
|
private apiOptions;
|
|
5
5
|
constructor(apiOptions: DfnsApiClientOptions);
|
|
6
|
+
callFunction(request: T.CallFunctionRequest): Promise<T.CallFunctionResponse>;
|
|
6
7
|
createCantonValidator(request: T.CreateCantonValidatorRequest): Promise<T.CreateCantonValidatorResponse>;
|
|
7
8
|
deleteCantonValidator(request: T.DeleteCantonValidatorRequest): Promise<T.DeleteCantonValidatorResponse>;
|
|
8
9
|
getCantonValidator(request: T.GetCantonValidatorRequest): Promise<T.GetCantonValidatorResponse>;
|
|
9
10
|
getFees(request?: T.GetFeesRequest): Promise<T.GetFeesResponse>;
|
|
10
11
|
listCantonValidators(request: T.ListCantonValidatorsRequest): Promise<T.ListCantonValidatorsResponse>;
|
|
11
|
-
readContract(request: T.ReadContractRequest): Promise<T.ReadContractResponse>;
|
|
12
12
|
updateCantonValidator(request: T.UpdateCantonValidatorRequest): Promise<T.UpdateCantonValidatorResponse>;
|
|
13
13
|
}
|
|
@@ -9,6 +9,18 @@ class NetworksClient {
|
|
|
9
9
|
constructor(apiOptions) {
|
|
10
10
|
this.apiOptions = apiOptions;
|
|
11
11
|
}
|
|
12
|
+
async callFunction(request) {
|
|
13
|
+
const path = (0, url_1.buildPathAndQuery)('/networks/:network/call-function', {
|
|
14
|
+
path: request ?? {},
|
|
15
|
+
query: {},
|
|
16
|
+
});
|
|
17
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
18
|
+
method: 'POST',
|
|
19
|
+
body: request.body,
|
|
20
|
+
apiOptions: this.apiOptions,
|
|
21
|
+
});
|
|
22
|
+
return response.json();
|
|
23
|
+
}
|
|
12
24
|
async createCantonValidator(request) {
|
|
13
25
|
const path = (0, url_1.buildPathAndQuery)('/networks/:network/validators', {
|
|
14
26
|
path: request ?? {},
|
|
@@ -66,18 +78,6 @@ class NetworksClient {
|
|
|
66
78
|
});
|
|
67
79
|
return response.json();
|
|
68
80
|
}
|
|
69
|
-
async readContract(request) {
|
|
70
|
-
const path = (0, url_1.buildPathAndQuery)('/networks/read-contract', {
|
|
71
|
-
path: request ?? {},
|
|
72
|
-
query: {},
|
|
73
|
-
});
|
|
74
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
75
|
-
method: 'POST',
|
|
76
|
-
body: request.body,
|
|
77
|
-
apiOptions: this.apiOptions,
|
|
78
|
-
});
|
|
79
|
-
return response.json();
|
|
80
|
-
}
|
|
81
81
|
async updateCantonValidator(request) {
|
|
82
82
|
const path = (0, url_1.buildPathAndQuery)('/networks/:network/validators/:validatorId', {
|
|
83
83
|
path: request ?? {},
|
|
@@ -4,6 +4,7 @@ import * as T from './types';
|
|
|
4
4
|
export declare class DelegatedNetworksClient {
|
|
5
5
|
private apiOptions;
|
|
6
6
|
constructor(apiOptions: DfnsDelegatedApiClientOptions);
|
|
7
|
+
callFunction(request: T.CallFunctionRequest): Promise<T.CallFunctionResponse>;
|
|
7
8
|
createCantonValidatorInit(request: T.CreateCantonValidatorRequest): Promise<UserActionChallengeResponse>;
|
|
8
9
|
createCantonValidatorComplete(request: T.CreateCantonValidatorRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreateCantonValidatorResponse>;
|
|
9
10
|
deleteCantonValidatorInit(request: T.DeleteCantonValidatorRequest): Promise<UserActionChallengeResponse>;
|
|
@@ -11,7 +12,6 @@ export declare class DelegatedNetworksClient {
|
|
|
11
12
|
getCantonValidator(request: T.GetCantonValidatorRequest): Promise<T.GetCantonValidatorResponse>;
|
|
12
13
|
getFees(request?: T.GetFeesRequest): Promise<T.GetFeesResponse>;
|
|
13
14
|
listCantonValidators(request: T.ListCantonValidatorsRequest): Promise<T.ListCantonValidatorsResponse>;
|
|
14
|
-
readContract(request: T.ReadContractRequest): Promise<T.ReadContractResponse>;
|
|
15
15
|
updateCantonValidatorInit(request: T.UpdateCantonValidatorRequest): Promise<UserActionChallengeResponse>;
|
|
16
16
|
updateCantonValidatorComplete(request: T.UpdateCantonValidatorRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.UpdateCantonValidatorResponse>;
|
|
17
17
|
}
|
|
@@ -8,6 +8,18 @@ class DelegatedNetworksClient {
|
|
|
8
8
|
constructor(apiOptions) {
|
|
9
9
|
this.apiOptions = apiOptions;
|
|
10
10
|
}
|
|
11
|
+
async callFunction(request) {
|
|
12
|
+
const path = (0, url_1.buildPathAndQuery)('/networks/:network/call-function', {
|
|
13
|
+
path: request ?? {},
|
|
14
|
+
query: {},
|
|
15
|
+
});
|
|
16
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
17
|
+
method: 'POST',
|
|
18
|
+
body: request.body,
|
|
19
|
+
apiOptions: this.apiOptions,
|
|
20
|
+
});
|
|
21
|
+
return response.json();
|
|
22
|
+
}
|
|
11
23
|
async createCantonValidatorInit(request) {
|
|
12
24
|
const path = (0, url_1.buildPathAndQuery)('/networks/:network/validators', {
|
|
13
25
|
path: request ?? {},
|
|
@@ -95,18 +107,6 @@ class DelegatedNetworksClient {
|
|
|
95
107
|
});
|
|
96
108
|
return response.json();
|
|
97
109
|
}
|
|
98
|
-
async readContract(request) {
|
|
99
|
-
const path = (0, url_1.buildPathAndQuery)('/networks/read-contract', {
|
|
100
|
-
path: request ?? {},
|
|
101
|
-
query: {},
|
|
102
|
-
});
|
|
103
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
104
|
-
method: 'POST',
|
|
105
|
-
body: request.body,
|
|
106
|
-
apiOptions: this.apiOptions,
|
|
107
|
-
});
|
|
108
|
-
return response.json();
|
|
109
|
-
}
|
|
110
110
|
async updateCantonValidatorInit(request) {
|
|
111
111
|
const path = (0, url_1.buildPathAndQuery)('/networks/:network/validators/:validatorId', {
|
|
112
112
|
path: request ?? {},
|
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
export type CallFunctionBody = {
|
|
2
|
+
/** Address of the contract to call */
|
|
3
|
+
contract: string;
|
|
4
|
+
/** ABI of the read-only function to invoke */
|
|
5
|
+
abi: {
|
|
6
|
+
type: string;
|
|
7
|
+
name: string;
|
|
8
|
+
stateMutability: string;
|
|
9
|
+
inputs: {
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
components?: CallFunctionBody | undefined;
|
|
13
|
+
}[];
|
|
14
|
+
outputs: {
|
|
15
|
+
name: string;
|
|
16
|
+
type: string;
|
|
17
|
+
components?: CallFunctionBody | undefined;
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
/** Function call arguments */
|
|
21
|
+
calldata?: {} | undefined;
|
|
22
|
+
};
|
|
23
|
+
export type CallFunctionParams = {
|
|
24
|
+
/** Network name formatted in kebab case */
|
|
25
|
+
network: string;
|
|
26
|
+
};
|
|
27
|
+
export type CallFunctionResponse = any;
|
|
28
|
+
export type CallFunctionRequest = CallFunctionParams & {
|
|
29
|
+
body: CallFunctionBody;
|
|
30
|
+
};
|
|
1
31
|
export type CreateCantonValidatorBody = {
|
|
2
32
|
/** Nickname for this validator. */
|
|
3
33
|
name?: string | undefined;
|
|
@@ -156,22 +186,6 @@ export type ListCantonValidatorsResponse = {
|
|
|
156
186
|
export type ListCantonValidatorsRequest = ListCantonValidatorsParams & {
|
|
157
187
|
query?: ListCantonValidatorsQuery;
|
|
158
188
|
};
|
|
159
|
-
export type ReadContractBody = {
|
|
160
|
-
kind: "Evm";
|
|
161
|
-
/** Network used for the wallet. */
|
|
162
|
-
network: "Adi" | "AdiTestnet" | "AdiTestnetAb" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "ArcTestnet" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Bob" | "BobSepolia" | "Bsc" | "BscTestnet" | "Berachain" | "BerachainBArtio" | "BerachainBepolia" | "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" | "Sonic" | "SonicTestnet" | "TempoAndantino" | "Tsc" | "TscTestnet1";
|
|
163
|
-
/** Address of the contract to call */
|
|
164
|
-
contract: string;
|
|
165
|
-
/** Encoded hex string indicating which function in the smart contract to call with which parameters. For more information, see the [encodeFunctionData ethersJS documentation](https://docs.ethers.org/v6/api/abi/#Interface-encodeFunctionData) */
|
|
166
|
-
data: string;
|
|
167
|
-
};
|
|
168
|
-
export type ReadContractResponse = {
|
|
169
|
-
kind: "Evm";
|
|
170
|
-
data: string;
|
|
171
|
-
};
|
|
172
|
-
export type ReadContractRequest = {
|
|
173
|
-
body: ReadContractBody;
|
|
174
|
-
};
|
|
175
189
|
export type UpdateCantonValidatorBody = {
|
|
176
190
|
/** Nickname for this validator. */
|
|
177
191
|
name?: string | undefined;
|