@caatinga/client 2.0.1 → 2.1.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/README.md +1 -1
- package/dist/index.cjs +7 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -82,7 +82,7 @@ Primary flow:
|
|
|
82
82
|
```ts
|
|
83
83
|
import { createCaatingaClient } from "@caatinga/client";
|
|
84
84
|
import { createStellarWalletsKitAdapter } from "@caatinga/client/stellar-wallets-kit";
|
|
85
|
-
import * as Counter from "./contracts/generated/counter";
|
|
85
|
+
import * as Counter from "./contracts/generated/counter/src/index.js";
|
|
86
86
|
import artifacts from "../caatinga.artifacts.json";
|
|
87
87
|
|
|
88
88
|
const wallet = createStellarWalletsKitAdapter();
|
package/dist/index.cjs
CHANGED
|
@@ -76,6 +76,13 @@ var import_browser2 = require("@caatinga/core/browser");
|
|
|
76
76
|
function createDefaultBindingAdapter(binding) {
|
|
77
77
|
return {
|
|
78
78
|
createClient({ contractId, publicKey, rpcUrl, networkPassphrase }) {
|
|
79
|
+
if (binding.__caatingaPlaceholder) {
|
|
80
|
+
throw new import_browser2.CaatingaError(
|
|
81
|
+
"Placeholder bindings are still in use; the app cannot reach the contract.",
|
|
82
|
+
import_browser2.CaatingaErrorCode.PLACEHOLDER_BINDING,
|
|
83
|
+
"Run `caatinga generate <contract> --network <network>`, then restart the dev server."
|
|
84
|
+
);
|
|
85
|
+
}
|
|
79
86
|
if (!binding.Client) {
|
|
80
87
|
throw new import_browser2.CaatingaError(
|
|
81
88
|
"Generated binding does not export Client.",
|
package/dist/index.d.cts
CHANGED
|
@@ -16,6 +16,12 @@ interface BindingWithClient {
|
|
|
16
16
|
rpcUrl: string;
|
|
17
17
|
networkPassphrase: string;
|
|
18
18
|
}) => unknown;
|
|
19
|
+
/**
|
|
20
|
+
* Set by the scaffolded placeholder binding (`src/contracts/generated/.../index.ts`)
|
|
21
|
+
* that ships with templates so they type-check before `caatinga generate`. Real
|
|
22
|
+
* Stellar CLI bindings never set this, so its presence means generate hasn't run.
|
|
23
|
+
*/
|
|
24
|
+
__caatingaPlaceholder?: boolean;
|
|
19
25
|
}
|
|
20
26
|
declare function createDefaultBindingAdapter(binding: BindingWithClient): CaatingaBindingAdapter;
|
|
21
27
|
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,12 @@ interface BindingWithClient {
|
|
|
16
16
|
rpcUrl: string;
|
|
17
17
|
networkPassphrase: string;
|
|
18
18
|
}) => unknown;
|
|
19
|
+
/**
|
|
20
|
+
* Set by the scaffolded placeholder binding (`src/contracts/generated/.../index.ts`)
|
|
21
|
+
* that ships with templates so they type-check before `caatinga generate`. Real
|
|
22
|
+
* Stellar CLI bindings never set this, so its presence means generate hasn't run.
|
|
23
|
+
*/
|
|
24
|
+
__caatingaPlaceholder?: boolean;
|
|
19
25
|
}
|
|
20
26
|
declare function createDefaultBindingAdapter(binding: BindingWithClient): CaatingaBindingAdapter;
|
|
21
27
|
|
package/dist/index.js
CHANGED
|
@@ -46,6 +46,13 @@ import { CaatingaError as CaatingaError2, CaatingaErrorCode as CaatingaErrorCode
|
|
|
46
46
|
function createDefaultBindingAdapter(binding) {
|
|
47
47
|
return {
|
|
48
48
|
createClient({ contractId, publicKey, rpcUrl, networkPassphrase }) {
|
|
49
|
+
if (binding.__caatingaPlaceholder) {
|
|
50
|
+
throw new CaatingaError2(
|
|
51
|
+
"Placeholder bindings are still in use; the app cannot reach the contract.",
|
|
52
|
+
CaatingaErrorCode2.PLACEHOLDER_BINDING,
|
|
53
|
+
"Run `caatinga generate <contract> --network <network>`, then restart the dev server."
|
|
54
|
+
);
|
|
55
|
+
}
|
|
49
56
|
if (!binding.Client) {
|
|
50
57
|
throw new CaatingaError2(
|
|
51
58
|
"Generated binding does not export Client.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caatinga/client",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Browser and Node client for Soroban smart contracts — connects generated bindings, Caatinga artifacts, and wallet adapters",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"stellar",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"LICENSE"
|
|
52
52
|
],
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@caatinga/core": "^2.0
|
|
54
|
+
"@caatinga/core": "^2.1.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"tsup": "^8.3.5",
|