@argonprotocol/mainchain 1.1.0 → 1.3.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 +6 -11
- package/lib/chunk-CGXT6XF7.js +2865 -0
- package/lib/chunk-CGXT6XF7.js.map +1 -0
- package/lib/chunk-FNSFV3MO.js +741 -0
- package/lib/chunk-FNSFV3MO.js.map +1 -0
- package/lib/chunk-NU36V3JQ.cjs +741 -0
- package/lib/chunk-NU36V3JQ.cjs.map +1 -0
- package/lib/chunk-SHAEHPI5.cjs +2865 -0
- package/lib/chunk-SHAEHPI5.cjs.map +1 -0
- package/lib/cli.cjs +6 -3348
- package/lib/cli.cjs.map +1 -1
- package/lib/cli.d.cts +1 -1
- package/lib/cli.d.ts +1 -1
- package/lib/cli.js +6 -3344
- package/lib/cli.js.map +1 -1
- package/lib/clis/index.cjs +4 -3355
- package/lib/clis/index.cjs.map +1 -1
- package/lib/clis/index.d.cts +1 -2
- package/lib/clis/index.d.ts +1 -2
- package/lib/clis/index.js +14 -3343
- package/lib/clis/index.js.map +1 -1
- package/lib/index.cjs +88 -2581
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1176 -767
- package/lib/index.d.ts +1176 -767
- package/lib/index.js +50 -2471
- package/lib/index.js.map +1 -1
- package/package.json +16 -12
package/README.md
CHANGED
|
@@ -32,14 +32,9 @@ Or you can subscribe to changes (for instance, to track a series of valid cpi ad
|
|
|
32
32
|
```javascript
|
|
33
33
|
const { WageProtector } = require('@argonprotocol/mainchain');
|
|
34
34
|
const basePrice = 1_000_000n; // 1 Argon
|
|
35
|
-
const { unsubscribe } = await WageProtector.subscribe(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
console.log(
|
|
39
|
-
`Protected price: ${protectedPrice.getProtectedWage(basePrice)}`,
|
|
40
|
-
);
|
|
41
|
-
},
|
|
42
|
-
);
|
|
35
|
+
const { unsubscribe } = await WageProtector.subscribe(client, protectedPrice => {
|
|
36
|
+
console.log(`Protected price: ${protectedPrice.getProtectedWage(basePrice)}`);
|
|
37
|
+
});
|
|
43
38
|
```
|
|
44
39
|
|
|
45
40
|
Each `WageProtector` instance has the details of the Argon Target Price and USD price at the time of creation.
|
|
@@ -111,7 +106,7 @@ import { CohortBidder } from '@argonprotocol/mainchain';
|
|
|
111
106
|
|
|
112
107
|
// on new bidding
|
|
113
108
|
const subaccounts = await accountset.getAvailableMinerAccounts(5);
|
|
114
|
-
const cohortBidder = new CohortBidder(accountset,
|
|
109
|
+
const cohortBidder = new CohortBidder(accountset, cohortFrameId, subaccounts, {
|
|
115
110
|
maxSeats: 5,
|
|
116
111
|
// a budget not to exceed
|
|
117
112
|
maxBudget: 100_000_000,
|
|
@@ -133,10 +128,10 @@ import { MiningBids } from '@argonprotocol/mainchain';
|
|
|
133
128
|
|
|
134
129
|
const miningBids = new MiningBids(client);
|
|
135
130
|
const { unsubscribe } = await miningBids.onCohortChange({
|
|
136
|
-
async onBiddingStart(
|
|
131
|
+
async onBiddingStart(cohortFrameId) {
|
|
137
132
|
// ...
|
|
138
133
|
},
|
|
139
|
-
async onBiddingEnd(
|
|
134
|
+
async onBiddingEnd(cohortFrameId) {
|
|
140
135
|
// ...
|
|
141
136
|
},
|
|
142
137
|
});
|