@clarigen/test 0.3.6 → 1.0.0-next.3

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/dist/index.d.ts CHANGED
@@ -1,28 +1,31 @@
1
1
  import { NativeClarityBinProvider } from '@clarigen/native-bin';
2
- import { ClarityAbiFunction } from '@stacks/transactions';
3
- import { Transaction, Contract, ContractInstances, Contracts, BaseProvider } from '@clarigen/core';
4
- import { Allocation, ClarinetAccounts } from './utils';
5
- export { Allocation, createClarityBin, tx, txOk, txErr, getBlockHeight, mineBlocks, getStxBalance, executeJson, evalJson, } from './utils';
6
- interface CreateOptions {
7
- allocations?: Allocation[];
8
- contractIdentifier: string;
9
- contractFilePath: string;
10
- clarityBin: NativeClarityBinProvider;
2
+ import { ContractInstances, Contracts, ContractCall, ContractCalls, ClarityTypes } from '@clarigen/core';
3
+ import { ClarinetAccounts } from './utils';
4
+ import { PublicResultErr, PublicResultOk, ReadOnlyResult } from './utils/pure';
5
+ export type { PublicResultErr, PublicResultOk, ReadOnlyResult } from './utils/pure';
6
+ export { Allocation, createClarityBin, getBlockHeight, mineBlocks, getStxBalance, executeJson, evalJson, makeRandomAddress, } from './utils';
7
+ interface FromContractsOptions {
8
+ accounts?: ClarinetAccounts;
9
+ clarityBin?: NativeClarityBinProvider;
11
10
  }
12
- interface FromContractOptions<T> {
13
- contract: Contract<T>;
14
- clarityBin: NativeClarityBinProvider;
11
+ interface FromContracts<T extends Contracts<any>> {
12
+ deployed: ContractInstances<T>;
13
+ provider: TestProvider;
15
14
  }
16
- export declare class TestProvider implements BaseProvider {
15
+ export declare class TestProvider {
17
16
  clarityBin: NativeClarityBinProvider;
18
- contractIdentifier: string;
19
- contractFile: string;
20
- constructor(clarityBin: NativeClarityBinProvider, contractIdentifier: string, contractFile: string);
21
- static create({ clarityBin, contractFilePath, contractIdentifier }: CreateOptions): Promise<TestProvider>;
22
- static fromContract<T>({ contract, clarityBin }: FromContractOptions<T>): Promise<T>;
23
- static fromContracts<T extends Contracts<M>, M>(contracts: T, clarityBin?: NativeClarityBinProvider): Promise<ContractInstances<T, M>>;
24
- static fromContracts<T extends Contracts<M>, M>(contracts: T, accounts?: ClarinetAccounts): Promise<ContractInstances<T, M>>;
25
- callReadOnly(func: ClarityAbiFunction, args: any[]): Promise<any>;
26
- callPublic(func: ClarityAbiFunction, args: any[]): Transaction<any, any>;
27
- formatArguments(func: ClarityAbiFunction, args: any[]): string[];
17
+ constructor(clarityBin: NativeClarityBinProvider);
18
+ static fromContracts<T extends Contracts<any>>(contracts: T, options?: FromContractsOptions): Promise<FromContracts<T>>;
19
+ ro<T>(tx: ContractCall<T>): Promise<ReadOnlyResult<T>>;
20
+ rov<T>(tx: ContractCall<T>): Promise<T>;
21
+ roOk<Ok, Err>(tx: ContractCall<ClarityTypes.Response<Ok, Err>>): Promise<ReadOnlyResult<Ok>>;
22
+ roErr<Ok, Err>(tx: ContractCall<ClarityTypes.Response<Ok, Err>>): Promise<ReadOnlyResult<Err>>;
23
+ rovOk<Ok, Err>(tx: ContractCall<ClarityTypes.Response<Ok, Err>>): Promise<Ok>;
24
+ rovErr<Ok, Err>(tx: ContractCall<ClarityTypes.Response<Ok, Err>>): Promise<Err>;
25
+ tx<Ok, Err>(tx: ContractCalls.Public<Ok, Err>, senderAddress: string): Promise<import("./utils/pure").PublicResult<Ok, Err>>;
26
+ txOk<Ok, Err>(tx: ContractCalls.Public<Ok, Err>, senderAddress: string): Promise<PublicResultOk<Ok>>;
27
+ txErr<Ok, Err>(tx: ContractCalls.Public<Ok, Err>, senderAddress: string): Promise<PublicResultErr<Err>>;
28
+ evalCode<T>(code: string, contractAddress?: string): Promise<ReadOnlyResult<T>>;
29
+ eval<T>(code: string, contractAddress?: string): Promise<T>;
30
+ mapGet<T extends ContractCalls.Map<any, Val>, Val>(map: T): Promise<Val | null>;
28
31
  }