@circle-fin/smart-contract-platform 9.6.0 → 10.0.0
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/package.json +1 -1
- package/dist/smart-contract-platform.cjs.js +0 -43
- package/dist/smart-contract-platform.es.js +0 -43
- package/dist/types/clients/configurations.d.ts +0 -1614
- package/dist/types/clients/core.d.ts +0 -357
- package/dist/types/clients/smart-contract-platform.d.ts +0 -2426
- package/dist/types/smart-contract-platform.d.ts +0 -601
|
@@ -1,601 +0,0 @@
|
|
|
1
|
-
import * as axios from 'axios';
|
|
2
|
-
import * as _shared_core from './clients/core';
|
|
3
|
-
import { APIParams as APIParams$1, ClientParams as ClientParams$1, FeeConfiguration, WithIdempotencyKey, Common, Pagination } from './clients/core';
|
|
4
|
-
export { APIParams as CoreAPIParams, ClientParams as CoreClientParams, FeeConfiguration, Pagination, Storage, TrimDataResponse, WithIdempotencyKey } from './clients/core';
|
|
5
|
-
import * as _shared_clients_smart_contract_platform from './clients/smart-contract-platform';
|
|
6
|
-
import { SmartContractPlatformClient, Blockchain, FeeLevel, ContractInputType, ContractStatus, AbiParametersInner } from './clients/smart-contract-platform';
|
|
7
|
-
export { AbiParametersInner, Blockchain, Contract, ContractDeployment, ContractDeploymentData, ContractDeploymentEstimateFeeRequest, ContractDeploymentEstimateRequest, ContractDeploymentRequest, ContractInputType, ContractResponse, ContractResponseData, ContractStatus, Contracts, ContractsData, CreateEventMonitorRequest, Event, EventLog, EventLogs, EventLogsData, EventMonitor, EventMonitorResponse, EventMonitorResponseData, EventMonitors, EventMonitorsData, FeeEstimation, FeeEstimationData, FeeLevel, Function, ImportContractRequest, ParamType, PatchContractRequest, ReadContractState, ReadContractStateData, ReadContractStateRequest, SmartContractPlatformClient, SolFile, TemplateContractDeployment, TemplateContractDeploymentData, TemplateContractDeploymentRequest, TemplatesApi, TransactionFee, UpdateEventMonitorRequest, VerificationStatus } from './clients/smart-contract-platform';
|
|
8
|
-
export { BadRequestResponse, CreateMonitoredTokensRequest, CreateSubscriptionRequest, DeleteMonitoredTokensRequest, EntityConfig, EntityConfigData, FaucetRequest, ModelError, MonitoredTokens, MonitoredTokensData, NotAuthorizedResponse, NotFoundResponse, NotificationSignaturePublicKey, NotificationSignaturePublicKeyData, NotificationType, Ping, PublicKey, PublicKeyData, Subscription, SubscriptionResponse, Subscriptions, TestnetBlockchain, Token, TokenMonitorScope, TokenStandard, UpdateMonitoredTokensRequest, UpdateMonitoredTokensScopeRequest, UpdateSubscriptionRequest } from './clients/configurations';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Type of the data that is stored.
|
|
12
|
-
*/
|
|
13
|
-
type StoredData = {
|
|
14
|
-
/**
|
|
15
|
-
* The publicKey that is associated to the entity.
|
|
16
|
-
*/
|
|
17
|
-
publicKey: string;
|
|
18
|
-
};
|
|
19
|
-
interface Config {
|
|
20
|
-
/**
|
|
21
|
-
* Your configured entity secret.
|
|
22
|
-
*/
|
|
23
|
-
entitySecret: string;
|
|
24
|
-
}
|
|
25
|
-
type APIParams = APIParams$1<SmartContractPlatformClient, StoredData> & Config;
|
|
26
|
-
type ClientParams = ClientParams$1<StoredData> & Config;
|
|
27
|
-
/**
|
|
28
|
-
* Represents the input parameters for deploying a contract.
|
|
29
|
-
*/
|
|
30
|
-
type DeployContractInput = {
|
|
31
|
-
/**
|
|
32
|
-
* The contract's name.
|
|
33
|
-
*/
|
|
34
|
-
name: string;
|
|
35
|
-
/**
|
|
36
|
-
* The description for the contract.
|
|
37
|
-
*/
|
|
38
|
-
description?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Unique identifier of the wallet that will deploy the contract.
|
|
41
|
-
*/
|
|
42
|
-
walletId: string;
|
|
43
|
-
/**
|
|
44
|
-
* The contract's ABI in a JSON stringified format.
|
|
45
|
-
*/
|
|
46
|
-
abiJson: string;
|
|
47
|
-
/**
|
|
48
|
-
* Bytecode of the contract being deployed.
|
|
49
|
-
*/
|
|
50
|
-
bytecode: string;
|
|
51
|
-
/**
|
|
52
|
-
* The blockchain on which the contract will be deployed.
|
|
53
|
-
*/
|
|
54
|
-
blockchain: Blockchain;
|
|
55
|
-
/**
|
|
56
|
-
* A list of arguments to pass to the contract's constructor function. Must be an empty array if there are no constructor parameters.
|
|
57
|
-
*/
|
|
58
|
-
constructorParameters?: any[];
|
|
59
|
-
/**
|
|
60
|
-
* Configuration that determines the fees that will be paid.
|
|
61
|
-
*/
|
|
62
|
-
fee: FeeConfiguration<FeeLevel>;
|
|
63
|
-
/**
|
|
64
|
-
* The reference ID for the operation, to ensure idempotency.
|
|
65
|
-
*/
|
|
66
|
-
refId?: string;
|
|
67
|
-
} & WithIdempotencyKey & Common;
|
|
68
|
-
/**
|
|
69
|
-
* Represents the input for deploying a contract.
|
|
70
|
-
*/
|
|
71
|
-
type EstimateDeploymentFeeInput = {
|
|
72
|
-
/**
|
|
73
|
-
* Blockchain is the blockchain to deploy onto.
|
|
74
|
-
*/
|
|
75
|
-
blockchain?: Blockchain;
|
|
76
|
-
/**
|
|
77
|
-
* Bytecode of the contract being deployed.
|
|
78
|
-
*/
|
|
79
|
-
bytecode: string;
|
|
80
|
-
/**
|
|
81
|
-
* The contract's ABI in a JSON stringified format.
|
|
82
|
-
*/
|
|
83
|
-
abiJson?: string;
|
|
84
|
-
/**
|
|
85
|
-
* Signature of the constructor if the contract has one. Constructor() by default.
|
|
86
|
-
*/
|
|
87
|
-
constructorSignature?: string;
|
|
88
|
-
/**
|
|
89
|
-
* A list of arguments to pass to the contract\'s constructor function. Must be an empty array if there are no constructor parameters.
|
|
90
|
-
*/
|
|
91
|
-
constructorParameters?: Array<any>;
|
|
92
|
-
/**
|
|
93
|
-
* The source address of the transaction.
|
|
94
|
-
*/
|
|
95
|
-
sourceAddress?: string;
|
|
96
|
-
/**
|
|
97
|
-
* Unique identifier of the wallet that will deploy the contract.
|
|
98
|
-
*/
|
|
99
|
-
walletId?: string;
|
|
100
|
-
} & Common;
|
|
101
|
-
/**
|
|
102
|
-
* Represents the input for fetching a contract.
|
|
103
|
-
*/
|
|
104
|
-
type GetContractInput = {
|
|
105
|
-
/**
|
|
106
|
-
* The contract's ID.
|
|
107
|
-
*/
|
|
108
|
-
id: string;
|
|
109
|
-
} & Common;
|
|
110
|
-
/**
|
|
111
|
-
* Represents the input for deploying a contract.
|
|
112
|
-
*/
|
|
113
|
-
type ImportContractInput = {
|
|
114
|
-
/**
|
|
115
|
-
* The contract's name.
|
|
116
|
-
*/
|
|
117
|
-
name: string;
|
|
118
|
-
/**
|
|
119
|
-
* The description for a contract.
|
|
120
|
-
*/
|
|
121
|
-
description?: string;
|
|
122
|
-
/**
|
|
123
|
-
* Address is the address of the contract to be imported.
|
|
124
|
-
*/
|
|
125
|
-
address: string;
|
|
126
|
-
/**
|
|
127
|
-
* Blockchain is the blockchain to deploy onto.
|
|
128
|
-
*/
|
|
129
|
-
blockchain: Blockchain;
|
|
130
|
-
} & WithIdempotencyKey & Common;
|
|
131
|
-
/**
|
|
132
|
-
* Represents the input for fetching all contracts.
|
|
133
|
-
*/
|
|
134
|
-
type ListContractsInput = {
|
|
135
|
-
/**
|
|
136
|
-
* Filter by blockchain.
|
|
137
|
-
*/
|
|
138
|
-
blockchain?: Blockchain;
|
|
139
|
-
/**
|
|
140
|
-
* Filter contracts by input type.
|
|
141
|
-
*/
|
|
142
|
-
contractInputType?: ContractInputType;
|
|
143
|
-
/**
|
|
144
|
-
* Filter contracts by deployer address.
|
|
145
|
-
*/
|
|
146
|
-
deployerAddress?: string;
|
|
147
|
-
/**
|
|
148
|
-
* Filter contracts by name.
|
|
149
|
-
*/
|
|
150
|
-
name?: string;
|
|
151
|
-
/**
|
|
152
|
-
* Filter contracts by status.
|
|
153
|
-
*/
|
|
154
|
-
status?: ContractStatus;
|
|
155
|
-
} & Pagination & Common;
|
|
156
|
-
/**
|
|
157
|
-
* Represents the input parameters for deploying a contract.
|
|
158
|
-
*/
|
|
159
|
-
type QueryContractInput = {
|
|
160
|
-
/**
|
|
161
|
-
* The contract ABI function signature or `callData` field is required for interacting with the smart contract. The ABI function signature cannot be used simultaneously with `callData`. e.g. Burn(uint256).
|
|
162
|
-
*/
|
|
163
|
-
abiFunctionSignature?: string;
|
|
164
|
-
/**
|
|
165
|
-
* The contract ABI function signature parameters for executing the contract interaction. Supported parameter types include string, integer, boolean, and array. These parameters should be used exclusively with the abiFunctionSignature and cannot be used with `callData`.
|
|
166
|
-
*/
|
|
167
|
-
abiParameters?: Array<AbiParametersInner>;
|
|
168
|
-
/**
|
|
169
|
-
* The contract's ABI in a JSON stringified format.
|
|
170
|
-
*/
|
|
171
|
-
abiJson?: string;
|
|
172
|
-
/**
|
|
173
|
-
* Address of the contract to be queried.
|
|
174
|
-
*/
|
|
175
|
-
address: string;
|
|
176
|
-
/**
|
|
177
|
-
* Blockchain of the contract to be queried.
|
|
178
|
-
*/
|
|
179
|
-
blockchain: Blockchain;
|
|
180
|
-
/**
|
|
181
|
-
* CallData is input data that encodes method and parameters.
|
|
182
|
-
*/
|
|
183
|
-
callData?: string;
|
|
184
|
-
/**
|
|
185
|
-
* FromAddress is the address that will populate msg.sender in the contract call.
|
|
186
|
-
*/
|
|
187
|
-
fromAddress?: string;
|
|
188
|
-
} & Common;
|
|
189
|
-
/**
|
|
190
|
-
* Represents the input for reading a contract.
|
|
191
|
-
*/
|
|
192
|
-
type ReadContractInput = {
|
|
193
|
-
/**
|
|
194
|
-
* The contract's ID.
|
|
195
|
-
*/
|
|
196
|
-
id: string;
|
|
197
|
-
/**
|
|
198
|
-
* The ABI function signature field is required for interacting with the smart contract.
|
|
199
|
-
* Example: Burn(uint256).
|
|
200
|
-
*/
|
|
201
|
-
abiFunctionSignature: string;
|
|
202
|
-
/**
|
|
203
|
-
* The ABI function signature parameters for executing the contract interaction. Supported parameter types include string, integer, boolean, and array.
|
|
204
|
-
*/
|
|
205
|
-
abiParameters?: Array<any>;
|
|
206
|
-
} & Common;
|
|
207
|
-
/**
|
|
208
|
-
* Represents the input for updating contract off-chain properties.
|
|
209
|
-
*/
|
|
210
|
-
type UpdateContractInput = {
|
|
211
|
-
/**
|
|
212
|
-
* The contract's ID.
|
|
213
|
-
*/
|
|
214
|
-
id: string;
|
|
215
|
-
/**
|
|
216
|
-
* The contract's name.
|
|
217
|
-
*/
|
|
218
|
-
name?: string;
|
|
219
|
-
/**
|
|
220
|
-
* The description for a contract.
|
|
221
|
-
*/
|
|
222
|
-
description?: string;
|
|
223
|
-
/**
|
|
224
|
-
* The archive state of the contract. If true, the contract will not be visible in your dashboard.
|
|
225
|
-
*/
|
|
226
|
-
archived?: boolean;
|
|
227
|
-
} & Common;
|
|
228
|
-
/**
|
|
229
|
-
* Represents the input parameters for deploying a contract using a template.
|
|
230
|
-
*/
|
|
231
|
-
type DeployContractTemplateInput = {
|
|
232
|
-
/**
|
|
233
|
-
* The template's ID.
|
|
234
|
-
*/
|
|
235
|
-
id: string;
|
|
236
|
-
/**
|
|
237
|
-
* The blockchain on which the contract will be deployed.
|
|
238
|
-
*/
|
|
239
|
-
blockchain: Blockchain;
|
|
240
|
-
/**
|
|
241
|
-
* The wallet's ID that will be used as the source for the contract deployment.
|
|
242
|
-
*/
|
|
243
|
-
walletId: string;
|
|
244
|
-
/**
|
|
245
|
-
* The contract's name.
|
|
246
|
-
*/
|
|
247
|
-
name: string;
|
|
248
|
-
/**
|
|
249
|
-
* The description for the contract.
|
|
250
|
-
*/
|
|
251
|
-
description?: string;
|
|
252
|
-
/**
|
|
253
|
-
* JSON object that contains the template deployment parameters used to initialize the contract(s) on-chain.
|
|
254
|
-
*/
|
|
255
|
-
templateParameters?: Record<string, string>;
|
|
256
|
-
/**
|
|
257
|
-
* Configuration that determines the fees that will be paid.
|
|
258
|
-
*/
|
|
259
|
-
fee: FeeConfiguration<FeeLevel>;
|
|
260
|
-
/**
|
|
261
|
-
* The reference ID for the operation, to ensure idempotency.
|
|
262
|
-
*/
|
|
263
|
-
refId?: string;
|
|
264
|
-
} & WithIdempotencyKey & Common;
|
|
265
|
-
/**
|
|
266
|
-
* Represents the input for deploying a contract using a template.
|
|
267
|
-
*/
|
|
268
|
-
type EstimateContractTemplateDeploymentFeeInput = {
|
|
269
|
-
/**
|
|
270
|
-
* The template's ID.
|
|
271
|
-
*/
|
|
272
|
-
id: string;
|
|
273
|
-
/**
|
|
274
|
-
* The blockchain on which the contract will be deployed.
|
|
275
|
-
*/
|
|
276
|
-
blockchain: Blockchain;
|
|
277
|
-
/**
|
|
278
|
-
* The source address of the transaction.
|
|
279
|
-
*/
|
|
280
|
-
sourceAddress?: string;
|
|
281
|
-
/**
|
|
282
|
-
* JSON object that contains the template deployment parameters used to initialize the contract(s) on-chain.
|
|
283
|
-
*/
|
|
284
|
-
templateParameters: Record<string, string>;
|
|
285
|
-
/**
|
|
286
|
-
* Unique identifier of the wallet that will deploy the contract.
|
|
287
|
-
*/
|
|
288
|
-
walletId?: string;
|
|
289
|
-
} & Common;
|
|
290
|
-
/**
|
|
291
|
-
* Represents the input for fetching event monitors.
|
|
292
|
-
*/
|
|
293
|
-
type ListEventMonitorsInput = {
|
|
294
|
-
contractAddress?: string;
|
|
295
|
-
blockchain?: Blockchain;
|
|
296
|
-
eventSignature?: string;
|
|
297
|
-
} & Pagination & Common;
|
|
298
|
-
/**
|
|
299
|
-
* Represents the input for creating an event monitor.
|
|
300
|
-
*/
|
|
301
|
-
type CreateEventMonitorInput = {
|
|
302
|
-
/**
|
|
303
|
-
* Create a new event monitor based on the provided blockchain.
|
|
304
|
-
*/
|
|
305
|
-
blockchain: Blockchain;
|
|
306
|
-
/**
|
|
307
|
-
* The on-chain address of this contract.
|
|
308
|
-
*/
|
|
309
|
-
contractAddress: string;
|
|
310
|
-
/**
|
|
311
|
-
* The specific event to which you want to subscribe. Please ensure no spaces are included.
|
|
312
|
-
*/
|
|
313
|
-
eventSignature: string;
|
|
314
|
-
} & WithIdempotencyKey & Common;
|
|
315
|
-
/**
|
|
316
|
-
* Represents the input for updating an event monitor.
|
|
317
|
-
*/
|
|
318
|
-
type UpdateEventMonitorInput = {
|
|
319
|
-
/**
|
|
320
|
-
* Event Monitor ID.
|
|
321
|
-
*/
|
|
322
|
-
id: string;
|
|
323
|
-
/**
|
|
324
|
-
* Indicates whether the event monitor should be active (true) or inactive (false).
|
|
325
|
-
*/
|
|
326
|
-
isEnabled: boolean;
|
|
327
|
-
} & Common;
|
|
328
|
-
/**
|
|
329
|
-
* Represents the input for deleting a event monitor.
|
|
330
|
-
*/
|
|
331
|
-
type DeleteEventMonitorsInput = {
|
|
332
|
-
/**
|
|
333
|
-
* Event Monitor ID.
|
|
334
|
-
*/
|
|
335
|
-
id: string;
|
|
336
|
-
} & Common;
|
|
337
|
-
/**
|
|
338
|
-
* Represents the input for listing all event logs.
|
|
339
|
-
*/
|
|
340
|
-
type ListEventLogsInput = {
|
|
341
|
-
contractAddress?: string;
|
|
342
|
-
blockchain?: Blockchain;
|
|
343
|
-
} & Pagination & Common;
|
|
344
|
-
|
|
345
|
-
declare const defaultBaseUrl = "https://api.circle.com";
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* A class-based client for Circle's Smart Contract Platform.
|
|
349
|
-
* All operations are available as class methods.
|
|
350
|
-
* @example
|
|
351
|
-
* ```
|
|
352
|
-
* import { CircleSmartContractPlatformClient } from '@circle-fin/smart-contract-platform'
|
|
353
|
-
*
|
|
354
|
-
* const client = new CircleSmartContractPlatformClient({
|
|
355
|
-
* apiKey: 'YOUR_KEY',
|
|
356
|
-
* entitySecret: 'YOUR_SECRET',
|
|
357
|
-
* })
|
|
358
|
-
*
|
|
359
|
-
* const response = await client.listContracts()
|
|
360
|
-
* console.log(response.data?.contracts)
|
|
361
|
-
* ```
|
|
362
|
-
*/
|
|
363
|
-
declare class CircleSmartContractPlatformClient {
|
|
364
|
-
private readonly params;
|
|
365
|
-
/**
|
|
366
|
-
* Creates an instance of CircleSmartContractPlatformClient.
|
|
367
|
-
* @param config - API key, entity secret, optional baseUrl.
|
|
368
|
-
*/
|
|
369
|
-
constructor(config: ClientParams);
|
|
370
|
-
/**
|
|
371
|
-
* Deploy a smart contract on a specified blockchain using the contract's ABI and bytecode. The deployment will originate from one of your Circle Programmable Wallets.
|
|
372
|
-
* @example
|
|
373
|
-
* ```
|
|
374
|
-
* const response = await client.deployContract({
|
|
375
|
-
* name: 'First Contract',
|
|
376
|
-
* description: 'My first hello world contract',
|
|
377
|
-
* blockchain: 'ETH-SEPOLIA',
|
|
378
|
-
* walletId: '004735f6-d9fc-44f8-933c-672cdf3d240d',
|
|
379
|
-
* abiJson: '[\n\t{\n\t\t\'inputs\': [],\n\t\t\'stateMutability\': \'nonpayable\',\n\t\t\'type\': \'constructor\'\n\t},\n\t...',
|
|
380
|
-
* bytecode: '0x60806040523480156200001157600080fd5b50604051806040...',
|
|
381
|
-
* constructorParameters: ['TICK',10000],
|
|
382
|
-
* fee: {
|
|
383
|
-
* type: 'level',
|
|
384
|
-
* config: {
|
|
385
|
-
* feeLevel: 'HIGH',
|
|
386
|
-
* },
|
|
387
|
-
* },
|
|
388
|
-
* })
|
|
389
|
-
* console.log(response.data)
|
|
390
|
-
* ```
|
|
391
|
-
* @category Contracts
|
|
392
|
-
*/
|
|
393
|
-
deployContract(input: DeployContractInput): Promise<_shared_core.TrimDataResponse<_shared_clients_smart_contract_platform.ContractDeployment>>;
|
|
394
|
-
/**
|
|
395
|
-
* Estimates the network fee for deploying a smart contract on a specified blockchain, given the contract bytecode.
|
|
396
|
-
* @example
|
|
397
|
-
* ```
|
|
398
|
-
* const response = await client.estimateContractDeploymentFee({
|
|
399
|
-
* sourceAddress: '0x1bf9ad0cc2ad298c69a2995aa806ee832788218c',
|
|
400
|
-
* blockchain: 'MATIC-AMOY',
|
|
401
|
-
* bytecode: '0x60806040523480156200001157600080fd5b50604051806040...',
|
|
402
|
-
* constructorSignature: 'constructor(string ticker, uint256 totalSupply)',
|
|
403
|
-
* constructorParameters: [ 'TICK', 10000],
|
|
404
|
-
* })
|
|
405
|
-
* console.log(response.data)
|
|
406
|
-
* ```
|
|
407
|
-
* @category Contracts
|
|
408
|
-
*/
|
|
409
|
-
estimateContractDeploymentFee(input: EstimateDeploymentFeeInput): Promise<_shared_core.TrimDataResponse<_shared_clients_smart_contract_platform.FeeEstimation>>;
|
|
410
|
-
/**
|
|
411
|
-
* Add an existing smart contract to your library of contracts. It also can be done in the Web3 Services Console.
|
|
412
|
-
* @example
|
|
413
|
-
* ```
|
|
414
|
-
* const response = await client.importContract({
|
|
415
|
-
* name: 'testContract',
|
|
416
|
-
* description: 'testDescription',
|
|
417
|
-
* address: '0xa51c9c604b79a0fadbfed35dd576ca1bce71da0a',
|
|
418
|
-
* blockchain: 'ETH-SEPOLIA',
|
|
419
|
-
* })
|
|
420
|
-
* console.log(response.data)
|
|
421
|
-
* ```
|
|
422
|
-
* @category Contracts
|
|
423
|
-
*/
|
|
424
|
-
importContract(input: ImportContractInput): Promise<_shared_core.TrimDataResponse<_shared_clients_smart_contract_platform.ContractResponse>>;
|
|
425
|
-
/**
|
|
426
|
-
* Retrieves a single contract that you've imported or deployed. You need to provide the contract's ID instead of the on-chain address.
|
|
427
|
-
* @example
|
|
428
|
-
* ```
|
|
429
|
-
* const response = await client.getContract({
|
|
430
|
-
* id: '39c7146d-d240-45c3-9402-8d817a633b17',
|
|
431
|
-
* })
|
|
432
|
-
* console.log(response.data)
|
|
433
|
-
* ```
|
|
434
|
-
* @category Contracts
|
|
435
|
-
*/
|
|
436
|
-
getContract(input: GetContractInput): Promise<_shared_core.TrimDataResponse<_shared_clients_smart_contract_platform.ContractResponse>>;
|
|
437
|
-
/**
|
|
438
|
-
* Fetch a list of contracts that you've imported and/or deployed.
|
|
439
|
-
* @example
|
|
440
|
-
* ```
|
|
441
|
-
* const response = await client.listContracts({
|
|
442
|
-
* blockchain: 'MATIC-AMOY',
|
|
443
|
-
* status: 'COMPLETE',
|
|
444
|
-
* contractInputType: 'IMPORT',
|
|
445
|
-
* })
|
|
446
|
-
* console.log(response.data)
|
|
447
|
-
* ```
|
|
448
|
-
* @category Contracts
|
|
449
|
-
*/
|
|
450
|
-
listContracts(input?: ListContractsInput): Promise<_shared_core.TrimDataResponse<_shared_clients_smart_contract_platform.Contracts>>;
|
|
451
|
-
/**
|
|
452
|
-
* Update the off-chain properties, such as description, of a contract that you've imported or deployed.
|
|
453
|
-
*
|
|
454
|
-
* This method uses the contract's ID instead of the on-chain address.
|
|
455
|
-
* @example
|
|
456
|
-
* ```
|
|
457
|
-
* const response = await client.updateContract({
|
|
458
|
-
* id: 'c4d1da72-111e-4d52-bdbf-2e74a2d803d5',
|
|
459
|
-
* archived: true,
|
|
460
|
-
* })
|
|
461
|
-
* console.log(response.data)
|
|
462
|
-
* ```
|
|
463
|
-
* @category Contracts
|
|
464
|
-
*/
|
|
465
|
-
updateContract(input: UpdateContractInput): Promise<_shared_core.TrimDataResponse<_shared_clients_smart_contract_platform.ContractResponse>>;
|
|
466
|
-
/**
|
|
467
|
-
* Query the state of a contract by providing the address and blockchain.
|
|
468
|
-
* @example
|
|
469
|
-
* ```
|
|
470
|
-
* const response = await client.queryContract({
|
|
471
|
-
* blockchain: "MATIC-AMOY",
|
|
472
|
-
* address: "0xfea0e6a371a0eb204dbfae2ee38eeedeebe15ed7",
|
|
473
|
-
* callData: "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
474
|
-
* })
|
|
475
|
-
* console.log(response.data)
|
|
476
|
-
* ```
|
|
477
|
-
* @category Contracts
|
|
478
|
-
*/
|
|
479
|
-
queryContract(input: QueryContractInput): Promise<_shared_core.TrimDataResponse<_shared_clients_smart_contract_platform.ReadContractState>>;
|
|
480
|
-
/**
|
|
481
|
-
* Deploy a smart contract using a template.
|
|
482
|
-
* @example
|
|
483
|
-
* ```
|
|
484
|
-
* const response = await client.deployContractTemplate({
|
|
485
|
-
* id: 'cf930871-bc29-43f0-9abb-0af6e66bd8db',
|
|
486
|
-
* blockchain: 'MATIC-AMOY',
|
|
487
|
-
* templateParameters: {},
|
|
488
|
-
* walletId: '3962046c-4bd3-43ca-bb84-0c8f7dbfa798',
|
|
489
|
-
* fee: {
|
|
490
|
-
* type: 'level',
|
|
491
|
-
* config: {
|
|
492
|
-
* feeLevel: 'HIGH',
|
|
493
|
-
* },
|
|
494
|
-
* },
|
|
495
|
-
* name: 'Contract name',
|
|
496
|
-
* })
|
|
497
|
-
* console.log(response.data)
|
|
498
|
-
* ```
|
|
499
|
-
* @category Contract Templates
|
|
500
|
-
*/
|
|
501
|
-
deployContractTemplate(input: DeployContractTemplateInput): Promise<_shared_core.TrimDataResponse<_shared_clients_smart_contract_platform.TemplateContractDeployment>>;
|
|
502
|
-
/**
|
|
503
|
-
* Estimate the fee required to deploy contract by template.
|
|
504
|
-
* @example
|
|
505
|
-
* ```
|
|
506
|
-
* const response = await client.estimateContractTemplateDeploymentFee({
|
|
507
|
-
* id: "cf930871-bc29-43f0-9abb-0af6e66bd8db",
|
|
508
|
-
* blockchain: "MATIC-AMOY",
|
|
509
|
-
* sourceAddress: "0xfea0e6a371a0eb204dbfae2ee38eeedeebe15ed7",
|
|
510
|
-
* templateParameters: {},
|
|
511
|
-
* })
|
|
512
|
-
* console.log(response.data)
|
|
513
|
-
* ```
|
|
514
|
-
* @category Contract Templates
|
|
515
|
-
*/
|
|
516
|
-
estimateContractTemplateDeploymentFee(input: EstimateContractTemplateDeploymentFeeInput): Promise<_shared_core.TrimDataResponse<_shared_clients_smart_contract_platform.FeeEstimation>>;
|
|
517
|
-
/**
|
|
518
|
-
* Create a new event monitor based on the provided blockchain, contract address, and event signature.
|
|
519
|
-
* @example
|
|
520
|
-
* ```
|
|
521
|
-
* const response = await client.createEventMonitor({
|
|
522
|
-
* blockchain: 'ETH',
|
|
523
|
-
* contractAddress: '0x71C7656EC7ab88b098defB751B7401B5f6d8976F',
|
|
524
|
-
* eventSignature: 'Transfer(address,address,uint256)',
|
|
525
|
-
* })
|
|
526
|
-
* console.log(response.data)
|
|
527
|
-
* ```
|
|
528
|
-
* @category Event Monitors
|
|
529
|
-
*/
|
|
530
|
-
createEventMonitor(input: CreateEventMonitorInput): Promise<_shared_core.TrimDataResponse<_shared_clients_smart_contract_platform.EventMonitorResponse>>;
|
|
531
|
-
/**
|
|
532
|
-
* Fetch a list of event monitors, optionally filtered by blockchain, contract address, and event signature.
|
|
533
|
-
* @example
|
|
534
|
-
* ```
|
|
535
|
-
* const response = await client.listEventMonitors()
|
|
536
|
-
* console.log(response.data)
|
|
537
|
-
* ```
|
|
538
|
-
* @category Event Monitors
|
|
539
|
-
*/
|
|
540
|
-
listEventMonitors(input: ListEventMonitorsInput): Promise<_shared_core.TrimDataResponse<_shared_clients_smart_contract_platform.EventMonitors>>;
|
|
541
|
-
/**
|
|
542
|
-
* Update an existing event monitor given its ID.
|
|
543
|
-
* @example
|
|
544
|
-
* ```
|
|
545
|
-
* const response = await client.updateEventMonitor({
|
|
546
|
-
* id: 'c4d1da72-111e-4d52-bdbf-2e74a2d803d5',
|
|
547
|
-
* isEnabled: true,
|
|
548
|
-
* })
|
|
549
|
-
* console.log(response.data)
|
|
550
|
-
* ```
|
|
551
|
-
* @category Event Monitors
|
|
552
|
-
*/
|
|
553
|
-
updateEventMonitor(input: UpdateEventMonitorInput): Promise<_shared_core.TrimDataResponse<_shared_clients_smart_contract_platform.EventMonitorResponse>>;
|
|
554
|
-
/**
|
|
555
|
-
* Delete an existing event monitor given its ID.
|
|
556
|
-
* @example
|
|
557
|
-
* ```
|
|
558
|
-
* const response = await client.deleteEventMonitor({
|
|
559
|
-
* id: 'c4d1da72-111e-4d52-bdbf-2e74a2d803d5',
|
|
560
|
-
* })
|
|
561
|
-
* console.log(response.data)
|
|
562
|
-
* ```
|
|
563
|
-
* @category Event Monitors
|
|
564
|
-
*/
|
|
565
|
-
deleteEventMonitor(input: DeleteEventMonitorsInput): Promise<axios.AxiosResponse<void, any, {}>>;
|
|
566
|
-
/**
|
|
567
|
-
* Fetch all event logs, optionally filtered by blockchain and contract address.
|
|
568
|
-
* @example
|
|
569
|
-
* ```
|
|
570
|
-
* const response = await client.listEventLogs()
|
|
571
|
-
* console.log(response.data)
|
|
572
|
-
* ```
|
|
573
|
-
* @category Event Monitors
|
|
574
|
-
*/
|
|
575
|
-
listEventLogs(input: ListEventLogsInput): Promise<_shared_core.TrimDataResponse<_shared_clients_smart_contract_platform.EventLogs>>;
|
|
576
|
-
}
|
|
577
|
-
/**
|
|
578
|
-
* Initiates a client for Circle's Smart Contract Platform.
|
|
579
|
-
* @example
|
|
580
|
-
* ```
|
|
581
|
-
* import { initiateSmartContractPlatformClient } from '@circle-fin/smart-contract-platform'
|
|
582
|
-
*
|
|
583
|
-
* const client = initiateSmartContractPlatformClient({
|
|
584
|
-
* apiKey: 'YOUR_KEY',
|
|
585
|
-
* entitySecret: 'YOUR_SECRET',
|
|
586
|
-
* })
|
|
587
|
-
*
|
|
588
|
-
* const response = await client.listContracts({
|
|
589
|
-
* blockchain: 'MATIC-AMOY',
|
|
590
|
-
* status: 'COMPLETE',
|
|
591
|
-
* contractInputType: 'IMPORT',
|
|
592
|
-
* })
|
|
593
|
-
* console.log(response.data?.contracts)
|
|
594
|
-
* ```
|
|
595
|
-
* @param config - The client parameters.
|
|
596
|
-
* @returns - The client object with various methods.
|
|
597
|
-
* @category Initialization
|
|
598
|
-
*/
|
|
599
|
-
declare function initiateSmartContractPlatformClient(config: ClientParams): CircleSmartContractPlatformClient;
|
|
600
|
-
|
|
601
|
-
export { type APIParams, CircleSmartContractPlatformClient, type ClientParams, type Config, type CreateEventMonitorInput, type DeleteEventMonitorsInput, type DeployContractInput, type DeployContractTemplateInput, type EstimateContractTemplateDeploymentFeeInput, type EstimateDeploymentFeeInput, type GetContractInput, type ImportContractInput, type ListContractsInput, type ListEventLogsInput, type ListEventMonitorsInput, type QueryContractInput, type ReadContractInput, type StoredData, type UpdateContractInput, type UpdateEventMonitorInput, defaultBaseUrl, initiateSmartContractPlatformClient };
|