@n1xyz/nord-ts 0.0.15 → 0.0.17
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/bridge/client.js +45 -6
- package/dist/gen/common.js +1 -1
- package/dist/gen/nord.d.ts +61 -29
- package/dist/gen/nord.js +723 -130
- package/dist/idl/bridge.d.ts +569 -2
- package/dist/idl/bridge.js +5 -927
- package/dist/idl/bridge.json +75 -62
- package/dist/idl/index.d.ts +71 -49
- package/dist/index.d.ts +1 -3
- package/dist/index.js +6 -13
- package/dist/nord/api/actions.d.ts +7 -2
- package/dist/nord/api/actions.js +7 -1
- package/dist/nord/api/core.d.ts +1 -1
- package/dist/nord/api/core.js +3 -3
- package/dist/nord/api/market.js +1 -3
- package/dist/nord/api/queries.js +2 -2
- package/dist/nord/client/Nord.d.ts +9 -14
- package/dist/nord/client/Nord.js +27 -38
- package/dist/nord/client/NordUser.d.ts +7 -23
- package/dist/nord/client/NordUser.js +79 -151
- package/dist/nord/utils/NordError.js +5 -2
- package/dist/types.d.ts +34 -50
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +14 -0
- package/dist/websocket/NordWebSocketClient.js +0 -2
- package/package.json +20 -18
- package/protoc-generate.sh +0 -0
- package/src/idl/bridge.json +75 -62
- package/src/index.ts +9 -12
- package/src/nord/api/actions.ts +14 -3
- package/src/nord/api/core.ts +4 -2
- package/src/nord/api/market.ts +1 -4
- package/src/nord/api/queries.ts +2 -2
- package/src/nord/client/Nord.ts +45 -50
- package/src/nord/client/NordUser.ts +107 -178
- package/src/nord/utils/NordError.ts +6 -2
- package/src/types.ts +34 -49
- package/src/utils.ts +18 -0
- package/src/websocket/NordWebSocketClient.ts +0 -2
- package/tsconfig.json +1 -1
- package/docs/.nojekyll +0 -1
- package/docs/assets/hierarchy.js +0 -1
- package/docs/assets/highlight.css +0 -92
- package/docs/assets/icons.js +0 -18
- package/docs/assets/icons.svg +0 -1
- package/docs/assets/main.js +0 -60
- package/docs/assets/navigation.js +0 -1
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1611
- package/docs/classes/Nord.html +0 -189
- package/docs/classes/NordError.html +0 -24
- package/docs/classes/NordUser.html +0 -115
- package/docs/classes/NordWebSocketClient.html +0 -330
- package/docs/classes/SolanaBridgeClient.html +0 -86
- package/docs/classes/Subscriber.html +0 -10
- package/docs/enums/FillMode.html +0 -5
- package/docs/enums/KeyType.html +0 -4
- package/docs/enums/MetricPeriod.html +0 -9
- package/docs/enums/PdaSeedType.html +0 -9
- package/docs/enums/PeakTpsPeriodUnit.html +0 -15
- package/docs/enums/Side.html +0 -3
- package/docs/enums/WebSocketMessageType.html +0 -7
- package/docs/functions/actionQueryRollman.html +0 -6
- package/docs/functions/actionsQueryRollman.html +0 -6
- package/docs/functions/aggregateMetrics-1.html +0 -7
- package/docs/functions/assert.html +0 -1
- package/docs/functions/bigIntToProtoU128.html +0 -4
- package/docs/functions/bridgeToBN.html +0 -5
- package/docs/functions/bufferToHex.html +0 -4
- package/docs/functions/cancelOrder.html +0 -1
- package/docs/functions/checkPubKeyLength.html +0 -1
- package/docs/functions/checkedFetch.html +0 -6
- package/docs/functions/createSession.html +0 -1
- package/docs/functions/decodeLengthDelimited.html +0 -11
- package/docs/functions/encodeLengthDelimited.html +0 -6
- package/docs/functions/fillModeToProtoFillMode.html +0 -5
- package/docs/functions/findMarket.html +0 -1
- package/docs/functions/findPda.html +0 -6
- package/docs/functions/findToken.html +0 -1
- package/docs/functions/fromBN.html +0 -5
- package/docs/functions/getAccount.html +0 -6
- package/docs/functions/getActionNonce.html +0 -5
- package/docs/functions/getCurrentTps.html +0 -6
- package/docs/functions/getInfo.html +0 -5
- package/docs/functions/getLastActionId.html +0 -5
- package/docs/functions/getMedianLatency.html +0 -6
- package/docs/functions/getOrderbook.html +0 -6
- package/docs/functions/getPeakTps.html +0 -6
- package/docs/functions/getTimestamp.html +0 -5
- package/docs/functions/getTotalTransactions.html +0 -5
- package/docs/functions/getTrades.html +0 -6
- package/docs/functions/getUserAccountIds.html +0 -6
- package/docs/functions/hexToBuffer.html +0 -4
- package/docs/functions/initWebSocketClient.html +0 -12
- package/docs/functions/keypairFromPrivateKey.html +0 -4
- package/docs/functions/makeSigningFunction.html +0 -4
- package/docs/functions/makeWalletSignFn.html +0 -6
- package/docs/functions/marketsStats.html +0 -5
- package/docs/functions/optExpect.html +0 -5
- package/docs/functions/optMap.html +0 -5
- package/docs/functions/optUnwrap.html +0 -2
- package/docs/functions/panic.html +0 -1
- package/docs/functions/placeOrder.html +0 -1
- package/docs/functions/queryAction.html +0 -6
- package/docs/functions/queryPrometheus.html +0 -6
- package/docs/functions/queryRecentActions.html +0 -7
- package/docs/functions/revokeSession.html +0 -1
- package/docs/functions/shortenPublicKey.html +0 -5
- package/docs/functions/signAction.html +0 -6
- package/docs/functions/toBN.html +0 -5
- package/docs/functions/toScaledU128.html +0 -8
- package/docs/functions/toScaledU64.html +0 -8
- package/docs/functions/transfer.html +0 -1
- package/docs/functions/withdraw.html +0 -1
- package/docs/hierarchy.html +0 -1
- package/docs/index.html +0 -40
- package/docs/interfaces/Account.html +0 -8
- package/docs/interfaces/ActionInfo.html +0 -8
- package/docs/interfaces/ActionNonceResponse.html +0 -3
- package/docs/interfaces/ActionQuery.html +0 -4
- package/docs/interfaces/ActionResponse.html +0 -8
- package/docs/interfaces/ActionsExtendedInfo.html +0 -10
- package/docs/interfaces/ActionsQuery.html +0 -5
- package/docs/interfaces/ActionsResponse.html +0 -6
- package/docs/interfaces/AggregateMetrics.html +0 -12
- package/docs/interfaces/BlockFacts.html +0 -10
- package/docs/interfaces/BlockQuery.html +0 -6
- package/docs/interfaces/BlockResponse.html +0 -6
- package/docs/interfaces/BlockSummary.html +0 -8
- package/docs/interfaces/BlockSummaryResponse.html +0 -6
- package/docs/interfaces/DeltaEvent.html +0 -6
- package/docs/interfaces/DepositSplParams.html +0 -10
- package/docs/interfaces/Info.html +0 -3
- package/docs/interfaces/Market.html +0 -8
- package/docs/interfaces/MarketStats.html +0 -7
- package/docs/interfaces/MarketsStatsResponse.html +0 -2
- package/docs/interfaces/NordConfig.html +0 -24
- package/docs/interfaces/NordWebSocketClientEvents.html +0 -4
- package/docs/interfaces/NordWebSocketEvents.html +0 -8
- package/docs/interfaces/Order.html +0 -6
- package/docs/interfaces/OrderInfo.html +0 -6
- package/docs/interfaces/OrderbookEntry.html +0 -4
- package/docs/interfaces/OrderbookQuery.html +0 -6
- package/docs/interfaces/OrderbookResponse.html +0 -6
- package/docs/interfaces/OrderbookSubscription.html +0 -159
- package/docs/interfaces/PerpMarketStats.html +0 -5
- package/docs/interfaces/RollmanActionExtendedInfo.html +0 -4
- package/docs/interfaces/RollmanActionInfo.html +0 -4
- package/docs/interfaces/RollmanActionResponse.html +0 -4
- package/docs/interfaces/RollmanActionsResponse.html +0 -2
- package/docs/interfaces/RollmanBlockResponse.html +0 -3
- package/docs/interfaces/SPLTokenInfo.html +0 -10
- package/docs/interfaces/SolanaBridgeConfig.html +0 -10
- package/docs/interfaces/StateFacts.html +0 -10
- package/docs/interfaces/SubscriberConfig.html +0 -3
- package/docs/interfaces/TimestampResponse.html +0 -3
- package/docs/interfaces/Token.html +0 -5
- package/docs/interfaces/TokenInfo.html +0 -6
- package/docs/interfaces/Trade.html +0 -5
- package/docs/interfaces/TradeSubscription.html +0 -159
- package/docs/interfaces/Trades.html +0 -5
- package/docs/interfaces/TradesQuery.html +0 -6
- package/docs/interfaces/TradesResponse.html +0 -7
- package/docs/interfaces/TransferParams.html +0 -8
- package/docs/interfaces/UserAccountIdsQuery.html +0 -3
- package/docs/interfaces/UserAccountIdsResponse.html +0 -3
- package/docs/interfaces/WebSocketAccountUpdate.html +0 -6
- package/docs/interfaces/WebSocketDeltaUpdate.html +0 -9
- package/docs/interfaces/WebSocketSubscription.html +0 -4
- package/docs/interfaces/WebSocketTradeUpdate.html +0 -6
- package/docs/interfaces/WithdrawalClaim.html +0 -14
- package/docs/interfaces/WithdrawalParams.html +0 -8
- package/docs/modules.html +0 -1
- package/docs/types/BigIntValue.html +0 -2
- package/docs/types/SubscriptionPattern.html +0 -4
- package/docs/types/SubscriptionType.html +0 -2
- package/docs/types/WebSocketMessage.html +0 -1
- package/docs/variables/DEBUG_KEYS.html +0 -1
- package/docs/variables/DEFAULT_FUNDING_AMOUNTS.html +0 -1
- package/docs/variables/DEV_TOKEN_INFOS.html +0 -1
- package/docs/variables/DEV_URL.html +0 -1
- package/docs/variables/MAX_BUFFER_LEN.html +0 -1
- package/docs/variables/SESSION_TTL.html +0 -1
- package/docs/variables/WEBSERVER_DEV_URL.html +0 -1
- package/docs/variables/ZERO_DECIMAL.html +0 -1
- package/docs/variables/_private.html +0 -2
- package/idl-generate.sh +0 -4
- package/src/bridge/client.ts +0 -498
- package/src/bridge/const.ts +0 -53
- package/src/bridge/index.ts +0 -6
- package/src/bridge/types.ts +0 -129
- package/src/bridge/utils.ts +0 -140
- package/src/gen/common.ts +0 -297
- package/src/gen/nord.ts +0 -6723
- package/src/idl/index.ts +0 -2
package/dist/bridge/client.js
CHANGED
|
@@ -185,7 +185,28 @@ class SolanaBridgeClient {
|
|
|
185
185
|
}
|
|
186
186
|
const tokenAuthority = (await this.findPda(types_1.PdaSeedType.TokenAuthority, this.bridge))[0];
|
|
187
187
|
const crumbAuthority = (await this.findPda(types_1.PdaSeedType.CrumbAuthority, this.bridge))[0];
|
|
188
|
-
|
|
188
|
+
// Get the token program ID from the mint account
|
|
189
|
+
const mintAccount = await this.connection.getAccountInfo(params.mint);
|
|
190
|
+
if (!mintAccount) {
|
|
191
|
+
throw new Error("Mint account not found");
|
|
192
|
+
}
|
|
193
|
+
const tokenProgramId = mintAccount.owner;
|
|
194
|
+
// Validate that the mint is owned by a supported SPL token program
|
|
195
|
+
if (!tokenProgramId.equals(spl_token_1.TOKEN_PROGRAM_ID) &&
|
|
196
|
+
!tokenProgramId.equals(spl_token_1.TOKEN_2022_PROGRAM_ID)) {
|
|
197
|
+
throw new Error("Mint Account is not owned by a supported SPL token program");
|
|
198
|
+
}
|
|
199
|
+
// Get the token program ID from the fromAccount to ensure we're using the same program
|
|
200
|
+
const fromAccountInfo = await this.connection.getAccountInfo(params.fromAccount);
|
|
201
|
+
if (!fromAccountInfo) {
|
|
202
|
+
throw new Error(`From account not found for address: ${params.fromAccount.toBase58()}. ` +
|
|
203
|
+
"This may indicate an invalid, uninitialized, or missing token account.");
|
|
204
|
+
}
|
|
205
|
+
if (!fromAccountInfo.owner.equals(tokenProgramId)) {
|
|
206
|
+
throw new Error(`From account owner (${fromAccountInfo.owner.toBase58()}) does not match mint owner (${tokenProgramId.toBase58()}). ` +
|
|
207
|
+
"This usually means the fromAccount is not a valid token account for the given mint.");
|
|
208
|
+
}
|
|
209
|
+
const toAccount = await (0, spl_token_1.getAssociatedTokenAddress)(params.mint, tokenAuthority, true, tokenProgramId);
|
|
189
210
|
// Build the transaction
|
|
190
211
|
const accounts = {
|
|
191
212
|
payer: this.provider.wallet.publicKey,
|
|
@@ -195,7 +216,7 @@ class SolanaBridgeClient {
|
|
|
195
216
|
program: this.programId,
|
|
196
217
|
fromAccount: params.fromAccount,
|
|
197
218
|
toAccount: toAccount,
|
|
198
|
-
tokenProgram:
|
|
219
|
+
tokenProgram: tokenProgramId,
|
|
199
220
|
systemProgram: web3_js_1.SystemProgram.programId,
|
|
200
221
|
crumbAuthority,
|
|
201
222
|
tokenAuthority,
|
|
@@ -217,7 +238,7 @@ class SolanaBridgeClient {
|
|
|
217
238
|
toAccount, // associated token account address
|
|
218
239
|
authority, // owner of the token account
|
|
219
240
|
params.mint, // token mint
|
|
220
|
-
|
|
241
|
+
tokenProgramId);
|
|
221
242
|
// Add the instruction to the beginning of the transaction
|
|
222
243
|
tx.instructions.unshift(createTokenAccountIx);
|
|
223
244
|
}
|
|
@@ -235,6 +256,18 @@ class SolanaBridgeClient {
|
|
|
235
256
|
const [stateUpdate] = await this.findBlockStoragePda(params.claim.blockId.toNumber());
|
|
236
257
|
const [withdrawalNullifier] = await this.findWithdrawalNullifierPda(params.claim.blockId.toNumber(), params.claim.leafIndex.toNumber());
|
|
237
258
|
const [authority] = await this.findAuthorityPda();
|
|
259
|
+
// Get the token program ID from the fromAccount
|
|
260
|
+
const fromAccountInfo = await this.connection.getAccountInfo(params.fromAccount);
|
|
261
|
+
if (!fromAccountInfo) {
|
|
262
|
+
throw new Error(`From account not found for address: ${params.fromAccount.toBase58()}. ` +
|
|
263
|
+
"This may indicate an invalid, uninitialized, or missing token account.");
|
|
264
|
+
}
|
|
265
|
+
const tokenProgramId = fromAccountInfo.owner;
|
|
266
|
+
// Validate that the account is owned by a supported SPL token program
|
|
267
|
+
if (!tokenProgramId.equals(spl_token_1.TOKEN_PROGRAM_ID) &&
|
|
268
|
+
!tokenProgramId.equals(spl_token_1.TOKEN_2022_PROGRAM_ID)) {
|
|
269
|
+
throw new Error("From Account is not owned by a supported SPL token program");
|
|
270
|
+
}
|
|
238
271
|
// Build the transaction
|
|
239
272
|
const tx = await this.program.methods
|
|
240
273
|
.withdraw(params.claim)
|
|
@@ -245,7 +278,7 @@ class SolanaBridgeClient {
|
|
|
245
278
|
fromAccount: params.fromAccount,
|
|
246
279
|
toAccount: params.toAccount,
|
|
247
280
|
authority,
|
|
248
|
-
tokenProgram:
|
|
281
|
+
tokenProgram: tokenProgramId,
|
|
249
282
|
systemProgram: web3_js_1.SystemProgram.programId,
|
|
250
283
|
})
|
|
251
284
|
.transaction();
|
|
@@ -379,13 +412,19 @@ class SolanaBridgeClient {
|
|
|
379
412
|
* @returns Associated token account address
|
|
380
413
|
*/
|
|
381
414
|
async createTokenAccountIfNeeded(mint, owner, payer) {
|
|
382
|
-
|
|
415
|
+
// Get the token program ID from the mint account
|
|
416
|
+
const mintAccount = await this.connection.getAccountInfo(mint);
|
|
417
|
+
if (!mintAccount) {
|
|
418
|
+
throw new Error("Mint account not found");
|
|
419
|
+
}
|
|
420
|
+
const tokenProgramId = mintAccount.owner;
|
|
421
|
+
const associatedTokenAddress = await (0, spl_token_1.getAssociatedTokenAddress)(mint, owner, false, tokenProgramId);
|
|
383
422
|
try {
|
|
384
423
|
await this.connection.getTokenAccountBalance(associatedTokenAddress);
|
|
385
424
|
}
|
|
386
425
|
catch {
|
|
387
426
|
// Account doesn't exist, create it
|
|
388
|
-
const transaction = new web3_js_1.Transaction().add((0, spl_token_1.createAssociatedTokenAccountInstruction)(payer.publicKey, associatedTokenAddress, owner, mint));
|
|
427
|
+
const transaction = new web3_js_1.Transaction().add((0, spl_token_1.createAssociatedTokenAccountInstruction)(payer.publicKey, associatedTokenAddress, owner, mint, tokenProgramId));
|
|
389
428
|
// Sign and send the transaction using our helper method
|
|
390
429
|
await this.signAndSendTransaction(transaction, [payer]);
|
|
391
430
|
}
|
package/dist/gen/common.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
4
|
// protoc-gen-ts_proto v2.7.0
|
|
5
|
-
// protoc
|
|
5
|
+
// protoc v5.28.3
|
|
6
6
|
// source: common.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.Message_Transfer = exports.Message = exports.protobufPackage = void 0;
|
package/dist/gen/nord.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
-
import { Message } from "./common";
|
|
3
2
|
export declare const protobufPackage = "nord";
|
|
4
3
|
export declare enum Side {
|
|
5
4
|
ASK = 0,
|
|
@@ -119,31 +118,6 @@ export declare enum Error {
|
|
|
119
118
|
* retained on account
|
|
120
119
|
*/
|
|
121
120
|
DUST_ACCOUNT = 145,
|
|
122
|
-
/** ORDER_EXECUTION - 10011_000 - 3 bit suffix */
|
|
123
|
-
ORDER_EXECUTION = 152,
|
|
124
|
-
/** ORDER_EXECUTION_EMPTY - 10011_001; */
|
|
125
|
-
ORDER_EXECUTION_EMPTY = 153,
|
|
126
|
-
/** ORDER_EXECUTION_FILL_OR_KILL - 10011_010; */
|
|
127
|
-
ORDER_EXECUTION_FILL_OR_KILL = 154,
|
|
128
|
-
/**
|
|
129
|
-
* ORDER_EXECUTION_MISSING_LIMITS - Order requires some of its limits specified according to fill mode
|
|
130
|
-
* 10011_011;
|
|
131
|
-
*/
|
|
132
|
-
ORDER_EXECUTION_MISSING_LIMITS = 155,
|
|
133
|
-
/** ORDER_EXECUTION_MISSING_PRICE - 10011_100; */
|
|
134
|
-
ORDER_EXECUTION_MISSING_PRICE = 156,
|
|
135
|
-
/** ORDER_EXECUTION_SIZE_LIMIT - 10011_101; */
|
|
136
|
-
ORDER_EXECUTION_SIZE_LIMIT = 157,
|
|
137
|
-
/**
|
|
138
|
-
* ORDER_REDUCE_IS_POST_ONLY - 10011_110;
|
|
139
|
-
* Reduce orders can only be post only.
|
|
140
|
-
*/
|
|
141
|
-
ORDER_REDUCE_IS_POST_ONLY = 158,
|
|
142
|
-
/**
|
|
143
|
-
* ORDER_EXECUTION_SELL_PRICE - 10011_111;
|
|
144
|
-
* Order was rejected, because it planned under proposed price
|
|
145
|
-
*/
|
|
146
|
-
ORDER_EXECUTION_SELL_PRICE = 159,
|
|
147
121
|
/** BALANCE - 10100_000 */
|
|
148
122
|
BALANCE = 160,
|
|
149
123
|
/** BALANCE_DEPOSIT_OVERFLOW - 10100_001 */
|
|
@@ -212,6 +186,19 @@ export declare enum Error {
|
|
|
212
186
|
SIGNATURE_VERIFICATION = 217,
|
|
213
187
|
SIGNATURE_VERIFICATION_MALFORMED_PUBLIC_KEY = 218,
|
|
214
188
|
SIGNATURE_VERIFICATION_INVALID_LENGTH = 219,
|
|
189
|
+
/** ORDER_EXECUTION - 1111_0000 = 240 -- 4 bit suffix */
|
|
190
|
+
ORDER_EXECUTION = 240,
|
|
191
|
+
ORDER_EXECUTION_EMPTY = 241,
|
|
192
|
+
ORDER_EXECUTION_FILL_OR_KILL = 242,
|
|
193
|
+
/** ORDER_EXECUTION_MISSING_LIMITS - Order requires some of its limits specified according to fill mode */
|
|
194
|
+
ORDER_EXECUTION_MISSING_LIMITS = 243,
|
|
195
|
+
ORDER_EXECUTION_MISSING_PRICE = 244,
|
|
196
|
+
ORDER_EXECUTION_SIZE_LIMIT = 245,
|
|
197
|
+
ORDER_EXECUTION_LIMIT_PRICE = 246,
|
|
198
|
+
/** ORDER_REDUCE_IS_POST_ONLY - Reduce orders can only be post only. */
|
|
199
|
+
ORDER_REDUCE_IS_POST_ONLY = 247,
|
|
200
|
+
/** ORDER_EXECUTION_SELL_PRICE - Order was rejected, because it planned under proposed price */
|
|
201
|
+
ORDER_EXECUTION_SELL_PRICE = 248,
|
|
215
202
|
NOT_IMPLEMENTED = 500,
|
|
216
203
|
Dropped = 999
|
|
217
204
|
}
|
|
@@ -247,6 +234,29 @@ export interface Token {
|
|
|
247
234
|
weightBps: number;
|
|
248
235
|
viewSymbol: string;
|
|
249
236
|
}
|
|
237
|
+
export interface QuoteSize {
|
|
238
|
+
size: bigint;
|
|
239
|
+
price: bigint;
|
|
240
|
+
}
|
|
241
|
+
export interface OrderLimit {
|
|
242
|
+
price: bigint;
|
|
243
|
+
size: bigint;
|
|
244
|
+
quoteSize: QuoteSize | undefined;
|
|
245
|
+
}
|
|
246
|
+
export interface OrderType {
|
|
247
|
+
side: Side;
|
|
248
|
+
fillMode: FillMode;
|
|
249
|
+
isReduceOnly: boolean;
|
|
250
|
+
}
|
|
251
|
+
export interface TradeOrPlace {
|
|
252
|
+
marketId: number;
|
|
253
|
+
orderType: OrderType | undefined;
|
|
254
|
+
limit: OrderLimit | undefined;
|
|
255
|
+
clientOrderId?: bigint | undefined;
|
|
256
|
+
}
|
|
257
|
+
export interface CancelOrder {
|
|
258
|
+
orderId: bigint;
|
|
259
|
+
}
|
|
250
260
|
export interface Action {
|
|
251
261
|
/**
|
|
252
262
|
* Must be within 60s of the engine's current logical time, which
|
|
@@ -308,9 +318,6 @@ export interface Action {
|
|
|
308
318
|
} | {
|
|
309
319
|
$case: "transfer";
|
|
310
320
|
value: Action_Transfer;
|
|
311
|
-
} | {
|
|
312
|
-
$case: "message";
|
|
313
|
-
value: Message;
|
|
314
321
|
} | {
|
|
315
322
|
$case: "addTrigger";
|
|
316
323
|
value: Action_AddTrigger;
|
|
@@ -320,6 +327,9 @@ export interface Action {
|
|
|
320
327
|
} | {
|
|
321
328
|
$case: "takePosition";
|
|
322
329
|
value: Action_TakePosition;
|
|
330
|
+
} | {
|
|
331
|
+
$case: "transaction";
|
|
332
|
+
value: Transaction;
|
|
323
333
|
} | undefined;
|
|
324
334
|
}
|
|
325
335
|
export interface Action_CreateSession {
|
|
@@ -574,6 +584,20 @@ export interface Action_TakePosition {
|
|
|
574
584
|
*/
|
|
575
585
|
price?: bigint | undefined;
|
|
576
586
|
}
|
|
587
|
+
export interface TransactionKind {
|
|
588
|
+
inner?: {
|
|
589
|
+
$case: "tradeOrPlace";
|
|
590
|
+
value: TradeOrPlace;
|
|
591
|
+
} | {
|
|
592
|
+
$case: "cancelOrder";
|
|
593
|
+
value: CancelOrder;
|
|
594
|
+
} | undefined;
|
|
595
|
+
}
|
|
596
|
+
export interface Transaction {
|
|
597
|
+
sessionId: bigint;
|
|
598
|
+
accountId?: bigint | undefined;
|
|
599
|
+
actions: TransactionKind[];
|
|
600
|
+
}
|
|
577
601
|
export interface Receipt {
|
|
578
602
|
/**
|
|
579
603
|
* Action id which was run to produce this receipt.
|
|
@@ -705,6 +729,7 @@ export interface Receipt_WithdrawResult {
|
|
|
705
729
|
amount: bigint;
|
|
706
730
|
balance: bigint;
|
|
707
731
|
accountId: number;
|
|
732
|
+
fee: bigint;
|
|
708
733
|
userPubkey: Uint8Array;
|
|
709
734
|
}
|
|
710
735
|
/** pyth receipts are not user facing, so they can be terse and optional */
|
|
@@ -752,6 +777,11 @@ export interface Receipt_TriggerRemoved {
|
|
|
752
777
|
export declare const U128: MessageFns<U128>;
|
|
753
778
|
export declare const Market: MessageFns<Market>;
|
|
754
779
|
export declare const Token: MessageFns<Token>;
|
|
780
|
+
export declare const QuoteSize: MessageFns<QuoteSize>;
|
|
781
|
+
export declare const OrderLimit: MessageFns<OrderLimit>;
|
|
782
|
+
export declare const OrderType: MessageFns<OrderType>;
|
|
783
|
+
export declare const TradeOrPlace: MessageFns<TradeOrPlace>;
|
|
784
|
+
export declare const CancelOrder: MessageFns<CancelOrder>;
|
|
755
785
|
export declare const Action: MessageFns<Action>;
|
|
756
786
|
export declare const Action_CreateSession: MessageFns<Action_CreateSession>;
|
|
757
787
|
export declare const Action_CreateToken: MessageFns<Action_CreateToken>;
|
|
@@ -771,6 +801,8 @@ export declare const Action_Transfer: MessageFns<Action_Transfer>;
|
|
|
771
801
|
export declare const Action_AddTrigger: MessageFns<Action_AddTrigger>;
|
|
772
802
|
export declare const Action_RemoveTrigger: MessageFns<Action_RemoveTrigger>;
|
|
773
803
|
export declare const Action_TakePosition: MessageFns<Action_TakePosition>;
|
|
804
|
+
export declare const TransactionKind: MessageFns<TransactionKind>;
|
|
805
|
+
export declare const Transaction: MessageFns<Transaction>;
|
|
774
806
|
export declare const Receipt: MessageFns<Receipt>;
|
|
775
807
|
export declare const Receipt_Posted: MessageFns<Receipt_Posted>;
|
|
776
808
|
export declare const Receipt_Trade: MessageFns<Receipt_Trade>;
|