@caatinga/client 3.0.0 → 3.0.1
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 +8 -11
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -96,20 +96,20 @@ const client = createCaatingaClient({
|
|
|
96
96
|
network: {
|
|
97
97
|
name: "testnet",
|
|
98
98
|
rpcUrl: "https://soroban-testnet.stellar.org",
|
|
99
|
-
networkPassphrase: "Test SDF Network ; September 2015"
|
|
99
|
+
networkPassphrase: "Test SDF Network ; September 2015",
|
|
100
100
|
},
|
|
101
101
|
artifacts,
|
|
102
102
|
wallet,
|
|
103
103
|
contracts: {
|
|
104
104
|
counter: {
|
|
105
|
-
binding: Counter
|
|
106
|
-
}
|
|
107
|
-
}
|
|
105
|
+
binding: Counter,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
108
|
});
|
|
109
109
|
|
|
110
110
|
const before = await client.contract("counter").read<number>("get");
|
|
111
111
|
const increment = await client.contract("counter").invoke<number>("increment");
|
|
112
|
-
const after = increment.result ?? await client.contract("counter").read<number>("get");
|
|
112
|
+
const after = increment.result ?? (await client.contract("counter").read<number>("get"));
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
## Wallet Adapter Contract
|
|
@@ -118,10 +118,7 @@ const after = increment.result ?? await client.contract("counter").read<number>(
|
|
|
118
118
|
export interface CaatingaWalletAdapter {
|
|
119
119
|
getPublicKey(): Promise<string>;
|
|
120
120
|
|
|
121
|
-
signTransaction(input: {
|
|
122
|
-
xdr: string;
|
|
123
|
-
networkPassphrase: string;
|
|
124
|
-
}): Promise<string>;
|
|
121
|
+
signTransaction(input: { xdr: string; networkPassphrase: string }): Promise<string>;
|
|
125
122
|
}
|
|
126
123
|
```
|
|
127
124
|
|
|
@@ -135,8 +132,8 @@ Wrap any adapter with connection state, persistence, and silent restore:
|
|
|
135
132
|
import { createWalletSession } from "@caatinga/client";
|
|
136
133
|
|
|
137
134
|
const session = createWalletSession(wallet, { persist: true });
|
|
138
|
-
await session.connect();
|
|
139
|
-
await session.restore();
|
|
135
|
+
await session.connect(); // modal when available, else getPublicKey()
|
|
136
|
+
await session.restore(); // silent reconnect on page load — never throws
|
|
140
137
|
session.subscribe(() => console.log(session.getState()));
|
|
141
138
|
```
|
|
142
139
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caatinga/client",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
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",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"LICENSE"
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@caatinga/core": "^3.0.
|
|
64
|
+
"@caatinga/core": "^3.0.1"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"tsup": "^8.3.5",
|