@acta-markets/ts-sdk 0.0.7-beta → 0.0.9-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 +4 -2
- package/dist/cjs/chain/fetch.test.js +4 -2
- package/dist/cjs/generated/accounts/position.js +4 -2
- package/dist/cjs/generated/types/actaEvent.js +2 -0
- package/dist/cjs/idl/acta_contract.json +9 -1
- package/dist/cjs/idl/hash.js +1 -1
- package/dist/generated/accounts/position.d.ts +2 -0
- package/dist/generated/accounts/position.js +4 -2
- package/dist/generated/types/actaEvent.d.ts +2 -0
- package/dist/generated/types/actaEvent.js +2 -0
- package/dist/idl/acta_contract.json +9 -1
- package/dist/idl/hash.d.ts +1 -1
- package/dist/idl/hash.js +1 -1
- package/package.json +1 -1
package/dist/chain/fetch.test.js
CHANGED
|
@@ -101,7 +101,8 @@ describe("fetch offsets and order encode", () => {
|
|
|
101
101
|
quantity: 0x1111222233334444n,
|
|
102
102
|
totalPremium: 0x9999888877776666n,
|
|
103
103
|
orderId: new Uint8Array(32).fill(0x88),
|
|
104
|
-
|
|
104
|
+
createdAt: 0n,
|
|
105
|
+
reserved: Array(31).fill(0n),
|
|
105
106
|
});
|
|
106
107
|
expect(positionData.length).toBe(getPositionSize());
|
|
107
108
|
expect(positionData[POSITION_OFFSET_STATUS]).toBe(3);
|
|
@@ -179,7 +180,8 @@ describe("fetch offsets and order encode", () => {
|
|
|
179
180
|
quantity: 1n,
|
|
180
181
|
totalPremium: 1n,
|
|
181
182
|
orderId: new Uint8Array(32).fill(0x11),
|
|
182
|
-
|
|
183
|
+
createdAt: 0n,
|
|
184
|
+
reserved: Array(31).fill(0n),
|
|
183
185
|
});
|
|
184
186
|
expect(() => decodeMarketAccount(Buffer.from(positionData))).toThrow("Invalid Market account discriminator");
|
|
185
187
|
expect(() => decodeMarketAccount(Buffer.alloc(8))).toThrow("Invalid Market account size");
|
|
@@ -103,7 +103,8 @@ describe("fetch offsets and order encode", () => {
|
|
|
103
103
|
quantity: 0x1111222233334444n,
|
|
104
104
|
totalPremium: 0x9999888877776666n,
|
|
105
105
|
orderId: new Uint8Array(32).fill(0x88),
|
|
106
|
-
|
|
106
|
+
createdAt: 0n,
|
|
107
|
+
reserved: Array(31).fill(0n),
|
|
107
108
|
});
|
|
108
109
|
expect(positionData.length).toBe((0, position_1.getPositionSize)());
|
|
109
110
|
expect(positionData[fetch_1.POSITION_OFFSET_STATUS]).toBe(3);
|
|
@@ -181,7 +182,8 @@ describe("fetch offsets and order encode", () => {
|
|
|
181
182
|
quantity: 1n,
|
|
182
183
|
totalPremium: 1n,
|
|
183
184
|
orderId: new Uint8Array(32).fill(0x11),
|
|
184
|
-
|
|
185
|
+
createdAt: 0n,
|
|
186
|
+
reserved: Array(31).fill(0n),
|
|
185
187
|
});
|
|
186
188
|
expect(() => (0, fetch_1.decodeMarketAccount)(buffer_1.Buffer.from(positionData))).toThrow("Invalid Market account discriminator");
|
|
187
189
|
expect(() => (0, fetch_1.decodeMarketAccount)(buffer_1.Buffer.alloc(8))).toThrow("Invalid Market account size");
|
|
@@ -35,7 +35,8 @@ function getPositionEncoder() {
|
|
|
35
35
|
["quantity", (0, kit_1.getU64Encoder)()],
|
|
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: 31 })],
|
|
39
40
|
]);
|
|
40
41
|
}
|
|
41
42
|
/** Gets the decoder for {@link Position} account data. */
|
|
@@ -56,7 +57,8 @@ function getPositionDecoder() {
|
|
|
56
57
|
["quantity", (0, kit_1.getU64Decoder)()],
|
|
57
58
|
["totalPremium", (0, kit_1.getU64Decoder)()],
|
|
58
59
|
["orderId", (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 32)],
|
|
59
|
-
["
|
|
60
|
+
["createdAt", (0, kit_1.getU64Decoder)()],
|
|
61
|
+
["reserved", (0, kit_1.getArrayDecoder)((0, kit_1.getU64Decoder)(), { size: 31 })],
|
|
60
62
|
]);
|
|
61
63
|
}
|
|
62
64
|
/** Gets the codec for {@link Position} account data. */
|
|
@@ -115,6 +115,7 @@ function getActaEventEncoder() {
|
|
|
115
115
|
["validUntil", (0, kit_1.getU64Encoder)()],
|
|
116
116
|
["orderId", (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 32)],
|
|
117
117
|
["totalPremium", (0, kit_1.getU64Encoder)()],
|
|
118
|
+
["createdAt", (0, kit_1.getU64Encoder)()],
|
|
118
119
|
]),
|
|
119
120
|
],
|
|
120
121
|
[
|
|
@@ -276,6 +277,7 @@ function getActaEventDecoder() {
|
|
|
276
277
|
["validUntil", (0, kit_1.getU64Decoder)()],
|
|
277
278
|
["orderId", (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 32)],
|
|
278
279
|
["totalPremium", (0, kit_1.getU64Decoder)()],
|
|
280
|
+
["createdAt", (0, kit_1.getU64Decoder)()],
|
|
279
281
|
]),
|
|
280
282
|
],
|
|
281
283
|
[
|
|
@@ -1596,12 +1596,16 @@
|
|
|
1596
1596
|
]
|
|
1597
1597
|
}
|
|
1598
1598
|
},
|
|
1599
|
+
{
|
|
1600
|
+
"name": "createdAt",
|
|
1601
|
+
"type": "u64"
|
|
1602
|
+
},
|
|
1599
1603
|
{
|
|
1600
1604
|
"name": "reserved",
|
|
1601
1605
|
"type": {
|
|
1602
1606
|
"array": [
|
|
1603
1607
|
"u64",
|
|
1604
|
-
|
|
1608
|
+
31
|
|
1605
1609
|
]
|
|
1606
1610
|
}
|
|
1607
1611
|
}
|
|
@@ -1967,6 +1971,10 @@
|
|
|
1967
1971
|
{
|
|
1968
1972
|
"name": "total_premium",
|
|
1969
1973
|
"type": "u64"
|
|
1974
|
+
},
|
|
1975
|
+
{
|
|
1976
|
+
"name": "created_at",
|
|
1977
|
+
"type": "u64"
|
|
1970
1978
|
}
|
|
1971
1979
|
]
|
|
1972
1980
|
},
|
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 = "64e4296b125327045af22a09a12faa5bd903a8e3c9b9e86c7313d533ba591f01";
|
|
@@ -22,6 +22,7 @@ export type Position = {
|
|
|
22
22
|
quantity: bigint;
|
|
23
23
|
totalPremium: bigint;
|
|
24
24
|
orderId: ReadonlyUint8Array;
|
|
25
|
+
createdAt: bigint;
|
|
25
26
|
reserved: Array<bigint>;
|
|
26
27
|
};
|
|
27
28
|
export type PositionArgs = {
|
|
@@ -40,6 +41,7 @@ export type PositionArgs = {
|
|
|
40
41
|
quantity: number | bigint;
|
|
41
42
|
totalPremium: number | bigint;
|
|
42
43
|
orderId: ReadonlyUint8Array;
|
|
44
|
+
createdAt: number | bigint;
|
|
43
45
|
reserved: Array<number | bigint>;
|
|
44
46
|
};
|
|
45
47
|
/** Gets the encoder for {@link PositionArgs} account data. */
|
|
@@ -24,7 +24,8 @@ export function getPositionEncoder() {
|
|
|
24
24
|
["quantity", getU64Encoder()],
|
|
25
25
|
["totalPremium", getU64Encoder()],
|
|
26
26
|
["orderId", fixEncoderSize(getBytesEncoder(), 32)],
|
|
27
|
-
["
|
|
27
|
+
["createdAt", getU64Encoder()],
|
|
28
|
+
["reserved", getArrayEncoder(getU64Encoder(), { size: 31 })],
|
|
28
29
|
]);
|
|
29
30
|
}
|
|
30
31
|
/** Gets the decoder for {@link Position} account data. */
|
|
@@ -45,7 +46,8 @@ export function getPositionDecoder() {
|
|
|
45
46
|
["quantity", getU64Decoder()],
|
|
46
47
|
["totalPremium", getU64Decoder()],
|
|
47
48
|
["orderId", fixDecoderSize(getBytesDecoder(), 32)],
|
|
48
|
-
["
|
|
49
|
+
["createdAt", getU64Decoder()],
|
|
50
|
+
["reserved", getArrayDecoder(getU64Decoder(), { size: 31 })],
|
|
49
51
|
]);
|
|
50
52
|
}
|
|
51
53
|
/** Gets the codec for {@link Position} account data. */
|
|
@@ -77,6 +77,7 @@ export type ActaEvent = {
|
|
|
77
77
|
validUntil: bigint;
|
|
78
78
|
orderId: ReadonlyUint8Array;
|
|
79
79
|
totalPremium: bigint;
|
|
80
|
+
createdAt: bigint;
|
|
80
81
|
} | {
|
|
81
82
|
__kind: "DepositFundsToPosition";
|
|
82
83
|
makerPda: Address;
|
|
@@ -188,6 +189,7 @@ export type ActaEventArgs = {
|
|
|
188
189
|
validUntil: number | bigint;
|
|
189
190
|
orderId: ReadonlyUint8Array;
|
|
190
191
|
totalPremium: number | bigint;
|
|
192
|
+
createdAt: number | bigint;
|
|
191
193
|
} | {
|
|
192
194
|
__kind: "DepositFundsToPosition";
|
|
193
195
|
makerPda: Address;
|
|
@@ -108,6 +108,7 @@ export function getActaEventEncoder() {
|
|
|
108
108
|
["validUntil", getU64Encoder()],
|
|
109
109
|
["orderId", fixEncoderSize(getBytesEncoder(), 32)],
|
|
110
110
|
["totalPremium", getU64Encoder()],
|
|
111
|
+
["createdAt", getU64Encoder()],
|
|
111
112
|
]),
|
|
112
113
|
],
|
|
113
114
|
[
|
|
@@ -269,6 +270,7 @@ export function getActaEventDecoder() {
|
|
|
269
270
|
["validUntil", getU64Decoder()],
|
|
270
271
|
["orderId", fixDecoderSize(getBytesDecoder(), 32)],
|
|
271
272
|
["totalPremium", getU64Decoder()],
|
|
273
|
+
["createdAt", getU64Decoder()],
|
|
272
274
|
]),
|
|
273
275
|
],
|
|
274
276
|
[
|
|
@@ -1596,12 +1596,16 @@
|
|
|
1596
1596
|
]
|
|
1597
1597
|
}
|
|
1598
1598
|
},
|
|
1599
|
+
{
|
|
1600
|
+
"name": "createdAt",
|
|
1601
|
+
"type": "u64"
|
|
1602
|
+
},
|
|
1599
1603
|
{
|
|
1600
1604
|
"name": "reserved",
|
|
1601
1605
|
"type": {
|
|
1602
1606
|
"array": [
|
|
1603
1607
|
"u64",
|
|
1604
|
-
|
|
1608
|
+
31
|
|
1605
1609
|
]
|
|
1606
1610
|
}
|
|
1607
1611
|
}
|
|
@@ -1967,6 +1971,10 @@
|
|
|
1967
1971
|
{
|
|
1968
1972
|
"name": "total_premium",
|
|
1969
1973
|
"type": "u64"
|
|
1974
|
+
},
|
|
1975
|
+
{
|
|
1976
|
+
"name": "created_at",
|
|
1977
|
+
"type": "u64"
|
|
1970
1978
|
}
|
|
1971
1979
|
]
|
|
1972
1980
|
},
|
package/dist/idl/hash.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ACTA_IDL_SHA256 = "
|
|
1
|
+
export declare const ACTA_IDL_SHA256 = "64e4296b125327045af22a09a12faa5bd903a8e3c9b9e86c7313d533ba591f01";
|
package/dist/idl/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ACTA_IDL_SHA256 = "
|
|
1
|
+
export const ACTA_IDL_SHA256 = "64e4296b125327045af22a09a12faa5bd903a8e3c9b9e86c7313d533ba591f01";
|