@caatinga/client 0.2.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/LICENSE +21 -0
- package/README.md +136 -0
- package/dist/freighter.cjs +42 -0
- package/dist/freighter.d.cts +6 -0
- package/dist/freighter.d.ts +6 -0
- package/dist/freighter.js +15 -0
- package/dist/index.cjs +339 -0
- package/dist/index.d.cts +47 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +308 -0
- package/dist/types-Bmw_J1fg.d.cts +66 -0
- package/dist/types-Bmw_J1fg.d.ts +66 -0
- package/dist/types-CND6fcI5.d.cts +66 -0
- package/dist/types-CND6fcI5.d.ts +66 -0
- package/dist/types-CiM5FkDn.d.cts +66 -0
- package/dist/types-CiM5FkDn.d.ts +66 -0
- package/dist/types-DEys6TaK.d.cts +66 -0
- package/dist/types-DEys6TaK.d.ts +66 -0
- package/package.json +69 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { KaleidoArtifacts } from '@kaleido-stellar/core';
|
|
2
|
+
|
|
3
|
+
interface KaleidoNetwork {
|
|
4
|
+
name: string;
|
|
5
|
+
rpcUrl: string;
|
|
6
|
+
networkPassphrase: string;
|
|
7
|
+
}
|
|
8
|
+
interface KaleidoWalletAdapter {
|
|
9
|
+
getPublicKey(): Promise<string>;
|
|
10
|
+
signTransaction(input: {
|
|
11
|
+
xdr: string;
|
|
12
|
+
networkPassphrase: string;
|
|
13
|
+
}): Promise<string>;
|
|
14
|
+
}
|
|
15
|
+
interface KaleidoContractRegistration {
|
|
16
|
+
binding: unknown;
|
|
17
|
+
contractId?: string;
|
|
18
|
+
}
|
|
19
|
+
interface KaleidoClientConfig {
|
|
20
|
+
network: KaleidoNetwork;
|
|
21
|
+
artifacts: KaleidoArtifacts;
|
|
22
|
+
wallet: KaleidoWalletAdapter;
|
|
23
|
+
contracts: Record<string, KaleidoContractRegistration>;
|
|
24
|
+
}
|
|
25
|
+
type KaleidoInvokeStatus = "built" | "prepared" | "signed" | "submitted" | "confirmed" | "failed";
|
|
26
|
+
interface KaleidoInvokeOptions {
|
|
27
|
+
debugXdr?: boolean;
|
|
28
|
+
debugRaw?: boolean;
|
|
29
|
+
}
|
|
30
|
+
interface KaleidoInvokeResult<T = unknown> {
|
|
31
|
+
status: KaleidoInvokeStatus;
|
|
32
|
+
contract: string;
|
|
33
|
+
method: string;
|
|
34
|
+
contractId: string;
|
|
35
|
+
transactionHash?: string;
|
|
36
|
+
result?: T;
|
|
37
|
+
xdr?: {
|
|
38
|
+
unsigned?: string;
|
|
39
|
+
prepared?: string;
|
|
40
|
+
signed?: string;
|
|
41
|
+
};
|
|
42
|
+
raw?: unknown;
|
|
43
|
+
}
|
|
44
|
+
interface KaleidoXdrBuildResult {
|
|
45
|
+
contract: string;
|
|
46
|
+
method: string;
|
|
47
|
+
contractId: string;
|
|
48
|
+
unsignedXdr?: string;
|
|
49
|
+
preparedXdr: string;
|
|
50
|
+
raw?: unknown;
|
|
51
|
+
}
|
|
52
|
+
interface KaleidoBindingAdapter {
|
|
53
|
+
createClient(input: {
|
|
54
|
+
contractId: string;
|
|
55
|
+
publicKey: string;
|
|
56
|
+
rpcUrl: string;
|
|
57
|
+
networkPassphrase: string;
|
|
58
|
+
}): unknown;
|
|
59
|
+
callMethod(input: {
|
|
60
|
+
client: unknown;
|
|
61
|
+
method: string;
|
|
62
|
+
args?: Record<string, unknown>;
|
|
63
|
+
}): Promise<unknown>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type { KaleidoWalletAdapter as K, KaleidoBindingAdapter as a, KaleidoClientConfig as b, KaleidoContractRegistration as c, KaleidoXdrBuildResult as d, KaleidoInvokeOptions as e, KaleidoInvokeResult as f, KaleidoInvokeStatus as g, KaleidoNetwork as h };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { KaleidoArtifacts } from '@kaleido-stellar/core';
|
|
2
|
+
|
|
3
|
+
interface KaleidoNetwork {
|
|
4
|
+
name: string;
|
|
5
|
+
rpcUrl: string;
|
|
6
|
+
networkPassphrase: string;
|
|
7
|
+
}
|
|
8
|
+
interface KaleidoWalletAdapter {
|
|
9
|
+
getPublicKey(): Promise<string>;
|
|
10
|
+
signTransaction(input: {
|
|
11
|
+
xdr: string;
|
|
12
|
+
networkPassphrase: string;
|
|
13
|
+
}): Promise<string>;
|
|
14
|
+
}
|
|
15
|
+
interface KaleidoContractRegistration {
|
|
16
|
+
binding: unknown;
|
|
17
|
+
contractId?: string;
|
|
18
|
+
}
|
|
19
|
+
interface KaleidoClientConfig {
|
|
20
|
+
network: KaleidoNetwork;
|
|
21
|
+
artifacts: KaleidoArtifacts;
|
|
22
|
+
wallet: KaleidoWalletAdapter;
|
|
23
|
+
contracts: Record<string, KaleidoContractRegistration>;
|
|
24
|
+
}
|
|
25
|
+
type KaleidoInvokeStatus = "built" | "prepared" | "signed" | "submitted" | "confirmed" | "failed";
|
|
26
|
+
interface KaleidoInvokeOptions {
|
|
27
|
+
debugXdr?: boolean;
|
|
28
|
+
debugRaw?: boolean;
|
|
29
|
+
}
|
|
30
|
+
interface KaleidoInvokeResult<T = unknown> {
|
|
31
|
+
status: KaleidoInvokeStatus;
|
|
32
|
+
contract: string;
|
|
33
|
+
method: string;
|
|
34
|
+
contractId: string;
|
|
35
|
+
transactionHash?: string;
|
|
36
|
+
result?: T;
|
|
37
|
+
xdr?: {
|
|
38
|
+
unsigned?: string;
|
|
39
|
+
prepared?: string;
|
|
40
|
+
signed?: string;
|
|
41
|
+
};
|
|
42
|
+
raw?: unknown;
|
|
43
|
+
}
|
|
44
|
+
interface KaleidoXdrBuildResult {
|
|
45
|
+
contract: string;
|
|
46
|
+
method: string;
|
|
47
|
+
contractId: string;
|
|
48
|
+
unsignedXdr?: string;
|
|
49
|
+
preparedXdr: string;
|
|
50
|
+
raw?: unknown;
|
|
51
|
+
}
|
|
52
|
+
interface KaleidoBindingAdapter {
|
|
53
|
+
createClient(input: {
|
|
54
|
+
contractId: string;
|
|
55
|
+
publicKey: string;
|
|
56
|
+
rpcUrl: string;
|
|
57
|
+
networkPassphrase: string;
|
|
58
|
+
}): unknown;
|
|
59
|
+
callMethod(input: {
|
|
60
|
+
client: unknown;
|
|
61
|
+
method: string;
|
|
62
|
+
args?: Record<string, unknown>;
|
|
63
|
+
}): Promise<unknown>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type { KaleidoWalletAdapter as K, KaleidoBindingAdapter as a, KaleidoClientConfig as b, KaleidoContractRegistration as c, KaleidoXdrBuildResult as d, KaleidoInvokeOptions as e, KaleidoInvokeResult as f, KaleidoInvokeStatus as g, KaleidoNetwork as h };
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@caatinga/client",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Browser and Node client for Soroban smart contracts — connects generated bindings, Caatinga artifacts, and wallet adapters",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"stellar",
|
|
7
|
+
"soroban",
|
|
8
|
+
"dapp",
|
|
9
|
+
"smart-contracts",
|
|
10
|
+
"blockchain",
|
|
11
|
+
"freighter",
|
|
12
|
+
"wallet",
|
|
13
|
+
"xdr",
|
|
14
|
+
"caatinga"
|
|
15
|
+
],
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/Dione-b/caatinga.git",
|
|
19
|
+
"directory": "packages/client"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/Dione-b/caatinga#readme",
|
|
22
|
+
"author": "Caatinga contributors",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=20"
|
|
26
|
+
},
|
|
27
|
+
"type": "module",
|
|
28
|
+
"main": "./dist/index.cjs",
|
|
29
|
+
"module": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.js",
|
|
35
|
+
"require": "./dist/index.cjs"
|
|
36
|
+
},
|
|
37
|
+
"./freighter": {
|
|
38
|
+
"types": "./dist/freighter.d.ts",
|
|
39
|
+
"import": "./dist/freighter.js",
|
|
40
|
+
"require": "./dist/freighter.cjs"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist",
|
|
45
|
+
"README.md",
|
|
46
|
+
"LICENSE"
|
|
47
|
+
],
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@caatinga/core": "^0.2.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"tsup": "^8.3.5",
|
|
53
|
+
"typescript": "^5.7.2",
|
|
54
|
+
"vitest": "^2.1.8"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"@stellar/freighter-api": "^4.0.0"
|
|
58
|
+
},
|
|
59
|
+
"peerDependenciesMeta": {
|
|
60
|
+
"@stellar/freighter-api": {
|
|
61
|
+
"optional": true
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"build": "tsup src/index.ts src/freighter.ts --format esm,cjs --dts",
|
|
66
|
+
"test": "vitest run --pool=threads",
|
|
67
|
+
"typecheck": "tsc --noEmit"
|
|
68
|
+
}
|
|
69
|
+
}
|