@triadxyz/triad-protocol 1.0.1-beta → 1.0.2-beta
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/dist/index.js +3 -1
- package/dist/local-test.js +13 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21,7 +21,9 @@ const stake_1 = __importDefault(require("./stake"));
|
|
|
21
21
|
const sendTransactionWithOptions_1 = __importDefault(require("./utils/sendTransactionWithOptions"));
|
|
22
22
|
class TriadProtocolClient {
|
|
23
23
|
constructor(connection, wallet) {
|
|
24
|
-
this.provider = new anchor_1.AnchorProvider(connection, wallet,
|
|
24
|
+
this.provider = new anchor_1.AnchorProvider(connection, wallet, {
|
|
25
|
+
commitment: 'confirmed'
|
|
26
|
+
});
|
|
25
27
|
this.program = new anchor_1.Program(idl_triad_protocol_json_1.default, this.provider);
|
|
26
28
|
this.trade = new trade_1.default(this.program, this.provider);
|
|
27
29
|
this.stake = new stake_1.default(this.program, this.provider);
|
package/dist/local-test.js
CHANGED
|
@@ -73,7 +73,6 @@ const getAllMarkets = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
73
73
|
const markets = yield triadProtocol.trade.getAllMarkets();
|
|
74
74
|
console.log(markets);
|
|
75
75
|
});
|
|
76
|
-
getAllMarkets();
|
|
77
76
|
const getMarket = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
78
77
|
const market = yield triadProtocol.trade.getMarketById(1);
|
|
79
78
|
console.log(market);
|
|
@@ -133,14 +132,19 @@ const runBot = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
133
132
|
}
|
|
134
133
|
});
|
|
135
134
|
const initializeQuestion = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
136
|
-
const currentTime = Math.floor(Date.now() / 1000); // Current time in seconds
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
const currentTime = Math.floor(Date.now() / 1000) + 10; // Current time in seconds
|
|
136
|
+
try {
|
|
137
|
+
const response = yield triadProtocol.trade.initializeQuestion({
|
|
138
|
+
marketId: 0,
|
|
139
|
+
question: 'Will Triad send the project to the Radar Hackathon?',
|
|
140
|
+
startTime: currentTime,
|
|
141
|
+
endTime: 1728320400
|
|
142
|
+
});
|
|
143
|
+
console.log(response);
|
|
144
|
+
}
|
|
145
|
+
catch (e) {
|
|
146
|
+
console.log(e);
|
|
147
|
+
}
|
|
144
148
|
});
|
|
145
149
|
initializeQuestion();
|
|
146
150
|
const resolveQuestion = () => __awaiter(void 0, void 0, void 0, function* () {
|