@clarigen/core 1.0.0-next.9 → 1.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/dist/index.d.ts +552 -14
- package/dist/index.js +1 -8
- package/dist/index.mjs +1 -0
- package/package.json +17 -17
- package/dist/api.d.ts +0 -16
- package/dist/base-provider.d.ts +0 -6
- package/dist/clarity-types.d.ts +0 -34
- package/dist/contracts.d.ts +0 -6
- package/dist/core.cjs.development.js +0 -1457
- package/dist/core.cjs.development.js.map +0 -1
- package/dist/core.cjs.production.min.js +0 -2
- package/dist/core.cjs.production.min.js.map +0 -1
- package/dist/core.esm.js +0 -1433
- package/dist/core.esm.js.map +0 -1
- package/dist/events.d.ts +0 -140
- package/dist/pure/index.d.ts +0 -36
- package/dist/transaction.d.ts +0 -69
- package/dist/types.d.ts +0 -19
- package/dist/utils.d.ts +0 -9
package/package.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.0
|
|
2
|
+
"version": "1.0.0",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
4
|
+
"types": "./dist/index.d.ts",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"import": "./dist/index.mjs",
|
|
6
8
|
"files": [
|
|
7
9
|
"dist"
|
|
8
10
|
],
|
|
9
11
|
"engines": {
|
|
10
12
|
"node": ">=10"
|
|
11
13
|
},
|
|
12
|
-
"scripts": {
|
|
13
|
-
"start": "tsdx watch",
|
|
14
|
-
"dev": "tsdx watch",
|
|
15
|
-
"build": "tsdx build",
|
|
16
|
-
"test": "jest",
|
|
17
|
-
"lint": "tsdx lint",
|
|
18
|
-
"prepublishOnly": "yarn build",
|
|
19
|
-
"typecheck": "tsc --noEmit"
|
|
20
|
-
},
|
|
21
14
|
"prettier": "@stacks/prettier-config",
|
|
22
15
|
"name": "@clarigen/core",
|
|
23
16
|
"author": "Hank Stoever",
|
|
24
|
-
"module": "dist/core.esm.js",
|
|
25
17
|
"dependencies": {
|
|
26
|
-
"micro-stacks": "^
|
|
27
|
-
"neverthrow": "4.2.1"
|
|
18
|
+
"micro-stacks": "^1.1.4"
|
|
28
19
|
},
|
|
29
20
|
"publishConfig": {
|
|
30
21
|
"access": "public"
|
|
31
22
|
},
|
|
32
|
-
"
|
|
33
|
-
|
|
23
|
+
"scripts": {
|
|
24
|
+
"start": "tsup --watch",
|
|
25
|
+
"dev": "tsup --watch",
|
|
26
|
+
"build": "shx rm -rf ./dist && tsup",
|
|
27
|
+
"test": "jest",
|
|
28
|
+
"lint": "eslint \"src/**/*.{ts,tsx}\" && prettier --check src/**/*.ts",
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
30
|
+
"publish:dev": "pnpm build && yalc publish --push",
|
|
31
|
+
"copy-types": "node copy-types.js"
|
|
32
|
+
}
|
|
33
|
+
}
|
package/dist/api.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { StacksNetwork } from 'micro-stacks/network';
|
|
2
|
-
import { StacksTransaction } from 'micro-stacks/transactions';
|
|
3
|
-
import { ClarityTypes } from './clarity-types';
|
|
4
|
-
import { ContractCall, ContractCalls } from './pure';
|
|
5
|
-
interface ApiOptions {
|
|
6
|
-
network: StacksNetwork;
|
|
7
|
-
}
|
|
8
|
-
export declare function ro<T>(tx: ContractCall<T>, options: ApiOptions): Promise<T>;
|
|
9
|
-
export declare function roOk<Ok>(tx: ContractCall<ClarityTypes.Response<Ok, any>>, options: ApiOptions): Promise<Ok>;
|
|
10
|
-
export declare function roErr<Err>(tx: ContractCall<ClarityTypes.Response<any, Err>>, options: ApiOptions): Promise<Err>;
|
|
11
|
-
export declare function fetchMapGet<T extends ContractCalls.Map<any, Val>, Val>(map: T, options: ApiOptions): Promise<Val | null>;
|
|
12
|
-
export declare function broadcast(transaction: StacksTransaction, options: ApiOptions): Promise<{
|
|
13
|
-
txId: string;
|
|
14
|
-
stacksTransaction: StacksTransaction;
|
|
15
|
-
}>;
|
|
16
|
-
export {};
|
package/dist/base-provider.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ClarityAbiFunction } from 'micro-stacks/clarity';
|
|
2
|
-
import { Transaction } from './transaction';
|
|
3
|
-
export declare abstract class BaseProvider {
|
|
4
|
-
callReadOnly(func: ClarityAbiFunction, args: any[]): Promise<void>;
|
|
5
|
-
callPublic(func: ClarityAbiFunction, args: any[]): Transaction<any, any>;
|
|
6
|
-
}
|
package/dist/clarity-types.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ClarityAbi as _ClarityAbi, ClarityAbiType, ClarityValue, ClarityAbiFunction } from 'micro-stacks/clarity';
|
|
2
|
-
import { Result } from 'neverthrow';
|
|
3
|
-
export declare namespace ClarityTypes {
|
|
4
|
-
type Response<Ok, Err> = Result<Ok, Err>;
|
|
5
|
-
}
|
|
6
|
-
export interface ClarityAbiMap {
|
|
7
|
-
name: string;
|
|
8
|
-
key: ClarityAbiType;
|
|
9
|
-
value: ClarityAbiType;
|
|
10
|
-
}
|
|
11
|
-
export interface ClarityAbi extends Omit<_ClarityAbi, 'maps'> {
|
|
12
|
-
maps: ClarityAbiMap[];
|
|
13
|
-
clarity_version?: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @param val - ClarityValue
|
|
17
|
-
* @param returnResponse - if true, this will return a "response" object from the `neverthrow`
|
|
18
|
-
* library. Otherwise, it returns the inner value of the response (whether ok or err)
|
|
19
|
-
*/
|
|
20
|
-
export declare function cvToValue<T = any>(val: ClarityValue, returnResponse?: boolean): T;
|
|
21
|
-
/**
|
|
22
|
-
* Converts a hex encoded string to the javascript clarity value object {type: string; value: any}
|
|
23
|
-
* @param hex - the hex encoded string with or without `0x` prefix
|
|
24
|
-
* @param jsonCompat - enable to serialize bigints to strings
|
|
25
|
-
*/
|
|
26
|
-
export declare function hexToCvValue<T>(hex: string, jsonCompat?: boolean): any;
|
|
27
|
-
declare type TupleInput = Record<string, any>;
|
|
28
|
-
declare type CVInput = string | boolean | TupleInput | number | bigint;
|
|
29
|
-
export declare function parseToCV(input: CVInput, type: ClarityAbiType): ClarityValue;
|
|
30
|
-
export declare function cvToString(val: ClarityValue, encoding?: 'tryAscii' | 'hex'): string;
|
|
31
|
-
export declare function transformArgsToCV(func: ClarityAbiFunction, args: any[]): ClarityValue[];
|
|
32
|
-
export declare function expectOk<Ok>(response: ClarityTypes.Response<Ok, any>): Ok;
|
|
33
|
-
export declare function expectErr<Err>(response: ClarityTypes.Response<any, Err>): Err;
|
|
34
|
-
export {};
|
package/dist/contracts.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Contracts, ContractInstances } from './types';
|
|
2
|
-
interface MakeContractsOptions {
|
|
3
|
-
deployerAddress?: string;
|
|
4
|
-
}
|
|
5
|
-
export declare function makeContracts<T extends Contracts<any>>(contracts: T, options?: MakeContractsOptions): ContractInstances<T>;
|
|
6
|
-
export {};
|