@acta-markets/ts-sdk 0.0.10-beta → 0.0.12-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/chain/fetch.test.js +2 -2
- package/dist/cjs/chain/fetch.test.js +2 -2
- package/dist/cjs/generated/accounts/position.js +3 -3
- package/dist/cjs/idl/acta_contract.json +1 -1
- package/dist/cjs/idl/hash.js +1 -1
- package/dist/cjs/ws/client.js +1 -1
- package/dist/generated/accounts/position.js +3 -3
- package/dist/idl/acta_contract.json +1 -1
- package/dist/idl/hash.d.ts +1 -1
- package/dist/idl/hash.js +1 -1
- package/dist/ws/client.js +1 -1
- package/package.json +1 -1
package/dist/chain/fetch.test.js
CHANGED
|
@@ -102,7 +102,7 @@ describe("fetch offsets and order encode", () => {
|
|
|
102
102
|
totalPremium: 0x9999888877776666n,
|
|
103
103
|
orderId: new Uint8Array(32).fill(0x88),
|
|
104
104
|
createdAt: 0n,
|
|
105
|
-
reserved: Array(
|
|
105
|
+
reserved: Array(32).fill(0n),
|
|
106
106
|
});
|
|
107
107
|
expect(positionData.length).toBe(getPositionSize());
|
|
108
108
|
expect(positionData[POSITION_OFFSET_STATUS]).toBe(3);
|
|
@@ -181,7 +181,7 @@ describe("fetch offsets and order encode", () => {
|
|
|
181
181
|
totalPremium: 1n,
|
|
182
182
|
orderId: new Uint8Array(32).fill(0x11),
|
|
183
183
|
createdAt: 0n,
|
|
184
|
-
reserved: Array(
|
|
184
|
+
reserved: Array(32).fill(0n),
|
|
185
185
|
});
|
|
186
186
|
expect(() => decodeMarketAccount(Buffer.from(positionData))).toThrow("Invalid Market account discriminator");
|
|
187
187
|
expect(() => decodeMarketAccount(Buffer.alloc(8))).toThrow("Invalid Market account size");
|
|
@@ -104,7 +104,7 @@ describe("fetch offsets and order encode", () => {
|
|
|
104
104
|
totalPremium: 0x9999888877776666n,
|
|
105
105
|
orderId: new Uint8Array(32).fill(0x88),
|
|
106
106
|
createdAt: 0n,
|
|
107
|
-
reserved: Array(
|
|
107
|
+
reserved: Array(32).fill(0n),
|
|
108
108
|
});
|
|
109
109
|
expect(positionData.length).toBe((0, position_1.getPositionSize)());
|
|
110
110
|
expect(positionData[fetch_1.POSITION_OFFSET_STATUS]).toBe(3);
|
|
@@ -183,7 +183,7 @@ describe("fetch offsets and order encode", () => {
|
|
|
183
183
|
totalPremium: 1n,
|
|
184
184
|
orderId: new Uint8Array(32).fill(0x11),
|
|
185
185
|
createdAt: 0n,
|
|
186
|
-
reserved: Array(
|
|
186
|
+
reserved: Array(32).fill(0n),
|
|
187
187
|
});
|
|
188
188
|
expect(() => (0, fetch_1.decodeMarketAccount)(buffer_1.Buffer.from(positionData))).toThrow("Invalid Market account discriminator");
|
|
189
189
|
expect(() => (0, fetch_1.decodeMarketAccount)(buffer_1.Buffer.alloc(8))).toThrow("Invalid Market account size");
|
|
@@ -36,7 +36,7 @@ function getPositionEncoder() {
|
|
|
36
36
|
["totalPremium", (0, kit_1.getU64Encoder)()],
|
|
37
37
|
["orderId", (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 32)],
|
|
38
38
|
["createdAt", (0, kit_1.getU64Encoder)()],
|
|
39
|
-
["reserved", (0, kit_1.getArrayEncoder)((0, kit_1.getU64Encoder)(), { size:
|
|
39
|
+
["reserved", (0, kit_1.getArrayEncoder)((0, kit_1.getU64Encoder)(), { size: 32 })],
|
|
40
40
|
]);
|
|
41
41
|
}
|
|
42
42
|
/** Gets the decoder for {@link Position} account data. */
|
|
@@ -58,7 +58,7 @@ function getPositionDecoder() {
|
|
|
58
58
|
["totalPremium", (0, kit_1.getU64Decoder)()],
|
|
59
59
|
["orderId", (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 32)],
|
|
60
60
|
["createdAt", (0, kit_1.getU64Decoder)()],
|
|
61
|
-
["reserved", (0, kit_1.getArrayDecoder)((0, kit_1.getU64Decoder)(), { size:
|
|
61
|
+
["reserved", (0, kit_1.getArrayDecoder)((0, kit_1.getU64Decoder)(), { size: 32 })],
|
|
62
62
|
]);
|
|
63
63
|
}
|
|
64
64
|
/** Gets the codec for {@link Position} account data. */
|
|
@@ -87,5 +87,5 @@ async function fetchAllMaybePosition(rpc, addresses, config) {
|
|
|
87
87
|
return maybeAccounts.map((maybeAccount) => decodePosition(maybeAccount));
|
|
88
88
|
}
|
|
89
89
|
function getPositionSize() {
|
|
90
|
-
return
|
|
90
|
+
return 424;
|
|
91
91
|
}
|
package/dist/cjs/idl/hash.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ACTA_IDL_SHA256 = void 0;
|
|
4
|
-
exports.ACTA_IDL_SHA256 = "
|
|
4
|
+
exports.ACTA_IDL_SHA256 = "a86d779d49761e2979103c9ebd3eeb10f85fc9c4fc5848d78d11326e3eedab83";
|
package/dist/cjs/ws/client.js
CHANGED
|
@@ -414,7 +414,7 @@ class ActaWsClient extends TypedEventEmitter {
|
|
|
414
414
|
}
|
|
415
415
|
this.setConnectionState("connecting");
|
|
416
416
|
this.emit("connecting");
|
|
417
|
-
const endpoint = this.options.role === "maker" ? "/
|
|
417
|
+
const endpoint = this.options.role === "maker" ? "/maker" : "/taker";
|
|
418
418
|
const url = `${this.options.url}${endpoint}`;
|
|
419
419
|
this.log(`Connecting to ${url}`);
|
|
420
420
|
const ws = this.options.makeSocket(url);
|
|
@@ -25,7 +25,7 @@ export function getPositionEncoder() {
|
|
|
25
25
|
["totalPremium", getU64Encoder()],
|
|
26
26
|
["orderId", fixEncoderSize(getBytesEncoder(), 32)],
|
|
27
27
|
["createdAt", getU64Encoder()],
|
|
28
|
-
["reserved", getArrayEncoder(getU64Encoder(), { size:
|
|
28
|
+
["reserved", getArrayEncoder(getU64Encoder(), { size: 32 })],
|
|
29
29
|
]);
|
|
30
30
|
}
|
|
31
31
|
/** Gets the decoder for {@link Position} account data. */
|
|
@@ -47,7 +47,7 @@ export function getPositionDecoder() {
|
|
|
47
47
|
["totalPremium", getU64Decoder()],
|
|
48
48
|
["orderId", fixDecoderSize(getBytesDecoder(), 32)],
|
|
49
49
|
["createdAt", getU64Decoder()],
|
|
50
|
-
["reserved", getArrayDecoder(getU64Decoder(), { size:
|
|
50
|
+
["reserved", getArrayDecoder(getU64Decoder(), { size: 32 })],
|
|
51
51
|
]);
|
|
52
52
|
}
|
|
53
53
|
/** Gets the codec for {@link Position} account data. */
|
|
@@ -76,5 +76,5 @@ export async function fetchAllMaybePosition(rpc, addresses, config) {
|
|
|
76
76
|
return maybeAccounts.map((maybeAccount) => decodePosition(maybeAccount));
|
|
77
77
|
}
|
|
78
78
|
export function getPositionSize() {
|
|
79
|
-
return
|
|
79
|
+
return 424;
|
|
80
80
|
}
|
package/dist/idl/hash.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ACTA_IDL_SHA256 = "
|
|
1
|
+
export declare const ACTA_IDL_SHA256 = "a86d779d49761e2979103c9ebd3eeb10f85fc9c4fc5848d78d11326e3eedab83";
|
package/dist/idl/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ACTA_IDL_SHA256 = "
|
|
1
|
+
export const ACTA_IDL_SHA256 = "a86d779d49761e2979103c9ebd3eeb10f85fc9c4fc5848d78d11326e3eedab83";
|
package/dist/ws/client.js
CHANGED
|
@@ -411,7 +411,7 @@ export class ActaWsClient extends TypedEventEmitter {
|
|
|
411
411
|
}
|
|
412
412
|
this.setConnectionState("connecting");
|
|
413
413
|
this.emit("connecting");
|
|
414
|
-
const endpoint = this.options.role === "maker" ? "/
|
|
414
|
+
const endpoint = this.options.role === "maker" ? "/maker" : "/taker";
|
|
415
415
|
const url = `${this.options.url}${endpoint}`;
|
|
416
416
|
this.log(`Connecting to ${url}`);
|
|
417
417
|
const ws = this.options.makeSocket(url);
|