@fivenorth/loop-sdk 0.6.0 → 0.6.2
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 +13 -3
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,6 +90,8 @@ const holdings = await provider.getHolding();
|
|
|
90
90
|
console.log(holdings);
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
+
Each holding includes its `instrument_id` (with `admin` and `id` fields), which you can use when building transfers for CC, CIP-56 tokens, LOOP, or any custom instrument.
|
|
94
|
+
|
|
93
95
|
#### Get Active Contracts
|
|
94
96
|
|
|
95
97
|
You can query for active contracts by `templateId` or `interfaceId`.
|
|
@@ -158,11 +160,12 @@ await loop.wallet.transfer(
|
|
|
158
160
|
'receiver::fingerprint',
|
|
159
161
|
'5', // amount (string or number)
|
|
160
162
|
{
|
|
161
|
-
|
|
162
|
-
instrument_admin: 'issuer::fingerprint', // optional
|
|
163
|
+
// Optional overrides. Defaults to Amulet/DSO if omitted.
|
|
164
|
+
instrument_admin: 'issuer::fingerprint', // optional
|
|
165
|
+
instrument_id: 'Amulet', // optional
|
|
163
166
|
},
|
|
164
167
|
{
|
|
165
|
-
requestedAt: new Date().toISOString(), // optional
|
|
168
|
+
requestedAt: new Date().toISOString(), // optional
|
|
166
169
|
executeBefore: new Date(Date.now() + 24*60*60*1000).toISOString(), // optional
|
|
167
170
|
},
|
|
168
171
|
);
|
|
@@ -172,6 +175,13 @@ Notes:
|
|
|
172
175
|
- You must have spendable holdings for the specified instrument (admin + id). If left blank, the SDK defaults to the native token.
|
|
173
176
|
- The helper handles fetching holdings, building the transfer factory payload, and submitting via Wallet Connect.
|
|
174
177
|
|
|
178
|
+
Common instrument overrides (pass into the `instrument` argument above):
|
|
179
|
+
|
|
180
|
+
- Canton Coin (CC): `{ instrument_admin: 'cc-issuer::fingerprint', instrument_id: 'CC' }`
|
|
181
|
+
- CIP-56: `{ instrument_admin: 'cip56-issuer::fingerprint', instrument_id: 'CIP-56' }`
|
|
182
|
+
|
|
183
|
+
Swap in the admin/id for the specific instrument you hold in the Loop wallet.
|
|
184
|
+
|
|
175
185
|
# API
|
|
176
186
|
|
|
177
187
|
Coming soon
|
package/dist/index.js
CHANGED
|
@@ -2268,7 +2268,7 @@ class Provider {
|
|
|
2268
2268
|
email;
|
|
2269
2269
|
auth_token;
|
|
2270
2270
|
requests = new Map;
|
|
2271
|
-
requestTimeout =
|
|
2271
|
+
requestTimeout = 300000;
|
|
2272
2272
|
constructor({ connection, party_id, public_key, auth_token, email, requestTimeout }) {
|
|
2273
2273
|
if (!connection) {
|
|
2274
2274
|
throw new Error("Provider requires a connection object.");
|
|
@@ -2278,7 +2278,7 @@ class Provider {
|
|
|
2278
2278
|
this.public_key = public_key;
|
|
2279
2279
|
this.email = email;
|
|
2280
2280
|
this.auth_token = auth_token;
|
|
2281
|
-
this.requestTimeout = requestTimeout ||
|
|
2281
|
+
this.requestTimeout = requestTimeout || 300000;
|
|
2282
2282
|
}
|
|
2283
2283
|
handleResponse(message) {
|
|
2284
2284
|
console.log("Received response:", message);
|