@byreal-io/byreal-cli-realclaw 0.3.11 → 0.3.12
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.cjs +2580 -436
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3029,11 +3029,11 @@ var require_commander = __commonJS({
|
|
|
3029
3029
|
});
|
|
3030
3030
|
|
|
3031
3031
|
// src/core/constants.ts
|
|
3032
|
-
var INJECTED_VERSION, VERSION, CLI_NAME, NPM_PACKAGE, API_BASE_URL, API_ENDPOINTS, SOLANA_RPC_URL, SOLANA_CLUSTER,
|
|
3032
|
+
var INJECTED_VERSION, VERSION, CLI_NAME, NPM_PACKAGE, API_BASE_URL, API_ENDPOINTS, SOLANA_RPC_URL, SOLANA_CLUSTER, JUPITER_API_KEY, JUP_PAID_BASE, JUP_FREE_BASE, TITAN_API_URL, TITAN_AUTH_TOKEN, DFLOW_PAID_URL, DFLOW_FREE_URL, DFLOW_API_KEY, CONFIG_DIR, CONFIG_FILE, DEFAULTS, TABLE_CHARS, LOGO, EXPERIMENTAL_WARNING, DEFAULT_CONFIG, DIR_PERMISSIONS;
|
|
3033
3033
|
var init_constants = __esm({
|
|
3034
3034
|
"src/core/constants.ts"() {
|
|
3035
3035
|
"use strict";
|
|
3036
|
-
INJECTED_VERSION = true ? "0.3.
|
|
3036
|
+
INJECTED_VERSION = true ? "0.3.12" : void 0;
|
|
3037
3037
|
VERSION = INJECTED_VERSION ?? process.env.npm_package_version ?? "0.0.0";
|
|
3038
3038
|
CLI_NAME = "byreal-cli";
|
|
3039
3039
|
NPM_PACKAGE = "@byreal-io/byreal-cli-realclaw";
|
|
@@ -3067,10 +3067,13 @@ var init_constants = __esm({
|
|
|
3067
3067
|
};
|
|
3068
3068
|
SOLANA_RPC_URL = process.env.SOLANA_RPC_URL || "https://jenelle-p85r4h-fast-mainnet.helius-rpc.com";
|
|
3069
3069
|
SOLANA_CLUSTER = process.env.SOLANA_CLUSTER || "mainnet-beta";
|
|
3070
|
-
|
|
3071
|
-
|
|
3070
|
+
JUPITER_API_KEY = process.env.JUPITER_API_KEY || process.env.JUP_API_KEY;
|
|
3071
|
+
JUP_PAID_BASE = "https://api.jup.ag";
|
|
3072
|
+
JUP_FREE_BASE = "https://lite-api.jup.ag";
|
|
3073
|
+
TITAN_API_URL = process.env.TITAN_API_URL || "https://partners.api.titan.exchange";
|
|
3072
3074
|
TITAN_AUTH_TOKEN = process.env.TITAN_AUTH_TOKEN;
|
|
3073
|
-
|
|
3075
|
+
DFLOW_PAID_URL = "https://quote-api.dflow.net";
|
|
3076
|
+
DFLOW_FREE_URL = "https://dev-quote-api.dflow.net";
|
|
3074
3077
|
DFLOW_API_KEY = process.env.DFLOW_API_KEY;
|
|
3075
3078
|
CONFIG_DIR = "~/.config/byreal";
|
|
3076
3079
|
CONFIG_FILE = "config.json";
|
|
@@ -15907,7 +15910,7 @@ var require_dist = __commonJS({
|
|
|
15907
15910
|
"use strict";
|
|
15908
15911
|
class StructError extends TypeError {
|
|
15909
15912
|
constructor(failure, failures) {
|
|
15910
|
-
let
|
|
15913
|
+
let cached2;
|
|
15911
15914
|
const { message, explanation, ...rest } = failure;
|
|
15912
15915
|
const { path: path3 } = failure;
|
|
15913
15916
|
const msg = path3.length === 0 ? message : `At path: ${path3.join(".")} -- ${message}`;
|
|
@@ -15917,7 +15920,7 @@ var require_dist = __commonJS({
|
|
|
15917
15920
|
Object.assign(this, rest);
|
|
15918
15921
|
this.name = this.constructor.name;
|
|
15919
15922
|
this.failures = () => {
|
|
15920
|
-
return
|
|
15923
|
+
return cached2 ?? (cached2 = [failure, ...failures()]);
|
|
15921
15924
|
};
|
|
15922
15925
|
}
|
|
15923
15926
|
}
|
|
@@ -22662,7 +22665,7 @@ var require_websocket = __commonJS({
|
|
|
22662
22665
|
var EventEmitter = require("events");
|
|
22663
22666
|
var https = require("https");
|
|
22664
22667
|
var http = require("http");
|
|
22665
|
-
var
|
|
22668
|
+
var net2 = require("net");
|
|
22666
22669
|
var tls = require("tls");
|
|
22667
22670
|
var { randomBytes, createHash } = require("crypto");
|
|
22668
22671
|
var { Duplex, Readable } = require("stream");
|
|
@@ -23396,12 +23399,12 @@ var require_websocket = __commonJS({
|
|
|
23396
23399
|
}
|
|
23397
23400
|
function netConnect(options) {
|
|
23398
23401
|
options.path = options.socketPath;
|
|
23399
|
-
return
|
|
23402
|
+
return net2.connect(options);
|
|
23400
23403
|
}
|
|
23401
23404
|
function tlsConnect(options) {
|
|
23402
23405
|
options.path = void 0;
|
|
23403
23406
|
if (!options.servername && options.servername !== "") {
|
|
23404
|
-
options.servername =
|
|
23407
|
+
options.servername = net2.isIP(options.host) ? "" : options.host;
|
|
23405
23408
|
}
|
|
23406
23409
|
return tls.connect(options);
|
|
23407
23410
|
}
|
|
@@ -26990,7 +26993,7 @@ var require_index_cjs = __commonJS({
|
|
|
26990
26993
|
return value._bn !== void 0;
|
|
26991
26994
|
}
|
|
26992
26995
|
var uniquePublicKeyCounter = 1;
|
|
26993
|
-
var
|
|
26996
|
+
var PublicKey51 = class _PublicKey2 extends Struct {
|
|
26994
26997
|
/**
|
|
26995
26998
|
* Create a new PublicKey object
|
|
26996
26999
|
* @param value ed25519 public key as buffer or base-58 encoded string
|
|
@@ -27152,9 +27155,9 @@ var require_index_cjs = __commonJS({
|
|
|
27152
27155
|
return isOnCurve(pubkey.toBytes());
|
|
27153
27156
|
}
|
|
27154
27157
|
};
|
|
27155
|
-
_PublicKey =
|
|
27156
|
-
|
|
27157
|
-
SOLANA_SCHEMA.set(
|
|
27158
|
+
_PublicKey = PublicKey51;
|
|
27159
|
+
PublicKey51.default = new _PublicKey("11111111111111111111111111111111");
|
|
27160
|
+
SOLANA_SCHEMA.set(PublicKey51, {
|
|
27158
27161
|
kind: "struct",
|
|
27159
27162
|
fields: [["_bn", "u256"]]
|
|
27160
27163
|
});
|
|
@@ -27186,7 +27189,7 @@ var require_index_cjs = __commonJS({
|
|
|
27186
27189
|
* The public key for this account
|
|
27187
27190
|
*/
|
|
27188
27191
|
get publicKey() {
|
|
27189
|
-
return new
|
|
27192
|
+
return new PublicKey51(this._publicKey);
|
|
27190
27193
|
}
|
|
27191
27194
|
/**
|
|
27192
27195
|
* The **unencrypted** secret key for this account. The first 32 bytes
|
|
@@ -27197,7 +27200,7 @@ var require_index_cjs = __commonJS({
|
|
|
27197
27200
|
return buffer.Buffer.concat([this._secretKey, this._publicKey], 64);
|
|
27198
27201
|
}
|
|
27199
27202
|
};
|
|
27200
|
-
var BPF_LOADER_DEPRECATED_PROGRAM_ID = new
|
|
27203
|
+
var BPF_LOADER_DEPRECATED_PROGRAM_ID = new PublicKey51("BPFLoader1111111111111111111111111111111111");
|
|
27201
27204
|
var PACKET_DATA_SIZE = 1280 - 40 - 8;
|
|
27202
27205
|
var VERSION_PREFIX_MASK = 127;
|
|
27203
27206
|
var SIGNATURE_LENGTH_IN_BYTES = 64;
|
|
@@ -27428,7 +27431,7 @@ var require_index_cjs = __commonJS({
|
|
|
27428
27431
|
const [payerAddress] = writableSigners[0];
|
|
27429
27432
|
assert(payerAddress === this.payer.toBase58(), "Expected first writable signer key to be the fee payer");
|
|
27430
27433
|
}
|
|
27431
|
-
const staticAccountKeys = [...writableSigners.map(([address]) => new
|
|
27434
|
+
const staticAccountKeys = [...writableSigners.map(([address]) => new PublicKey51(address)), ...readonlySigners.map(([address]) => new PublicKey51(address)), ...writableNonSigners.map(([address]) => new PublicKey51(address)), ...readonlyNonSigners.map(([address]) => new PublicKey51(address))];
|
|
27432
27435
|
return [header, staticAccountKeys];
|
|
27433
27436
|
}
|
|
27434
27437
|
extractTableLookup(lookupTable) {
|
|
@@ -27452,7 +27455,7 @@ var require_index_cjs = __commonJS({
|
|
|
27452
27455
|
const drainedKeys = new Array();
|
|
27453
27456
|
for (const [address, keyMeta] of this.keyMetaMap.entries()) {
|
|
27454
27457
|
if (keyMetaFilter(keyMeta)) {
|
|
27455
|
-
const key = new
|
|
27458
|
+
const key = new PublicKey51(address);
|
|
27456
27459
|
const lookupTableIndex = lookupTableEntries.findIndex((entry) => entry.equals(key));
|
|
27457
27460
|
if (lookupTableIndex >= 0) {
|
|
27458
27461
|
assert(lookupTableIndex < 256, "Max lookup table index exceeded");
|
|
@@ -27487,7 +27490,7 @@ var require_index_cjs = __commonJS({
|
|
|
27487
27490
|
this.instructions = void 0;
|
|
27488
27491
|
this.indexToProgramIds = /* @__PURE__ */ new Map();
|
|
27489
27492
|
this.header = args.header;
|
|
27490
|
-
this.accountKeys = args.accountKeys.map((account) => new
|
|
27493
|
+
this.accountKeys = args.accountKeys.map((account) => new PublicKey51(account));
|
|
27491
27494
|
this.recentBlockhash = args.recentBlockhash;
|
|
27492
27495
|
this.instructions = args.instructions;
|
|
27493
27496
|
this.instructions.forEach((ix) => this.indexToProgramIds.set(ix.programIdIndex, this.accountKeys[ix.programIdIndex]));
|
|
@@ -27613,7 +27616,7 @@ var require_index_cjs = __commonJS({
|
|
|
27613
27616
|
let accountKeys = [];
|
|
27614
27617
|
for (let i = 0; i < accountCount; i++) {
|
|
27615
27618
|
const account = guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH2);
|
|
27616
|
-
accountKeys.push(new
|
|
27619
|
+
accountKeys.push(new PublicKey51(buffer.Buffer.from(account)));
|
|
27617
27620
|
}
|
|
27618
27621
|
const recentBlockhash = guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH2);
|
|
27619
27622
|
const instructionCount = decodeLength(byteArray);
|
|
@@ -27837,7 +27840,7 @@ var require_index_cjs = __commonJS({
|
|
|
27837
27840
|
const staticAccountKeys = [];
|
|
27838
27841
|
const staticAccountKeysLength = decodeLength(byteArray);
|
|
27839
27842
|
for (let i = 0; i < staticAccountKeysLength; i++) {
|
|
27840
|
-
staticAccountKeys.push(new
|
|
27843
|
+
staticAccountKeys.push(new PublicKey51(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH2)));
|
|
27841
27844
|
}
|
|
27842
27845
|
const recentBlockhash = bs58__default.default.encode(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH2));
|
|
27843
27846
|
const instructionCount = decodeLength(byteArray);
|
|
@@ -27857,7 +27860,7 @@ var require_index_cjs = __commonJS({
|
|
|
27857
27860
|
const addressTableLookupsCount = decodeLength(byteArray);
|
|
27858
27861
|
const addressTableLookups = [];
|
|
27859
27862
|
for (let i = 0; i < addressTableLookupsCount; i++) {
|
|
27860
|
-
const accountKey = new
|
|
27863
|
+
const accountKey = new PublicKey51(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH2));
|
|
27861
27864
|
const writableIndexesLength = decodeLength(byteArray);
|
|
27862
27865
|
const writableIndexes = guardedSplice(byteArray, 0, writableIndexesLength);
|
|
27863
27866
|
const readonlyIndexesLength = decodeLength(byteArray);
|
|
@@ -27906,7 +27909,7 @@ var require_index_cjs = __commonJS({
|
|
|
27906
27909
|
return TransactionStatus2;
|
|
27907
27910
|
}({});
|
|
27908
27911
|
var DEFAULT_SIGNATURE = buffer.Buffer.alloc(SIGNATURE_LENGTH_IN_BYTES).fill(0);
|
|
27909
|
-
var
|
|
27912
|
+
var TransactionInstruction44 = class {
|
|
27910
27913
|
constructor(opts) {
|
|
27911
27914
|
this.keys = void 0;
|
|
27912
27915
|
this.programId = void 0;
|
|
@@ -28038,7 +28041,7 @@ var require_index_cjs = __commonJS({
|
|
|
28038
28041
|
} else if ("data" in item && "programId" in item && "keys" in item) {
|
|
28039
28042
|
this.instructions.push(item);
|
|
28040
28043
|
} else {
|
|
28041
|
-
this.instructions.push(new
|
|
28044
|
+
this.instructions.push(new TransactionInstruction44(item));
|
|
28042
28045
|
}
|
|
28043
28046
|
});
|
|
28044
28047
|
return this;
|
|
@@ -28097,7 +28100,7 @@ var require_index_cjs = __commonJS({
|
|
|
28097
28100
|
});
|
|
28098
28101
|
programIds.forEach((programId) => {
|
|
28099
28102
|
accountMetas.push({
|
|
28100
|
-
pubkey: new
|
|
28103
|
+
pubkey: new PublicKey51(programId),
|
|
28101
28104
|
isSigner: false,
|
|
28102
28105
|
isWritable: false
|
|
28103
28106
|
});
|
|
@@ -28531,7 +28534,7 @@ Missing signature for public key${sigErrors.missing.length === 1 ? "" : "(s)"} [
|
|
|
28531
28534
|
isWritable: message.isAccountWritable(account)
|
|
28532
28535
|
};
|
|
28533
28536
|
});
|
|
28534
|
-
transaction.instructions.push(new
|
|
28537
|
+
transaction.instructions.push(new TransactionInstruction44({
|
|
28535
28538
|
keys,
|
|
28536
28539
|
programId: message.accountKeys[instruction.programIdIndex],
|
|
28537
28540
|
data: bs58__default.default.decode(instruction.data)
|
|
@@ -28542,7 +28545,7 @@ Missing signature for public key${sigErrors.missing.length === 1 ? "" : "(s)"} [
|
|
|
28542
28545
|
return transaction;
|
|
28543
28546
|
}
|
|
28544
28547
|
};
|
|
28545
|
-
var
|
|
28548
|
+
var TransactionMessage5 = class _TransactionMessage {
|
|
28546
28549
|
constructor(args) {
|
|
28547
28550
|
this.payerKey = void 0;
|
|
28548
28551
|
this.instructions = void 0;
|
|
@@ -28599,7 +28602,7 @@ Missing signature for public key${sigErrors.missing.length === 1 ? "" : "(s)"} [
|
|
|
28599
28602
|
if (programId === void 0) {
|
|
28600
28603
|
throw new Error(`Failed to find program id for program id index ${compiledIx.programIdIndex}`);
|
|
28601
28604
|
}
|
|
28602
|
-
instructions.push(new
|
|
28605
|
+
instructions.push(new TransactionInstruction44({
|
|
28603
28606
|
programId,
|
|
28604
28607
|
data: toBuffer(compiledIx.data),
|
|
28605
28608
|
keys
|
|
@@ -28627,7 +28630,7 @@ Missing signature for public key${sigErrors.missing.length === 1 ? "" : "(s)"} [
|
|
|
28627
28630
|
});
|
|
28628
28631
|
}
|
|
28629
28632
|
};
|
|
28630
|
-
var
|
|
28633
|
+
var VersionedTransaction6 = class _VersionedTransaction {
|
|
28631
28634
|
get version() {
|
|
28632
28635
|
return this.message.version;
|
|
28633
28636
|
}
|
|
@@ -28690,15 +28693,15 @@ Missing signature for public key${sigErrors.missing.length === 1 ? "" : "(s)"} [
|
|
|
28690
28693
|
var DEFAULT_TICKS_PER_SLOT = 64;
|
|
28691
28694
|
var NUM_SLOTS_PER_SECOND = NUM_TICKS_PER_SECOND / DEFAULT_TICKS_PER_SLOT;
|
|
28692
28695
|
var MS_PER_SLOT = 1e3 / NUM_SLOTS_PER_SECOND;
|
|
28693
|
-
var SYSVAR_CLOCK_PUBKEY2 = new
|
|
28694
|
-
var SYSVAR_EPOCH_SCHEDULE_PUBKEY = new
|
|
28695
|
-
var SYSVAR_INSTRUCTIONS_PUBKEY = new
|
|
28696
|
-
var SYSVAR_RECENT_BLOCKHASHES_PUBKEY = new
|
|
28697
|
-
var SYSVAR_RENT_PUBKEY5 = new
|
|
28698
|
-
var SYSVAR_REWARDS_PUBKEY = new
|
|
28699
|
-
var SYSVAR_SLOT_HASHES_PUBKEY = new
|
|
28700
|
-
var SYSVAR_SLOT_HISTORY_PUBKEY = new
|
|
28701
|
-
var SYSVAR_STAKE_HISTORY_PUBKEY = new
|
|
28696
|
+
var SYSVAR_CLOCK_PUBKEY2 = new PublicKey51("SysvarC1ock11111111111111111111111111111111");
|
|
28697
|
+
var SYSVAR_EPOCH_SCHEDULE_PUBKEY = new PublicKey51("SysvarEpochSchedu1e111111111111111111111111");
|
|
28698
|
+
var SYSVAR_INSTRUCTIONS_PUBKEY = new PublicKey51("Sysvar1nstructions1111111111111111111111111");
|
|
28699
|
+
var SYSVAR_RECENT_BLOCKHASHES_PUBKEY = new PublicKey51("SysvarRecentB1ockHashes11111111111111111111");
|
|
28700
|
+
var SYSVAR_RENT_PUBKEY5 = new PublicKey51("SysvarRent111111111111111111111111111111111");
|
|
28701
|
+
var SYSVAR_REWARDS_PUBKEY = new PublicKey51("SysvarRewards111111111111111111111111111111");
|
|
28702
|
+
var SYSVAR_SLOT_HASHES_PUBKEY = new PublicKey51("SysvarS1otHashes111111111111111111111111111");
|
|
28703
|
+
var SYSVAR_SLOT_HISTORY_PUBKEY = new PublicKey51("SysvarS1otHistory11111111111111111111111111");
|
|
28704
|
+
var SYSVAR_STAKE_HISTORY_PUBKEY = new PublicKey51("SysvarStakeHistory1111111111111111111111111");
|
|
28702
28705
|
var SendTransactionError = class extends Error {
|
|
28703
28706
|
constructor({
|
|
28704
28707
|
action,
|
|
@@ -28889,8 +28892,8 @@ Message: ${transactionMessage}.
|
|
|
28889
28892
|
static fromAccountData(buffer2) {
|
|
28890
28893
|
const nonceAccount = NonceAccountLayout.decode(toBuffer(buffer2), 0);
|
|
28891
28894
|
return new _NonceAccount({
|
|
28892
|
-
authorizedPubkey: new
|
|
28893
|
-
nonce: new
|
|
28895
|
+
authorizedPubkey: new PublicKey51(nonceAccount.authorizedPubkey),
|
|
28896
|
+
nonce: new PublicKey51(nonceAccount.nonce).toString(),
|
|
28894
28897
|
feeCalculator: nonceAccount.feeCalculator
|
|
28895
28898
|
});
|
|
28896
28899
|
}
|
|
@@ -28952,7 +28955,7 @@ Message: ${transactionMessage}.
|
|
|
28952
28955
|
newAccountPubkey: instruction.keys[1].pubkey,
|
|
28953
28956
|
lamports,
|
|
28954
28957
|
space,
|
|
28955
|
-
programId: new
|
|
28958
|
+
programId: new PublicKey51(programId)
|
|
28956
28959
|
};
|
|
28957
28960
|
}
|
|
28958
28961
|
/**
|
|
@@ -28987,7 +28990,7 @@ Message: ${transactionMessage}.
|
|
|
28987
28990
|
toPubkey: instruction.keys[2].pubkey,
|
|
28988
28991
|
lamports,
|
|
28989
28992
|
seed,
|
|
28990
|
-
programId: new
|
|
28993
|
+
programId: new PublicKey51(programId)
|
|
28991
28994
|
};
|
|
28992
28995
|
}
|
|
28993
28996
|
/**
|
|
@@ -29018,10 +29021,10 @@ Message: ${transactionMessage}.
|
|
|
29018
29021
|
} = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AllocateWithSeed, instruction.data);
|
|
29019
29022
|
return {
|
|
29020
29023
|
accountPubkey: instruction.keys[0].pubkey,
|
|
29021
|
-
basePubkey: new
|
|
29024
|
+
basePubkey: new PublicKey51(base),
|
|
29022
29025
|
seed,
|
|
29023
29026
|
space,
|
|
29024
|
-
programId: new
|
|
29027
|
+
programId: new PublicKey51(programId)
|
|
29025
29028
|
};
|
|
29026
29029
|
}
|
|
29027
29030
|
/**
|
|
@@ -29035,7 +29038,7 @@ Message: ${transactionMessage}.
|
|
|
29035
29038
|
} = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Assign, instruction.data);
|
|
29036
29039
|
return {
|
|
29037
29040
|
accountPubkey: instruction.keys[0].pubkey,
|
|
29038
|
-
programId: new
|
|
29041
|
+
programId: new PublicKey51(programId)
|
|
29039
29042
|
};
|
|
29040
29043
|
}
|
|
29041
29044
|
/**
|
|
@@ -29051,9 +29054,9 @@ Message: ${transactionMessage}.
|
|
|
29051
29054
|
} = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AssignWithSeed, instruction.data);
|
|
29052
29055
|
return {
|
|
29053
29056
|
accountPubkey: instruction.keys[0].pubkey,
|
|
29054
|
-
basePubkey: new
|
|
29057
|
+
basePubkey: new PublicKey51(base),
|
|
29055
29058
|
seed,
|
|
29056
|
-
programId: new
|
|
29059
|
+
programId: new PublicKey51(programId)
|
|
29057
29060
|
};
|
|
29058
29061
|
}
|
|
29059
29062
|
/**
|
|
@@ -29072,11 +29075,11 @@ Message: ${transactionMessage}.
|
|
|
29072
29075
|
return {
|
|
29073
29076
|
fromPubkey: instruction.keys[0].pubkey,
|
|
29074
29077
|
newAccountPubkey: instruction.keys[1].pubkey,
|
|
29075
|
-
basePubkey: new
|
|
29078
|
+
basePubkey: new PublicKey51(base),
|
|
29076
29079
|
seed,
|
|
29077
29080
|
lamports,
|
|
29078
29081
|
space,
|
|
29079
|
-
programId: new
|
|
29082
|
+
programId: new PublicKey51(programId)
|
|
29080
29083
|
};
|
|
29081
29084
|
}
|
|
29082
29085
|
/**
|
|
@@ -29090,7 +29093,7 @@ Message: ${transactionMessage}.
|
|
|
29090
29093
|
} = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.InitializeNonceAccount, instruction.data);
|
|
29091
29094
|
return {
|
|
29092
29095
|
noncePubkey: instruction.keys[0].pubkey,
|
|
29093
|
-
authorizedPubkey: new
|
|
29096
|
+
authorizedPubkey: new PublicKey51(authorized2)
|
|
29094
29097
|
};
|
|
29095
29098
|
}
|
|
29096
29099
|
/**
|
|
@@ -29133,7 +29136,7 @@ Message: ${transactionMessage}.
|
|
|
29133
29136
|
return {
|
|
29134
29137
|
noncePubkey: instruction.keys[0].pubkey,
|
|
29135
29138
|
authorizedPubkey: instruction.keys[1].pubkey,
|
|
29136
|
-
newAuthorizedPubkey: new
|
|
29139
|
+
newAuthorizedPubkey: new PublicKey51(authorized2)
|
|
29137
29140
|
};
|
|
29138
29141
|
}
|
|
29139
29142
|
/**
|
|
@@ -29226,7 +29229,7 @@ Message: ${transactionMessage}.
|
|
|
29226
29229
|
space: params.space,
|
|
29227
29230
|
programId: toBuffer(params.programId.toBuffer())
|
|
29228
29231
|
});
|
|
29229
|
-
return new
|
|
29232
|
+
return new TransactionInstruction44({
|
|
29230
29233
|
keys: [{
|
|
29231
29234
|
pubkey: params.fromPubkey,
|
|
29232
29235
|
isSigner: true,
|
|
@@ -29281,7 +29284,7 @@ Message: ${transactionMessage}.
|
|
|
29281
29284
|
isWritable: true
|
|
29282
29285
|
}];
|
|
29283
29286
|
}
|
|
29284
|
-
return new
|
|
29287
|
+
return new TransactionInstruction44({
|
|
29285
29288
|
keys,
|
|
29286
29289
|
programId: this.programId,
|
|
29287
29290
|
data
|
|
@@ -29320,7 +29323,7 @@ Message: ${transactionMessage}.
|
|
|
29320
29323
|
isWritable: true
|
|
29321
29324
|
}];
|
|
29322
29325
|
}
|
|
29323
|
-
return new
|
|
29326
|
+
return new TransactionInstruction44({
|
|
29324
29327
|
keys,
|
|
29325
29328
|
programId: this.programId,
|
|
29326
29329
|
data
|
|
@@ -29355,7 +29358,7 @@ Message: ${transactionMessage}.
|
|
|
29355
29358
|
isWritable: false
|
|
29356
29359
|
});
|
|
29357
29360
|
}
|
|
29358
|
-
return new
|
|
29361
|
+
return new TransactionInstruction44({
|
|
29359
29362
|
keys,
|
|
29360
29363
|
programId: this.programId,
|
|
29361
29364
|
data
|
|
@@ -29417,7 +29420,7 @@ Message: ${transactionMessage}.
|
|
|
29417
29420
|
programId: this.programId,
|
|
29418
29421
|
data
|
|
29419
29422
|
};
|
|
29420
|
-
return new
|
|
29423
|
+
return new TransactionInstruction44(instructionData);
|
|
29421
29424
|
}
|
|
29422
29425
|
/**
|
|
29423
29426
|
* Generate an instruction to advance the nonce in a Nonce account
|
|
@@ -29442,7 +29445,7 @@ Message: ${transactionMessage}.
|
|
|
29442
29445
|
programId: this.programId,
|
|
29443
29446
|
data
|
|
29444
29447
|
};
|
|
29445
|
-
return new
|
|
29448
|
+
return new TransactionInstruction44(instructionData);
|
|
29446
29449
|
}
|
|
29447
29450
|
/**
|
|
29448
29451
|
* Generate a transaction instruction that withdraws lamports from a Nonce account
|
|
@@ -29452,7 +29455,7 @@ Message: ${transactionMessage}.
|
|
|
29452
29455
|
const data = encodeData(type, {
|
|
29453
29456
|
lamports: params.lamports
|
|
29454
29457
|
});
|
|
29455
|
-
return new
|
|
29458
|
+
return new TransactionInstruction44({
|
|
29456
29459
|
keys: [{
|
|
29457
29460
|
pubkey: params.noncePubkey,
|
|
29458
29461
|
isSigner: false,
|
|
@@ -29487,7 +29490,7 @@ Message: ${transactionMessage}.
|
|
|
29487
29490
|
const data = encodeData(type, {
|
|
29488
29491
|
authorized: toBuffer(params.newAuthorizedPubkey.toBuffer())
|
|
29489
29492
|
});
|
|
29490
|
-
return new
|
|
29493
|
+
return new TransactionInstruction44({
|
|
29491
29494
|
keys: [{
|
|
29492
29495
|
pubkey: params.noncePubkey,
|
|
29493
29496
|
isSigner: false,
|
|
@@ -29535,14 +29538,14 @@ Message: ${transactionMessage}.
|
|
|
29535
29538
|
isWritable: true
|
|
29536
29539
|
}];
|
|
29537
29540
|
}
|
|
29538
|
-
return new
|
|
29541
|
+
return new TransactionInstruction44({
|
|
29539
29542
|
keys,
|
|
29540
29543
|
programId: this.programId,
|
|
29541
29544
|
data
|
|
29542
29545
|
});
|
|
29543
29546
|
}
|
|
29544
29547
|
};
|
|
29545
|
-
SystemProgram13.programId = new
|
|
29548
|
+
SystemProgram13.programId = new PublicKey51("11111111111111111111111111111111");
|
|
29546
29549
|
var CHUNK_SIZE = PACKET_DATA_SIZE - 300;
|
|
29547
29550
|
var Loader = class _Loader {
|
|
29548
29551
|
/**
|
|
@@ -29709,7 +29712,7 @@ Message: ${transactionMessage}.
|
|
|
29709
29712
|
}
|
|
29710
29713
|
};
|
|
29711
29714
|
Loader.chunkSize = CHUNK_SIZE;
|
|
29712
|
-
var BPF_LOADER_PROGRAM_ID = new
|
|
29715
|
+
var BPF_LOADER_PROGRAM_ID = new PublicKey51("BPFLoader2111111111111111111111111111111111");
|
|
29713
29716
|
var BpfLoader = class {
|
|
29714
29717
|
/**
|
|
29715
29718
|
* Minimum number of signatures required to load a program not including
|
|
@@ -30481,7 +30484,7 @@ Message: ${transactionMessage}.
|
|
|
30481
30484
|
return decoded;
|
|
30482
30485
|
}
|
|
30483
30486
|
var LOOKUP_TABLE_META_SIZE = 56;
|
|
30484
|
-
var
|
|
30487
|
+
var AddressLookupTableAccount2 = class {
|
|
30485
30488
|
constructor(args) {
|
|
30486
30489
|
this.key = void 0;
|
|
30487
30490
|
this.state = void 0;
|
|
@@ -30505,8 +30508,8 @@ Message: ${transactionMessage}.
|
|
|
30505
30508
|
deactivationSlot: meta.deactivationSlot,
|
|
30506
30509
|
lastExtendedSlot: meta.lastExtendedSlot,
|
|
30507
30510
|
lastExtendedSlotStartIndex: meta.lastExtendedStartIndex,
|
|
30508
|
-
authority: meta.authority.length !== 0 ? new
|
|
30509
|
-
addresses: addresses.map((address) => new
|
|
30511
|
+
authority: meta.authority.length !== 0 ? new PublicKey51(meta.authority[0]) : void 0,
|
|
30512
|
+
addresses: addresses.map((address) => new PublicKey51(address))
|
|
30510
30513
|
};
|
|
30511
30514
|
}
|
|
30512
30515
|
};
|
|
@@ -30548,7 +30551,7 @@ Message: ${transactionMessage}.
|
|
|
30548
30551
|
);
|
|
30549
30552
|
return `${protocol}//${hostish}${websocketPort}${rest}`;
|
|
30550
30553
|
}
|
|
30551
|
-
var PublicKeyFromString = superstruct.coerce(superstruct.instance(
|
|
30554
|
+
var PublicKeyFromString = superstruct.coerce(superstruct.instance(PublicKey51), superstruct.string(), (value) => new PublicKey51(value));
|
|
30552
30555
|
var RawAccountDataResult = superstruct.tuple([superstruct.string(), superstruct.literal("base64")]);
|
|
30553
30556
|
var BufferFromRawAccountData = superstruct.coerce(superstruct.instance(buffer.Buffer), RawAccountDataResult, (value) => buffer.Buffer.from(value[0], "base64"));
|
|
30554
30557
|
var BLOCKHASH_CACHE_TIMEOUT_MS = 30 * 1e3;
|
|
@@ -30633,7 +30636,7 @@ Message: ${transactionMessage}.
|
|
|
30633
30636
|
if (version2 === 0) {
|
|
30634
30637
|
return new MessageV0({
|
|
30635
30638
|
header: response.header,
|
|
30636
|
-
staticAccountKeys: response.accountKeys.map((accountKey) => new
|
|
30639
|
+
staticAccountKeys: response.accountKeys.map((accountKey) => new PublicKey51(accountKey)),
|
|
30637
30640
|
recentBlockhash: response.recentBlockhash,
|
|
30638
30641
|
compiledInstructions: response.instructions.map((ix) => ({
|
|
30639
30642
|
programIdIndex: ix.programIdIndex,
|
|
@@ -33030,9 +33033,9 @@ Message: ${transactionMessage}.
|
|
|
33030
33033
|
} = await this.getAccountInfoAndContext(accountKey, config3);
|
|
33031
33034
|
let value = null;
|
|
33032
33035
|
if (accountInfo !== null) {
|
|
33033
|
-
value = new
|
|
33036
|
+
value = new AddressLookupTableAccount2({
|
|
33034
33037
|
key: accountKey,
|
|
33035
|
-
state:
|
|
33038
|
+
state: AddressLookupTableAccount2.deserialize(accountInfo.data)
|
|
33036
33039
|
});
|
|
33037
33040
|
}
|
|
33038
33041
|
return {
|
|
@@ -34073,7 +34076,7 @@ Message: ${transactionMessage}.
|
|
|
34073
34076
|
* @returns {PublicKey} PublicKey
|
|
34074
34077
|
*/
|
|
34075
34078
|
get publicKey() {
|
|
34076
|
-
return new
|
|
34079
|
+
return new PublicKey51(this._keypair.publicKey);
|
|
34077
34080
|
}
|
|
34078
34081
|
/**
|
|
34079
34082
|
* The raw secret key for this keypair
|
|
@@ -34151,7 +34154,7 @@ Message: ${transactionMessage}.
|
|
|
34151
34154
|
lookupTable: instruction.keys[0].pubkey,
|
|
34152
34155
|
authority: instruction.keys[1].pubkey,
|
|
34153
34156
|
payer: instruction.keys.length > 2 ? instruction.keys[2].pubkey : void 0,
|
|
34154
|
-
addresses: addresses.map((buffer2) => new
|
|
34157
|
+
addresses: addresses.map((buffer2) => new PublicKey51(buffer2))
|
|
34155
34158
|
};
|
|
34156
34159
|
}
|
|
34157
34160
|
static decodeCloseLookupTable(instruction) {
|
|
@@ -34203,7 +34206,7 @@ Message: ${transactionMessage}.
|
|
|
34203
34206
|
constructor() {
|
|
34204
34207
|
}
|
|
34205
34208
|
static createLookupTable(params) {
|
|
34206
|
-
const [lookupTableAddress, bumpSeed] =
|
|
34209
|
+
const [lookupTableAddress, bumpSeed] = PublicKey51.findProgramAddressSync([params.authority.toBuffer(), codecsNumbers.getU64Encoder().encode(params.recentSlot)], this.programId);
|
|
34207
34210
|
const type = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.CreateLookupTable;
|
|
34208
34211
|
const data = encodeData(type, {
|
|
34209
34212
|
recentSlot: BigInt(params.recentSlot),
|
|
@@ -34226,7 +34229,7 @@ Message: ${transactionMessage}.
|
|
|
34226
34229
|
isSigner: false,
|
|
34227
34230
|
isWritable: false
|
|
34228
34231
|
}];
|
|
34229
|
-
return [new
|
|
34232
|
+
return [new TransactionInstruction44({
|
|
34230
34233
|
programId: this.programId,
|
|
34231
34234
|
keys,
|
|
34232
34235
|
data
|
|
@@ -34244,7 +34247,7 @@ Message: ${transactionMessage}.
|
|
|
34244
34247
|
isSigner: true,
|
|
34245
34248
|
isWritable: false
|
|
34246
34249
|
}];
|
|
34247
|
-
return new
|
|
34250
|
+
return new TransactionInstruction44({
|
|
34248
34251
|
programId: this.programId,
|
|
34249
34252
|
keys,
|
|
34250
34253
|
data
|
|
@@ -34275,7 +34278,7 @@ Message: ${transactionMessage}.
|
|
|
34275
34278
|
isWritable: false
|
|
34276
34279
|
});
|
|
34277
34280
|
}
|
|
34278
|
-
return new
|
|
34281
|
+
return new TransactionInstruction44({
|
|
34279
34282
|
programId: this.programId,
|
|
34280
34283
|
keys,
|
|
34281
34284
|
data
|
|
@@ -34293,7 +34296,7 @@ Message: ${transactionMessage}.
|
|
|
34293
34296
|
isSigner: true,
|
|
34294
34297
|
isWritable: false
|
|
34295
34298
|
}];
|
|
34296
|
-
return new
|
|
34299
|
+
return new TransactionInstruction44({
|
|
34297
34300
|
programId: this.programId,
|
|
34298
34301
|
keys,
|
|
34299
34302
|
data
|
|
@@ -34315,14 +34318,14 @@ Message: ${transactionMessage}.
|
|
|
34315
34318
|
isSigner: false,
|
|
34316
34319
|
isWritable: true
|
|
34317
34320
|
}];
|
|
34318
|
-
return new
|
|
34321
|
+
return new TransactionInstruction44({
|
|
34319
34322
|
programId: this.programId,
|
|
34320
34323
|
keys,
|
|
34321
34324
|
data
|
|
34322
34325
|
});
|
|
34323
34326
|
}
|
|
34324
34327
|
};
|
|
34325
|
-
AddressLookupTableProgram.programId = new
|
|
34328
|
+
AddressLookupTableProgram.programId = new PublicKey51("AddressLookupTab1e1111111111111111111111111");
|
|
34326
34329
|
var ComputeBudgetInstruction = class {
|
|
34327
34330
|
/**
|
|
34328
34331
|
* @internal
|
|
@@ -34402,7 +34405,7 @@ Message: ${transactionMessage}.
|
|
|
34402
34405
|
* @internal
|
|
34403
34406
|
*/
|
|
34404
34407
|
static checkProgramId(programId) {
|
|
34405
|
-
if (!programId.equals(
|
|
34408
|
+
if (!programId.equals(ComputeBudgetProgram4.programId)) {
|
|
34406
34409
|
throw new Error("invalid instruction; programId is not ComputeBudgetProgram");
|
|
34407
34410
|
}
|
|
34408
34411
|
}
|
|
@@ -34425,7 +34428,7 @@ Message: ${transactionMessage}.
|
|
|
34425
34428
|
layout: BufferLayout__namespace.struct([BufferLayout__namespace.u8("instruction"), u643("microLamports")])
|
|
34426
34429
|
}
|
|
34427
34430
|
});
|
|
34428
|
-
var
|
|
34431
|
+
var ComputeBudgetProgram4 = class {
|
|
34429
34432
|
/**
|
|
34430
34433
|
* @internal
|
|
34431
34434
|
*/
|
|
@@ -34440,7 +34443,7 @@ Message: ${transactionMessage}.
|
|
|
34440
34443
|
static requestUnits(params) {
|
|
34441
34444
|
const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestUnits;
|
|
34442
34445
|
const data = encodeData(type, params);
|
|
34443
|
-
return new
|
|
34446
|
+
return new TransactionInstruction44({
|
|
34444
34447
|
keys: [],
|
|
34445
34448
|
programId: this.programId,
|
|
34446
34449
|
data
|
|
@@ -34449,7 +34452,7 @@ Message: ${transactionMessage}.
|
|
|
34449
34452
|
static requestHeapFrame(params) {
|
|
34450
34453
|
const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestHeapFrame;
|
|
34451
34454
|
const data = encodeData(type, params);
|
|
34452
|
-
return new
|
|
34455
|
+
return new TransactionInstruction44({
|
|
34453
34456
|
keys: [],
|
|
34454
34457
|
programId: this.programId,
|
|
34455
34458
|
data
|
|
@@ -34458,7 +34461,7 @@ Message: ${transactionMessage}.
|
|
|
34458
34461
|
static setComputeUnitLimit(params) {
|
|
34459
34462
|
const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitLimit;
|
|
34460
34463
|
const data = encodeData(type, params);
|
|
34461
|
-
return new
|
|
34464
|
+
return new TransactionInstruction44({
|
|
34462
34465
|
keys: [],
|
|
34463
34466
|
programId: this.programId,
|
|
34464
34467
|
data
|
|
@@ -34469,14 +34472,14 @@ Message: ${transactionMessage}.
|
|
|
34469
34472
|
const data = encodeData(type, {
|
|
34470
34473
|
microLamports: BigInt(params.microLamports)
|
|
34471
34474
|
});
|
|
34472
|
-
return new
|
|
34475
|
+
return new TransactionInstruction44({
|
|
34473
34476
|
keys: [],
|
|
34474
34477
|
programId: this.programId,
|
|
34475
34478
|
data
|
|
34476
34479
|
});
|
|
34477
34480
|
}
|
|
34478
34481
|
};
|
|
34479
|
-
|
|
34482
|
+
ComputeBudgetProgram4.programId = new PublicKey51("ComputeBudget111111111111111111111111111111");
|
|
34480
34483
|
var PRIVATE_KEY_BYTES$1 = 64;
|
|
34481
34484
|
var PUBLIC_KEY_BYTES$1 = 32;
|
|
34482
34485
|
var SIGNATURE_BYTES = 64;
|
|
@@ -34524,7 +34527,7 @@ Message: ${transactionMessage}.
|
|
|
34524
34527
|
instructionData.fill(publicKey4, publicKeyOffset);
|
|
34525
34528
|
instructionData.fill(signature2, signatureOffset);
|
|
34526
34529
|
instructionData.fill(message, messageDataOffset);
|
|
34527
|
-
return new
|
|
34530
|
+
return new TransactionInstruction44({
|
|
34528
34531
|
keys: [],
|
|
34529
34532
|
programId: _Ed25519Program.programId,
|
|
34530
34533
|
data: instructionData
|
|
@@ -34556,7 +34559,7 @@ Message: ${transactionMessage}.
|
|
|
34556
34559
|
}
|
|
34557
34560
|
}
|
|
34558
34561
|
};
|
|
34559
|
-
Ed25519Program.programId = new
|
|
34562
|
+
Ed25519Program.programId = new PublicKey51("Ed25519SigVerify111111111111111111111111111");
|
|
34560
34563
|
var ecdsaSign = (msgHash, privKey) => {
|
|
34561
34564
|
const signature2 = secp256k1.secp256k1.sign(msgHash, privKey);
|
|
34562
34565
|
return [signature2.toCompactRawBytes(), signature2.recovery];
|
|
@@ -34652,7 +34655,7 @@ Message: ${transactionMessage}.
|
|
|
34652
34655
|
recoveryId
|
|
34653
34656
|
}, instructionData);
|
|
34654
34657
|
instructionData.fill(toBuffer(message), SECP256K1_INSTRUCTION_LAYOUT.span);
|
|
34655
|
-
return new
|
|
34658
|
+
return new TransactionInstruction44({
|
|
34656
34659
|
keys: [],
|
|
34657
34660
|
programId: _Secp256k1Program.programId,
|
|
34658
34661
|
data: instructionData
|
|
@@ -34690,9 +34693,9 @@ Message: ${transactionMessage}.
|
|
|
34690
34693
|
}
|
|
34691
34694
|
}
|
|
34692
34695
|
};
|
|
34693
|
-
Secp256k1Program.programId = new
|
|
34696
|
+
Secp256k1Program.programId = new PublicKey51("KeccakSecp256k11111111111111111111111111111");
|
|
34694
34697
|
var _Lockup;
|
|
34695
|
-
var STAKE_CONFIG_ID = new
|
|
34698
|
+
var STAKE_CONFIG_ID = new PublicKey51("StakeConfig11111111111111111111111111111111");
|
|
34696
34699
|
var Authorized = class {
|
|
34697
34700
|
/**
|
|
34698
34701
|
* Create a new Authorized object
|
|
@@ -34723,7 +34726,7 @@ Message: ${transactionMessage}.
|
|
|
34723
34726
|
*/
|
|
34724
34727
|
};
|
|
34725
34728
|
_Lockup = Lockup;
|
|
34726
|
-
Lockup.default = new _Lockup(0, 0,
|
|
34729
|
+
Lockup.default = new _Lockup(0, 0, PublicKey51.default);
|
|
34727
34730
|
var StakeInstruction = class {
|
|
34728
34731
|
/**
|
|
34729
34732
|
* @internal
|
|
@@ -34761,8 +34764,8 @@ Message: ${transactionMessage}.
|
|
|
34761
34764
|
} = decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Initialize, instruction.data);
|
|
34762
34765
|
return {
|
|
34763
34766
|
stakePubkey: instruction.keys[0].pubkey,
|
|
34764
|
-
authorized: new Authorized(new
|
|
34765
|
-
lockup: new Lockup(lockup2.unixTimestamp, lockup2.epoch, new
|
|
34767
|
+
authorized: new Authorized(new PublicKey51(authorized2.staker), new PublicKey51(authorized2.withdrawer)),
|
|
34768
|
+
lockup: new Lockup(lockup2.unixTimestamp, lockup2.epoch, new PublicKey51(lockup2.custodian))
|
|
34766
34769
|
};
|
|
34767
34770
|
}
|
|
34768
34771
|
/**
|
|
@@ -34791,7 +34794,7 @@ Message: ${transactionMessage}.
|
|
|
34791
34794
|
const o = {
|
|
34792
34795
|
stakePubkey: instruction.keys[0].pubkey,
|
|
34793
34796
|
authorizedPubkey: instruction.keys[2].pubkey,
|
|
34794
|
-
newAuthorizedPubkey: new
|
|
34797
|
+
newAuthorizedPubkey: new PublicKey51(newAuthorized),
|
|
34795
34798
|
stakeAuthorizationType: {
|
|
34796
34799
|
index: stakeAuthorizationType
|
|
34797
34800
|
}
|
|
@@ -34817,8 +34820,8 @@ Message: ${transactionMessage}.
|
|
|
34817
34820
|
stakePubkey: instruction.keys[0].pubkey,
|
|
34818
34821
|
authorityBase: instruction.keys[1].pubkey,
|
|
34819
34822
|
authoritySeed,
|
|
34820
|
-
authorityOwner: new
|
|
34821
|
-
newAuthorizedPubkey: new
|
|
34823
|
+
authorityOwner: new PublicKey51(authorityOwner),
|
|
34824
|
+
newAuthorizedPubkey: new PublicKey51(newAuthorized),
|
|
34822
34825
|
stakeAuthorizationType: {
|
|
34823
34826
|
index: stakeAuthorizationType
|
|
34824
34827
|
}
|
|
@@ -34992,7 +34995,7 @@ Message: ${transactionMessage}.
|
|
|
34992
34995
|
programId: this.programId,
|
|
34993
34996
|
data
|
|
34994
34997
|
};
|
|
34995
|
-
return new
|
|
34998
|
+
return new TransactionInstruction44(instructionData);
|
|
34996
34999
|
}
|
|
34997
35000
|
/**
|
|
34998
35001
|
* Generate a Transaction that creates a new Stake account at
|
|
@@ -35190,7 +35193,7 @@ Message: ${transactionMessage}.
|
|
|
35190
35193
|
const data = encodeData(type, {
|
|
35191
35194
|
lamports
|
|
35192
35195
|
});
|
|
35193
|
-
return new
|
|
35196
|
+
return new TransactionInstruction44({
|
|
35194
35197
|
keys: [{
|
|
35195
35198
|
pubkey: stakePubkey,
|
|
35196
35199
|
isSigner: false,
|
|
@@ -35372,7 +35375,7 @@ Message: ${transactionMessage}.
|
|
|
35372
35375
|
});
|
|
35373
35376
|
}
|
|
35374
35377
|
};
|
|
35375
|
-
StakeProgram.programId = new
|
|
35378
|
+
StakeProgram.programId = new PublicKey51("Stake11111111111111111111111111111111111111");
|
|
35376
35379
|
StakeProgram.space = 200;
|
|
35377
35380
|
var VoteInit = class {
|
|
35378
35381
|
/** [0, 100] */
|
|
@@ -35424,7 +35427,7 @@ Message: ${transactionMessage}.
|
|
|
35424
35427
|
return {
|
|
35425
35428
|
votePubkey: instruction.keys[0].pubkey,
|
|
35426
35429
|
nodePubkey: instruction.keys[3].pubkey,
|
|
35427
|
-
voteInit: new VoteInit(new
|
|
35430
|
+
voteInit: new VoteInit(new PublicKey51(voteInit2.nodePubkey), new PublicKey51(voteInit2.authorizedVoter), new PublicKey51(voteInit2.authorizedWithdrawer), voteInit2.commission)
|
|
35428
35431
|
};
|
|
35429
35432
|
}
|
|
35430
35433
|
/**
|
|
@@ -35440,7 +35443,7 @@ Message: ${transactionMessage}.
|
|
|
35440
35443
|
return {
|
|
35441
35444
|
votePubkey: instruction.keys[0].pubkey,
|
|
35442
35445
|
authorizedPubkey: instruction.keys[2].pubkey,
|
|
35443
|
-
newAuthorizedPubkey: new
|
|
35446
|
+
newAuthorizedPubkey: new PublicKey51(newAuthorized),
|
|
35444
35447
|
voteAuthorizationType: {
|
|
35445
35448
|
index: voteAuthorizationType
|
|
35446
35449
|
}
|
|
@@ -35462,9 +35465,9 @@ Message: ${transactionMessage}.
|
|
|
35462
35465
|
} = decodeData$1(VOTE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed, instruction.data);
|
|
35463
35466
|
return {
|
|
35464
35467
|
currentAuthorityDerivedKeyBasePubkey: instruction.keys[2].pubkey,
|
|
35465
|
-
currentAuthorityDerivedKeyOwnerPubkey: new
|
|
35468
|
+
currentAuthorityDerivedKeyOwnerPubkey: new PublicKey51(currentAuthorityDerivedKeyOwnerPubkey),
|
|
35466
35469
|
currentAuthorityDerivedKeySeed,
|
|
35467
|
-
newAuthorizedPubkey: new
|
|
35470
|
+
newAuthorizedPubkey: new PublicKey51(newAuthorized),
|
|
35468
35471
|
voteAuthorizationType: {
|
|
35469
35472
|
index: voteAuthorizationType
|
|
35470
35473
|
},
|
|
@@ -35582,7 +35585,7 @@ Message: ${transactionMessage}.
|
|
|
35582
35585
|
programId: this.programId,
|
|
35583
35586
|
data
|
|
35584
35587
|
};
|
|
35585
|
-
return new
|
|
35588
|
+
return new TransactionInstruction44(instructionData);
|
|
35586
35589
|
}
|
|
35587
35590
|
/**
|
|
35588
35591
|
* Generate a transaction that creates a new Vote account.
|
|
@@ -35755,9 +35758,9 @@ Message: ${transactionMessage}.
|
|
|
35755
35758
|
});
|
|
35756
35759
|
}
|
|
35757
35760
|
};
|
|
35758
|
-
VoteProgram.programId = new
|
|
35761
|
+
VoteProgram.programId = new PublicKey51("Vote111111111111111111111111111111111111111");
|
|
35759
35762
|
VoteProgram.space = 3762;
|
|
35760
|
-
var VALIDATOR_INFO_KEY = new
|
|
35763
|
+
var VALIDATOR_INFO_KEY = new PublicKey51("Va1idator1nfo111111111111111111111111111111");
|
|
35761
35764
|
var InfoString = superstruct.type({
|
|
35762
35765
|
name: superstruct.string(),
|
|
35763
35766
|
website: superstruct.optional(superstruct.string()),
|
|
@@ -35791,7 +35794,7 @@ Message: ${transactionMessage}.
|
|
|
35791
35794
|
if (configKeyCount !== 2) return null;
|
|
35792
35795
|
const configKeys = [];
|
|
35793
35796
|
for (let i = 0; i < 2; i++) {
|
|
35794
|
-
const publicKey4 = new
|
|
35797
|
+
const publicKey4 = new PublicKey51(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH2));
|
|
35795
35798
|
const isSigner = guardedShift(byteArray) === 1;
|
|
35796
35799
|
configKeys.push({
|
|
35797
35800
|
publicKey: publicKey4,
|
|
@@ -35809,7 +35812,7 @@ Message: ${transactionMessage}.
|
|
|
35809
35812
|
return null;
|
|
35810
35813
|
}
|
|
35811
35814
|
};
|
|
35812
|
-
var VOTE_PROGRAM_ID = new
|
|
35815
|
+
var VOTE_PROGRAM_ID = new PublicKey51("Vote111111111111111111111111111111111111111");
|
|
35813
35816
|
var VoteAccountLayout = BufferLayout__namespace.struct([
|
|
35814
35817
|
publicKey3("nodePubkey"),
|
|
35815
35818
|
publicKey3("authorizedWithdrawer"),
|
|
@@ -35866,8 +35869,8 @@ Message: ${transactionMessage}.
|
|
|
35866
35869
|
rootSlot = null;
|
|
35867
35870
|
}
|
|
35868
35871
|
return new _VoteAccount({
|
|
35869
|
-
nodePubkey: new
|
|
35870
|
-
authorizedWithdrawer: new
|
|
35872
|
+
nodePubkey: new PublicKey51(va.nodePubkey),
|
|
35873
|
+
authorizedWithdrawer: new PublicKey51(va.authorizedWithdrawer),
|
|
35871
35874
|
commission: va.commission,
|
|
35872
35875
|
votes: va.votes,
|
|
35873
35876
|
rootSlot,
|
|
@@ -35884,7 +35887,7 @@ Message: ${transactionMessage}.
|
|
|
35884
35887
|
}) {
|
|
35885
35888
|
return {
|
|
35886
35889
|
epoch,
|
|
35887
|
-
authorizedVoter: new
|
|
35890
|
+
authorizedVoter: new PublicKey51(authorizedVoter)
|
|
35888
35891
|
};
|
|
35889
35892
|
}
|
|
35890
35893
|
function parsePriorVoters({
|
|
@@ -35893,7 +35896,7 @@ Message: ${transactionMessage}.
|
|
|
35893
35896
|
targetEpoch
|
|
35894
35897
|
}) {
|
|
35895
35898
|
return {
|
|
35896
|
-
authorizedPubkey: new
|
|
35899
|
+
authorizedPubkey: new PublicKey51(authorizedPubkey),
|
|
35897
35900
|
epochOfLastAuthorizedSwitch,
|
|
35898
35901
|
targetEpoch
|
|
35899
35902
|
};
|
|
@@ -35966,7 +35969,7 @@ Message: ${transactionMessage}.
|
|
|
35966
35969
|
}
|
|
35967
35970
|
var LAMPORTS_PER_SOL4 = 1e9;
|
|
35968
35971
|
exports2.Account = Account;
|
|
35969
|
-
exports2.AddressLookupTableAccount =
|
|
35972
|
+
exports2.AddressLookupTableAccount = AddressLookupTableAccount2;
|
|
35970
35973
|
exports2.AddressLookupTableInstruction = AddressLookupTableInstruction;
|
|
35971
35974
|
exports2.AddressLookupTableProgram = AddressLookupTableProgram;
|
|
35972
35975
|
exports2.Authorized = Authorized;
|
|
@@ -35976,7 +35979,7 @@ Message: ${transactionMessage}.
|
|
|
35976
35979
|
exports2.BpfLoader = BpfLoader;
|
|
35977
35980
|
exports2.COMPUTE_BUDGET_INSTRUCTION_LAYOUTS = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS;
|
|
35978
35981
|
exports2.ComputeBudgetInstruction = ComputeBudgetInstruction;
|
|
35979
|
-
exports2.ComputeBudgetProgram =
|
|
35982
|
+
exports2.ComputeBudgetProgram = ComputeBudgetProgram4;
|
|
35980
35983
|
exports2.Connection = Connection5;
|
|
35981
35984
|
exports2.Ed25519Program = Ed25519Program;
|
|
35982
35985
|
exports2.Enum = Enum;
|
|
@@ -35995,7 +35998,7 @@ Message: ${transactionMessage}.
|
|
|
35995
35998
|
exports2.NonceAccount = NonceAccount;
|
|
35996
35999
|
exports2.PACKET_DATA_SIZE = PACKET_DATA_SIZE;
|
|
35997
36000
|
exports2.PUBLIC_KEY_LENGTH = PUBLIC_KEY_LENGTH2;
|
|
35998
|
-
exports2.PublicKey =
|
|
36001
|
+
exports2.PublicKey = PublicKey51;
|
|
35999
36002
|
exports2.SIGNATURE_LENGTH_IN_BYTES = SIGNATURE_LENGTH_IN_BYTES;
|
|
36000
36003
|
exports2.SOLANA_SCHEMA = SOLANA_SCHEMA;
|
|
36001
36004
|
exports2.STAKE_CONFIG_ID = STAKE_CONFIG_ID;
|
|
@@ -36024,15 +36027,15 @@ Message: ${transactionMessage}.
|
|
|
36024
36027
|
exports2.TransactionExpiredBlockheightExceededError = TransactionExpiredBlockheightExceededError;
|
|
36025
36028
|
exports2.TransactionExpiredNonceInvalidError = TransactionExpiredNonceInvalidError;
|
|
36026
36029
|
exports2.TransactionExpiredTimeoutError = TransactionExpiredTimeoutError;
|
|
36027
|
-
exports2.TransactionInstruction =
|
|
36028
|
-
exports2.TransactionMessage =
|
|
36030
|
+
exports2.TransactionInstruction = TransactionInstruction44;
|
|
36031
|
+
exports2.TransactionMessage = TransactionMessage5;
|
|
36029
36032
|
exports2.TransactionStatus = TransactionStatus;
|
|
36030
36033
|
exports2.VALIDATOR_INFO_KEY = VALIDATOR_INFO_KEY;
|
|
36031
36034
|
exports2.VERSION_PREFIX_MASK = VERSION_PREFIX_MASK;
|
|
36032
36035
|
exports2.VOTE_PROGRAM_ID = VOTE_PROGRAM_ID;
|
|
36033
36036
|
exports2.ValidatorInfo = ValidatorInfo;
|
|
36034
36037
|
exports2.VersionedMessage = VersionedMessage;
|
|
36035
|
-
exports2.VersionedTransaction =
|
|
36038
|
+
exports2.VersionedTransaction = VersionedTransaction6;
|
|
36036
36039
|
exports2.VoteAccount = VoteAccount;
|
|
36037
36040
|
exports2.VoteAuthorizationLayout = VoteAuthorizationLayout;
|
|
36038
36041
|
exports2.VoteInit = VoteInit;
|
|
@@ -39774,7 +39777,7 @@ var require_table = __commonJS({
|
|
|
39774
39777
|
var debug = require_debug();
|
|
39775
39778
|
var utils = require_utils4();
|
|
39776
39779
|
var tableLayout = require_layout_manager();
|
|
39777
|
-
var
|
|
39780
|
+
var Table9 = class extends Array {
|
|
39778
39781
|
constructor(opts) {
|
|
39779
39782
|
super();
|
|
39780
39783
|
const options = utils.mergeOptions(opts);
|
|
@@ -39849,7 +39852,7 @@ var require_table = __commonJS({
|
|
|
39849
39852
|
return str[0].length;
|
|
39850
39853
|
}
|
|
39851
39854
|
};
|
|
39852
|
-
|
|
39855
|
+
Table9.reset = () => debug.reset();
|
|
39853
39856
|
function doDraw(row, lineNum, result) {
|
|
39854
39857
|
let line = [];
|
|
39855
39858
|
row.forEach(function(cell) {
|
|
@@ -39858,7 +39861,7 @@ var require_table = __commonJS({
|
|
|
39858
39861
|
let str = line.join("");
|
|
39859
39862
|
if (str.length) result.push(str);
|
|
39860
39863
|
}
|
|
39861
|
-
module2.exports =
|
|
39864
|
+
module2.exports = Table9;
|
|
39862
39865
|
}
|
|
39863
39866
|
});
|
|
39864
39867
|
|
|
@@ -48385,7 +48388,7 @@ var require_lib4 = __commonJS({
|
|
|
48385
48388
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
48386
48389
|
var StructError = class extends TypeError {
|
|
48387
48390
|
constructor(failure, failures) {
|
|
48388
|
-
let
|
|
48391
|
+
let cached2;
|
|
48389
48392
|
const {
|
|
48390
48393
|
message,
|
|
48391
48394
|
...rest
|
|
@@ -48406,7 +48409,7 @@ var require_lib4 = __commonJS({
|
|
|
48406
48409
|
this.name = this.constructor.name;
|
|
48407
48410
|
this.failures = () => {
|
|
48408
48411
|
var _cached;
|
|
48409
|
-
return (_cached =
|
|
48412
|
+
return (_cached = cached2) != null ? _cached : cached2 = [failure, ...failures()];
|
|
48410
48413
|
};
|
|
48411
48414
|
}
|
|
48412
48415
|
};
|
|
@@ -58812,10 +58815,10 @@ var require_parser = __commonJS({
|
|
|
58812
58815
|
}
|
|
58813
58816
|
function peg$parsestart() {
|
|
58814
58817
|
var s0, s1, s2;
|
|
58815
|
-
var key = peg$currPos * 49 + 0,
|
|
58816
|
-
if (
|
|
58817
|
-
peg$currPos =
|
|
58818
|
-
return
|
|
58818
|
+
var key = peg$currPos * 49 + 0, cached2 = peg$cache[key];
|
|
58819
|
+
if (cached2) {
|
|
58820
|
+
peg$currPos = cached2.nextPos;
|
|
58821
|
+
return cached2.result;
|
|
58819
58822
|
}
|
|
58820
58823
|
s0 = peg$currPos;
|
|
58821
58824
|
s1 = [];
|
|
@@ -58834,10 +58837,10 @@ var require_parser = __commonJS({
|
|
|
58834
58837
|
}
|
|
58835
58838
|
function peg$parseline() {
|
|
58836
58839
|
var s0, s1, s2, s3, s4, s5, s6;
|
|
58837
|
-
var key = peg$currPos * 49 + 1,
|
|
58838
|
-
if (
|
|
58839
|
-
peg$currPos =
|
|
58840
|
-
return
|
|
58840
|
+
var key = peg$currPos * 49 + 1, cached2 = peg$cache[key];
|
|
58841
|
+
if (cached2) {
|
|
58842
|
+
peg$currPos = cached2.nextPos;
|
|
58843
|
+
return cached2.result;
|
|
58841
58844
|
}
|
|
58842
58845
|
s0 = peg$currPos;
|
|
58843
58846
|
s1 = [];
|
|
@@ -58945,10 +58948,10 @@ var require_parser = __commonJS({
|
|
|
58945
58948
|
}
|
|
58946
58949
|
function peg$parseexpression() {
|
|
58947
58950
|
var s0;
|
|
58948
|
-
var key = peg$currPos * 49 + 2,
|
|
58949
|
-
if (
|
|
58950
|
-
peg$currPos =
|
|
58951
|
-
return
|
|
58951
|
+
var key = peg$currPos * 49 + 2, cached2 = peg$cache[key];
|
|
58952
|
+
if (cached2) {
|
|
58953
|
+
peg$currPos = cached2.nextPos;
|
|
58954
|
+
return cached2.result;
|
|
58952
58955
|
}
|
|
58953
58956
|
s0 = peg$parsecomment();
|
|
58954
58957
|
if (s0 === peg$FAILED) {
|
|
@@ -58965,10 +58968,10 @@ var require_parser = __commonJS({
|
|
|
58965
58968
|
}
|
|
58966
58969
|
function peg$parsecomment() {
|
|
58967
58970
|
var s0, s1, s2, s3, s4, s5;
|
|
58968
|
-
var key = peg$currPos * 49 + 3,
|
|
58969
|
-
if (
|
|
58970
|
-
peg$currPos =
|
|
58971
|
-
return
|
|
58971
|
+
var key = peg$currPos * 49 + 3, cached2 = peg$cache[key];
|
|
58972
|
+
if (cached2) {
|
|
58973
|
+
peg$currPos = cached2.nextPos;
|
|
58974
|
+
return cached2.result;
|
|
58972
58975
|
}
|
|
58973
58976
|
s0 = peg$currPos;
|
|
58974
58977
|
if (input.charCodeAt(peg$currPos) === 35) {
|
|
@@ -59071,10 +59074,10 @@ var require_parser = __commonJS({
|
|
|
59071
59074
|
}
|
|
59072
59075
|
function peg$parsepath() {
|
|
59073
59076
|
var s0, s1, s2, s3, s4, s5;
|
|
59074
|
-
var key = peg$currPos * 49 + 4,
|
|
59075
|
-
if (
|
|
59076
|
-
peg$currPos =
|
|
59077
|
-
return
|
|
59077
|
+
var key = peg$currPos * 49 + 4, cached2 = peg$cache[key];
|
|
59078
|
+
if (cached2) {
|
|
59079
|
+
peg$currPos = cached2.nextPos;
|
|
59080
|
+
return cached2.result;
|
|
59078
59081
|
}
|
|
59079
59082
|
s0 = peg$currPos;
|
|
59080
59083
|
if (input.charCodeAt(peg$currPos) === 91) {
|
|
@@ -59141,10 +59144,10 @@ var require_parser = __commonJS({
|
|
|
59141
59144
|
}
|
|
59142
59145
|
function peg$parsetablearray() {
|
|
59143
59146
|
var s0, s1, s2, s3, s4, s5, s6, s7;
|
|
59144
|
-
var key = peg$currPos * 49 + 5,
|
|
59145
|
-
if (
|
|
59146
|
-
peg$currPos =
|
|
59147
|
-
return
|
|
59147
|
+
var key = peg$currPos * 49 + 5, cached2 = peg$cache[key];
|
|
59148
|
+
if (cached2) {
|
|
59149
|
+
peg$currPos = cached2.nextPos;
|
|
59150
|
+
return cached2.result;
|
|
59148
59151
|
}
|
|
59149
59152
|
s0 = peg$currPos;
|
|
59150
59153
|
if (input.charCodeAt(peg$currPos) === 91) {
|
|
@@ -59239,10 +59242,10 @@ var require_parser = __commonJS({
|
|
|
59239
59242
|
}
|
|
59240
59243
|
function peg$parsetable_key() {
|
|
59241
59244
|
var s0, s1, s2;
|
|
59242
|
-
var key = peg$currPos * 49 + 6,
|
|
59243
|
-
if (
|
|
59244
|
-
peg$currPos =
|
|
59245
|
-
return
|
|
59245
|
+
var key = peg$currPos * 49 + 6, cached2 = peg$cache[key];
|
|
59246
|
+
if (cached2) {
|
|
59247
|
+
peg$currPos = cached2.nextPos;
|
|
59248
|
+
return cached2.result;
|
|
59246
59249
|
}
|
|
59247
59250
|
s0 = peg$currPos;
|
|
59248
59251
|
s1 = [];
|
|
@@ -59283,10 +59286,10 @@ var require_parser = __commonJS({
|
|
|
59283
59286
|
}
|
|
59284
59287
|
function peg$parsetable_key_part() {
|
|
59285
59288
|
var s0, s1, s2, s3, s4;
|
|
59286
|
-
var key = peg$currPos * 49 + 7,
|
|
59287
|
-
if (
|
|
59288
|
-
peg$currPos =
|
|
59289
|
-
return
|
|
59289
|
+
var key = peg$currPos * 49 + 7, cached2 = peg$cache[key];
|
|
59290
|
+
if (cached2) {
|
|
59291
|
+
peg$currPos = cached2.nextPos;
|
|
59292
|
+
return cached2.result;
|
|
59290
59293
|
}
|
|
59291
59294
|
s0 = peg$currPos;
|
|
59292
59295
|
s1 = [];
|
|
@@ -59359,10 +59362,10 @@ var require_parser = __commonJS({
|
|
|
59359
59362
|
}
|
|
59360
59363
|
function peg$parsedot_ended_table_key_part() {
|
|
59361
59364
|
var s0, s1, s2, s3, s4, s5, s6;
|
|
59362
|
-
var key = peg$currPos * 49 + 8,
|
|
59363
|
-
if (
|
|
59364
|
-
peg$currPos =
|
|
59365
|
-
return
|
|
59365
|
+
var key = peg$currPos * 49 + 8, cached2 = peg$cache[key];
|
|
59366
|
+
if (cached2) {
|
|
59367
|
+
peg$currPos = cached2.nextPos;
|
|
59368
|
+
return cached2.result;
|
|
59366
59369
|
}
|
|
59367
59370
|
s0 = peg$currPos;
|
|
59368
59371
|
s1 = [];
|
|
@@ -59485,10 +59488,10 @@ var require_parser = __commonJS({
|
|
|
59485
59488
|
}
|
|
59486
59489
|
function peg$parseassignment() {
|
|
59487
59490
|
var s0, s1, s2, s3, s4, s5;
|
|
59488
|
-
var key = peg$currPos * 49 + 9,
|
|
59489
|
-
if (
|
|
59490
|
-
peg$currPos =
|
|
59491
|
-
return
|
|
59491
|
+
var key = peg$currPos * 49 + 9, cached2 = peg$cache[key];
|
|
59492
|
+
if (cached2) {
|
|
59493
|
+
peg$currPos = cached2.nextPos;
|
|
59494
|
+
return cached2.result;
|
|
59492
59495
|
}
|
|
59493
59496
|
s0 = peg$currPos;
|
|
59494
59497
|
s1 = peg$parsekey();
|
|
@@ -59601,10 +59604,10 @@ var require_parser = __commonJS({
|
|
|
59601
59604
|
}
|
|
59602
59605
|
function peg$parsekey() {
|
|
59603
59606
|
var s0, s1, s2;
|
|
59604
|
-
var key = peg$currPos * 49 + 10,
|
|
59605
|
-
if (
|
|
59606
|
-
peg$currPos =
|
|
59607
|
-
return
|
|
59607
|
+
var key = peg$currPos * 49 + 10, cached2 = peg$cache[key];
|
|
59608
|
+
if (cached2) {
|
|
59609
|
+
peg$currPos = cached2.nextPos;
|
|
59610
|
+
return cached2.result;
|
|
59608
59611
|
}
|
|
59609
59612
|
s0 = peg$currPos;
|
|
59610
59613
|
s1 = [];
|
|
@@ -59627,10 +59630,10 @@ var require_parser = __commonJS({
|
|
|
59627
59630
|
}
|
|
59628
59631
|
function peg$parsequoted_key() {
|
|
59629
59632
|
var s0, s1;
|
|
59630
|
-
var key = peg$currPos * 49 + 11,
|
|
59631
|
-
if (
|
|
59632
|
-
peg$currPos =
|
|
59633
|
-
return
|
|
59633
|
+
var key = peg$currPos * 49 + 11, cached2 = peg$cache[key];
|
|
59634
|
+
if (cached2) {
|
|
59635
|
+
peg$currPos = cached2.nextPos;
|
|
59636
|
+
return cached2.result;
|
|
59634
59637
|
}
|
|
59635
59638
|
s0 = peg$currPos;
|
|
59636
59639
|
s1 = peg$parsedouble_quoted_single_line_string();
|
|
@@ -59653,10 +59656,10 @@ var require_parser = __commonJS({
|
|
|
59653
59656
|
}
|
|
59654
59657
|
function peg$parsevalue() {
|
|
59655
59658
|
var s0;
|
|
59656
|
-
var key = peg$currPos * 49 + 12,
|
|
59657
|
-
if (
|
|
59658
|
-
peg$currPos =
|
|
59659
|
-
return
|
|
59659
|
+
var key = peg$currPos * 49 + 12, cached2 = peg$cache[key];
|
|
59660
|
+
if (cached2) {
|
|
59661
|
+
peg$currPos = cached2.nextPos;
|
|
59662
|
+
return cached2.result;
|
|
59660
59663
|
}
|
|
59661
59664
|
s0 = peg$parsestring();
|
|
59662
59665
|
if (s0 === peg$FAILED) {
|
|
@@ -59682,10 +59685,10 @@ var require_parser = __commonJS({
|
|
|
59682
59685
|
}
|
|
59683
59686
|
function peg$parsestring() {
|
|
59684
59687
|
var s0;
|
|
59685
|
-
var key = peg$currPos * 49 + 13,
|
|
59686
|
-
if (
|
|
59687
|
-
peg$currPos =
|
|
59688
|
-
return
|
|
59688
|
+
var key = peg$currPos * 49 + 13, cached2 = peg$cache[key];
|
|
59689
|
+
if (cached2) {
|
|
59690
|
+
peg$currPos = cached2.nextPos;
|
|
59691
|
+
return cached2.result;
|
|
59689
59692
|
}
|
|
59690
59693
|
s0 = peg$parsedouble_quoted_multiline_string();
|
|
59691
59694
|
if (s0 === peg$FAILED) {
|
|
@@ -59702,10 +59705,10 @@ var require_parser = __commonJS({
|
|
|
59702
59705
|
}
|
|
59703
59706
|
function peg$parsedouble_quoted_multiline_string() {
|
|
59704
59707
|
var s0, s1, s2, s3, s4;
|
|
59705
|
-
var key = peg$currPos * 49 + 14,
|
|
59706
|
-
if (
|
|
59707
|
-
peg$currPos =
|
|
59708
|
-
return
|
|
59708
|
+
var key = peg$currPos * 49 + 14, cached2 = peg$cache[key];
|
|
59709
|
+
if (cached2) {
|
|
59710
|
+
peg$currPos = cached2.nextPos;
|
|
59711
|
+
return cached2.result;
|
|
59709
59712
|
}
|
|
59710
59713
|
s0 = peg$currPos;
|
|
59711
59714
|
if (input.substr(peg$currPos, 3) === peg$c23) {
|
|
@@ -59764,10 +59767,10 @@ var require_parser = __commonJS({
|
|
|
59764
59767
|
}
|
|
59765
59768
|
function peg$parsedouble_quoted_single_line_string() {
|
|
59766
59769
|
var s0, s1, s2, s3;
|
|
59767
|
-
var key = peg$currPos * 49 + 15,
|
|
59768
|
-
if (
|
|
59769
|
-
peg$currPos =
|
|
59770
|
-
return
|
|
59770
|
+
var key = peg$currPos * 49 + 15, cached2 = peg$cache[key];
|
|
59771
|
+
if (cached2) {
|
|
59772
|
+
peg$currPos = cached2.nextPos;
|
|
59773
|
+
return cached2.result;
|
|
59771
59774
|
}
|
|
59772
59775
|
s0 = peg$currPos;
|
|
59773
59776
|
if (input.charCodeAt(peg$currPos) === 34) {
|
|
@@ -59817,10 +59820,10 @@ var require_parser = __commonJS({
|
|
|
59817
59820
|
}
|
|
59818
59821
|
function peg$parsesingle_quoted_multiline_string() {
|
|
59819
59822
|
var s0, s1, s2, s3, s4;
|
|
59820
|
-
var key = peg$currPos * 49 + 16,
|
|
59821
|
-
if (
|
|
59822
|
-
peg$currPos =
|
|
59823
|
-
return
|
|
59823
|
+
var key = peg$currPos * 49 + 16, cached2 = peg$cache[key];
|
|
59824
|
+
if (cached2) {
|
|
59825
|
+
peg$currPos = cached2.nextPos;
|
|
59826
|
+
return cached2.result;
|
|
59824
59827
|
}
|
|
59825
59828
|
s0 = peg$currPos;
|
|
59826
59829
|
if (input.substr(peg$currPos, 3) === peg$c29) {
|
|
@@ -59879,10 +59882,10 @@ var require_parser = __commonJS({
|
|
|
59879
59882
|
}
|
|
59880
59883
|
function peg$parsesingle_quoted_single_line_string() {
|
|
59881
59884
|
var s0, s1, s2, s3;
|
|
59882
|
-
var key = peg$currPos * 49 + 17,
|
|
59883
|
-
if (
|
|
59884
|
-
peg$currPos =
|
|
59885
|
-
return
|
|
59885
|
+
var key = peg$currPos * 49 + 17, cached2 = peg$cache[key];
|
|
59886
|
+
if (cached2) {
|
|
59887
|
+
peg$currPos = cached2.nextPos;
|
|
59888
|
+
return cached2.result;
|
|
59886
59889
|
}
|
|
59887
59890
|
s0 = peg$currPos;
|
|
59888
59891
|
if (input.charCodeAt(peg$currPos) === 39) {
|
|
@@ -59932,10 +59935,10 @@ var require_parser = __commonJS({
|
|
|
59932
59935
|
}
|
|
59933
59936
|
function peg$parsestring_char() {
|
|
59934
59937
|
var s0, s1, s2;
|
|
59935
|
-
var key = peg$currPos * 49 + 18,
|
|
59936
|
-
if (
|
|
59937
|
-
peg$currPos =
|
|
59938
|
-
return
|
|
59938
|
+
var key = peg$currPos * 49 + 18, cached2 = peg$cache[key];
|
|
59939
|
+
if (cached2) {
|
|
59940
|
+
peg$currPos = cached2.nextPos;
|
|
59941
|
+
return cached2.result;
|
|
59939
59942
|
}
|
|
59940
59943
|
s0 = peg$parseESCAPED();
|
|
59941
59944
|
if (s0 === peg$FAILED) {
|
|
@@ -59986,10 +59989,10 @@ var require_parser = __commonJS({
|
|
|
59986
59989
|
}
|
|
59987
59990
|
function peg$parseliteral_char() {
|
|
59988
59991
|
var s0, s1, s2;
|
|
59989
|
-
var key = peg$currPos * 49 + 19,
|
|
59990
|
-
if (
|
|
59991
|
-
peg$currPos =
|
|
59992
|
-
return
|
|
59992
|
+
var key = peg$currPos * 49 + 19, cached2 = peg$cache[key];
|
|
59993
|
+
if (cached2) {
|
|
59994
|
+
peg$currPos = cached2.nextPos;
|
|
59995
|
+
return cached2.result;
|
|
59993
59996
|
}
|
|
59994
59997
|
s0 = peg$currPos;
|
|
59995
59998
|
s1 = peg$currPos;
|
|
@@ -60037,10 +60040,10 @@ var require_parser = __commonJS({
|
|
|
60037
60040
|
}
|
|
60038
60041
|
function peg$parsemultiline_string_char() {
|
|
60039
60042
|
var s0, s1, s2;
|
|
60040
|
-
var key = peg$currPos * 49 + 20,
|
|
60041
|
-
if (
|
|
60042
|
-
peg$currPos =
|
|
60043
|
-
return
|
|
60043
|
+
var key = peg$currPos * 49 + 20, cached2 = peg$cache[key];
|
|
60044
|
+
if (cached2) {
|
|
60045
|
+
peg$currPos = cached2.nextPos;
|
|
60046
|
+
return cached2.result;
|
|
60044
60047
|
}
|
|
60045
60048
|
s0 = peg$parseESCAPED();
|
|
60046
60049
|
if (s0 === peg$FAILED) {
|
|
@@ -60094,10 +60097,10 @@ var require_parser = __commonJS({
|
|
|
60094
60097
|
}
|
|
60095
60098
|
function peg$parsemultiline_string_delim() {
|
|
60096
60099
|
var s0, s1, s2, s3, s4;
|
|
60097
|
-
var key = peg$currPos * 49 + 21,
|
|
60098
|
-
if (
|
|
60099
|
-
peg$currPos =
|
|
60100
|
-
return
|
|
60100
|
+
var key = peg$currPos * 49 + 21, cached2 = peg$cache[key];
|
|
60101
|
+
if (cached2) {
|
|
60102
|
+
peg$currPos = cached2.nextPos;
|
|
60103
|
+
return cached2.result;
|
|
60101
60104
|
}
|
|
60102
60105
|
s0 = peg$currPos;
|
|
60103
60106
|
if (input.charCodeAt(peg$currPos) === 92) {
|
|
@@ -60139,10 +60142,10 @@ var require_parser = __commonJS({
|
|
|
60139
60142
|
}
|
|
60140
60143
|
function peg$parsemultiline_literal_char() {
|
|
60141
60144
|
var s0, s1, s2;
|
|
60142
|
-
var key = peg$currPos * 49 + 22,
|
|
60143
|
-
if (
|
|
60144
|
-
peg$currPos =
|
|
60145
|
-
return
|
|
60145
|
+
var key = peg$currPos * 49 + 22, cached2 = peg$cache[key];
|
|
60146
|
+
if (cached2) {
|
|
60147
|
+
peg$currPos = cached2.nextPos;
|
|
60148
|
+
return cached2.result;
|
|
60146
60149
|
}
|
|
60147
60150
|
s0 = peg$currPos;
|
|
60148
60151
|
s1 = peg$currPos;
|
|
@@ -60190,10 +60193,10 @@ var require_parser = __commonJS({
|
|
|
60190
60193
|
}
|
|
60191
60194
|
function peg$parsefloat() {
|
|
60192
60195
|
var s0, s1, s2, s3;
|
|
60193
|
-
var key = peg$currPos * 49 + 23,
|
|
60194
|
-
if (
|
|
60195
|
-
peg$currPos =
|
|
60196
|
-
return
|
|
60196
|
+
var key = peg$currPos * 49 + 23, cached2 = peg$cache[key];
|
|
60197
|
+
if (cached2) {
|
|
60198
|
+
peg$currPos = cached2.nextPos;
|
|
60199
|
+
return cached2.result;
|
|
60197
60200
|
}
|
|
60198
60201
|
s0 = peg$currPos;
|
|
60199
60202
|
s1 = peg$parsefloat_text();
|
|
@@ -60253,10 +60256,10 @@ var require_parser = __commonJS({
|
|
|
60253
60256
|
}
|
|
60254
60257
|
function peg$parsefloat_text() {
|
|
60255
60258
|
var s0, s1, s2, s3, s4, s5;
|
|
60256
|
-
var key = peg$currPos * 49 + 24,
|
|
60257
|
-
if (
|
|
60258
|
-
peg$currPos =
|
|
60259
|
-
return
|
|
60259
|
+
var key = peg$currPos * 49 + 24, cached2 = peg$cache[key];
|
|
60260
|
+
if (cached2) {
|
|
60261
|
+
peg$currPos = cached2.nextPos;
|
|
60262
|
+
return cached2.result;
|
|
60260
60263
|
}
|
|
60261
60264
|
s0 = peg$currPos;
|
|
60262
60265
|
if (input.charCodeAt(peg$currPos) === 43) {
|
|
@@ -60372,10 +60375,10 @@ var require_parser = __commonJS({
|
|
|
60372
60375
|
}
|
|
60373
60376
|
function peg$parseinteger() {
|
|
60374
60377
|
var s0, s1;
|
|
60375
|
-
var key = peg$currPos * 49 + 25,
|
|
60376
|
-
if (
|
|
60377
|
-
peg$currPos =
|
|
60378
|
-
return
|
|
60378
|
+
var key = peg$currPos * 49 + 25, cached2 = peg$cache[key];
|
|
60379
|
+
if (cached2) {
|
|
60380
|
+
peg$currPos = cached2.nextPos;
|
|
60381
|
+
return cached2.result;
|
|
60379
60382
|
}
|
|
60380
60383
|
s0 = peg$currPos;
|
|
60381
60384
|
s1 = peg$parseinteger_text();
|
|
@@ -60389,10 +60392,10 @@ var require_parser = __commonJS({
|
|
|
60389
60392
|
}
|
|
60390
60393
|
function peg$parseinteger_text() {
|
|
60391
60394
|
var s0, s1, s2, s3, s4;
|
|
60392
|
-
var key = peg$currPos * 49 + 26,
|
|
60393
|
-
if (
|
|
60394
|
-
peg$currPos =
|
|
60395
|
-
return
|
|
60395
|
+
var key = peg$currPos * 49 + 26, cached2 = peg$cache[key];
|
|
60396
|
+
if (cached2) {
|
|
60397
|
+
peg$currPos = cached2.nextPos;
|
|
60398
|
+
return cached2.result;
|
|
60396
60399
|
}
|
|
60397
60400
|
s0 = peg$currPos;
|
|
60398
60401
|
if (input.charCodeAt(peg$currPos) === 43) {
|
|
@@ -60516,10 +60519,10 @@ var require_parser = __commonJS({
|
|
|
60516
60519
|
}
|
|
60517
60520
|
function peg$parseboolean() {
|
|
60518
60521
|
var s0, s1;
|
|
60519
|
-
var key = peg$currPos * 49 + 27,
|
|
60520
|
-
if (
|
|
60521
|
-
peg$currPos =
|
|
60522
|
-
return
|
|
60522
|
+
var key = peg$currPos * 49 + 27, cached2 = peg$cache[key];
|
|
60523
|
+
if (cached2) {
|
|
60524
|
+
peg$currPos = cached2.nextPos;
|
|
60525
|
+
return cached2.result;
|
|
60523
60526
|
}
|
|
60524
60527
|
s0 = peg$currPos;
|
|
60525
60528
|
if (input.substr(peg$currPos, 4) === peg$c51) {
|
|
@@ -60558,10 +60561,10 @@ var require_parser = __commonJS({
|
|
|
60558
60561
|
}
|
|
60559
60562
|
function peg$parsearray() {
|
|
60560
60563
|
var s0, s1, s2, s3, s4;
|
|
60561
|
-
var key = peg$currPos * 49 + 28,
|
|
60562
|
-
if (
|
|
60563
|
-
peg$currPos =
|
|
60564
|
-
return
|
|
60564
|
+
var key = peg$currPos * 49 + 28, cached2 = peg$cache[key];
|
|
60565
|
+
if (cached2) {
|
|
60566
|
+
peg$currPos = cached2.nextPos;
|
|
60567
|
+
return cached2.result;
|
|
60565
60568
|
}
|
|
60566
60569
|
s0 = peg$currPos;
|
|
60567
60570
|
if (input.charCodeAt(peg$currPos) === 91) {
|
|
@@ -60758,10 +60761,10 @@ var require_parser = __commonJS({
|
|
|
60758
60761
|
}
|
|
60759
60762
|
function peg$parsearray_value() {
|
|
60760
60763
|
var s0, s1, s2, s3, s4;
|
|
60761
|
-
var key = peg$currPos * 49 + 29,
|
|
60762
|
-
if (
|
|
60763
|
-
peg$currPos =
|
|
60764
|
-
return
|
|
60764
|
+
var key = peg$currPos * 49 + 29, cached2 = peg$cache[key];
|
|
60765
|
+
if (cached2) {
|
|
60766
|
+
peg$currPos = cached2.nextPos;
|
|
60767
|
+
return cached2.result;
|
|
60765
60768
|
}
|
|
60766
60769
|
s0 = peg$currPos;
|
|
60767
60770
|
s1 = [];
|
|
@@ -60800,10 +60803,10 @@ var require_parser = __commonJS({
|
|
|
60800
60803
|
}
|
|
60801
60804
|
function peg$parsearray_value_list() {
|
|
60802
60805
|
var s0, s1, s2, s3, s4, s5, s6;
|
|
60803
|
-
var key = peg$currPos * 49 + 30,
|
|
60804
|
-
if (
|
|
60805
|
-
peg$currPos =
|
|
60806
|
-
return
|
|
60806
|
+
var key = peg$currPos * 49 + 30, cached2 = peg$cache[key];
|
|
60807
|
+
if (cached2) {
|
|
60808
|
+
peg$currPos = cached2.nextPos;
|
|
60809
|
+
return cached2.result;
|
|
60807
60810
|
}
|
|
60808
60811
|
s0 = peg$currPos;
|
|
60809
60812
|
s1 = [];
|
|
@@ -60867,10 +60870,10 @@ var require_parser = __commonJS({
|
|
|
60867
60870
|
}
|
|
60868
60871
|
function peg$parsearray_sep() {
|
|
60869
60872
|
var s0;
|
|
60870
|
-
var key = peg$currPos * 49 + 31,
|
|
60871
|
-
if (
|
|
60872
|
-
peg$currPos =
|
|
60873
|
-
return
|
|
60873
|
+
var key = peg$currPos * 49 + 31, cached2 = peg$cache[key];
|
|
60874
|
+
if (cached2) {
|
|
60875
|
+
peg$currPos = cached2.nextPos;
|
|
60876
|
+
return cached2.result;
|
|
60874
60877
|
}
|
|
60875
60878
|
s0 = peg$parseS();
|
|
60876
60879
|
if (s0 === peg$FAILED) {
|
|
@@ -60884,10 +60887,10 @@ var require_parser = __commonJS({
|
|
|
60884
60887
|
}
|
|
60885
60888
|
function peg$parseinline_table() {
|
|
60886
60889
|
var s0, s1, s2, s3, s4, s5;
|
|
60887
|
-
var key = peg$currPos * 49 + 32,
|
|
60888
|
-
if (
|
|
60889
|
-
peg$currPos =
|
|
60890
|
-
return
|
|
60890
|
+
var key = peg$currPos * 49 + 32, cached2 = peg$cache[key];
|
|
60891
|
+
if (cached2) {
|
|
60892
|
+
peg$currPos = cached2.nextPos;
|
|
60893
|
+
return cached2.result;
|
|
60891
60894
|
}
|
|
60892
60895
|
s0 = peg$currPos;
|
|
60893
60896
|
if (input.charCodeAt(peg$currPos) === 123) {
|
|
@@ -60959,10 +60962,10 @@ var require_parser = __commonJS({
|
|
|
60959
60962
|
}
|
|
60960
60963
|
function peg$parseinline_table_assignment() {
|
|
60961
60964
|
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;
|
|
60962
|
-
var key = peg$currPos * 49 + 33,
|
|
60963
|
-
if (
|
|
60964
|
-
peg$currPos =
|
|
60965
|
-
return
|
|
60965
|
+
var key = peg$currPos * 49 + 33, cached2 = peg$cache[key];
|
|
60966
|
+
if (cached2) {
|
|
60967
|
+
peg$currPos = cached2.nextPos;
|
|
60968
|
+
return cached2.result;
|
|
60966
60969
|
}
|
|
60967
60970
|
s0 = peg$currPos;
|
|
60968
60971
|
s1 = [];
|
|
@@ -61133,10 +61136,10 @@ var require_parser = __commonJS({
|
|
|
61133
61136
|
}
|
|
61134
61137
|
function peg$parsesecfragment() {
|
|
61135
61138
|
var s0, s1, s2;
|
|
61136
|
-
var key = peg$currPos * 49 + 34,
|
|
61137
|
-
if (
|
|
61138
|
-
peg$currPos =
|
|
61139
|
-
return
|
|
61139
|
+
var key = peg$currPos * 49 + 34, cached2 = peg$cache[key];
|
|
61140
|
+
if (cached2) {
|
|
61141
|
+
peg$currPos = cached2.nextPos;
|
|
61142
|
+
return cached2.result;
|
|
61140
61143
|
}
|
|
61141
61144
|
s0 = peg$currPos;
|
|
61142
61145
|
if (input.charCodeAt(peg$currPos) === 46) {
|
|
@@ -61167,10 +61170,10 @@ var require_parser = __commonJS({
|
|
|
61167
61170
|
}
|
|
61168
61171
|
function peg$parsedate() {
|
|
61169
61172
|
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;
|
|
61170
|
-
var key = peg$currPos * 49 + 35,
|
|
61171
|
-
if (
|
|
61172
|
-
peg$currPos =
|
|
61173
|
-
return
|
|
61173
|
+
var key = peg$currPos * 49 + 35, cached2 = peg$cache[key];
|
|
61174
|
+
if (cached2) {
|
|
61175
|
+
peg$currPos = cached2.nextPos;
|
|
61176
|
+
return cached2.result;
|
|
61174
61177
|
}
|
|
61175
61178
|
s0 = peg$currPos;
|
|
61176
61179
|
s1 = peg$currPos;
|
|
@@ -61262,10 +61265,10 @@ var require_parser = __commonJS({
|
|
|
61262
61265
|
}
|
|
61263
61266
|
function peg$parsetime() {
|
|
61264
61267
|
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;
|
|
61265
|
-
var key = peg$currPos * 49 + 36,
|
|
61266
|
-
if (
|
|
61267
|
-
peg$currPos =
|
|
61268
|
-
return
|
|
61268
|
+
var key = peg$currPos * 49 + 36, cached2 = peg$cache[key];
|
|
61269
|
+
if (cached2) {
|
|
61270
|
+
peg$currPos = cached2.nextPos;
|
|
61271
|
+
return cached2.result;
|
|
61269
61272
|
}
|
|
61270
61273
|
s0 = peg$currPos;
|
|
61271
61274
|
s1 = peg$currPos;
|
|
@@ -61354,10 +61357,10 @@ var require_parser = __commonJS({
|
|
|
61354
61357
|
}
|
|
61355
61358
|
function peg$parsetime_with_offset() {
|
|
61356
61359
|
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s163;
|
|
61357
|
-
var key = peg$currPos * 49 + 37,
|
|
61358
|
-
if (
|
|
61359
|
-
peg$currPos =
|
|
61360
|
-
return
|
|
61360
|
+
var key = peg$currPos * 49 + 37, cached2 = peg$cache[key];
|
|
61361
|
+
if (cached2) {
|
|
61362
|
+
peg$currPos = cached2.nextPos;
|
|
61363
|
+
return cached2.result;
|
|
61361
61364
|
}
|
|
61362
61365
|
s0 = peg$currPos;
|
|
61363
61366
|
s1 = peg$currPos;
|
|
@@ -61509,10 +61512,10 @@ var require_parser = __commonJS({
|
|
|
61509
61512
|
}
|
|
61510
61513
|
function peg$parsedatetime() {
|
|
61511
61514
|
var s0, s1, s2, s3, s4;
|
|
61512
|
-
var key = peg$currPos * 49 + 38,
|
|
61513
|
-
if (
|
|
61514
|
-
peg$currPos =
|
|
61515
|
-
return
|
|
61515
|
+
var key = peg$currPos * 49 + 38, cached2 = peg$cache[key];
|
|
61516
|
+
if (cached2) {
|
|
61517
|
+
peg$currPos = cached2.nextPos;
|
|
61518
|
+
return cached2.result;
|
|
61516
61519
|
}
|
|
61517
61520
|
s0 = peg$currPos;
|
|
61518
61521
|
s1 = peg$parsedate();
|
|
@@ -61595,10 +61598,10 @@ var require_parser = __commonJS({
|
|
|
61595
61598
|
}
|
|
61596
61599
|
function peg$parseS() {
|
|
61597
61600
|
var s0;
|
|
61598
|
-
var key = peg$currPos * 49 + 39,
|
|
61599
|
-
if (
|
|
61600
|
-
peg$currPos =
|
|
61601
|
-
return
|
|
61601
|
+
var key = peg$currPos * 49 + 39, cached2 = peg$cache[key];
|
|
61602
|
+
if (cached2) {
|
|
61603
|
+
peg$currPos = cached2.nextPos;
|
|
61604
|
+
return cached2.result;
|
|
61602
61605
|
}
|
|
61603
61606
|
if (peg$c81.test(input.charAt(peg$currPos))) {
|
|
61604
61607
|
s0 = input.charAt(peg$currPos);
|
|
@@ -61614,10 +61617,10 @@ var require_parser = __commonJS({
|
|
|
61614
61617
|
}
|
|
61615
61618
|
function peg$parseNL() {
|
|
61616
61619
|
var s0, s1, s2;
|
|
61617
|
-
var key = peg$currPos * 49 + 40,
|
|
61618
|
-
if (
|
|
61619
|
-
peg$currPos =
|
|
61620
|
-
return
|
|
61620
|
+
var key = peg$currPos * 49 + 40, cached2 = peg$cache[key];
|
|
61621
|
+
if (cached2) {
|
|
61622
|
+
peg$currPos = cached2.nextPos;
|
|
61623
|
+
return cached2.result;
|
|
61621
61624
|
}
|
|
61622
61625
|
if (input.charCodeAt(peg$currPos) === 10) {
|
|
61623
61626
|
s0 = peg$c83;
|
|
@@ -61666,10 +61669,10 @@ var require_parser = __commonJS({
|
|
|
61666
61669
|
}
|
|
61667
61670
|
function peg$parseNLS() {
|
|
61668
61671
|
var s0;
|
|
61669
|
-
var key = peg$currPos * 49 + 41,
|
|
61670
|
-
if (
|
|
61671
|
-
peg$currPos =
|
|
61672
|
-
return
|
|
61672
|
+
var key = peg$currPos * 49 + 41, cached2 = peg$cache[key];
|
|
61673
|
+
if (cached2) {
|
|
61674
|
+
peg$currPos = cached2.nextPos;
|
|
61675
|
+
return cached2.result;
|
|
61673
61676
|
}
|
|
61674
61677
|
s0 = peg$parseNL();
|
|
61675
61678
|
if (s0 === peg$FAILED) {
|
|
@@ -61680,10 +61683,10 @@ var require_parser = __commonJS({
|
|
|
61680
61683
|
}
|
|
61681
61684
|
function peg$parseEOF() {
|
|
61682
61685
|
var s0, s1;
|
|
61683
|
-
var key = peg$currPos * 49 + 42,
|
|
61684
|
-
if (
|
|
61685
|
-
peg$currPos =
|
|
61686
|
-
return
|
|
61686
|
+
var key = peg$currPos * 49 + 42, cached2 = peg$cache[key];
|
|
61687
|
+
if (cached2) {
|
|
61688
|
+
peg$currPos = cached2.nextPos;
|
|
61689
|
+
return cached2.result;
|
|
61687
61690
|
}
|
|
61688
61691
|
s0 = peg$currPos;
|
|
61689
61692
|
peg$silentFails++;
|
|
@@ -61708,10 +61711,10 @@ var require_parser = __commonJS({
|
|
|
61708
61711
|
}
|
|
61709
61712
|
function peg$parseHEX() {
|
|
61710
61713
|
var s0;
|
|
61711
|
-
var key = peg$currPos * 49 + 43,
|
|
61712
|
-
if (
|
|
61713
|
-
peg$currPos =
|
|
61714
|
-
return
|
|
61714
|
+
var key = peg$currPos * 49 + 43, cached2 = peg$cache[key];
|
|
61715
|
+
if (cached2) {
|
|
61716
|
+
peg$currPos = cached2.nextPos;
|
|
61717
|
+
return cached2.result;
|
|
61715
61718
|
}
|
|
61716
61719
|
if (peg$c87.test(input.charAt(peg$currPos))) {
|
|
61717
61720
|
s0 = input.charAt(peg$currPos);
|
|
@@ -61727,10 +61730,10 @@ var require_parser = __commonJS({
|
|
|
61727
61730
|
}
|
|
61728
61731
|
function peg$parseDIGIT_OR_UNDER() {
|
|
61729
61732
|
var s0, s1;
|
|
61730
|
-
var key = peg$currPos * 49 + 44,
|
|
61731
|
-
if (
|
|
61732
|
-
peg$currPos =
|
|
61733
|
-
return
|
|
61733
|
+
var key = peg$currPos * 49 + 44, cached2 = peg$cache[key];
|
|
61734
|
+
if (cached2) {
|
|
61735
|
+
peg$currPos = cached2.nextPos;
|
|
61736
|
+
return cached2.result;
|
|
61734
61737
|
}
|
|
61735
61738
|
if (peg$c89.test(input.charAt(peg$currPos))) {
|
|
61736
61739
|
s0 = input.charAt(peg$currPos);
|
|
@@ -61763,10 +61766,10 @@ var require_parser = __commonJS({
|
|
|
61763
61766
|
}
|
|
61764
61767
|
function peg$parseASCII_BASIC() {
|
|
61765
61768
|
var s0;
|
|
61766
|
-
var key = peg$currPos * 49 + 45,
|
|
61767
|
-
if (
|
|
61768
|
-
peg$currPos =
|
|
61769
|
-
return
|
|
61769
|
+
var key = peg$currPos * 49 + 45, cached2 = peg$cache[key];
|
|
61770
|
+
if (cached2) {
|
|
61771
|
+
peg$currPos = cached2.nextPos;
|
|
61772
|
+
return cached2.result;
|
|
61770
61773
|
}
|
|
61771
61774
|
if (peg$c94.test(input.charAt(peg$currPos))) {
|
|
61772
61775
|
s0 = input.charAt(peg$currPos);
|
|
@@ -61782,10 +61785,10 @@ var require_parser = __commonJS({
|
|
|
61782
61785
|
}
|
|
61783
61786
|
function peg$parseDIGITS() {
|
|
61784
61787
|
var s0, s1, s2;
|
|
61785
|
-
var key = peg$currPos * 49 + 46,
|
|
61786
|
-
if (
|
|
61787
|
-
peg$currPos =
|
|
61788
|
-
return
|
|
61788
|
+
var key = peg$currPos * 49 + 46, cached2 = peg$cache[key];
|
|
61789
|
+
if (cached2) {
|
|
61790
|
+
peg$currPos = cached2.nextPos;
|
|
61791
|
+
return cached2.result;
|
|
61789
61792
|
}
|
|
61790
61793
|
s0 = peg$currPos;
|
|
61791
61794
|
s1 = [];
|
|
@@ -61808,10 +61811,10 @@ var require_parser = __commonJS({
|
|
|
61808
61811
|
}
|
|
61809
61812
|
function peg$parseESCAPED() {
|
|
61810
61813
|
var s0, s1;
|
|
61811
|
-
var key = peg$currPos * 49 + 47,
|
|
61812
|
-
if (
|
|
61813
|
-
peg$currPos =
|
|
61814
|
-
return
|
|
61814
|
+
var key = peg$currPos * 49 + 47, cached2 = peg$cache[key];
|
|
61815
|
+
if (cached2) {
|
|
61816
|
+
peg$currPos = cached2.nextPos;
|
|
61817
|
+
return cached2.result;
|
|
61815
61818
|
}
|
|
61816
61819
|
s0 = peg$currPos;
|
|
61817
61820
|
if (input.substr(peg$currPos, 2) === peg$c97) {
|
|
@@ -61938,10 +61941,10 @@ var require_parser = __commonJS({
|
|
|
61938
61941
|
}
|
|
61939
61942
|
function peg$parseESCAPED_UNICODE() {
|
|
61940
61943
|
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;
|
|
61941
|
-
var key = peg$currPos * 49 + 48,
|
|
61942
|
-
if (
|
|
61943
|
-
peg$currPos =
|
|
61944
|
-
return
|
|
61944
|
+
var key = peg$currPos * 49 + 48, cached2 = peg$cache[key];
|
|
61945
|
+
if (cached2) {
|
|
61946
|
+
peg$currPos = cached2.nextPos;
|
|
61947
|
+
return cached2.result;
|
|
61945
61948
|
}
|
|
61946
61949
|
s0 = peg$currPos;
|
|
61947
61950
|
if (input.substr(peg$currPos, 2) === peg$c118) {
|
|
@@ -80831,6 +80834,1715 @@ var init_init = __esm({
|
|
|
80831
80834
|
}
|
|
80832
80835
|
});
|
|
80833
80836
|
|
|
80837
|
+
// node_modules/@msgpack/msgpack/dist.cjs/utils/utf8.cjs
|
|
80838
|
+
var require_utf82 = __commonJS({
|
|
80839
|
+
"node_modules/@msgpack/msgpack/dist.cjs/utils/utf8.cjs"(exports2) {
|
|
80840
|
+
"use strict";
|
|
80841
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
80842
|
+
exports2.utf8Count = utf8Count;
|
|
80843
|
+
exports2.utf8EncodeJs = utf8EncodeJs;
|
|
80844
|
+
exports2.utf8EncodeTE = utf8EncodeTE;
|
|
80845
|
+
exports2.utf8Encode = utf8Encode;
|
|
80846
|
+
exports2.utf8DecodeJs = utf8DecodeJs;
|
|
80847
|
+
exports2.utf8DecodeTD = utf8DecodeTD;
|
|
80848
|
+
exports2.utf8Decode = utf8Decode;
|
|
80849
|
+
function utf8Count(str) {
|
|
80850
|
+
const strLength = str.length;
|
|
80851
|
+
let byteLength = 0;
|
|
80852
|
+
let pos = 0;
|
|
80853
|
+
while (pos < strLength) {
|
|
80854
|
+
let value = str.charCodeAt(pos++);
|
|
80855
|
+
if ((value & 4294967168) === 0) {
|
|
80856
|
+
byteLength++;
|
|
80857
|
+
continue;
|
|
80858
|
+
} else if ((value & 4294965248) === 0) {
|
|
80859
|
+
byteLength += 2;
|
|
80860
|
+
} else {
|
|
80861
|
+
if (value >= 55296 && value <= 56319) {
|
|
80862
|
+
if (pos < strLength) {
|
|
80863
|
+
const extra = str.charCodeAt(pos);
|
|
80864
|
+
if ((extra & 64512) === 56320) {
|
|
80865
|
+
++pos;
|
|
80866
|
+
value = ((value & 1023) << 10) + (extra & 1023) + 65536;
|
|
80867
|
+
}
|
|
80868
|
+
}
|
|
80869
|
+
}
|
|
80870
|
+
if ((value & 4294901760) === 0) {
|
|
80871
|
+
byteLength += 3;
|
|
80872
|
+
} else {
|
|
80873
|
+
byteLength += 4;
|
|
80874
|
+
}
|
|
80875
|
+
}
|
|
80876
|
+
}
|
|
80877
|
+
return byteLength;
|
|
80878
|
+
}
|
|
80879
|
+
function utf8EncodeJs(str, output2, outputOffset) {
|
|
80880
|
+
const strLength = str.length;
|
|
80881
|
+
let offset2 = outputOffset;
|
|
80882
|
+
let pos = 0;
|
|
80883
|
+
while (pos < strLength) {
|
|
80884
|
+
let value = str.charCodeAt(pos++);
|
|
80885
|
+
if ((value & 4294967168) === 0) {
|
|
80886
|
+
output2[offset2++] = value;
|
|
80887
|
+
continue;
|
|
80888
|
+
} else if ((value & 4294965248) === 0) {
|
|
80889
|
+
output2[offset2++] = value >> 6 & 31 | 192;
|
|
80890
|
+
} else {
|
|
80891
|
+
if (value >= 55296 && value <= 56319) {
|
|
80892
|
+
if (pos < strLength) {
|
|
80893
|
+
const extra = str.charCodeAt(pos);
|
|
80894
|
+
if ((extra & 64512) === 56320) {
|
|
80895
|
+
++pos;
|
|
80896
|
+
value = ((value & 1023) << 10) + (extra & 1023) + 65536;
|
|
80897
|
+
}
|
|
80898
|
+
}
|
|
80899
|
+
}
|
|
80900
|
+
if ((value & 4294901760) === 0) {
|
|
80901
|
+
output2[offset2++] = value >> 12 & 15 | 224;
|
|
80902
|
+
output2[offset2++] = value >> 6 & 63 | 128;
|
|
80903
|
+
} else {
|
|
80904
|
+
output2[offset2++] = value >> 18 & 7 | 240;
|
|
80905
|
+
output2[offset2++] = value >> 12 & 63 | 128;
|
|
80906
|
+
output2[offset2++] = value >> 6 & 63 | 128;
|
|
80907
|
+
}
|
|
80908
|
+
}
|
|
80909
|
+
output2[offset2++] = value & 63 | 128;
|
|
80910
|
+
}
|
|
80911
|
+
}
|
|
80912
|
+
var sharedTextEncoder = new TextEncoder();
|
|
80913
|
+
var TEXT_ENCODER_THRESHOLD = 50;
|
|
80914
|
+
function utf8EncodeTE(str, output2, outputOffset) {
|
|
80915
|
+
sharedTextEncoder.encodeInto(str, output2.subarray(outputOffset));
|
|
80916
|
+
}
|
|
80917
|
+
function utf8Encode(str, output2, outputOffset) {
|
|
80918
|
+
if (str.length > TEXT_ENCODER_THRESHOLD) {
|
|
80919
|
+
utf8EncodeTE(str, output2, outputOffset);
|
|
80920
|
+
} else {
|
|
80921
|
+
utf8EncodeJs(str, output2, outputOffset);
|
|
80922
|
+
}
|
|
80923
|
+
}
|
|
80924
|
+
var CHUNK_SIZE = 4096;
|
|
80925
|
+
function utf8DecodeJs(bytes, inputOffset, byteLength) {
|
|
80926
|
+
let offset2 = inputOffset;
|
|
80927
|
+
const end = offset2 + byteLength;
|
|
80928
|
+
const units = [];
|
|
80929
|
+
let result = "";
|
|
80930
|
+
while (offset2 < end) {
|
|
80931
|
+
const byte1 = bytes[offset2++];
|
|
80932
|
+
if ((byte1 & 128) === 0) {
|
|
80933
|
+
units.push(byte1);
|
|
80934
|
+
} else if ((byte1 & 224) === 192) {
|
|
80935
|
+
const byte2 = bytes[offset2++] & 63;
|
|
80936
|
+
units.push((byte1 & 31) << 6 | byte2);
|
|
80937
|
+
} else if ((byte1 & 240) === 224) {
|
|
80938
|
+
const byte2 = bytes[offset2++] & 63;
|
|
80939
|
+
const byte3 = bytes[offset2++] & 63;
|
|
80940
|
+
units.push((byte1 & 31) << 12 | byte2 << 6 | byte3);
|
|
80941
|
+
} else if ((byte1 & 248) === 240) {
|
|
80942
|
+
const byte2 = bytes[offset2++] & 63;
|
|
80943
|
+
const byte3 = bytes[offset2++] & 63;
|
|
80944
|
+
const byte4 = bytes[offset2++] & 63;
|
|
80945
|
+
let unit = (byte1 & 7) << 18 | byte2 << 12 | byte3 << 6 | byte4;
|
|
80946
|
+
if (unit > 65535) {
|
|
80947
|
+
unit -= 65536;
|
|
80948
|
+
units.push(unit >>> 10 & 1023 | 55296);
|
|
80949
|
+
unit = 56320 | unit & 1023;
|
|
80950
|
+
}
|
|
80951
|
+
units.push(unit);
|
|
80952
|
+
} else {
|
|
80953
|
+
units.push(byte1);
|
|
80954
|
+
}
|
|
80955
|
+
if (units.length >= CHUNK_SIZE) {
|
|
80956
|
+
result += String.fromCharCode(...units);
|
|
80957
|
+
units.length = 0;
|
|
80958
|
+
}
|
|
80959
|
+
}
|
|
80960
|
+
if (units.length > 0) {
|
|
80961
|
+
result += String.fromCharCode(...units);
|
|
80962
|
+
}
|
|
80963
|
+
return result;
|
|
80964
|
+
}
|
|
80965
|
+
var sharedTextDecoder = new TextDecoder();
|
|
80966
|
+
var TEXT_DECODER_THRESHOLD = 200;
|
|
80967
|
+
function utf8DecodeTD(bytes, inputOffset, byteLength) {
|
|
80968
|
+
const stringBytes = bytes.subarray(inputOffset, inputOffset + byteLength);
|
|
80969
|
+
return sharedTextDecoder.decode(stringBytes);
|
|
80970
|
+
}
|
|
80971
|
+
function utf8Decode(bytes, inputOffset, byteLength) {
|
|
80972
|
+
if (byteLength > TEXT_DECODER_THRESHOLD) {
|
|
80973
|
+
return utf8DecodeTD(bytes, inputOffset, byteLength);
|
|
80974
|
+
} else {
|
|
80975
|
+
return utf8DecodeJs(bytes, inputOffset, byteLength);
|
|
80976
|
+
}
|
|
80977
|
+
}
|
|
80978
|
+
}
|
|
80979
|
+
});
|
|
80980
|
+
|
|
80981
|
+
// node_modules/@msgpack/msgpack/dist.cjs/ExtData.cjs
|
|
80982
|
+
var require_ExtData = __commonJS({
|
|
80983
|
+
"node_modules/@msgpack/msgpack/dist.cjs/ExtData.cjs"(exports2) {
|
|
80984
|
+
"use strict";
|
|
80985
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
80986
|
+
exports2.ExtData = void 0;
|
|
80987
|
+
var ExtData = class {
|
|
80988
|
+
type;
|
|
80989
|
+
data;
|
|
80990
|
+
constructor(type, data) {
|
|
80991
|
+
this.type = type;
|
|
80992
|
+
this.data = data;
|
|
80993
|
+
}
|
|
80994
|
+
};
|
|
80995
|
+
exports2.ExtData = ExtData;
|
|
80996
|
+
}
|
|
80997
|
+
});
|
|
80998
|
+
|
|
80999
|
+
// node_modules/@msgpack/msgpack/dist.cjs/DecodeError.cjs
|
|
81000
|
+
var require_DecodeError = __commonJS({
|
|
81001
|
+
"node_modules/@msgpack/msgpack/dist.cjs/DecodeError.cjs"(exports2) {
|
|
81002
|
+
"use strict";
|
|
81003
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
81004
|
+
exports2.DecodeError = void 0;
|
|
81005
|
+
var DecodeError = class _DecodeError extends Error {
|
|
81006
|
+
constructor(message) {
|
|
81007
|
+
super(message);
|
|
81008
|
+
const proto2 = Object.create(_DecodeError.prototype);
|
|
81009
|
+
Object.setPrototypeOf(this, proto2);
|
|
81010
|
+
Object.defineProperty(this, "name", {
|
|
81011
|
+
configurable: true,
|
|
81012
|
+
enumerable: false,
|
|
81013
|
+
value: _DecodeError.name
|
|
81014
|
+
});
|
|
81015
|
+
}
|
|
81016
|
+
};
|
|
81017
|
+
exports2.DecodeError = DecodeError;
|
|
81018
|
+
}
|
|
81019
|
+
});
|
|
81020
|
+
|
|
81021
|
+
// node_modules/@msgpack/msgpack/dist.cjs/utils/int.cjs
|
|
81022
|
+
var require_int = __commonJS({
|
|
81023
|
+
"node_modules/@msgpack/msgpack/dist.cjs/utils/int.cjs"(exports2) {
|
|
81024
|
+
"use strict";
|
|
81025
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
81026
|
+
exports2.UINT32_MAX = void 0;
|
|
81027
|
+
exports2.setUint64 = setUint64;
|
|
81028
|
+
exports2.setInt64 = setInt64;
|
|
81029
|
+
exports2.getInt64 = getInt64;
|
|
81030
|
+
exports2.getUint64 = getUint64;
|
|
81031
|
+
exports2.UINT32_MAX = 4294967295;
|
|
81032
|
+
function setUint64(view, offset2, value) {
|
|
81033
|
+
const high = value / 4294967296;
|
|
81034
|
+
const low = value;
|
|
81035
|
+
view.setUint32(offset2, high);
|
|
81036
|
+
view.setUint32(offset2 + 4, low);
|
|
81037
|
+
}
|
|
81038
|
+
function setInt64(view, offset2, value) {
|
|
81039
|
+
const high = Math.floor(value / 4294967296);
|
|
81040
|
+
const low = value;
|
|
81041
|
+
view.setUint32(offset2, high);
|
|
81042
|
+
view.setUint32(offset2 + 4, low);
|
|
81043
|
+
}
|
|
81044
|
+
function getInt64(view, offset2) {
|
|
81045
|
+
const high = view.getInt32(offset2);
|
|
81046
|
+
const low = view.getUint32(offset2 + 4);
|
|
81047
|
+
return high * 4294967296 + low;
|
|
81048
|
+
}
|
|
81049
|
+
function getUint64(view, offset2) {
|
|
81050
|
+
const high = view.getUint32(offset2);
|
|
81051
|
+
const low = view.getUint32(offset2 + 4);
|
|
81052
|
+
return high * 4294967296 + low;
|
|
81053
|
+
}
|
|
81054
|
+
}
|
|
81055
|
+
});
|
|
81056
|
+
|
|
81057
|
+
// node_modules/@msgpack/msgpack/dist.cjs/timestamp.cjs
|
|
81058
|
+
var require_timestamp = __commonJS({
|
|
81059
|
+
"node_modules/@msgpack/msgpack/dist.cjs/timestamp.cjs"(exports2) {
|
|
81060
|
+
"use strict";
|
|
81061
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
81062
|
+
exports2.timestampExtension = exports2.EXT_TIMESTAMP = void 0;
|
|
81063
|
+
exports2.encodeTimeSpecToTimestamp = encodeTimeSpecToTimestamp;
|
|
81064
|
+
exports2.encodeDateToTimeSpec = encodeDateToTimeSpec;
|
|
81065
|
+
exports2.encodeTimestampExtension = encodeTimestampExtension;
|
|
81066
|
+
exports2.decodeTimestampToTimeSpec = decodeTimestampToTimeSpec;
|
|
81067
|
+
exports2.decodeTimestampExtension = decodeTimestampExtension;
|
|
81068
|
+
var DecodeError_ts_1 = require_DecodeError();
|
|
81069
|
+
var int_ts_1 = require_int();
|
|
81070
|
+
exports2.EXT_TIMESTAMP = -1;
|
|
81071
|
+
var TIMESTAMP32_MAX_SEC = 4294967296 - 1;
|
|
81072
|
+
var TIMESTAMP64_MAX_SEC = 17179869184 - 1;
|
|
81073
|
+
function encodeTimeSpecToTimestamp({ sec, nsec }) {
|
|
81074
|
+
if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) {
|
|
81075
|
+
if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) {
|
|
81076
|
+
const rv = new Uint8Array(4);
|
|
81077
|
+
const view = new DataView(rv.buffer);
|
|
81078
|
+
view.setUint32(0, sec);
|
|
81079
|
+
return rv;
|
|
81080
|
+
} else {
|
|
81081
|
+
const secHigh = sec / 4294967296;
|
|
81082
|
+
const secLow = sec & 4294967295;
|
|
81083
|
+
const rv = new Uint8Array(8);
|
|
81084
|
+
const view = new DataView(rv.buffer);
|
|
81085
|
+
view.setUint32(0, nsec << 2 | secHigh & 3);
|
|
81086
|
+
view.setUint32(4, secLow);
|
|
81087
|
+
return rv;
|
|
81088
|
+
}
|
|
81089
|
+
} else {
|
|
81090
|
+
const rv = new Uint8Array(12);
|
|
81091
|
+
const view = new DataView(rv.buffer);
|
|
81092
|
+
view.setUint32(0, nsec);
|
|
81093
|
+
(0, int_ts_1.setInt64)(view, 4, sec);
|
|
81094
|
+
return rv;
|
|
81095
|
+
}
|
|
81096
|
+
}
|
|
81097
|
+
function encodeDateToTimeSpec(date) {
|
|
81098
|
+
const msec = date.getTime();
|
|
81099
|
+
const sec = Math.floor(msec / 1e3);
|
|
81100
|
+
const nsec = (msec - sec * 1e3) * 1e6;
|
|
81101
|
+
const nsecInSec = Math.floor(nsec / 1e9);
|
|
81102
|
+
return {
|
|
81103
|
+
sec: sec + nsecInSec,
|
|
81104
|
+
nsec: nsec - nsecInSec * 1e9
|
|
81105
|
+
};
|
|
81106
|
+
}
|
|
81107
|
+
function encodeTimestampExtension(object) {
|
|
81108
|
+
if (object instanceof Date) {
|
|
81109
|
+
const timeSpec = encodeDateToTimeSpec(object);
|
|
81110
|
+
return encodeTimeSpecToTimestamp(timeSpec);
|
|
81111
|
+
} else {
|
|
81112
|
+
return null;
|
|
81113
|
+
}
|
|
81114
|
+
}
|
|
81115
|
+
function decodeTimestampToTimeSpec(data) {
|
|
81116
|
+
const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
81117
|
+
switch (data.byteLength) {
|
|
81118
|
+
case 4: {
|
|
81119
|
+
const sec = view.getUint32(0);
|
|
81120
|
+
const nsec = 0;
|
|
81121
|
+
return { sec, nsec };
|
|
81122
|
+
}
|
|
81123
|
+
case 8: {
|
|
81124
|
+
const nsec30AndSecHigh2 = view.getUint32(0);
|
|
81125
|
+
const secLow32 = view.getUint32(4);
|
|
81126
|
+
const sec = (nsec30AndSecHigh2 & 3) * 4294967296 + secLow32;
|
|
81127
|
+
const nsec = nsec30AndSecHigh2 >>> 2;
|
|
81128
|
+
return { sec, nsec };
|
|
81129
|
+
}
|
|
81130
|
+
case 12: {
|
|
81131
|
+
const sec = (0, int_ts_1.getInt64)(view, 4);
|
|
81132
|
+
const nsec = view.getUint32(0);
|
|
81133
|
+
return { sec, nsec };
|
|
81134
|
+
}
|
|
81135
|
+
default:
|
|
81136
|
+
throw new DecodeError_ts_1.DecodeError(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${data.length}`);
|
|
81137
|
+
}
|
|
81138
|
+
}
|
|
81139
|
+
function decodeTimestampExtension(data) {
|
|
81140
|
+
const timeSpec = decodeTimestampToTimeSpec(data);
|
|
81141
|
+
return new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6);
|
|
81142
|
+
}
|
|
81143
|
+
exports2.timestampExtension = {
|
|
81144
|
+
type: exports2.EXT_TIMESTAMP,
|
|
81145
|
+
encode: encodeTimestampExtension,
|
|
81146
|
+
decode: decodeTimestampExtension
|
|
81147
|
+
};
|
|
81148
|
+
}
|
|
81149
|
+
});
|
|
81150
|
+
|
|
81151
|
+
// node_modules/@msgpack/msgpack/dist.cjs/ExtensionCodec.cjs
|
|
81152
|
+
var require_ExtensionCodec = __commonJS({
|
|
81153
|
+
"node_modules/@msgpack/msgpack/dist.cjs/ExtensionCodec.cjs"(exports2) {
|
|
81154
|
+
"use strict";
|
|
81155
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
81156
|
+
exports2.ExtensionCodec = void 0;
|
|
81157
|
+
var ExtData_ts_1 = require_ExtData();
|
|
81158
|
+
var timestamp_ts_1 = require_timestamp();
|
|
81159
|
+
var ExtensionCodec = class _ExtensionCodec {
|
|
81160
|
+
static defaultCodec = new _ExtensionCodec();
|
|
81161
|
+
// ensures ExtensionCodecType<X> matches ExtensionCodec<X>
|
|
81162
|
+
// this will make type errors a lot more clear
|
|
81163
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
81164
|
+
__brand;
|
|
81165
|
+
// built-in extensions
|
|
81166
|
+
builtInEncoders = [];
|
|
81167
|
+
builtInDecoders = [];
|
|
81168
|
+
// custom extensions
|
|
81169
|
+
encoders = [];
|
|
81170
|
+
decoders = [];
|
|
81171
|
+
constructor() {
|
|
81172
|
+
this.register(timestamp_ts_1.timestampExtension);
|
|
81173
|
+
}
|
|
81174
|
+
register({ type, encode, decode }) {
|
|
81175
|
+
if (type >= 0) {
|
|
81176
|
+
this.encoders[type] = encode;
|
|
81177
|
+
this.decoders[type] = decode;
|
|
81178
|
+
} else {
|
|
81179
|
+
const index = -1 - type;
|
|
81180
|
+
this.builtInEncoders[index] = encode;
|
|
81181
|
+
this.builtInDecoders[index] = decode;
|
|
81182
|
+
}
|
|
81183
|
+
}
|
|
81184
|
+
tryToEncode(object, context) {
|
|
81185
|
+
for (let i = 0; i < this.builtInEncoders.length; i++) {
|
|
81186
|
+
const encodeExt = this.builtInEncoders[i];
|
|
81187
|
+
if (encodeExt != null) {
|
|
81188
|
+
const data = encodeExt(object, context);
|
|
81189
|
+
if (data != null) {
|
|
81190
|
+
const type = -1 - i;
|
|
81191
|
+
return new ExtData_ts_1.ExtData(type, data);
|
|
81192
|
+
}
|
|
81193
|
+
}
|
|
81194
|
+
}
|
|
81195
|
+
for (let i = 0; i < this.encoders.length; i++) {
|
|
81196
|
+
const encodeExt = this.encoders[i];
|
|
81197
|
+
if (encodeExt != null) {
|
|
81198
|
+
const data = encodeExt(object, context);
|
|
81199
|
+
if (data != null) {
|
|
81200
|
+
const type = i;
|
|
81201
|
+
return new ExtData_ts_1.ExtData(type, data);
|
|
81202
|
+
}
|
|
81203
|
+
}
|
|
81204
|
+
}
|
|
81205
|
+
if (object instanceof ExtData_ts_1.ExtData) {
|
|
81206
|
+
return object;
|
|
81207
|
+
}
|
|
81208
|
+
return null;
|
|
81209
|
+
}
|
|
81210
|
+
decode(data, type, context) {
|
|
81211
|
+
const decodeExt = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type];
|
|
81212
|
+
if (decodeExt) {
|
|
81213
|
+
return decodeExt(data, type, context);
|
|
81214
|
+
} else {
|
|
81215
|
+
return new ExtData_ts_1.ExtData(type, data);
|
|
81216
|
+
}
|
|
81217
|
+
}
|
|
81218
|
+
};
|
|
81219
|
+
exports2.ExtensionCodec = ExtensionCodec;
|
|
81220
|
+
}
|
|
81221
|
+
});
|
|
81222
|
+
|
|
81223
|
+
// node_modules/@msgpack/msgpack/dist.cjs/utils/typedArrays.cjs
|
|
81224
|
+
var require_typedArrays = __commonJS({
|
|
81225
|
+
"node_modules/@msgpack/msgpack/dist.cjs/utils/typedArrays.cjs"(exports2) {
|
|
81226
|
+
"use strict";
|
|
81227
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
81228
|
+
exports2.ensureUint8Array = ensureUint8Array;
|
|
81229
|
+
function isArrayBufferLike(buffer) {
|
|
81230
|
+
return buffer instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && buffer instanceof SharedArrayBuffer;
|
|
81231
|
+
}
|
|
81232
|
+
function ensureUint8Array(buffer) {
|
|
81233
|
+
if (buffer instanceof Uint8Array) {
|
|
81234
|
+
return buffer;
|
|
81235
|
+
} else if (ArrayBuffer.isView(buffer)) {
|
|
81236
|
+
return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
81237
|
+
} else if (isArrayBufferLike(buffer)) {
|
|
81238
|
+
return new Uint8Array(buffer);
|
|
81239
|
+
} else {
|
|
81240
|
+
return Uint8Array.from(buffer);
|
|
81241
|
+
}
|
|
81242
|
+
}
|
|
81243
|
+
}
|
|
81244
|
+
});
|
|
81245
|
+
|
|
81246
|
+
// node_modules/@msgpack/msgpack/dist.cjs/Encoder.cjs
|
|
81247
|
+
var require_Encoder = __commonJS({
|
|
81248
|
+
"node_modules/@msgpack/msgpack/dist.cjs/Encoder.cjs"(exports2) {
|
|
81249
|
+
"use strict";
|
|
81250
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
81251
|
+
exports2.Encoder = exports2.DEFAULT_INITIAL_BUFFER_SIZE = exports2.DEFAULT_MAX_DEPTH = void 0;
|
|
81252
|
+
var utf8_ts_1 = require_utf82();
|
|
81253
|
+
var ExtensionCodec_ts_1 = require_ExtensionCodec();
|
|
81254
|
+
var int_ts_1 = require_int();
|
|
81255
|
+
var typedArrays_ts_1 = require_typedArrays();
|
|
81256
|
+
exports2.DEFAULT_MAX_DEPTH = 100;
|
|
81257
|
+
exports2.DEFAULT_INITIAL_BUFFER_SIZE = 2048;
|
|
81258
|
+
var Encoder = class _Encoder {
|
|
81259
|
+
extensionCodec;
|
|
81260
|
+
context;
|
|
81261
|
+
useBigInt64;
|
|
81262
|
+
maxDepth;
|
|
81263
|
+
initialBufferSize;
|
|
81264
|
+
sortKeys;
|
|
81265
|
+
forceFloat32;
|
|
81266
|
+
ignoreUndefined;
|
|
81267
|
+
forceIntegerToFloat;
|
|
81268
|
+
pos;
|
|
81269
|
+
view;
|
|
81270
|
+
bytes;
|
|
81271
|
+
entered = false;
|
|
81272
|
+
constructor(options) {
|
|
81273
|
+
this.extensionCodec = options?.extensionCodec ?? ExtensionCodec_ts_1.ExtensionCodec.defaultCodec;
|
|
81274
|
+
this.context = options?.context;
|
|
81275
|
+
this.useBigInt64 = options?.useBigInt64 ?? false;
|
|
81276
|
+
this.maxDepth = options?.maxDepth ?? exports2.DEFAULT_MAX_DEPTH;
|
|
81277
|
+
this.initialBufferSize = options?.initialBufferSize ?? exports2.DEFAULT_INITIAL_BUFFER_SIZE;
|
|
81278
|
+
this.sortKeys = options?.sortKeys ?? false;
|
|
81279
|
+
this.forceFloat32 = options?.forceFloat32 ?? false;
|
|
81280
|
+
this.ignoreUndefined = options?.ignoreUndefined ?? false;
|
|
81281
|
+
this.forceIntegerToFloat = options?.forceIntegerToFloat ?? false;
|
|
81282
|
+
this.pos = 0;
|
|
81283
|
+
this.view = new DataView(new ArrayBuffer(this.initialBufferSize));
|
|
81284
|
+
this.bytes = new Uint8Array(this.view.buffer);
|
|
81285
|
+
}
|
|
81286
|
+
clone() {
|
|
81287
|
+
return new _Encoder({
|
|
81288
|
+
extensionCodec: this.extensionCodec,
|
|
81289
|
+
context: this.context,
|
|
81290
|
+
useBigInt64: this.useBigInt64,
|
|
81291
|
+
maxDepth: this.maxDepth,
|
|
81292
|
+
initialBufferSize: this.initialBufferSize,
|
|
81293
|
+
sortKeys: this.sortKeys,
|
|
81294
|
+
forceFloat32: this.forceFloat32,
|
|
81295
|
+
ignoreUndefined: this.ignoreUndefined,
|
|
81296
|
+
forceIntegerToFloat: this.forceIntegerToFloat
|
|
81297
|
+
});
|
|
81298
|
+
}
|
|
81299
|
+
reinitializeState() {
|
|
81300
|
+
this.pos = 0;
|
|
81301
|
+
}
|
|
81302
|
+
/**
|
|
81303
|
+
* This is almost equivalent to {@link Encoder#encode}, but it returns an reference of the encoder's internal buffer and thus much faster than {@link Encoder#encode}.
|
|
81304
|
+
*
|
|
81305
|
+
* @returns Encodes the object and returns a shared reference the encoder's internal buffer.
|
|
81306
|
+
*/
|
|
81307
|
+
encodeSharedRef(object) {
|
|
81308
|
+
if (this.entered) {
|
|
81309
|
+
const instance = this.clone();
|
|
81310
|
+
return instance.encodeSharedRef(object);
|
|
81311
|
+
}
|
|
81312
|
+
try {
|
|
81313
|
+
this.entered = true;
|
|
81314
|
+
this.reinitializeState();
|
|
81315
|
+
this.doEncode(object, 1);
|
|
81316
|
+
return this.bytes.subarray(0, this.pos);
|
|
81317
|
+
} finally {
|
|
81318
|
+
this.entered = false;
|
|
81319
|
+
}
|
|
81320
|
+
}
|
|
81321
|
+
/**
|
|
81322
|
+
* @returns Encodes the object and returns a copy of the encoder's internal buffer.
|
|
81323
|
+
*/
|
|
81324
|
+
encode(object) {
|
|
81325
|
+
if (this.entered) {
|
|
81326
|
+
const instance = this.clone();
|
|
81327
|
+
return instance.encode(object);
|
|
81328
|
+
}
|
|
81329
|
+
try {
|
|
81330
|
+
this.entered = true;
|
|
81331
|
+
this.reinitializeState();
|
|
81332
|
+
this.doEncode(object, 1);
|
|
81333
|
+
return this.bytes.slice(0, this.pos);
|
|
81334
|
+
} finally {
|
|
81335
|
+
this.entered = false;
|
|
81336
|
+
}
|
|
81337
|
+
}
|
|
81338
|
+
doEncode(object, depth) {
|
|
81339
|
+
if (depth > this.maxDepth) {
|
|
81340
|
+
throw new Error(`Too deep objects in depth ${depth}`);
|
|
81341
|
+
}
|
|
81342
|
+
if (object == null) {
|
|
81343
|
+
this.encodeNil();
|
|
81344
|
+
} else if (typeof object === "boolean") {
|
|
81345
|
+
this.encodeBoolean(object);
|
|
81346
|
+
} else if (typeof object === "number") {
|
|
81347
|
+
if (!this.forceIntegerToFloat) {
|
|
81348
|
+
this.encodeNumber(object);
|
|
81349
|
+
} else {
|
|
81350
|
+
this.encodeNumberAsFloat(object);
|
|
81351
|
+
}
|
|
81352
|
+
} else if (typeof object === "string") {
|
|
81353
|
+
this.encodeString(object);
|
|
81354
|
+
} else if (this.useBigInt64 && typeof object === "bigint") {
|
|
81355
|
+
this.encodeBigInt64(object);
|
|
81356
|
+
} else {
|
|
81357
|
+
this.encodeObject(object, depth);
|
|
81358
|
+
}
|
|
81359
|
+
}
|
|
81360
|
+
ensureBufferSizeToWrite(sizeToWrite) {
|
|
81361
|
+
const requiredSize = this.pos + sizeToWrite;
|
|
81362
|
+
if (this.view.byteLength < requiredSize) {
|
|
81363
|
+
this.resizeBuffer(requiredSize * 2);
|
|
81364
|
+
}
|
|
81365
|
+
}
|
|
81366
|
+
resizeBuffer(newSize) {
|
|
81367
|
+
const newBuffer = new ArrayBuffer(newSize);
|
|
81368
|
+
const newBytes = new Uint8Array(newBuffer);
|
|
81369
|
+
const newView = new DataView(newBuffer);
|
|
81370
|
+
newBytes.set(this.bytes);
|
|
81371
|
+
this.view = newView;
|
|
81372
|
+
this.bytes = newBytes;
|
|
81373
|
+
}
|
|
81374
|
+
encodeNil() {
|
|
81375
|
+
this.writeU8(192);
|
|
81376
|
+
}
|
|
81377
|
+
encodeBoolean(object) {
|
|
81378
|
+
if (object === false) {
|
|
81379
|
+
this.writeU8(194);
|
|
81380
|
+
} else {
|
|
81381
|
+
this.writeU8(195);
|
|
81382
|
+
}
|
|
81383
|
+
}
|
|
81384
|
+
encodeNumber(object) {
|
|
81385
|
+
if (!this.forceIntegerToFloat && Number.isSafeInteger(object)) {
|
|
81386
|
+
if (object >= 0) {
|
|
81387
|
+
if (object < 128) {
|
|
81388
|
+
this.writeU8(object);
|
|
81389
|
+
} else if (object < 256) {
|
|
81390
|
+
this.writeU8(204);
|
|
81391
|
+
this.writeU8(object);
|
|
81392
|
+
} else if (object < 65536) {
|
|
81393
|
+
this.writeU8(205);
|
|
81394
|
+
this.writeU16(object);
|
|
81395
|
+
} else if (object < 4294967296) {
|
|
81396
|
+
this.writeU8(206);
|
|
81397
|
+
this.writeU32(object);
|
|
81398
|
+
} else if (!this.useBigInt64) {
|
|
81399
|
+
this.writeU8(207);
|
|
81400
|
+
this.writeU64(object);
|
|
81401
|
+
} else {
|
|
81402
|
+
this.encodeNumberAsFloat(object);
|
|
81403
|
+
}
|
|
81404
|
+
} else {
|
|
81405
|
+
if (object >= -32) {
|
|
81406
|
+
this.writeU8(224 | object + 32);
|
|
81407
|
+
} else if (object >= -128) {
|
|
81408
|
+
this.writeU8(208);
|
|
81409
|
+
this.writeI8(object);
|
|
81410
|
+
} else if (object >= -32768) {
|
|
81411
|
+
this.writeU8(209);
|
|
81412
|
+
this.writeI16(object);
|
|
81413
|
+
} else if (object >= -2147483648) {
|
|
81414
|
+
this.writeU8(210);
|
|
81415
|
+
this.writeI32(object);
|
|
81416
|
+
} else if (!this.useBigInt64) {
|
|
81417
|
+
this.writeU8(211);
|
|
81418
|
+
this.writeI64(object);
|
|
81419
|
+
} else {
|
|
81420
|
+
this.encodeNumberAsFloat(object);
|
|
81421
|
+
}
|
|
81422
|
+
}
|
|
81423
|
+
} else {
|
|
81424
|
+
this.encodeNumberAsFloat(object);
|
|
81425
|
+
}
|
|
81426
|
+
}
|
|
81427
|
+
encodeNumberAsFloat(object) {
|
|
81428
|
+
if (this.forceFloat32) {
|
|
81429
|
+
this.writeU8(202);
|
|
81430
|
+
this.writeF32(object);
|
|
81431
|
+
} else {
|
|
81432
|
+
this.writeU8(203);
|
|
81433
|
+
this.writeF64(object);
|
|
81434
|
+
}
|
|
81435
|
+
}
|
|
81436
|
+
encodeBigInt64(object) {
|
|
81437
|
+
if (object >= BigInt(0)) {
|
|
81438
|
+
this.writeU8(207);
|
|
81439
|
+
this.writeBigUint64(object);
|
|
81440
|
+
} else {
|
|
81441
|
+
this.writeU8(211);
|
|
81442
|
+
this.writeBigInt64(object);
|
|
81443
|
+
}
|
|
81444
|
+
}
|
|
81445
|
+
writeStringHeader(byteLength) {
|
|
81446
|
+
if (byteLength < 32) {
|
|
81447
|
+
this.writeU8(160 + byteLength);
|
|
81448
|
+
} else if (byteLength < 256) {
|
|
81449
|
+
this.writeU8(217);
|
|
81450
|
+
this.writeU8(byteLength);
|
|
81451
|
+
} else if (byteLength < 65536) {
|
|
81452
|
+
this.writeU8(218);
|
|
81453
|
+
this.writeU16(byteLength);
|
|
81454
|
+
} else if (byteLength < 4294967296) {
|
|
81455
|
+
this.writeU8(219);
|
|
81456
|
+
this.writeU32(byteLength);
|
|
81457
|
+
} else {
|
|
81458
|
+
throw new Error(`Too long string: ${byteLength} bytes in UTF-8`);
|
|
81459
|
+
}
|
|
81460
|
+
}
|
|
81461
|
+
encodeString(object) {
|
|
81462
|
+
const maxHeaderSize = 1 + 4;
|
|
81463
|
+
const byteLength = (0, utf8_ts_1.utf8Count)(object);
|
|
81464
|
+
this.ensureBufferSizeToWrite(maxHeaderSize + byteLength);
|
|
81465
|
+
this.writeStringHeader(byteLength);
|
|
81466
|
+
(0, utf8_ts_1.utf8Encode)(object, this.bytes, this.pos);
|
|
81467
|
+
this.pos += byteLength;
|
|
81468
|
+
}
|
|
81469
|
+
encodeObject(object, depth) {
|
|
81470
|
+
const ext = this.extensionCodec.tryToEncode(object, this.context);
|
|
81471
|
+
if (ext != null) {
|
|
81472
|
+
this.encodeExtension(ext);
|
|
81473
|
+
} else if (Array.isArray(object)) {
|
|
81474
|
+
this.encodeArray(object, depth);
|
|
81475
|
+
} else if (ArrayBuffer.isView(object)) {
|
|
81476
|
+
this.encodeBinary(object);
|
|
81477
|
+
} else if (typeof object === "object") {
|
|
81478
|
+
this.encodeMap(object, depth);
|
|
81479
|
+
} else {
|
|
81480
|
+
throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(object)}`);
|
|
81481
|
+
}
|
|
81482
|
+
}
|
|
81483
|
+
encodeBinary(object) {
|
|
81484
|
+
const size = object.byteLength;
|
|
81485
|
+
if (size < 256) {
|
|
81486
|
+
this.writeU8(196);
|
|
81487
|
+
this.writeU8(size);
|
|
81488
|
+
} else if (size < 65536) {
|
|
81489
|
+
this.writeU8(197);
|
|
81490
|
+
this.writeU16(size);
|
|
81491
|
+
} else if (size < 4294967296) {
|
|
81492
|
+
this.writeU8(198);
|
|
81493
|
+
this.writeU32(size);
|
|
81494
|
+
} else {
|
|
81495
|
+
throw new Error(`Too large binary: ${size}`);
|
|
81496
|
+
}
|
|
81497
|
+
const bytes = (0, typedArrays_ts_1.ensureUint8Array)(object);
|
|
81498
|
+
this.writeU8a(bytes);
|
|
81499
|
+
}
|
|
81500
|
+
encodeArray(object, depth) {
|
|
81501
|
+
const size = object.length;
|
|
81502
|
+
if (size < 16) {
|
|
81503
|
+
this.writeU8(144 + size);
|
|
81504
|
+
} else if (size < 65536) {
|
|
81505
|
+
this.writeU8(220);
|
|
81506
|
+
this.writeU16(size);
|
|
81507
|
+
} else if (size < 4294967296) {
|
|
81508
|
+
this.writeU8(221);
|
|
81509
|
+
this.writeU32(size);
|
|
81510
|
+
} else {
|
|
81511
|
+
throw new Error(`Too large array: ${size}`);
|
|
81512
|
+
}
|
|
81513
|
+
for (const item of object) {
|
|
81514
|
+
this.doEncode(item, depth + 1);
|
|
81515
|
+
}
|
|
81516
|
+
}
|
|
81517
|
+
countWithoutUndefined(object, keys) {
|
|
81518
|
+
let count = 0;
|
|
81519
|
+
for (const key of keys) {
|
|
81520
|
+
if (object[key] !== void 0) {
|
|
81521
|
+
count++;
|
|
81522
|
+
}
|
|
81523
|
+
}
|
|
81524
|
+
return count;
|
|
81525
|
+
}
|
|
81526
|
+
encodeMap(object, depth) {
|
|
81527
|
+
const keys = Object.keys(object);
|
|
81528
|
+
if (this.sortKeys) {
|
|
81529
|
+
keys.sort();
|
|
81530
|
+
}
|
|
81531
|
+
const size = this.ignoreUndefined ? this.countWithoutUndefined(object, keys) : keys.length;
|
|
81532
|
+
if (size < 16) {
|
|
81533
|
+
this.writeU8(128 + size);
|
|
81534
|
+
} else if (size < 65536) {
|
|
81535
|
+
this.writeU8(222);
|
|
81536
|
+
this.writeU16(size);
|
|
81537
|
+
} else if (size < 4294967296) {
|
|
81538
|
+
this.writeU8(223);
|
|
81539
|
+
this.writeU32(size);
|
|
81540
|
+
} else {
|
|
81541
|
+
throw new Error(`Too large map object: ${size}`);
|
|
81542
|
+
}
|
|
81543
|
+
for (const key of keys) {
|
|
81544
|
+
const value = object[key];
|
|
81545
|
+
if (!(this.ignoreUndefined && value === void 0)) {
|
|
81546
|
+
this.encodeString(key);
|
|
81547
|
+
this.doEncode(value, depth + 1);
|
|
81548
|
+
}
|
|
81549
|
+
}
|
|
81550
|
+
}
|
|
81551
|
+
encodeExtension(ext) {
|
|
81552
|
+
if (typeof ext.data === "function") {
|
|
81553
|
+
const data = ext.data(this.pos + 6);
|
|
81554
|
+
const size2 = data.length;
|
|
81555
|
+
if (size2 >= 4294967296) {
|
|
81556
|
+
throw new Error(`Too large extension object: ${size2}`);
|
|
81557
|
+
}
|
|
81558
|
+
this.writeU8(201);
|
|
81559
|
+
this.writeU32(size2);
|
|
81560
|
+
this.writeI8(ext.type);
|
|
81561
|
+
this.writeU8a(data);
|
|
81562
|
+
return;
|
|
81563
|
+
}
|
|
81564
|
+
const size = ext.data.length;
|
|
81565
|
+
if (size === 1) {
|
|
81566
|
+
this.writeU8(212);
|
|
81567
|
+
} else if (size === 2) {
|
|
81568
|
+
this.writeU8(213);
|
|
81569
|
+
} else if (size === 4) {
|
|
81570
|
+
this.writeU8(214);
|
|
81571
|
+
} else if (size === 8) {
|
|
81572
|
+
this.writeU8(215);
|
|
81573
|
+
} else if (size === 16) {
|
|
81574
|
+
this.writeU8(216);
|
|
81575
|
+
} else if (size < 256) {
|
|
81576
|
+
this.writeU8(199);
|
|
81577
|
+
this.writeU8(size);
|
|
81578
|
+
} else if (size < 65536) {
|
|
81579
|
+
this.writeU8(200);
|
|
81580
|
+
this.writeU16(size);
|
|
81581
|
+
} else if (size < 4294967296) {
|
|
81582
|
+
this.writeU8(201);
|
|
81583
|
+
this.writeU32(size);
|
|
81584
|
+
} else {
|
|
81585
|
+
throw new Error(`Too large extension object: ${size}`);
|
|
81586
|
+
}
|
|
81587
|
+
this.writeI8(ext.type);
|
|
81588
|
+
this.writeU8a(ext.data);
|
|
81589
|
+
}
|
|
81590
|
+
writeU8(value) {
|
|
81591
|
+
this.ensureBufferSizeToWrite(1);
|
|
81592
|
+
this.view.setUint8(this.pos, value);
|
|
81593
|
+
this.pos++;
|
|
81594
|
+
}
|
|
81595
|
+
writeU8a(values) {
|
|
81596
|
+
const size = values.length;
|
|
81597
|
+
this.ensureBufferSizeToWrite(size);
|
|
81598
|
+
this.bytes.set(values, this.pos);
|
|
81599
|
+
this.pos += size;
|
|
81600
|
+
}
|
|
81601
|
+
writeI8(value) {
|
|
81602
|
+
this.ensureBufferSizeToWrite(1);
|
|
81603
|
+
this.view.setInt8(this.pos, value);
|
|
81604
|
+
this.pos++;
|
|
81605
|
+
}
|
|
81606
|
+
writeU16(value) {
|
|
81607
|
+
this.ensureBufferSizeToWrite(2);
|
|
81608
|
+
this.view.setUint16(this.pos, value);
|
|
81609
|
+
this.pos += 2;
|
|
81610
|
+
}
|
|
81611
|
+
writeI16(value) {
|
|
81612
|
+
this.ensureBufferSizeToWrite(2);
|
|
81613
|
+
this.view.setInt16(this.pos, value);
|
|
81614
|
+
this.pos += 2;
|
|
81615
|
+
}
|
|
81616
|
+
writeU32(value) {
|
|
81617
|
+
this.ensureBufferSizeToWrite(4);
|
|
81618
|
+
this.view.setUint32(this.pos, value);
|
|
81619
|
+
this.pos += 4;
|
|
81620
|
+
}
|
|
81621
|
+
writeI32(value) {
|
|
81622
|
+
this.ensureBufferSizeToWrite(4);
|
|
81623
|
+
this.view.setInt32(this.pos, value);
|
|
81624
|
+
this.pos += 4;
|
|
81625
|
+
}
|
|
81626
|
+
writeF32(value) {
|
|
81627
|
+
this.ensureBufferSizeToWrite(4);
|
|
81628
|
+
this.view.setFloat32(this.pos, value);
|
|
81629
|
+
this.pos += 4;
|
|
81630
|
+
}
|
|
81631
|
+
writeF64(value) {
|
|
81632
|
+
this.ensureBufferSizeToWrite(8);
|
|
81633
|
+
this.view.setFloat64(this.pos, value);
|
|
81634
|
+
this.pos += 8;
|
|
81635
|
+
}
|
|
81636
|
+
writeU64(value) {
|
|
81637
|
+
this.ensureBufferSizeToWrite(8);
|
|
81638
|
+
(0, int_ts_1.setUint64)(this.view, this.pos, value);
|
|
81639
|
+
this.pos += 8;
|
|
81640
|
+
}
|
|
81641
|
+
writeI64(value) {
|
|
81642
|
+
this.ensureBufferSizeToWrite(8);
|
|
81643
|
+
(0, int_ts_1.setInt64)(this.view, this.pos, value);
|
|
81644
|
+
this.pos += 8;
|
|
81645
|
+
}
|
|
81646
|
+
writeBigUint64(value) {
|
|
81647
|
+
this.ensureBufferSizeToWrite(8);
|
|
81648
|
+
this.view.setBigUint64(this.pos, value);
|
|
81649
|
+
this.pos += 8;
|
|
81650
|
+
}
|
|
81651
|
+
writeBigInt64(value) {
|
|
81652
|
+
this.ensureBufferSizeToWrite(8);
|
|
81653
|
+
this.view.setBigInt64(this.pos, value);
|
|
81654
|
+
this.pos += 8;
|
|
81655
|
+
}
|
|
81656
|
+
};
|
|
81657
|
+
exports2.Encoder = Encoder;
|
|
81658
|
+
}
|
|
81659
|
+
});
|
|
81660
|
+
|
|
81661
|
+
// node_modules/@msgpack/msgpack/dist.cjs/encode.cjs
|
|
81662
|
+
var require_encode = __commonJS({
|
|
81663
|
+
"node_modules/@msgpack/msgpack/dist.cjs/encode.cjs"(exports2) {
|
|
81664
|
+
"use strict";
|
|
81665
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
81666
|
+
exports2.encode = encode;
|
|
81667
|
+
var Encoder_ts_1 = require_Encoder();
|
|
81668
|
+
function encode(value, options) {
|
|
81669
|
+
const encoder = new Encoder_ts_1.Encoder(options);
|
|
81670
|
+
return encoder.encodeSharedRef(value);
|
|
81671
|
+
}
|
|
81672
|
+
}
|
|
81673
|
+
});
|
|
81674
|
+
|
|
81675
|
+
// node_modules/@msgpack/msgpack/dist.cjs/utils/prettyByte.cjs
|
|
81676
|
+
var require_prettyByte = __commonJS({
|
|
81677
|
+
"node_modules/@msgpack/msgpack/dist.cjs/utils/prettyByte.cjs"(exports2) {
|
|
81678
|
+
"use strict";
|
|
81679
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
81680
|
+
exports2.prettyByte = prettyByte;
|
|
81681
|
+
function prettyByte(byte) {
|
|
81682
|
+
return `${byte < 0 ? "-" : ""}0x${Math.abs(byte).toString(16).padStart(2, "0")}`;
|
|
81683
|
+
}
|
|
81684
|
+
}
|
|
81685
|
+
});
|
|
81686
|
+
|
|
81687
|
+
// node_modules/@msgpack/msgpack/dist.cjs/CachedKeyDecoder.cjs
|
|
81688
|
+
var require_CachedKeyDecoder = __commonJS({
|
|
81689
|
+
"node_modules/@msgpack/msgpack/dist.cjs/CachedKeyDecoder.cjs"(exports2) {
|
|
81690
|
+
"use strict";
|
|
81691
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
81692
|
+
exports2.CachedKeyDecoder = void 0;
|
|
81693
|
+
var utf8_ts_1 = require_utf82();
|
|
81694
|
+
var DEFAULT_MAX_KEY_LENGTH = 16;
|
|
81695
|
+
var DEFAULT_MAX_LENGTH_PER_KEY = 16;
|
|
81696
|
+
var CachedKeyDecoder = class {
|
|
81697
|
+
hit = 0;
|
|
81698
|
+
miss = 0;
|
|
81699
|
+
caches;
|
|
81700
|
+
maxKeyLength;
|
|
81701
|
+
maxLengthPerKey;
|
|
81702
|
+
constructor(maxKeyLength = DEFAULT_MAX_KEY_LENGTH, maxLengthPerKey = DEFAULT_MAX_LENGTH_PER_KEY) {
|
|
81703
|
+
this.maxKeyLength = maxKeyLength;
|
|
81704
|
+
this.maxLengthPerKey = maxLengthPerKey;
|
|
81705
|
+
this.caches = [];
|
|
81706
|
+
for (let i = 0; i < this.maxKeyLength; i++) {
|
|
81707
|
+
this.caches.push([]);
|
|
81708
|
+
}
|
|
81709
|
+
}
|
|
81710
|
+
canBeCached(byteLength) {
|
|
81711
|
+
return byteLength > 0 && byteLength <= this.maxKeyLength;
|
|
81712
|
+
}
|
|
81713
|
+
find(bytes, inputOffset, byteLength) {
|
|
81714
|
+
const records = this.caches[byteLength - 1];
|
|
81715
|
+
FIND_CHUNK: for (const record of records) {
|
|
81716
|
+
const recordBytes = record.bytes;
|
|
81717
|
+
for (let j = 0; j < byteLength; j++) {
|
|
81718
|
+
if (recordBytes[j] !== bytes[inputOffset + j]) {
|
|
81719
|
+
continue FIND_CHUNK;
|
|
81720
|
+
}
|
|
81721
|
+
}
|
|
81722
|
+
return record.str;
|
|
81723
|
+
}
|
|
81724
|
+
return null;
|
|
81725
|
+
}
|
|
81726
|
+
store(bytes, value) {
|
|
81727
|
+
const records = this.caches[bytes.length - 1];
|
|
81728
|
+
const record = { bytes, str: value };
|
|
81729
|
+
if (records.length >= this.maxLengthPerKey) {
|
|
81730
|
+
records[Math.random() * records.length | 0] = record;
|
|
81731
|
+
} else {
|
|
81732
|
+
records.push(record);
|
|
81733
|
+
}
|
|
81734
|
+
}
|
|
81735
|
+
decode(bytes, inputOffset, byteLength) {
|
|
81736
|
+
const cachedValue = this.find(bytes, inputOffset, byteLength);
|
|
81737
|
+
if (cachedValue != null) {
|
|
81738
|
+
this.hit++;
|
|
81739
|
+
return cachedValue;
|
|
81740
|
+
}
|
|
81741
|
+
this.miss++;
|
|
81742
|
+
const str = (0, utf8_ts_1.utf8DecodeJs)(bytes, inputOffset, byteLength);
|
|
81743
|
+
const slicedCopyOfBytes = Uint8Array.prototype.slice.call(bytes, inputOffset, inputOffset + byteLength);
|
|
81744
|
+
this.store(slicedCopyOfBytes, str);
|
|
81745
|
+
return str;
|
|
81746
|
+
}
|
|
81747
|
+
};
|
|
81748
|
+
exports2.CachedKeyDecoder = CachedKeyDecoder;
|
|
81749
|
+
}
|
|
81750
|
+
});
|
|
81751
|
+
|
|
81752
|
+
// node_modules/@msgpack/msgpack/dist.cjs/Decoder.cjs
|
|
81753
|
+
var require_Decoder = __commonJS({
|
|
81754
|
+
"node_modules/@msgpack/msgpack/dist.cjs/Decoder.cjs"(exports2) {
|
|
81755
|
+
"use strict";
|
|
81756
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
81757
|
+
exports2.Decoder = void 0;
|
|
81758
|
+
var prettyByte_ts_1 = require_prettyByte();
|
|
81759
|
+
var ExtensionCodec_ts_1 = require_ExtensionCodec();
|
|
81760
|
+
var int_ts_1 = require_int();
|
|
81761
|
+
var utf8_ts_1 = require_utf82();
|
|
81762
|
+
var typedArrays_ts_1 = require_typedArrays();
|
|
81763
|
+
var CachedKeyDecoder_ts_1 = require_CachedKeyDecoder();
|
|
81764
|
+
var DecodeError_ts_1 = require_DecodeError();
|
|
81765
|
+
var STATE_ARRAY = "array";
|
|
81766
|
+
var STATE_MAP_KEY = "map_key";
|
|
81767
|
+
var STATE_MAP_VALUE = "map_value";
|
|
81768
|
+
var mapKeyConverter = (key) => {
|
|
81769
|
+
if (typeof key === "string" || typeof key === "number") {
|
|
81770
|
+
return key;
|
|
81771
|
+
}
|
|
81772
|
+
throw new DecodeError_ts_1.DecodeError("The type of key must be string or number but " + typeof key);
|
|
81773
|
+
};
|
|
81774
|
+
var StackPool = class {
|
|
81775
|
+
stack = [];
|
|
81776
|
+
stackHeadPosition = -1;
|
|
81777
|
+
get length() {
|
|
81778
|
+
return this.stackHeadPosition + 1;
|
|
81779
|
+
}
|
|
81780
|
+
top() {
|
|
81781
|
+
return this.stack[this.stackHeadPosition];
|
|
81782
|
+
}
|
|
81783
|
+
pushArrayState(size) {
|
|
81784
|
+
const state = this.getUninitializedStateFromPool();
|
|
81785
|
+
state.type = STATE_ARRAY;
|
|
81786
|
+
state.position = 0;
|
|
81787
|
+
state.size = size;
|
|
81788
|
+
state.array = new Array(size);
|
|
81789
|
+
}
|
|
81790
|
+
pushMapState(size) {
|
|
81791
|
+
const state = this.getUninitializedStateFromPool();
|
|
81792
|
+
state.type = STATE_MAP_KEY;
|
|
81793
|
+
state.readCount = 0;
|
|
81794
|
+
state.size = size;
|
|
81795
|
+
state.map = {};
|
|
81796
|
+
}
|
|
81797
|
+
getUninitializedStateFromPool() {
|
|
81798
|
+
this.stackHeadPosition++;
|
|
81799
|
+
if (this.stackHeadPosition === this.stack.length) {
|
|
81800
|
+
const partialState = {
|
|
81801
|
+
type: void 0,
|
|
81802
|
+
size: 0,
|
|
81803
|
+
array: void 0,
|
|
81804
|
+
position: 0,
|
|
81805
|
+
readCount: 0,
|
|
81806
|
+
map: void 0,
|
|
81807
|
+
key: null
|
|
81808
|
+
};
|
|
81809
|
+
this.stack.push(partialState);
|
|
81810
|
+
}
|
|
81811
|
+
return this.stack[this.stackHeadPosition];
|
|
81812
|
+
}
|
|
81813
|
+
release(state) {
|
|
81814
|
+
const topStackState = this.stack[this.stackHeadPosition];
|
|
81815
|
+
if (topStackState !== state) {
|
|
81816
|
+
throw new Error("Invalid stack state. Released state is not on top of the stack.");
|
|
81817
|
+
}
|
|
81818
|
+
if (state.type === STATE_ARRAY) {
|
|
81819
|
+
const partialState = state;
|
|
81820
|
+
partialState.size = 0;
|
|
81821
|
+
partialState.array = void 0;
|
|
81822
|
+
partialState.position = 0;
|
|
81823
|
+
partialState.type = void 0;
|
|
81824
|
+
}
|
|
81825
|
+
if (state.type === STATE_MAP_KEY || state.type === STATE_MAP_VALUE) {
|
|
81826
|
+
const partialState = state;
|
|
81827
|
+
partialState.size = 0;
|
|
81828
|
+
partialState.map = void 0;
|
|
81829
|
+
partialState.readCount = 0;
|
|
81830
|
+
partialState.type = void 0;
|
|
81831
|
+
}
|
|
81832
|
+
this.stackHeadPosition--;
|
|
81833
|
+
}
|
|
81834
|
+
reset() {
|
|
81835
|
+
this.stack.length = 0;
|
|
81836
|
+
this.stackHeadPosition = -1;
|
|
81837
|
+
}
|
|
81838
|
+
};
|
|
81839
|
+
var HEAD_BYTE_REQUIRED = -1;
|
|
81840
|
+
var EMPTY_VIEW = new DataView(new ArrayBuffer(0));
|
|
81841
|
+
var EMPTY_BYTES = new Uint8Array(EMPTY_VIEW.buffer);
|
|
81842
|
+
try {
|
|
81843
|
+
EMPTY_VIEW.getInt8(0);
|
|
81844
|
+
} catch (e) {
|
|
81845
|
+
if (!(e instanceof RangeError)) {
|
|
81846
|
+
throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access");
|
|
81847
|
+
}
|
|
81848
|
+
}
|
|
81849
|
+
var MORE_DATA = new RangeError("Insufficient data");
|
|
81850
|
+
var sharedCachedKeyDecoder = new CachedKeyDecoder_ts_1.CachedKeyDecoder();
|
|
81851
|
+
var Decoder = class _Decoder {
|
|
81852
|
+
extensionCodec;
|
|
81853
|
+
context;
|
|
81854
|
+
useBigInt64;
|
|
81855
|
+
rawStrings;
|
|
81856
|
+
maxStrLength;
|
|
81857
|
+
maxBinLength;
|
|
81858
|
+
maxArrayLength;
|
|
81859
|
+
maxMapLength;
|
|
81860
|
+
maxExtLength;
|
|
81861
|
+
keyDecoder;
|
|
81862
|
+
mapKeyConverter;
|
|
81863
|
+
totalPos = 0;
|
|
81864
|
+
pos = 0;
|
|
81865
|
+
view = EMPTY_VIEW;
|
|
81866
|
+
bytes = EMPTY_BYTES;
|
|
81867
|
+
headByte = HEAD_BYTE_REQUIRED;
|
|
81868
|
+
stack = new StackPool();
|
|
81869
|
+
entered = false;
|
|
81870
|
+
constructor(options) {
|
|
81871
|
+
this.extensionCodec = options?.extensionCodec ?? ExtensionCodec_ts_1.ExtensionCodec.defaultCodec;
|
|
81872
|
+
this.context = options?.context;
|
|
81873
|
+
this.useBigInt64 = options?.useBigInt64 ?? false;
|
|
81874
|
+
this.rawStrings = options?.rawStrings ?? false;
|
|
81875
|
+
this.maxStrLength = options?.maxStrLength ?? int_ts_1.UINT32_MAX;
|
|
81876
|
+
this.maxBinLength = options?.maxBinLength ?? int_ts_1.UINT32_MAX;
|
|
81877
|
+
this.maxArrayLength = options?.maxArrayLength ?? int_ts_1.UINT32_MAX;
|
|
81878
|
+
this.maxMapLength = options?.maxMapLength ?? int_ts_1.UINT32_MAX;
|
|
81879
|
+
this.maxExtLength = options?.maxExtLength ?? int_ts_1.UINT32_MAX;
|
|
81880
|
+
this.keyDecoder = options?.keyDecoder !== void 0 ? options.keyDecoder : sharedCachedKeyDecoder;
|
|
81881
|
+
this.mapKeyConverter = options?.mapKeyConverter ?? mapKeyConverter;
|
|
81882
|
+
}
|
|
81883
|
+
clone() {
|
|
81884
|
+
return new _Decoder({
|
|
81885
|
+
extensionCodec: this.extensionCodec,
|
|
81886
|
+
context: this.context,
|
|
81887
|
+
useBigInt64: this.useBigInt64,
|
|
81888
|
+
rawStrings: this.rawStrings,
|
|
81889
|
+
maxStrLength: this.maxStrLength,
|
|
81890
|
+
maxBinLength: this.maxBinLength,
|
|
81891
|
+
maxArrayLength: this.maxArrayLength,
|
|
81892
|
+
maxMapLength: this.maxMapLength,
|
|
81893
|
+
maxExtLength: this.maxExtLength,
|
|
81894
|
+
keyDecoder: this.keyDecoder
|
|
81895
|
+
});
|
|
81896
|
+
}
|
|
81897
|
+
reinitializeState() {
|
|
81898
|
+
this.totalPos = 0;
|
|
81899
|
+
this.headByte = HEAD_BYTE_REQUIRED;
|
|
81900
|
+
this.stack.reset();
|
|
81901
|
+
}
|
|
81902
|
+
setBuffer(buffer) {
|
|
81903
|
+
const bytes = (0, typedArrays_ts_1.ensureUint8Array)(buffer);
|
|
81904
|
+
this.bytes = bytes;
|
|
81905
|
+
this.view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
81906
|
+
this.pos = 0;
|
|
81907
|
+
}
|
|
81908
|
+
appendBuffer(buffer) {
|
|
81909
|
+
if (this.headByte === HEAD_BYTE_REQUIRED && !this.hasRemaining(1)) {
|
|
81910
|
+
this.setBuffer(buffer);
|
|
81911
|
+
} else {
|
|
81912
|
+
const remainingData = this.bytes.subarray(this.pos);
|
|
81913
|
+
const newData = (0, typedArrays_ts_1.ensureUint8Array)(buffer);
|
|
81914
|
+
const newBuffer = new Uint8Array(remainingData.length + newData.length);
|
|
81915
|
+
newBuffer.set(remainingData);
|
|
81916
|
+
newBuffer.set(newData, remainingData.length);
|
|
81917
|
+
this.setBuffer(newBuffer);
|
|
81918
|
+
}
|
|
81919
|
+
}
|
|
81920
|
+
hasRemaining(size) {
|
|
81921
|
+
return this.view.byteLength - this.pos >= size;
|
|
81922
|
+
}
|
|
81923
|
+
createExtraByteError(posToShow) {
|
|
81924
|
+
const { view, pos } = this;
|
|
81925
|
+
return new RangeError(`Extra ${view.byteLength - pos} of ${view.byteLength} byte(s) found at buffer[${posToShow}]`);
|
|
81926
|
+
}
|
|
81927
|
+
/**
|
|
81928
|
+
* @throws {@link DecodeError}
|
|
81929
|
+
* @throws {@link RangeError}
|
|
81930
|
+
*/
|
|
81931
|
+
decode(buffer) {
|
|
81932
|
+
if (this.entered) {
|
|
81933
|
+
const instance = this.clone();
|
|
81934
|
+
return instance.decode(buffer);
|
|
81935
|
+
}
|
|
81936
|
+
try {
|
|
81937
|
+
this.entered = true;
|
|
81938
|
+
this.reinitializeState();
|
|
81939
|
+
this.setBuffer(buffer);
|
|
81940
|
+
const object = this.doDecodeSync();
|
|
81941
|
+
if (this.hasRemaining(1)) {
|
|
81942
|
+
throw this.createExtraByteError(this.pos);
|
|
81943
|
+
}
|
|
81944
|
+
return object;
|
|
81945
|
+
} finally {
|
|
81946
|
+
this.entered = false;
|
|
81947
|
+
}
|
|
81948
|
+
}
|
|
81949
|
+
*decodeMulti(buffer) {
|
|
81950
|
+
if (this.entered) {
|
|
81951
|
+
const instance = this.clone();
|
|
81952
|
+
yield* instance.decodeMulti(buffer);
|
|
81953
|
+
return;
|
|
81954
|
+
}
|
|
81955
|
+
try {
|
|
81956
|
+
this.entered = true;
|
|
81957
|
+
this.reinitializeState();
|
|
81958
|
+
this.setBuffer(buffer);
|
|
81959
|
+
while (this.hasRemaining(1)) {
|
|
81960
|
+
yield this.doDecodeSync();
|
|
81961
|
+
}
|
|
81962
|
+
} finally {
|
|
81963
|
+
this.entered = false;
|
|
81964
|
+
}
|
|
81965
|
+
}
|
|
81966
|
+
async decodeAsync(stream) {
|
|
81967
|
+
if (this.entered) {
|
|
81968
|
+
const instance = this.clone();
|
|
81969
|
+
return instance.decodeAsync(stream);
|
|
81970
|
+
}
|
|
81971
|
+
try {
|
|
81972
|
+
this.entered = true;
|
|
81973
|
+
let decoded = false;
|
|
81974
|
+
let object;
|
|
81975
|
+
for await (const buffer of stream) {
|
|
81976
|
+
if (decoded) {
|
|
81977
|
+
this.entered = false;
|
|
81978
|
+
throw this.createExtraByteError(this.totalPos);
|
|
81979
|
+
}
|
|
81980
|
+
this.appendBuffer(buffer);
|
|
81981
|
+
try {
|
|
81982
|
+
object = this.doDecodeSync();
|
|
81983
|
+
decoded = true;
|
|
81984
|
+
} catch (e) {
|
|
81985
|
+
if (!(e instanceof RangeError)) {
|
|
81986
|
+
throw e;
|
|
81987
|
+
}
|
|
81988
|
+
}
|
|
81989
|
+
this.totalPos += this.pos;
|
|
81990
|
+
}
|
|
81991
|
+
if (decoded) {
|
|
81992
|
+
if (this.hasRemaining(1)) {
|
|
81993
|
+
throw this.createExtraByteError(this.totalPos);
|
|
81994
|
+
}
|
|
81995
|
+
return object;
|
|
81996
|
+
}
|
|
81997
|
+
const { headByte, pos, totalPos } = this;
|
|
81998
|
+
throw new RangeError(`Insufficient data in parsing ${(0, prettyByte_ts_1.prettyByte)(headByte)} at ${totalPos} (${pos} in the current buffer)`);
|
|
81999
|
+
} finally {
|
|
82000
|
+
this.entered = false;
|
|
82001
|
+
}
|
|
82002
|
+
}
|
|
82003
|
+
decodeArrayStream(stream) {
|
|
82004
|
+
return this.decodeMultiAsync(stream, true);
|
|
82005
|
+
}
|
|
82006
|
+
decodeStream(stream) {
|
|
82007
|
+
return this.decodeMultiAsync(stream, false);
|
|
82008
|
+
}
|
|
82009
|
+
async *decodeMultiAsync(stream, isArray) {
|
|
82010
|
+
if (this.entered) {
|
|
82011
|
+
const instance = this.clone();
|
|
82012
|
+
yield* instance.decodeMultiAsync(stream, isArray);
|
|
82013
|
+
return;
|
|
82014
|
+
}
|
|
82015
|
+
try {
|
|
82016
|
+
this.entered = true;
|
|
82017
|
+
let isArrayHeaderRequired = isArray;
|
|
82018
|
+
let arrayItemsLeft = -1;
|
|
82019
|
+
for await (const buffer of stream) {
|
|
82020
|
+
if (isArray && arrayItemsLeft === 0) {
|
|
82021
|
+
throw this.createExtraByteError(this.totalPos);
|
|
82022
|
+
}
|
|
82023
|
+
this.appendBuffer(buffer);
|
|
82024
|
+
if (isArrayHeaderRequired) {
|
|
82025
|
+
arrayItemsLeft = this.readArraySize();
|
|
82026
|
+
isArrayHeaderRequired = false;
|
|
82027
|
+
this.complete();
|
|
82028
|
+
}
|
|
82029
|
+
try {
|
|
82030
|
+
while (true) {
|
|
82031
|
+
yield this.doDecodeSync();
|
|
82032
|
+
if (--arrayItemsLeft === 0) {
|
|
82033
|
+
break;
|
|
82034
|
+
}
|
|
82035
|
+
}
|
|
82036
|
+
} catch (e) {
|
|
82037
|
+
if (!(e instanceof RangeError)) {
|
|
82038
|
+
throw e;
|
|
82039
|
+
}
|
|
82040
|
+
}
|
|
82041
|
+
this.totalPos += this.pos;
|
|
82042
|
+
}
|
|
82043
|
+
} finally {
|
|
82044
|
+
this.entered = false;
|
|
82045
|
+
}
|
|
82046
|
+
}
|
|
82047
|
+
doDecodeSync() {
|
|
82048
|
+
DECODE: while (true) {
|
|
82049
|
+
const headByte = this.readHeadByte();
|
|
82050
|
+
let object;
|
|
82051
|
+
if (headByte >= 224) {
|
|
82052
|
+
object = headByte - 256;
|
|
82053
|
+
} else if (headByte < 192) {
|
|
82054
|
+
if (headByte < 128) {
|
|
82055
|
+
object = headByte;
|
|
82056
|
+
} else if (headByte < 144) {
|
|
82057
|
+
const size = headByte - 128;
|
|
82058
|
+
if (size !== 0) {
|
|
82059
|
+
this.pushMapState(size);
|
|
82060
|
+
this.complete();
|
|
82061
|
+
continue DECODE;
|
|
82062
|
+
} else {
|
|
82063
|
+
object = {};
|
|
82064
|
+
}
|
|
82065
|
+
} else if (headByte < 160) {
|
|
82066
|
+
const size = headByte - 144;
|
|
82067
|
+
if (size !== 0) {
|
|
82068
|
+
this.pushArrayState(size);
|
|
82069
|
+
this.complete();
|
|
82070
|
+
continue DECODE;
|
|
82071
|
+
} else {
|
|
82072
|
+
object = [];
|
|
82073
|
+
}
|
|
82074
|
+
} else {
|
|
82075
|
+
const byteLength = headByte - 160;
|
|
82076
|
+
object = this.decodeString(byteLength, 0);
|
|
82077
|
+
}
|
|
82078
|
+
} else if (headByte === 192) {
|
|
82079
|
+
object = null;
|
|
82080
|
+
} else if (headByte === 194) {
|
|
82081
|
+
object = false;
|
|
82082
|
+
} else if (headByte === 195) {
|
|
82083
|
+
object = true;
|
|
82084
|
+
} else if (headByte === 202) {
|
|
82085
|
+
object = this.readF32();
|
|
82086
|
+
} else if (headByte === 203) {
|
|
82087
|
+
object = this.readF64();
|
|
82088
|
+
} else if (headByte === 204) {
|
|
82089
|
+
object = this.readU8();
|
|
82090
|
+
} else if (headByte === 205) {
|
|
82091
|
+
object = this.readU16();
|
|
82092
|
+
} else if (headByte === 206) {
|
|
82093
|
+
object = this.readU32();
|
|
82094
|
+
} else if (headByte === 207) {
|
|
82095
|
+
if (this.useBigInt64) {
|
|
82096
|
+
object = this.readU64AsBigInt();
|
|
82097
|
+
} else {
|
|
82098
|
+
object = this.readU64();
|
|
82099
|
+
}
|
|
82100
|
+
} else if (headByte === 208) {
|
|
82101
|
+
object = this.readI8();
|
|
82102
|
+
} else if (headByte === 209) {
|
|
82103
|
+
object = this.readI16();
|
|
82104
|
+
} else if (headByte === 210) {
|
|
82105
|
+
object = this.readI32();
|
|
82106
|
+
} else if (headByte === 211) {
|
|
82107
|
+
if (this.useBigInt64) {
|
|
82108
|
+
object = this.readI64AsBigInt();
|
|
82109
|
+
} else {
|
|
82110
|
+
object = this.readI64();
|
|
82111
|
+
}
|
|
82112
|
+
} else if (headByte === 217) {
|
|
82113
|
+
const byteLength = this.lookU8();
|
|
82114
|
+
object = this.decodeString(byteLength, 1);
|
|
82115
|
+
} else if (headByte === 218) {
|
|
82116
|
+
const byteLength = this.lookU16();
|
|
82117
|
+
object = this.decodeString(byteLength, 2);
|
|
82118
|
+
} else if (headByte === 219) {
|
|
82119
|
+
const byteLength = this.lookU32();
|
|
82120
|
+
object = this.decodeString(byteLength, 4);
|
|
82121
|
+
} else if (headByte === 220) {
|
|
82122
|
+
const size = this.readU16();
|
|
82123
|
+
if (size !== 0) {
|
|
82124
|
+
this.pushArrayState(size);
|
|
82125
|
+
this.complete();
|
|
82126
|
+
continue DECODE;
|
|
82127
|
+
} else {
|
|
82128
|
+
object = [];
|
|
82129
|
+
}
|
|
82130
|
+
} else if (headByte === 221) {
|
|
82131
|
+
const size = this.readU32();
|
|
82132
|
+
if (size !== 0) {
|
|
82133
|
+
this.pushArrayState(size);
|
|
82134
|
+
this.complete();
|
|
82135
|
+
continue DECODE;
|
|
82136
|
+
} else {
|
|
82137
|
+
object = [];
|
|
82138
|
+
}
|
|
82139
|
+
} else if (headByte === 222) {
|
|
82140
|
+
const size = this.readU16();
|
|
82141
|
+
if (size !== 0) {
|
|
82142
|
+
this.pushMapState(size);
|
|
82143
|
+
this.complete();
|
|
82144
|
+
continue DECODE;
|
|
82145
|
+
} else {
|
|
82146
|
+
object = {};
|
|
82147
|
+
}
|
|
82148
|
+
} else if (headByte === 223) {
|
|
82149
|
+
const size = this.readU32();
|
|
82150
|
+
if (size !== 0) {
|
|
82151
|
+
this.pushMapState(size);
|
|
82152
|
+
this.complete();
|
|
82153
|
+
continue DECODE;
|
|
82154
|
+
} else {
|
|
82155
|
+
object = {};
|
|
82156
|
+
}
|
|
82157
|
+
} else if (headByte === 196) {
|
|
82158
|
+
const size = this.lookU8();
|
|
82159
|
+
object = this.decodeBinary(size, 1);
|
|
82160
|
+
} else if (headByte === 197) {
|
|
82161
|
+
const size = this.lookU16();
|
|
82162
|
+
object = this.decodeBinary(size, 2);
|
|
82163
|
+
} else if (headByte === 198) {
|
|
82164
|
+
const size = this.lookU32();
|
|
82165
|
+
object = this.decodeBinary(size, 4);
|
|
82166
|
+
} else if (headByte === 212) {
|
|
82167
|
+
object = this.decodeExtension(1, 0);
|
|
82168
|
+
} else if (headByte === 213) {
|
|
82169
|
+
object = this.decodeExtension(2, 0);
|
|
82170
|
+
} else if (headByte === 214) {
|
|
82171
|
+
object = this.decodeExtension(4, 0);
|
|
82172
|
+
} else if (headByte === 215) {
|
|
82173
|
+
object = this.decodeExtension(8, 0);
|
|
82174
|
+
} else if (headByte === 216) {
|
|
82175
|
+
object = this.decodeExtension(16, 0);
|
|
82176
|
+
} else if (headByte === 199) {
|
|
82177
|
+
const size = this.lookU8();
|
|
82178
|
+
object = this.decodeExtension(size, 1);
|
|
82179
|
+
} else if (headByte === 200) {
|
|
82180
|
+
const size = this.lookU16();
|
|
82181
|
+
object = this.decodeExtension(size, 2);
|
|
82182
|
+
} else if (headByte === 201) {
|
|
82183
|
+
const size = this.lookU32();
|
|
82184
|
+
object = this.decodeExtension(size, 4);
|
|
82185
|
+
} else {
|
|
82186
|
+
throw new DecodeError_ts_1.DecodeError(`Unrecognized type byte: ${(0, prettyByte_ts_1.prettyByte)(headByte)}`);
|
|
82187
|
+
}
|
|
82188
|
+
this.complete();
|
|
82189
|
+
const stack = this.stack;
|
|
82190
|
+
while (stack.length > 0) {
|
|
82191
|
+
const state = stack.top();
|
|
82192
|
+
if (state.type === STATE_ARRAY) {
|
|
82193
|
+
state.array[state.position] = object;
|
|
82194
|
+
state.position++;
|
|
82195
|
+
if (state.position === state.size) {
|
|
82196
|
+
object = state.array;
|
|
82197
|
+
stack.release(state);
|
|
82198
|
+
} else {
|
|
82199
|
+
continue DECODE;
|
|
82200
|
+
}
|
|
82201
|
+
} else if (state.type === STATE_MAP_KEY) {
|
|
82202
|
+
if (object === "__proto__") {
|
|
82203
|
+
throw new DecodeError_ts_1.DecodeError("The key __proto__ is not allowed");
|
|
82204
|
+
}
|
|
82205
|
+
state.key = this.mapKeyConverter(object);
|
|
82206
|
+
state.type = STATE_MAP_VALUE;
|
|
82207
|
+
continue DECODE;
|
|
82208
|
+
} else {
|
|
82209
|
+
state.map[state.key] = object;
|
|
82210
|
+
state.readCount++;
|
|
82211
|
+
if (state.readCount === state.size) {
|
|
82212
|
+
object = state.map;
|
|
82213
|
+
stack.release(state);
|
|
82214
|
+
} else {
|
|
82215
|
+
state.key = null;
|
|
82216
|
+
state.type = STATE_MAP_KEY;
|
|
82217
|
+
continue DECODE;
|
|
82218
|
+
}
|
|
82219
|
+
}
|
|
82220
|
+
}
|
|
82221
|
+
return object;
|
|
82222
|
+
}
|
|
82223
|
+
}
|
|
82224
|
+
readHeadByte() {
|
|
82225
|
+
if (this.headByte === HEAD_BYTE_REQUIRED) {
|
|
82226
|
+
this.headByte = this.readU8();
|
|
82227
|
+
}
|
|
82228
|
+
return this.headByte;
|
|
82229
|
+
}
|
|
82230
|
+
complete() {
|
|
82231
|
+
this.headByte = HEAD_BYTE_REQUIRED;
|
|
82232
|
+
}
|
|
82233
|
+
readArraySize() {
|
|
82234
|
+
const headByte = this.readHeadByte();
|
|
82235
|
+
switch (headByte) {
|
|
82236
|
+
case 220:
|
|
82237
|
+
return this.readU16();
|
|
82238
|
+
case 221:
|
|
82239
|
+
return this.readU32();
|
|
82240
|
+
default: {
|
|
82241
|
+
if (headByte < 160) {
|
|
82242
|
+
return headByte - 144;
|
|
82243
|
+
} else {
|
|
82244
|
+
throw new DecodeError_ts_1.DecodeError(`Unrecognized array type byte: ${(0, prettyByte_ts_1.prettyByte)(headByte)}`);
|
|
82245
|
+
}
|
|
82246
|
+
}
|
|
82247
|
+
}
|
|
82248
|
+
}
|
|
82249
|
+
pushMapState(size) {
|
|
82250
|
+
if (size > this.maxMapLength) {
|
|
82251
|
+
throw new DecodeError_ts_1.DecodeError(`Max length exceeded: map length (${size}) > maxMapLengthLength (${this.maxMapLength})`);
|
|
82252
|
+
}
|
|
82253
|
+
this.stack.pushMapState(size);
|
|
82254
|
+
}
|
|
82255
|
+
pushArrayState(size) {
|
|
82256
|
+
if (size > this.maxArrayLength) {
|
|
82257
|
+
throw new DecodeError_ts_1.DecodeError(`Max length exceeded: array length (${size}) > maxArrayLength (${this.maxArrayLength})`);
|
|
82258
|
+
}
|
|
82259
|
+
this.stack.pushArrayState(size);
|
|
82260
|
+
}
|
|
82261
|
+
decodeString(byteLength, headerOffset) {
|
|
82262
|
+
if (!this.rawStrings || this.stateIsMapKey()) {
|
|
82263
|
+
return this.decodeUtf8String(byteLength, headerOffset);
|
|
82264
|
+
}
|
|
82265
|
+
return this.decodeBinary(byteLength, headerOffset);
|
|
82266
|
+
}
|
|
82267
|
+
/**
|
|
82268
|
+
* @throws {@link RangeError}
|
|
82269
|
+
*/
|
|
82270
|
+
decodeUtf8String(byteLength, headerOffset) {
|
|
82271
|
+
if (byteLength > this.maxStrLength) {
|
|
82272
|
+
throw new DecodeError_ts_1.DecodeError(`Max length exceeded: UTF-8 byte length (${byteLength}) > maxStrLength (${this.maxStrLength})`);
|
|
82273
|
+
}
|
|
82274
|
+
if (this.bytes.byteLength < this.pos + headerOffset + byteLength) {
|
|
82275
|
+
throw MORE_DATA;
|
|
82276
|
+
}
|
|
82277
|
+
const offset2 = this.pos + headerOffset;
|
|
82278
|
+
let object;
|
|
82279
|
+
if (this.stateIsMapKey() && this.keyDecoder?.canBeCached(byteLength)) {
|
|
82280
|
+
object = this.keyDecoder.decode(this.bytes, offset2, byteLength);
|
|
82281
|
+
} else {
|
|
82282
|
+
object = (0, utf8_ts_1.utf8Decode)(this.bytes, offset2, byteLength);
|
|
82283
|
+
}
|
|
82284
|
+
this.pos += headerOffset + byteLength;
|
|
82285
|
+
return object;
|
|
82286
|
+
}
|
|
82287
|
+
stateIsMapKey() {
|
|
82288
|
+
if (this.stack.length > 0) {
|
|
82289
|
+
const state = this.stack.top();
|
|
82290
|
+
return state.type === STATE_MAP_KEY;
|
|
82291
|
+
}
|
|
82292
|
+
return false;
|
|
82293
|
+
}
|
|
82294
|
+
/**
|
|
82295
|
+
* @throws {@link RangeError}
|
|
82296
|
+
*/
|
|
82297
|
+
decodeBinary(byteLength, headOffset) {
|
|
82298
|
+
if (byteLength > this.maxBinLength) {
|
|
82299
|
+
throw new DecodeError_ts_1.DecodeError(`Max length exceeded: bin length (${byteLength}) > maxBinLength (${this.maxBinLength})`);
|
|
82300
|
+
}
|
|
82301
|
+
if (!this.hasRemaining(byteLength + headOffset)) {
|
|
82302
|
+
throw MORE_DATA;
|
|
82303
|
+
}
|
|
82304
|
+
const offset2 = this.pos + headOffset;
|
|
82305
|
+
const object = this.bytes.subarray(offset2, offset2 + byteLength);
|
|
82306
|
+
this.pos += headOffset + byteLength;
|
|
82307
|
+
return object;
|
|
82308
|
+
}
|
|
82309
|
+
decodeExtension(size, headOffset) {
|
|
82310
|
+
if (size > this.maxExtLength) {
|
|
82311
|
+
throw new DecodeError_ts_1.DecodeError(`Max length exceeded: ext length (${size}) > maxExtLength (${this.maxExtLength})`);
|
|
82312
|
+
}
|
|
82313
|
+
const extType = this.view.getInt8(this.pos + headOffset);
|
|
82314
|
+
const data = this.decodeBinary(
|
|
82315
|
+
size,
|
|
82316
|
+
headOffset + 1
|
|
82317
|
+
/* extType */
|
|
82318
|
+
);
|
|
82319
|
+
return this.extensionCodec.decode(data, extType, this.context);
|
|
82320
|
+
}
|
|
82321
|
+
lookU8() {
|
|
82322
|
+
return this.view.getUint8(this.pos);
|
|
82323
|
+
}
|
|
82324
|
+
lookU16() {
|
|
82325
|
+
return this.view.getUint16(this.pos);
|
|
82326
|
+
}
|
|
82327
|
+
lookU32() {
|
|
82328
|
+
return this.view.getUint32(this.pos);
|
|
82329
|
+
}
|
|
82330
|
+
readU8() {
|
|
82331
|
+
const value = this.view.getUint8(this.pos);
|
|
82332
|
+
this.pos++;
|
|
82333
|
+
return value;
|
|
82334
|
+
}
|
|
82335
|
+
readI8() {
|
|
82336
|
+
const value = this.view.getInt8(this.pos);
|
|
82337
|
+
this.pos++;
|
|
82338
|
+
return value;
|
|
82339
|
+
}
|
|
82340
|
+
readU16() {
|
|
82341
|
+
const value = this.view.getUint16(this.pos);
|
|
82342
|
+
this.pos += 2;
|
|
82343
|
+
return value;
|
|
82344
|
+
}
|
|
82345
|
+
readI16() {
|
|
82346
|
+
const value = this.view.getInt16(this.pos);
|
|
82347
|
+
this.pos += 2;
|
|
82348
|
+
return value;
|
|
82349
|
+
}
|
|
82350
|
+
readU32() {
|
|
82351
|
+
const value = this.view.getUint32(this.pos);
|
|
82352
|
+
this.pos += 4;
|
|
82353
|
+
return value;
|
|
82354
|
+
}
|
|
82355
|
+
readI32() {
|
|
82356
|
+
const value = this.view.getInt32(this.pos);
|
|
82357
|
+
this.pos += 4;
|
|
82358
|
+
return value;
|
|
82359
|
+
}
|
|
82360
|
+
readU64() {
|
|
82361
|
+
const value = (0, int_ts_1.getUint64)(this.view, this.pos);
|
|
82362
|
+
this.pos += 8;
|
|
82363
|
+
return value;
|
|
82364
|
+
}
|
|
82365
|
+
readI64() {
|
|
82366
|
+
const value = (0, int_ts_1.getInt64)(this.view, this.pos);
|
|
82367
|
+
this.pos += 8;
|
|
82368
|
+
return value;
|
|
82369
|
+
}
|
|
82370
|
+
readU64AsBigInt() {
|
|
82371
|
+
const value = this.view.getBigUint64(this.pos);
|
|
82372
|
+
this.pos += 8;
|
|
82373
|
+
return value;
|
|
82374
|
+
}
|
|
82375
|
+
readI64AsBigInt() {
|
|
82376
|
+
const value = this.view.getBigInt64(this.pos);
|
|
82377
|
+
this.pos += 8;
|
|
82378
|
+
return value;
|
|
82379
|
+
}
|
|
82380
|
+
readF32() {
|
|
82381
|
+
const value = this.view.getFloat32(this.pos);
|
|
82382
|
+
this.pos += 4;
|
|
82383
|
+
return value;
|
|
82384
|
+
}
|
|
82385
|
+
readF64() {
|
|
82386
|
+
const value = this.view.getFloat64(this.pos);
|
|
82387
|
+
this.pos += 8;
|
|
82388
|
+
return value;
|
|
82389
|
+
}
|
|
82390
|
+
};
|
|
82391
|
+
exports2.Decoder = Decoder;
|
|
82392
|
+
}
|
|
82393
|
+
});
|
|
82394
|
+
|
|
82395
|
+
// node_modules/@msgpack/msgpack/dist.cjs/decode.cjs
|
|
82396
|
+
var require_decode = __commonJS({
|
|
82397
|
+
"node_modules/@msgpack/msgpack/dist.cjs/decode.cjs"(exports2) {
|
|
82398
|
+
"use strict";
|
|
82399
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
82400
|
+
exports2.decode = decode;
|
|
82401
|
+
exports2.decodeMulti = decodeMulti;
|
|
82402
|
+
var Decoder_ts_1 = require_Decoder();
|
|
82403
|
+
function decode(buffer, options) {
|
|
82404
|
+
const decoder = new Decoder_ts_1.Decoder(options);
|
|
82405
|
+
return decoder.decode(buffer);
|
|
82406
|
+
}
|
|
82407
|
+
function decodeMulti(buffer, options) {
|
|
82408
|
+
const decoder = new Decoder_ts_1.Decoder(options);
|
|
82409
|
+
return decoder.decodeMulti(buffer);
|
|
82410
|
+
}
|
|
82411
|
+
}
|
|
82412
|
+
});
|
|
82413
|
+
|
|
82414
|
+
// node_modules/@msgpack/msgpack/dist.cjs/utils/stream.cjs
|
|
82415
|
+
var require_stream2 = __commonJS({
|
|
82416
|
+
"node_modules/@msgpack/msgpack/dist.cjs/utils/stream.cjs"(exports2) {
|
|
82417
|
+
"use strict";
|
|
82418
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
82419
|
+
exports2.isAsyncIterable = isAsyncIterable;
|
|
82420
|
+
exports2.asyncIterableFromStream = asyncIterableFromStream;
|
|
82421
|
+
exports2.ensureAsyncIterable = ensureAsyncIterable;
|
|
82422
|
+
function isAsyncIterable(object) {
|
|
82423
|
+
return object[Symbol.asyncIterator] != null;
|
|
82424
|
+
}
|
|
82425
|
+
async function* asyncIterableFromStream(stream) {
|
|
82426
|
+
const reader = stream.getReader();
|
|
82427
|
+
try {
|
|
82428
|
+
while (true) {
|
|
82429
|
+
const { done, value } = await reader.read();
|
|
82430
|
+
if (done) {
|
|
82431
|
+
return;
|
|
82432
|
+
}
|
|
82433
|
+
yield value;
|
|
82434
|
+
}
|
|
82435
|
+
} finally {
|
|
82436
|
+
reader.releaseLock();
|
|
82437
|
+
}
|
|
82438
|
+
}
|
|
82439
|
+
function ensureAsyncIterable(streamLike) {
|
|
82440
|
+
if (isAsyncIterable(streamLike)) {
|
|
82441
|
+
return streamLike;
|
|
82442
|
+
} else {
|
|
82443
|
+
return asyncIterableFromStream(streamLike);
|
|
82444
|
+
}
|
|
82445
|
+
}
|
|
82446
|
+
}
|
|
82447
|
+
});
|
|
82448
|
+
|
|
82449
|
+
// node_modules/@msgpack/msgpack/dist.cjs/decodeAsync.cjs
|
|
82450
|
+
var require_decodeAsync = __commonJS({
|
|
82451
|
+
"node_modules/@msgpack/msgpack/dist.cjs/decodeAsync.cjs"(exports2) {
|
|
82452
|
+
"use strict";
|
|
82453
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
82454
|
+
exports2.decodeAsync = decodeAsync;
|
|
82455
|
+
exports2.decodeArrayStream = decodeArrayStream;
|
|
82456
|
+
exports2.decodeMultiStream = decodeMultiStream;
|
|
82457
|
+
var Decoder_ts_1 = require_Decoder();
|
|
82458
|
+
var stream_ts_1 = require_stream2();
|
|
82459
|
+
async function decodeAsync(streamLike, options) {
|
|
82460
|
+
const stream = (0, stream_ts_1.ensureAsyncIterable)(streamLike);
|
|
82461
|
+
const decoder = new Decoder_ts_1.Decoder(options);
|
|
82462
|
+
return decoder.decodeAsync(stream);
|
|
82463
|
+
}
|
|
82464
|
+
function decodeArrayStream(streamLike, options) {
|
|
82465
|
+
const stream = (0, stream_ts_1.ensureAsyncIterable)(streamLike);
|
|
82466
|
+
const decoder = new Decoder_ts_1.Decoder(options);
|
|
82467
|
+
return decoder.decodeArrayStream(stream);
|
|
82468
|
+
}
|
|
82469
|
+
function decodeMultiStream(streamLike, options) {
|
|
82470
|
+
const stream = (0, stream_ts_1.ensureAsyncIterable)(streamLike);
|
|
82471
|
+
const decoder = new Decoder_ts_1.Decoder(options);
|
|
82472
|
+
return decoder.decodeStream(stream);
|
|
82473
|
+
}
|
|
82474
|
+
}
|
|
82475
|
+
});
|
|
82476
|
+
|
|
82477
|
+
// node_modules/@msgpack/msgpack/dist.cjs/index.cjs
|
|
82478
|
+
var require_dist5 = __commonJS({
|
|
82479
|
+
"node_modules/@msgpack/msgpack/dist.cjs/index.cjs"(exports2) {
|
|
82480
|
+
"use strict";
|
|
82481
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
82482
|
+
exports2.decodeTimestampExtension = exports2.encodeTimestampExtension = exports2.decodeTimestampToTimeSpec = exports2.encodeTimeSpecToTimestamp = exports2.encodeDateToTimeSpec = exports2.EXT_TIMESTAMP = exports2.ExtData = exports2.ExtensionCodec = exports2.Encoder = exports2.DecodeError = exports2.Decoder = exports2.decodeMultiStream = exports2.decodeArrayStream = exports2.decodeAsync = exports2.decodeMulti = exports2.decode = exports2.encode = void 0;
|
|
82483
|
+
var encode_ts_1 = require_encode();
|
|
82484
|
+
Object.defineProperty(exports2, "encode", { enumerable: true, get: function() {
|
|
82485
|
+
return encode_ts_1.encode;
|
|
82486
|
+
} });
|
|
82487
|
+
var decode_ts_1 = require_decode();
|
|
82488
|
+
Object.defineProperty(exports2, "decode", { enumerable: true, get: function() {
|
|
82489
|
+
return decode_ts_1.decode;
|
|
82490
|
+
} });
|
|
82491
|
+
Object.defineProperty(exports2, "decodeMulti", { enumerable: true, get: function() {
|
|
82492
|
+
return decode_ts_1.decodeMulti;
|
|
82493
|
+
} });
|
|
82494
|
+
var decodeAsync_ts_1 = require_decodeAsync();
|
|
82495
|
+
Object.defineProperty(exports2, "decodeAsync", { enumerable: true, get: function() {
|
|
82496
|
+
return decodeAsync_ts_1.decodeAsync;
|
|
82497
|
+
} });
|
|
82498
|
+
Object.defineProperty(exports2, "decodeArrayStream", { enumerable: true, get: function() {
|
|
82499
|
+
return decodeAsync_ts_1.decodeArrayStream;
|
|
82500
|
+
} });
|
|
82501
|
+
Object.defineProperty(exports2, "decodeMultiStream", { enumerable: true, get: function() {
|
|
82502
|
+
return decodeAsync_ts_1.decodeMultiStream;
|
|
82503
|
+
} });
|
|
82504
|
+
var Decoder_ts_1 = require_Decoder();
|
|
82505
|
+
Object.defineProperty(exports2, "Decoder", { enumerable: true, get: function() {
|
|
82506
|
+
return Decoder_ts_1.Decoder;
|
|
82507
|
+
} });
|
|
82508
|
+
var DecodeError_ts_1 = require_DecodeError();
|
|
82509
|
+
Object.defineProperty(exports2, "DecodeError", { enumerable: true, get: function() {
|
|
82510
|
+
return DecodeError_ts_1.DecodeError;
|
|
82511
|
+
} });
|
|
82512
|
+
var Encoder_ts_1 = require_Encoder();
|
|
82513
|
+
Object.defineProperty(exports2, "Encoder", { enumerable: true, get: function() {
|
|
82514
|
+
return Encoder_ts_1.Encoder;
|
|
82515
|
+
} });
|
|
82516
|
+
var ExtensionCodec_ts_1 = require_ExtensionCodec();
|
|
82517
|
+
Object.defineProperty(exports2, "ExtensionCodec", { enumerable: true, get: function() {
|
|
82518
|
+
return ExtensionCodec_ts_1.ExtensionCodec;
|
|
82519
|
+
} });
|
|
82520
|
+
var ExtData_ts_1 = require_ExtData();
|
|
82521
|
+
Object.defineProperty(exports2, "ExtData", { enumerable: true, get: function() {
|
|
82522
|
+
return ExtData_ts_1.ExtData;
|
|
82523
|
+
} });
|
|
82524
|
+
var timestamp_ts_1 = require_timestamp();
|
|
82525
|
+
Object.defineProperty(exports2, "EXT_TIMESTAMP", { enumerable: true, get: function() {
|
|
82526
|
+
return timestamp_ts_1.EXT_TIMESTAMP;
|
|
82527
|
+
} });
|
|
82528
|
+
Object.defineProperty(exports2, "encodeDateToTimeSpec", { enumerable: true, get: function() {
|
|
82529
|
+
return timestamp_ts_1.encodeDateToTimeSpec;
|
|
82530
|
+
} });
|
|
82531
|
+
Object.defineProperty(exports2, "encodeTimeSpecToTimestamp", { enumerable: true, get: function() {
|
|
82532
|
+
return timestamp_ts_1.encodeTimeSpecToTimestamp;
|
|
82533
|
+
} });
|
|
82534
|
+
Object.defineProperty(exports2, "decodeTimestampToTimeSpec", { enumerable: true, get: function() {
|
|
82535
|
+
return timestamp_ts_1.decodeTimestampToTimeSpec;
|
|
82536
|
+
} });
|
|
82537
|
+
Object.defineProperty(exports2, "encodeTimestampExtension", { enumerable: true, get: function() {
|
|
82538
|
+
return timestamp_ts_1.encodeTimestampExtension;
|
|
82539
|
+
} });
|
|
82540
|
+
Object.defineProperty(exports2, "decodeTimestampExtension", { enumerable: true, get: function() {
|
|
82541
|
+
return timestamp_ts_1.decodeTimestampExtension;
|
|
82542
|
+
} });
|
|
82543
|
+
}
|
|
82544
|
+
});
|
|
82545
|
+
|
|
80834
82546
|
// src/sdk/calculate.ts
|
|
80835
82547
|
var calculate_exports = {};
|
|
80836
82548
|
__export(calculate_exports, {
|
|
@@ -84625,7 +86337,7 @@ function createSkillCommand() {
|
|
|
84625
86337
|
}
|
|
84626
86338
|
|
|
84627
86339
|
// src/cli/commands/catalog.ts
|
|
84628
|
-
var
|
|
86340
|
+
var import_cli_table38 = __toESM(require_cli_table3(), 1);
|
|
84629
86341
|
init_constants();
|
|
84630
86342
|
|
|
84631
86343
|
// src/plugins/jupiter/commands.ts
|
|
@@ -84696,6 +86408,79 @@ init_constants();
|
|
|
84696
86408
|
init_types();
|
|
84697
86409
|
init_errors();
|
|
84698
86410
|
init_constants();
|
|
86411
|
+
|
|
86412
|
+
// src/core/proxy.ts
|
|
86413
|
+
var import_node_net = __toESM(require("node:net"), 1);
|
|
86414
|
+
var PROXY_URL = process.env.BYREAL_PROXY_URL ?? "http://api-proxy:8080";
|
|
86415
|
+
var PROBE_TIMEOUT_MS = 500;
|
|
86416
|
+
var cached = null;
|
|
86417
|
+
var inFlight = null;
|
|
86418
|
+
async function isProxyAvailable() {
|
|
86419
|
+
if (cached !== null) return cached;
|
|
86420
|
+
if (inFlight) return inFlight;
|
|
86421
|
+
inFlight = probe().then((ok2) => {
|
|
86422
|
+
cached = ok2;
|
|
86423
|
+
inFlight = null;
|
|
86424
|
+
return ok2;
|
|
86425
|
+
});
|
|
86426
|
+
return inFlight;
|
|
86427
|
+
}
|
|
86428
|
+
async function probe() {
|
|
86429
|
+
if (!PROXY_URL) return false;
|
|
86430
|
+
let host;
|
|
86431
|
+
let port;
|
|
86432
|
+
try {
|
|
86433
|
+
const u = new URL(PROXY_URL);
|
|
86434
|
+
host = u.hostname;
|
|
86435
|
+
port = Number(u.port) || (u.protocol === "https:" ? 443 : 80);
|
|
86436
|
+
} catch {
|
|
86437
|
+
return false;
|
|
86438
|
+
}
|
|
86439
|
+
return new Promise((resolve) => {
|
|
86440
|
+
const socket = new import_node_net.default.Socket();
|
|
86441
|
+
let settled = false;
|
|
86442
|
+
const settle = (ok2) => {
|
|
86443
|
+
if (settled) return;
|
|
86444
|
+
settled = true;
|
|
86445
|
+
socket.destroy();
|
|
86446
|
+
resolve(ok2);
|
|
86447
|
+
};
|
|
86448
|
+
socket.setTimeout(PROBE_TIMEOUT_MS);
|
|
86449
|
+
socket.once("error", () => settle(false));
|
|
86450
|
+
socket.once("timeout", () => settle(false));
|
|
86451
|
+
socket.connect(port, host, () => settle(true));
|
|
86452
|
+
});
|
|
86453
|
+
}
|
|
86454
|
+
|
|
86455
|
+
// src/plugins/jupiter/api.ts
|
|
86456
|
+
var lastRoute = null;
|
|
86457
|
+
function getLastRoute() {
|
|
86458
|
+
return lastRoute;
|
|
86459
|
+
}
|
|
86460
|
+
async function resolveRoute(subPath) {
|
|
86461
|
+
if (await isProxyAvailable()) {
|
|
86462
|
+
lastRoute = "proxy";
|
|
86463
|
+
return {
|
|
86464
|
+
url: `${PROXY_URL.replace(/\/$/, "")}/jup${subPath}`,
|
|
86465
|
+
headers: {},
|
|
86466
|
+
route: "proxy"
|
|
86467
|
+
};
|
|
86468
|
+
}
|
|
86469
|
+
if (JUPITER_API_KEY) {
|
|
86470
|
+
lastRoute = "direct-paid";
|
|
86471
|
+
return {
|
|
86472
|
+
url: `${JUP_PAID_BASE}${subPath}`,
|
|
86473
|
+
headers: { "x-api-key": JUPITER_API_KEY },
|
|
86474
|
+
route: "direct-paid"
|
|
86475
|
+
};
|
|
86476
|
+
}
|
|
86477
|
+
lastRoute = "direct-free";
|
|
86478
|
+
return {
|
|
86479
|
+
url: `${JUP_FREE_BASE}${subPath}`,
|
|
86480
|
+
headers: {},
|
|
86481
|
+
route: "direct-free"
|
|
86482
|
+
};
|
|
86483
|
+
}
|
|
84699
86484
|
async function getQuote(params) {
|
|
84700
86485
|
try {
|
|
84701
86486
|
const searchParams = new URLSearchParams({
|
|
@@ -84709,7 +86494,8 @@ async function getQuote(params) {
|
|
|
84709
86494
|
if (params.slippageBps !== void 0) {
|
|
84710
86495
|
searchParams.set("slippageBps", String(params.slippageBps));
|
|
84711
86496
|
}
|
|
84712
|
-
const
|
|
86497
|
+
const { url, headers } = await resolveRoute("/swap/v1/quote");
|
|
86498
|
+
const response = await fetch(`${url}?${searchParams}`, { headers });
|
|
84713
86499
|
if (!response.ok) {
|
|
84714
86500
|
const text = await response.text();
|
|
84715
86501
|
return err(apiError(`Jupiter quote failed: ${text}`, response.status));
|
|
@@ -84722,9 +86508,10 @@ async function getQuote(params) {
|
|
|
84722
86508
|
}
|
|
84723
86509
|
async function getSwapTransaction(params) {
|
|
84724
86510
|
try {
|
|
84725
|
-
const
|
|
86511
|
+
const { url, headers } = await resolveRoute("/swap/v1/swap");
|
|
86512
|
+
const response = await fetch(url, {
|
|
84726
86513
|
method: "POST",
|
|
84727
|
-
headers: { "Content-Type": "application/json" },
|
|
86514
|
+
headers: { "Content-Type": "application/json", ...headers },
|
|
84728
86515
|
body: JSON.stringify({
|
|
84729
86516
|
quoteResponse: params.quoteResponse,
|
|
84730
86517
|
userPublicKey: params.userPublicKey,
|
|
@@ -84752,7 +86539,8 @@ async function getSwapTransaction(params) {
|
|
|
84752
86539
|
}
|
|
84753
86540
|
async function getPrice(mints) {
|
|
84754
86541
|
try {
|
|
84755
|
-
const
|
|
86542
|
+
const { url, headers } = await resolveRoute("/price/v3");
|
|
86543
|
+
const response = await fetch(`${url}?ids=${mints.join(",")}`, { headers });
|
|
84756
86544
|
if (!response.ok) {
|
|
84757
86545
|
const text = await response.text();
|
|
84758
86546
|
return err(apiError(`Jupiter price failed: ${text}`, response.status));
|
|
@@ -84765,6 +86553,11 @@ async function getPrice(mints) {
|
|
|
84765
86553
|
}
|
|
84766
86554
|
|
|
84767
86555
|
// src/plugins/jupiter/commands.ts
|
|
86556
|
+
function fallbackHint(route) {
|
|
86557
|
+
if (route === "direct-paid") return "byreal proxy unreachable \u2014 using api.jup.ag with JUPITER_API_KEY";
|
|
86558
|
+
if (route === "direct-free") return "byreal proxy unreachable \u2014 using lite-api.jup.ag (no key, rate-limited)";
|
|
86559
|
+
return null;
|
|
86560
|
+
}
|
|
84768
86561
|
function createJupSwapCommand() {
|
|
84769
86562
|
return new Command("swap").description("Swap tokens via Jupiter aggregator").requiredOption("--input-mint <address>", "Input token mint address").requiredOption("--output-mint <address>", "Output token mint address").requiredOption("--amount <amount>", "Amount to swap (UI amount, decimals auto-resolved)").option("--slippage <bps>", "Slippage tolerance in basis points").option("--raw", "Amount is already in raw (smallest unit) format").option("--dry-run", "Preview the swap without generating a transaction").action(async (options, cmdObj) => {
|
|
84770
86563
|
const globalOptions = cmdObj.optsWithGlobals();
|
|
@@ -84830,6 +86623,8 @@ Error: ${msg}`));
|
|
|
84830
86623
|
);
|
|
84831
86624
|
console.log(source_default.cyan.bold("\n Jupiter Swap Preview\n"));
|
|
84832
86625
|
console.log(table.toString());
|
|
86626
|
+
const hint = fallbackHint(getLastRoute());
|
|
86627
|
+
if (hint) console.error(source_default.gray(`[byreal] ${hint}`));
|
|
84833
86628
|
console.log(source_default.yellow("\n Remove --dry-run to generate the unsigned transaction"));
|
|
84834
86629
|
}
|
|
84835
86630
|
return;
|
|
@@ -84882,6 +86677,8 @@ function createJupPriceCommand() {
|
|
|
84882
86677
|
}
|
|
84883
86678
|
console.log(source_default.cyan.bold("\n Jupiter Price\n"));
|
|
84884
86679
|
console.log(table.toString());
|
|
86680
|
+
const hint = fallbackHint(getLastRoute());
|
|
86681
|
+
if (hint) console.error(source_default.gray(`[byreal] ${hint}`));
|
|
84885
86682
|
}
|
|
84886
86683
|
});
|
|
84887
86684
|
}
|
|
@@ -86000,113 +87797,458 @@ var consolidatePlugin = {
|
|
|
86000
87797
|
capabilities: capabilities4
|
|
86001
87798
|
};
|
|
86002
87799
|
|
|
86003
|
-
// src/plugins/
|
|
87800
|
+
// src/plugins/titan/commands.ts
|
|
86004
87801
|
var import_cli_table36 = __toESM(require_cli_table3(), 1);
|
|
86005
|
-
var
|
|
87802
|
+
var import_web3120 = __toESM(require_index_cjs(), 1);
|
|
86006
87803
|
init_solana();
|
|
86007
87804
|
init_errors();
|
|
86008
87805
|
init_constants();
|
|
86009
87806
|
|
|
86010
|
-
// src/plugins/
|
|
87807
|
+
// src/plugins/titan/api.ts
|
|
87808
|
+
var import_web3119 = __toESM(require_index_cjs(), 1);
|
|
87809
|
+
var import_msgpack = __toESM(require_dist5(), 1);
|
|
86011
87810
|
init_errors();
|
|
86012
87811
|
init_constants();
|
|
86013
|
-
|
|
86014
|
-
|
|
86015
|
-
|
|
86016
|
-
|
|
86017
|
-
|
|
86018
|
-
"Content-Type": "application/json",
|
|
86019
|
-
"User-Agent": "byreal-cli",
|
|
86020
|
-
...DFLOW_API_KEY ? { "x-api-key": DFLOW_API_KEY } : {}
|
|
86021
|
-
},
|
|
86022
|
-
hooks: {
|
|
86023
|
-
beforeRequest: [
|
|
86024
|
-
(request) => {
|
|
86025
|
-
if (process.env.DEBUG) {
|
|
86026
|
-
console.error(`[DEBUG] DFlow ${request.method} ${request.url}`);
|
|
86027
|
-
}
|
|
86028
|
-
}
|
|
86029
|
-
]
|
|
86030
|
-
}
|
|
86031
|
-
});
|
|
87812
|
+
init_solana();
|
|
87813
|
+
var TITAN_TIMEOUT_MS = 15e3;
|
|
87814
|
+
var lastRoute2 = null;
|
|
87815
|
+
function getLastRoute2() {
|
|
87816
|
+
return lastRoute2;
|
|
86032
87817
|
}
|
|
86033
87818
|
async function getSwapQuote2(params) {
|
|
86034
|
-
|
|
86035
|
-
const
|
|
87819
|
+
let url;
|
|
87820
|
+
const headers = { Accept: "application/vnd.msgpack" };
|
|
87821
|
+
if (await isProxyAvailable()) {
|
|
87822
|
+
lastRoute2 = "proxy";
|
|
87823
|
+
const base = PROXY_URL.replace(/\/$/, "");
|
|
87824
|
+
url = `${base}/titan/api/v1/quote/swap`;
|
|
87825
|
+
} else if (TITAN_AUTH_TOKEN) {
|
|
87826
|
+
lastRoute2 = "direct";
|
|
87827
|
+
url = `${TITAN_API_URL}/api/v1/quote/swap`;
|
|
87828
|
+
headers.Authorization = `Bearer ${TITAN_AUTH_TOKEN}`;
|
|
87829
|
+
} else {
|
|
87830
|
+
return {
|
|
87831
|
+
ok: false,
|
|
87832
|
+
error: new ByrealError({
|
|
87833
|
+
code: ErrorCodes.MISSING_REQUIRED,
|
|
87834
|
+
type: "VALIDATION",
|
|
87835
|
+
message: "Titan is only available via the Byreal proxy. The proxy is currently unreachable \u2014 please contact the Byreal team.",
|
|
87836
|
+
retryable: false
|
|
87837
|
+
})
|
|
87838
|
+
};
|
|
87839
|
+
}
|
|
87840
|
+
const query = new URLSearchParams({
|
|
87841
|
+
inputMint: params.inputMint,
|
|
87842
|
+
outputMint: params.outputMint,
|
|
87843
|
+
amount: params.amount,
|
|
87844
|
+
userPublicKey: params.userPublicKey,
|
|
87845
|
+
slippageBps: String(params.slippageBps),
|
|
87846
|
+
swapMode: params.swapMode
|
|
87847
|
+
});
|
|
87848
|
+
url = `${url}?${query.toString()}`;
|
|
87849
|
+
const controller = new AbortController();
|
|
87850
|
+
const timer = setTimeout(() => controller.abort(), TITAN_TIMEOUT_MS);
|
|
87851
|
+
let response;
|
|
86036
87852
|
try {
|
|
86037
|
-
|
|
86038
|
-
|
|
86039
|
-
|
|
87853
|
+
response = await fetch(url, {
|
|
87854
|
+
method: "GET",
|
|
87855
|
+
headers,
|
|
87856
|
+
signal: controller.signal
|
|
87857
|
+
});
|
|
87858
|
+
} catch (e) {
|
|
87859
|
+
clearTimeout(timer);
|
|
87860
|
+
const aborted = e.name === "AbortError";
|
|
87861
|
+
return {
|
|
87862
|
+
ok: false,
|
|
87863
|
+
error: new ByrealError({
|
|
87864
|
+
code: ErrorCodes.NETWORK_ERROR,
|
|
87865
|
+
type: "NETWORK",
|
|
87866
|
+
message: aborted ? `Titan request timed out after ${TITAN_TIMEOUT_MS}ms` : `Titan request failed: ${e.message}`,
|
|
87867
|
+
retryable: true
|
|
87868
|
+
})
|
|
87869
|
+
};
|
|
87870
|
+
}
|
|
87871
|
+
clearTimeout(timer);
|
|
87872
|
+
if (!response.ok) {
|
|
87873
|
+
const bodyText = await response.text().catch(() => "");
|
|
87874
|
+
return {
|
|
87875
|
+
ok: false,
|
|
87876
|
+
error: new ByrealError({
|
|
87877
|
+
code: ErrorCodes.API_ERROR,
|
|
87878
|
+
type: "NETWORK",
|
|
87879
|
+
message: `Titan API error ${response.status}: ${bodyText.slice(0, 200) || response.statusText}`,
|
|
87880
|
+
retryable: response.status >= 500 || response.status === 429
|
|
87881
|
+
})
|
|
87882
|
+
};
|
|
87883
|
+
}
|
|
87884
|
+
let decoded;
|
|
87885
|
+
try {
|
|
87886
|
+
const buf = new Uint8Array(await response.arrayBuffer());
|
|
87887
|
+
decoded = (0, import_msgpack.decode)(buf);
|
|
87888
|
+
} catch (e) {
|
|
87889
|
+
return {
|
|
87890
|
+
ok: false,
|
|
87891
|
+
error: new ByrealError({
|
|
87892
|
+
code: ErrorCodes.API_ERROR,
|
|
87893
|
+
type: "NETWORK",
|
|
87894
|
+
message: `Failed to decode Titan msgpack response: ${e.message}`,
|
|
87895
|
+
retryable: true
|
|
87896
|
+
})
|
|
87897
|
+
};
|
|
87898
|
+
}
|
|
87899
|
+
const bestRoute = pickBestRoute(decoded.quotes ?? {}, params.swapMode);
|
|
87900
|
+
if (!bestRoute || !bestRoute.instructions?.length) {
|
|
87901
|
+
return {
|
|
87902
|
+
ok: false,
|
|
87903
|
+
error: new ByrealError({
|
|
87904
|
+
code: ErrorCodes.API_ERROR,
|
|
87905
|
+
type: "NETWORK",
|
|
87906
|
+
message: "No swap route returned from Titan.",
|
|
87907
|
+
retryable: true
|
|
87908
|
+
})
|
|
87909
|
+
};
|
|
87910
|
+
}
|
|
87911
|
+
try {
|
|
87912
|
+
const transaction = await buildTransaction(
|
|
87913
|
+
bestRoute.instructions,
|
|
87914
|
+
bestRoute.addressLookupTables,
|
|
87915
|
+
params.userPublicKey,
|
|
87916
|
+
bestRoute.computeUnitsSafe ?? bestRoute.computeUnits
|
|
87917
|
+
);
|
|
87918
|
+
return {
|
|
87919
|
+
ok: true,
|
|
87920
|
+
value: {
|
|
87921
|
+
inAmount: String(bestRoute.inAmount),
|
|
87922
|
+
outAmount: String(bestRoute.outAmount),
|
|
86040
87923
|
inputMint: params.inputMint,
|
|
86041
87924
|
outputMint: params.outputMint,
|
|
86042
|
-
|
|
86043
|
-
slippageBps: slippageValue
|
|
87925
|
+
transaction
|
|
86044
87926
|
}
|
|
87927
|
+
};
|
|
87928
|
+
} catch (e) {
|
|
87929
|
+
return {
|
|
87930
|
+
ok: false,
|
|
87931
|
+
error: new ByrealError({
|
|
87932
|
+
code: ErrorCodes.NETWORK_ERROR,
|
|
87933
|
+
type: "NETWORK",
|
|
87934
|
+
message: `Failed to build Titan transaction: ${e.message}`,
|
|
87935
|
+
retryable: true
|
|
87936
|
+
})
|
|
87937
|
+
};
|
|
87938
|
+
}
|
|
87939
|
+
}
|
|
87940
|
+
function pickBestRoute(quotes, swapMode) {
|
|
87941
|
+
let best = null;
|
|
87942
|
+
for (const route of Object.values(quotes)) {
|
|
87943
|
+
if (!route?.instructions?.length) continue;
|
|
87944
|
+
if (!best) {
|
|
87945
|
+
best = route;
|
|
87946
|
+
continue;
|
|
87947
|
+
}
|
|
87948
|
+
if (swapMode === "ExactIn") {
|
|
87949
|
+
if (BigInt(route.outAmount) > BigInt(best.outAmount)) best = route;
|
|
87950
|
+
} else {
|
|
87951
|
+
if (BigInt(route.inAmount) < BigInt(best.inAmount)) best = route;
|
|
87952
|
+
}
|
|
87953
|
+
}
|
|
87954
|
+
return best;
|
|
87955
|
+
}
|
|
87956
|
+
async function buildTransaction(instructions, altAddresses, userPublicKey, computeUnits) {
|
|
87957
|
+
const connection = getConnection();
|
|
87958
|
+
const payer = new import_web3119.PublicKey(userPublicKey);
|
|
87959
|
+
const budgetInstructions = [];
|
|
87960
|
+
if (computeUnits && computeUnits > 2e5) {
|
|
87961
|
+
budgetInstructions.push(
|
|
87962
|
+
import_web3119.ComputeBudgetProgram.setComputeUnitLimit({ units: computeUnits })
|
|
87963
|
+
);
|
|
87964
|
+
}
|
|
87965
|
+
budgetInstructions.push(
|
|
87966
|
+
import_web3119.ComputeBudgetProgram.setComputeUnitPrice({ microLamports: DEFAULTS.PRIORITY_FEE_MICRO_LAMPORTS })
|
|
87967
|
+
);
|
|
87968
|
+
const txInstructions = instructions.map((ix) => {
|
|
87969
|
+
const accounts = (ix.a || []).map((acc) => ({
|
|
87970
|
+
pubkey: new import_web3119.PublicKey(acc.p),
|
|
87971
|
+
isSigner: acc.s ?? false,
|
|
87972
|
+
isWritable: acc.w ?? false
|
|
87973
|
+
}));
|
|
87974
|
+
return new import_web3119.TransactionInstruction({
|
|
87975
|
+
programId: new import_web3119.PublicKey(ix.p),
|
|
87976
|
+
keys: accounts,
|
|
87977
|
+
data: Buffer.from(ix.d)
|
|
86045
87978
|
});
|
|
86046
|
-
|
|
86047
|
-
|
|
87979
|
+
});
|
|
87980
|
+
let lookupTableAccounts = [];
|
|
87981
|
+
if (altAddresses?.length) {
|
|
87982
|
+
const fetched = await Promise.all(
|
|
87983
|
+
altAddresses.map(async (addr) => {
|
|
87984
|
+
try {
|
|
87985
|
+
const result = await connection.getAddressLookupTable(new import_web3119.PublicKey(addr));
|
|
87986
|
+
return result.value;
|
|
87987
|
+
} catch {
|
|
87988
|
+
return null;
|
|
87989
|
+
}
|
|
87990
|
+
})
|
|
87991
|
+
);
|
|
87992
|
+
lookupTableAccounts = fetched.filter(
|
|
87993
|
+
(t) => t !== null
|
|
87994
|
+
);
|
|
87995
|
+
}
|
|
87996
|
+
const { blockhash } = await connection.getLatestBlockhash("confirmed");
|
|
87997
|
+
const messageV0 = new import_web3119.TransactionMessage({
|
|
87998
|
+
payerKey: payer,
|
|
87999
|
+
recentBlockhash: blockhash,
|
|
88000
|
+
instructions: [...budgetInstructions, ...txInstructions]
|
|
88001
|
+
}).compileToV0Message(lookupTableAccounts);
|
|
88002
|
+
const tx = new import_web3119.VersionedTransaction(messageV0);
|
|
88003
|
+
return Buffer.from(tx.serialize()).toString("base64");
|
|
88004
|
+
}
|
|
88005
|
+
|
|
88006
|
+
// src/plugins/titan/commands.ts
|
|
88007
|
+
function fallbackHint2(route) {
|
|
88008
|
+
if (route === "direct") return "byreal proxy unreachable \u2014 using direct Titan Gateway with TITAN_AUTH_TOKEN";
|
|
88009
|
+
return null;
|
|
88010
|
+
}
|
|
88011
|
+
function createTitanSwapCommand() {
|
|
88012
|
+
return new Command("swap").description("Swap tokens via Titan Exchange aggregator").requiredOption("--input-mint <address>", "Input token mint address").requiredOption("--output-mint <address>", "Output token mint address").requiredOption("--amount <amount>", "Amount to swap (UI amount, decimals auto-resolved)").option("--swap-mode <mode>", "Swap mode: ExactIn or ExactOut", "ExactIn").option("--slippage <bps>", "Slippage tolerance in basis points").option("--raw", "Amount is already in raw (smallest unit) format").option("--dry-run", "Preview the swap without generating a transaction").action(async (options, cmdObj) => {
|
|
88013
|
+
const globalOptions = cmdObj.optsWithGlobals();
|
|
88014
|
+
const format = globalOptions.output;
|
|
88015
|
+
const startTime = Date.now();
|
|
88016
|
+
const mode = resolveExecutionMode(options);
|
|
88017
|
+
const walletAddress = globalOptions.walletAddress;
|
|
88018
|
+
if (!walletAddress) {
|
|
88019
|
+
const e = missingWalletAddressError();
|
|
88020
|
+
format === "json" ? outputErrorJson(e.toJSON()) : outputErrorTable(e.toJSON());
|
|
88021
|
+
process.exit(1);
|
|
88022
|
+
}
|
|
88023
|
+
try {
|
|
88024
|
+
new import_web3120.PublicKey(walletAddress);
|
|
88025
|
+
} catch {
|
|
88026
|
+
const msg = `Invalid wallet address: ${walletAddress}`;
|
|
88027
|
+
format === "json" ? outputErrorJson({ code: "INVALID_PARAMETER", type: "VALIDATION", message: msg, retryable: false }) : console.error(source_default.red(`
|
|
88028
|
+
Error: ${msg}`));
|
|
88029
|
+
process.exit(1);
|
|
88030
|
+
}
|
|
88031
|
+
try {
|
|
88032
|
+
const swapMode = options.swapMode;
|
|
88033
|
+
const targetMint = swapMode === "ExactIn" ? options.inputMint : options.outputMint;
|
|
88034
|
+
const targetDecimals = await resolveDecimals(targetMint);
|
|
88035
|
+
const rawAmount = options.raw ? options.amount : uiToRaw(options.amount, targetDecimals);
|
|
88036
|
+
const slippageBps = options.slippage ? parseInt(options.slippage, 10) : getSlippageBps();
|
|
88037
|
+
const quoteResult = await getSwapQuote2({
|
|
88038
|
+
inputMint: options.inputMint,
|
|
88039
|
+
outputMint: options.outputMint,
|
|
88040
|
+
amount: rawAmount,
|
|
88041
|
+
swapMode,
|
|
88042
|
+
slippageBps,
|
|
88043
|
+
userPublicKey: walletAddress
|
|
88044
|
+
});
|
|
88045
|
+
if (!quoteResult.ok) {
|
|
88046
|
+
format === "json" ? outputErrorJson(quoteResult.error) : outputErrorTable(quoteResult.error);
|
|
88047
|
+
process.exit(1);
|
|
88048
|
+
}
|
|
88049
|
+
const quote = quoteResult.value;
|
|
88050
|
+
const inputDecimals = await resolveDecimals(options.inputMint);
|
|
88051
|
+
const outputDecimals = await resolveDecimals(options.outputMint);
|
|
88052
|
+
const uiInAmount = rawToUi(quote.inAmount, inputDecimals);
|
|
88053
|
+
const uiOutAmount = rawToUi(quote.outAmount, outputDecimals);
|
|
88054
|
+
if (mode === "dry-run") {
|
|
88055
|
+
printDryRunBanner();
|
|
88056
|
+
if (format === "json") {
|
|
88057
|
+
outputJson({
|
|
88058
|
+
mode: "dry-run",
|
|
88059
|
+
source: "titan",
|
|
88060
|
+
inputMint: quote.inputMint,
|
|
88061
|
+
outputMint: quote.outputMint,
|
|
88062
|
+
inAmount: quote.inAmount,
|
|
88063
|
+
outAmount: quote.outAmount,
|
|
88064
|
+
uiInAmount,
|
|
88065
|
+
uiOutAmount,
|
|
88066
|
+
swapMode,
|
|
88067
|
+
slippageBps
|
|
88068
|
+
}, startTime);
|
|
88069
|
+
} else {
|
|
88070
|
+
const table = new import_cli_table36.default({ chars: TABLE_CHARS });
|
|
88071
|
+
table.push(
|
|
88072
|
+
[source_default.gray("Source"), "Titan Exchange"],
|
|
88073
|
+
[source_default.gray("Input"), `${uiInAmount} (${options.inputMint})`],
|
|
88074
|
+
[source_default.gray("Output"), `${uiOutAmount} (${options.outputMint})`],
|
|
88075
|
+
[source_default.gray("Swap Mode"), swapMode],
|
|
88076
|
+
[source_default.gray("Slippage"), `${slippageBps} bps`]
|
|
88077
|
+
);
|
|
88078
|
+
console.log(source_default.cyan.bold("\n Titan Swap Preview\n"));
|
|
88079
|
+
console.log(table.toString());
|
|
88080
|
+
const hint = fallbackHint2(getLastRoute2());
|
|
88081
|
+
if (hint) console.error(source_default.gray(`[byreal] ${hint}`));
|
|
88082
|
+
console.log(source_default.yellow("\n Remove --dry-run to generate the unsigned transaction"));
|
|
88083
|
+
}
|
|
88084
|
+
return;
|
|
88085
|
+
}
|
|
88086
|
+
console.log(JSON.stringify({ unsignedTransactions: [quote.transaction] }));
|
|
88087
|
+
} catch (e) {
|
|
88088
|
+
const message = e.message || "Titan swap failed";
|
|
88089
|
+
format === "json" ? outputErrorJson({ code: "API_ERROR", type: "NETWORK", message, retryable: true }) : console.error(source_default.red(`
|
|
88090
|
+
Error: ${message}`));
|
|
88091
|
+
process.exit(1);
|
|
88092
|
+
}
|
|
88093
|
+
});
|
|
88094
|
+
}
|
|
88095
|
+
|
|
88096
|
+
// src/plugins/titan/index.ts
|
|
88097
|
+
var capabilities5 = [
|
|
88098
|
+
{
|
|
88099
|
+
id: "defi.titan.swap",
|
|
88100
|
+
name: "Titan Swap",
|
|
88101
|
+
description: "Swap tokens via Titan Exchange aggregator with WebSocket-based quote streaming",
|
|
88102
|
+
category: "execute",
|
|
88103
|
+
auth_required: true,
|
|
88104
|
+
command: "byreal-cli titan swap --wallet-address <address>",
|
|
88105
|
+
params: [
|
|
88106
|
+
{ name: "input-mint", type: "string", required: true, description: "Input token mint address" },
|
|
88107
|
+
{ name: "output-mint", type: "string", required: true, description: "Output token mint address" },
|
|
88108
|
+
{ name: "amount", type: "string", required: true, description: "Amount to swap (UI format)" },
|
|
88109
|
+
{ name: "swap-mode", type: "string", required: false, description: "Swap mode", default: "ExactIn", enum: ["ExactIn", "ExactOut"] },
|
|
88110
|
+
{ name: "slippage", type: "integer", required: false, description: "Slippage tolerance in basis points" },
|
|
88111
|
+
{ name: "raw", type: "boolean", required: false, description: "Amount is already in raw format" },
|
|
88112
|
+
{ name: "dry-run", type: "boolean", required: false, description: "Preview without generating transaction" }
|
|
88113
|
+
]
|
|
88114
|
+
}
|
|
88115
|
+
];
|
|
88116
|
+
var titanPlugin = {
|
|
88117
|
+
id: "titan",
|
|
88118
|
+
name: "Titan Exchange",
|
|
88119
|
+
createCommand() {
|
|
88120
|
+
const cmd = new Command("titan").description("Titan Exchange \u2014 swap");
|
|
88121
|
+
cmd.addCommand(createTitanSwapCommand());
|
|
88122
|
+
return cmd;
|
|
88123
|
+
},
|
|
88124
|
+
capabilities: capabilities5
|
|
88125
|
+
};
|
|
88126
|
+
|
|
88127
|
+
// src/plugins/dflow/commands.ts
|
|
88128
|
+
var import_cli_table37 = __toESM(require_cli_table3(), 1);
|
|
88129
|
+
var import_web3121 = __toESM(require_index_cjs(), 1);
|
|
88130
|
+
init_solana();
|
|
88131
|
+
init_errors();
|
|
88132
|
+
init_constants();
|
|
88133
|
+
|
|
88134
|
+
// src/plugins/dflow/api.ts
|
|
88135
|
+
init_errors();
|
|
88136
|
+
init_constants();
|
|
88137
|
+
var lastRoute3 = null;
|
|
88138
|
+
function getLastRoute3() {
|
|
88139
|
+
return lastRoute3;
|
|
88140
|
+
}
|
|
88141
|
+
async function resolveOrderUrl() {
|
|
88142
|
+
if (await isProxyAvailable()) {
|
|
88143
|
+
lastRoute3 = "proxy";
|
|
88144
|
+
return {
|
|
88145
|
+
base: `${PROXY_URL.replace(/\/$/, "")}/dflow`,
|
|
88146
|
+
headers: {},
|
|
88147
|
+
route: "proxy"
|
|
88148
|
+
};
|
|
88149
|
+
}
|
|
88150
|
+
if (DFLOW_API_KEY) {
|
|
88151
|
+
lastRoute3 = "direct-paid";
|
|
88152
|
+
return {
|
|
88153
|
+
base: DFLOW_PAID_URL,
|
|
88154
|
+
headers: { "x-api-key": DFLOW_API_KEY },
|
|
88155
|
+
route: "direct-paid"
|
|
88156
|
+
};
|
|
88157
|
+
}
|
|
88158
|
+
lastRoute3 = "direct-free";
|
|
88159
|
+
return { base: DFLOW_FREE_URL, headers: {}, route: "direct-free" };
|
|
88160
|
+
}
|
|
88161
|
+
async function getSwapQuote3(params) {
|
|
88162
|
+
const slippageValue = params.slippageBps > 0 ? String(params.slippageBps) : "auto";
|
|
88163
|
+
const query = new URLSearchParams({
|
|
88164
|
+
userPublicKey: params.userPublicKey,
|
|
88165
|
+
inputMint: params.inputMint,
|
|
88166
|
+
outputMint: params.outputMint,
|
|
88167
|
+
amount: params.amount,
|
|
88168
|
+
slippageBps: slippageValue
|
|
88169
|
+
});
|
|
88170
|
+
const { base, headers } = await resolveOrderUrl();
|
|
88171
|
+
const url = `${base}/order?${query.toString()}`;
|
|
88172
|
+
if (process.env.DEBUG) {
|
|
88173
|
+
console.error(`[DEBUG] DFlow GET ${url}`);
|
|
88174
|
+
}
|
|
88175
|
+
const controller = new AbortController();
|
|
88176
|
+
const timer = setTimeout(() => controller.abort(), DEFAULTS.REQUEST_TIMEOUT_MS);
|
|
88177
|
+
let response;
|
|
88178
|
+
try {
|
|
88179
|
+
response = await fetch(url, {
|
|
88180
|
+
method: "GET",
|
|
88181
|
+
headers: { "User-Agent": "byreal-cli", ...headers },
|
|
88182
|
+
signal: controller.signal
|
|
88183
|
+
});
|
|
88184
|
+
} catch (e) {
|
|
88185
|
+
clearTimeout(timer);
|
|
88186
|
+
const aborted = e.name === "AbortError";
|
|
88187
|
+
return {
|
|
88188
|
+
ok: false,
|
|
88189
|
+
error: new ByrealError({
|
|
88190
|
+
code: aborted ? ErrorCodes.TIMEOUT : ErrorCodes.NETWORK_ERROR,
|
|
88191
|
+
type: "NETWORK",
|
|
88192
|
+
message: aborted ? "DFlow request timed out." : `DFlow swap failed: ${e.message}`,
|
|
88193
|
+
retryable: true
|
|
88194
|
+
})
|
|
88195
|
+
};
|
|
88196
|
+
}
|
|
88197
|
+
clearTimeout(timer);
|
|
88198
|
+
if (!response.ok) {
|
|
88199
|
+
if (response.status === 429) {
|
|
86048
88200
|
return {
|
|
86049
88201
|
ok: false,
|
|
86050
88202
|
error: new ByrealError({
|
|
86051
|
-
code: ErrorCodes.
|
|
88203
|
+
code: ErrorCodes.NETWORK_ERROR,
|
|
86052
88204
|
type: "NETWORK",
|
|
86053
|
-
message: "
|
|
88205
|
+
message: "DFlow rate limit exceeded.",
|
|
86054
88206
|
retryable: true
|
|
86055
88207
|
})
|
|
86056
88208
|
};
|
|
86057
88209
|
}
|
|
86058
88210
|
return {
|
|
86059
|
-
ok:
|
|
86060
|
-
|
|
86061
|
-
|
|
86062
|
-
|
|
86063
|
-
|
|
86064
|
-
|
|
86065
|
-
|
|
86066
|
-
|
|
86067
|
-
}
|
|
88211
|
+
ok: false,
|
|
88212
|
+
error: new ByrealError({
|
|
88213
|
+
code: ErrorCodes.API_ERROR,
|
|
88214
|
+
type: "NETWORK",
|
|
88215
|
+
message: `DFlow API error: ${response.status} ${response.statusText}`,
|
|
88216
|
+
details: { status_code: response.status },
|
|
88217
|
+
retryable: response.status >= 500
|
|
88218
|
+
})
|
|
86068
88219
|
};
|
|
86069
|
-
} catch (e) {
|
|
86070
|
-
return { ok: false, error: handleDFlowError(e) };
|
|
86071
88220
|
}
|
|
86072
|
-
|
|
86073
|
-
|
|
86074
|
-
|
|
86075
|
-
|
|
86076
|
-
|
|
86077
|
-
|
|
86078
|
-
code: ErrorCodes.NETWORK_ERROR,
|
|
88221
|
+
const data = await response.json();
|
|
88222
|
+
if (!data.transaction) {
|
|
88223
|
+
return {
|
|
88224
|
+
ok: false,
|
|
88225
|
+
error: new ByrealError({
|
|
88226
|
+
code: ErrorCodes.API_ERROR,
|
|
86079
88227
|
type: "NETWORK",
|
|
86080
|
-
message: "
|
|
88228
|
+
message: "No transaction returned from DFlow /order endpoint.",
|
|
86081
88229
|
retryable: true
|
|
86082
|
-
})
|
|
86083
|
-
}
|
|
86084
|
-
return new ByrealError({
|
|
86085
|
-
code: ErrorCodes.API_ERROR,
|
|
86086
|
-
type: "NETWORK",
|
|
86087
|
-
message: `DFlow API error: ${status} ${error.response.statusText}`,
|
|
86088
|
-
details: { status_code: status },
|
|
86089
|
-
retryable: status >= 500
|
|
86090
|
-
});
|
|
86091
|
-
}
|
|
86092
|
-
if (error instanceof TimeoutError) {
|
|
86093
|
-
return new ByrealError({
|
|
86094
|
-
code: ErrorCodes.TIMEOUT,
|
|
86095
|
-
type: "NETWORK",
|
|
86096
|
-
message: "DFlow request timed out.",
|
|
86097
|
-
retryable: true
|
|
86098
|
-
});
|
|
88230
|
+
})
|
|
88231
|
+
};
|
|
86099
88232
|
}
|
|
86100
|
-
|
|
86101
|
-
|
|
86102
|
-
|
|
86103
|
-
|
|
86104
|
-
|
|
86105
|
-
|
|
86106
|
-
|
|
88233
|
+
return {
|
|
88234
|
+
ok: true,
|
|
88235
|
+
value: {
|
|
88236
|
+
inAmount: data.inAmount || params.amount,
|
|
88237
|
+
outAmount: data.outAmount || "0",
|
|
88238
|
+
inputMint: data.inputMint || params.inputMint,
|
|
88239
|
+
outputMint: data.outputMint || params.outputMint,
|
|
88240
|
+
transaction: data.transaction,
|
|
88241
|
+
priceImpactPct: data.priceImpactPct
|
|
88242
|
+
}
|
|
88243
|
+
};
|
|
86107
88244
|
}
|
|
86108
88245
|
|
|
86109
88246
|
// src/plugins/dflow/commands.ts
|
|
88247
|
+
function fallbackHint3(route) {
|
|
88248
|
+
if (route === "direct-paid") return "byreal proxy unreachable \u2014 using quote-api.dflow.net with DFLOW_API_KEY";
|
|
88249
|
+
if (route === "direct-free") return "byreal proxy unreachable \u2014 using dev-quote-api.dflow.net (no key, rate-limited)";
|
|
88250
|
+
return null;
|
|
88251
|
+
}
|
|
86110
88252
|
function createDFlowSwapCommand() {
|
|
86111
88253
|
return new Command("swap").description("Swap tokens via DFlow order-flow aggregator").requiredOption("--input-mint <address>", "Input token mint address").requiredOption("--output-mint <address>", "Output token mint address").requiredOption("--amount <amount>", "Amount to swap (UI amount, decimals auto-resolved)").option("--slippage <bps>", "Slippage tolerance in basis points").option("--raw", "Amount is already in raw (smallest unit) format").option("--dry-run", "Preview the swap without generating a transaction").action(async (options, cmdObj) => {
|
|
86112
88254
|
const globalOptions = cmdObj.optsWithGlobals();
|
|
@@ -86120,7 +88262,7 @@ function createDFlowSwapCommand() {
|
|
|
86120
88262
|
process.exit(1);
|
|
86121
88263
|
}
|
|
86122
88264
|
try {
|
|
86123
|
-
new
|
|
88265
|
+
new import_web3121.PublicKey(walletAddress);
|
|
86124
88266
|
} catch {
|
|
86125
88267
|
const msg = `Invalid wallet address: ${walletAddress}`;
|
|
86126
88268
|
format === "json" ? outputErrorJson({ code: "INVALID_PARAMETER", type: "VALIDATION", message: msg, retryable: false }) : console.error(source_default.red(`
|
|
@@ -86131,7 +88273,7 @@ Error: ${msg}`));
|
|
|
86131
88273
|
const inputDecimals = await resolveDecimals(options.inputMint);
|
|
86132
88274
|
const rawAmount = options.raw ? options.amount : uiToRaw(options.amount, inputDecimals);
|
|
86133
88275
|
const slippageBps = options.slippage ? parseInt(options.slippage, 10) : getSlippageBps();
|
|
86134
|
-
const quoteResult = await
|
|
88276
|
+
const quoteResult = await getSwapQuote3({
|
|
86135
88277
|
inputMint: options.inputMint,
|
|
86136
88278
|
outputMint: options.outputMint,
|
|
86137
88279
|
amount: rawAmount,
|
|
@@ -86162,7 +88304,7 @@ Error: ${msg}`));
|
|
|
86162
88304
|
slippageBps
|
|
86163
88305
|
}, startTime);
|
|
86164
88306
|
} else {
|
|
86165
|
-
const table = new
|
|
88307
|
+
const table = new import_cli_table37.default({ chars: TABLE_CHARS });
|
|
86166
88308
|
table.push(
|
|
86167
88309
|
[source_default.gray("Source"), "DFlow"],
|
|
86168
88310
|
[source_default.gray("Input"), `${uiInAmount} (${options.inputMint})`],
|
|
@@ -86176,6 +88318,8 @@ Error: ${msg}`));
|
|
|
86176
88318
|
}
|
|
86177
88319
|
console.log(source_default.cyan.bold("\n DFlow Swap Preview\n"));
|
|
86178
88320
|
console.log(table.toString());
|
|
88321
|
+
const hint = fallbackHint3(getLastRoute3());
|
|
88322
|
+
if (hint) console.error(source_default.gray(`[byreal] ${hint}`));
|
|
86179
88323
|
console.log(source_default.yellow("\n Remove --dry-run to generate the unsigned transaction"));
|
|
86180
88324
|
}
|
|
86181
88325
|
return;
|
|
@@ -86191,7 +88335,7 @@ Error: ${message}`));
|
|
|
86191
88335
|
}
|
|
86192
88336
|
|
|
86193
88337
|
// src/plugins/dflow/index.ts
|
|
86194
|
-
var
|
|
88338
|
+
var capabilities6 = [
|
|
86195
88339
|
{
|
|
86196
88340
|
id: "defi.dflow.swap",
|
|
86197
88341
|
name: "DFlow Swap",
|
|
@@ -86217,7 +88361,7 @@ var dflowPlugin = {
|
|
|
86217
88361
|
cmd.addCommand(createDFlowSwapCommand());
|
|
86218
88362
|
return cmd;
|
|
86219
88363
|
},
|
|
86220
|
-
capabilities:
|
|
88364
|
+
capabilities: capabilities6
|
|
86221
88365
|
};
|
|
86222
88366
|
|
|
86223
88367
|
// src/plugins/index.ts
|
|
@@ -86226,7 +88370,7 @@ var plugins = [
|
|
|
86226
88370
|
kaminoPlugin,
|
|
86227
88371
|
rentPlugin,
|
|
86228
88372
|
consolidatePlugin,
|
|
86229
|
-
|
|
88373
|
+
titanPlugin,
|
|
86230
88374
|
dflowPlugin
|
|
86231
88375
|
];
|
|
86232
88376
|
|
|
@@ -86575,12 +88719,12 @@ function searchCapabilities(keyword) {
|
|
|
86575
88719
|
(cap) => cap.id.toLowerCase().includes(lowerKeyword) || cap.name.toLowerCase().includes(lowerKeyword) || cap.description.toLowerCase().includes(lowerKeyword)
|
|
86576
88720
|
);
|
|
86577
88721
|
}
|
|
86578
|
-
function outputCapabilitiesTable(
|
|
86579
|
-
const table = new
|
|
88722
|
+
function outputCapabilitiesTable(capabilities7) {
|
|
88723
|
+
const table = new import_cli_table38.default({
|
|
86580
88724
|
head: [source_default.cyan.bold("ID"), source_default.cyan.bold("Name"), source_default.cyan.bold("Category"), source_default.cyan.bold("Auth")],
|
|
86581
88725
|
chars: TABLE_CHARS
|
|
86582
88726
|
});
|
|
86583
|
-
for (const cap of
|
|
88727
|
+
for (const cap of capabilities7) {
|
|
86584
88728
|
table.push([
|
|
86585
88729
|
source_default.white(cap.id),
|
|
86586
88730
|
cap.name,
|
|
@@ -86603,7 +88747,7 @@ ${cap.name}`));
|
|
|
86603
88747
|
Command: ${source_default.green(cap.command)}`));
|
|
86604
88748
|
if (cap.params.length > 0) {
|
|
86605
88749
|
console.log(source_default.cyan("\nParameters:"));
|
|
86606
|
-
const table = new
|
|
88750
|
+
const table = new import_cli_table38.default({
|
|
86607
88751
|
head: [source_default.cyan("Name"), source_default.cyan("Type"), source_default.cyan("Required"), source_default.cyan("Default"), source_default.cyan("Description")],
|
|
86608
88752
|
chars: TABLE_CHARS
|
|
86609
88753
|
});
|
|
@@ -86706,7 +88850,7 @@ Available Capabilities (${all.length}):
|
|
|
86706
88850
|
}
|
|
86707
88851
|
|
|
86708
88852
|
// src/cli/commands/wallet.ts
|
|
86709
|
-
var
|
|
88853
|
+
var import_web3122 = __toESM(require_index_cjs(), 1);
|
|
86710
88854
|
init_constants();
|
|
86711
88855
|
init_errors();
|
|
86712
88856
|
|
|
@@ -86743,7 +88887,7 @@ function createWalletCommand() {
|
|
|
86743
88887
|
}
|
|
86744
88888
|
let publicKey3;
|
|
86745
88889
|
try {
|
|
86746
|
-
publicKey3 = new
|
|
88890
|
+
publicKey3 = new import_web3122.PublicKey(walletAddress);
|
|
86747
88891
|
} catch {
|
|
86748
88892
|
outputError({
|
|
86749
88893
|
code: "INVALID_PARAMETER",
|
|
@@ -86756,9 +88900,9 @@ function createWalletCommand() {
|
|
|
86756
88900
|
try {
|
|
86757
88901
|
const configResult = loadConfig();
|
|
86758
88902
|
const rpcUrl = configResult.ok ? configResult.value.rpc_url : SOLANA_RPC_URL;
|
|
86759
|
-
const connection = new
|
|
88903
|
+
const connection = new import_web3122.Connection(rpcUrl);
|
|
86760
88904
|
const lamports = await connection.getBalance(publicKey3);
|
|
86761
|
-
const solBalance = lamports /
|
|
88905
|
+
const solBalance = lamports / import_web3122.LAMPORTS_PER_SOL;
|
|
86762
88906
|
const rawAccounts = [];
|
|
86763
88907
|
const [splResult, t22Result] = await Promise.allSettled([
|
|
86764
88908
|
connection.getTokenAccountsByOwner(publicKey3, { programId: TOKEN_PROGRAM_ID }),
|
|
@@ -86771,7 +88915,7 @@ function createWalletCommand() {
|
|
|
86771
88915
|
if (result.status !== "fulfilled") continue;
|
|
86772
88916
|
for (const { account } of result.value.value) {
|
|
86773
88917
|
const data = account.data;
|
|
86774
|
-
const mint = new
|
|
88918
|
+
const mint = new import_web3122.PublicKey(data.subarray(0, 32)).toBase58();
|
|
86775
88919
|
const amount = data.subarray(64, 72).readBigUInt64LE();
|
|
86776
88920
|
if (amount === 0n) continue;
|
|
86777
88921
|
rawAccounts.push({ mint, amount, isToken2022: isToken20222 });
|
|
@@ -86782,7 +88926,7 @@ function createWalletCommand() {
|
|
|
86782
88926
|
if (uniqueMints.length > 0) {
|
|
86783
88927
|
for (let i = 0; i < uniqueMints.length; i += 100) {
|
|
86784
88928
|
const batch = uniqueMints.slice(i, i + 100);
|
|
86785
|
-
const mintPubkeys = batch.map((m) => new
|
|
88929
|
+
const mintPubkeys = batch.map((m) => new import_web3122.PublicKey(m));
|
|
86786
88930
|
const mintInfos = await connection.getMultipleAccountsInfo(mintPubkeys);
|
|
86787
88931
|
for (let j = 0; j < batch.length; j++) {
|
|
86788
88932
|
const info = mintInfos[j];
|
|
@@ -86932,7 +89076,7 @@ Configuration updated: ${key} = ${value}`);
|
|
|
86932
89076
|
}
|
|
86933
89077
|
|
|
86934
89078
|
// src/cli/commands/swap.ts
|
|
86935
|
-
var
|
|
89079
|
+
var import_web3123 = __toESM(require_index_cjs(), 1);
|
|
86936
89080
|
init_solana();
|
|
86937
89081
|
init_errors();
|
|
86938
89082
|
async function resolveRawAmount(amount, swapMode, inputMint, outputMint, isRaw) {
|
|
@@ -86966,7 +89110,7 @@ function createSwapExecuteCommand() {
|
|
|
86966
89110
|
process.exit(1);
|
|
86967
89111
|
}
|
|
86968
89112
|
try {
|
|
86969
|
-
new
|
|
89113
|
+
new import_web3123.PublicKey(userPublicKey);
|
|
86970
89114
|
} catch {
|
|
86971
89115
|
if (format === "json") {
|
|
86972
89116
|
outputErrorJson({ code: "INVALID_PARAMETER", type: "VALIDATION", message: `Invalid wallet address: ${userPublicKey}`, retryable: false });
|
|
@@ -87057,11 +89201,11 @@ function createSwapCommand() {
|
|
|
87057
89201
|
|
|
87058
89202
|
// src/cli/commands/positions.ts
|
|
87059
89203
|
var import_bn19 = __toESM(require_bn(), 1);
|
|
87060
|
-
var
|
|
89204
|
+
var import_web3125 = __toESM(require_index_cjs(), 1);
|
|
87061
89205
|
init_solana();
|
|
87062
89206
|
|
|
87063
89207
|
// src/core/transaction.ts
|
|
87064
|
-
var
|
|
89208
|
+
var import_web3124 = __toESM(require_index_cjs(), 1);
|
|
87065
89209
|
init_types();
|
|
87066
89210
|
init_errors();
|
|
87067
89211
|
function serializeTransaction(tx) {
|
|
@@ -87144,7 +89288,7 @@ var KNOWN_SYMBOLS = {
|
|
|
87144
89288
|
async function fetchWalletBalanceSummary(owner) {
|
|
87145
89289
|
const connection = getConnection();
|
|
87146
89290
|
const lamports = await connection.getBalance(owner);
|
|
87147
|
-
const solUi = (lamports /
|
|
89291
|
+
const solUi = (lamports / import_web3125.LAMPORTS_PER_SOL).toString();
|
|
87148
89292
|
const rawAccounts = [];
|
|
87149
89293
|
const [splResult, t22Result] = await Promise.allSettled([
|
|
87150
89294
|
connection.getTokenAccountsByOwner(owner, { programId: TOKEN_PROGRAM_ID }),
|
|
@@ -87156,7 +89300,7 @@ async function fetchWalletBalanceSummary(owner) {
|
|
|
87156
89300
|
if (result.status !== "fulfilled") continue;
|
|
87157
89301
|
for (const { account } of result.value.value) {
|
|
87158
89302
|
const data = account.data;
|
|
87159
|
-
const mint = new
|
|
89303
|
+
const mint = new import_web3125.PublicKey(data.subarray(0, 32)).toBase58();
|
|
87160
89304
|
const amount = data.subarray(64, 72).readBigUInt64LE();
|
|
87161
89305
|
if (amount === 0n) continue;
|
|
87162
89306
|
rawAccounts.push({ mint, amount });
|
|
@@ -87167,7 +89311,7 @@ async function fetchWalletBalanceSummary(owner) {
|
|
|
87167
89311
|
if (uniqueMints.length > 0) {
|
|
87168
89312
|
for (let i = 0; i < uniqueMints.length; i += 100) {
|
|
87169
89313
|
const batch = uniqueMints.slice(i, i + 100);
|
|
87170
|
-
const mintPubkeys = batch.map((m) => new
|
|
89314
|
+
const mintPubkeys = batch.map((m) => new import_web3125.PublicKey(m));
|
|
87171
89315
|
const mintInfos = await connection.getMultipleAccountsInfo(mintPubkeys);
|
|
87172
89316
|
for (let j = 0; j < batch.length; j++) {
|
|
87173
89317
|
const info = mintInfos[j];
|
|
@@ -87188,11 +89332,11 @@ async function fetchWalletBalanceSummary(owner) {
|
|
|
87188
89332
|
}
|
|
87189
89333
|
return { sol: solUi, tokens };
|
|
87190
89334
|
}
|
|
87191
|
-
var ASSOCIATED_TOKEN_PROGRAM = new
|
|
89335
|
+
var ASSOCIATED_TOKEN_PROGRAM = new import_web3125.PublicKey(
|
|
87192
89336
|
"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
87193
89337
|
);
|
|
87194
89338
|
function getAtaAddress(owner, mint, tokenProgramId) {
|
|
87195
|
-
const [address] =
|
|
89339
|
+
const [address] = import_web3125.PublicKey.findProgramAddressSync(
|
|
87196
89340
|
[owner.toBuffer(), tokenProgramId.toBuffer(), mint.toBuffer()],
|
|
87197
89341
|
ASSOCIATED_TOKEN_PROGRAM
|
|
87198
89342
|
);
|
|
@@ -87204,7 +89348,7 @@ async function getTokenBalance(owner, mint) {
|
|
|
87204
89348
|
const lamports = await connection.getBalance(owner);
|
|
87205
89349
|
return new import_bn19.default(lamports.toString());
|
|
87206
89350
|
}
|
|
87207
|
-
const mintPk = new
|
|
89351
|
+
const mintPk = new import_web3125.PublicKey(mint);
|
|
87208
89352
|
const ataSpl = getAtaAddress(owner, mintPk, TOKEN_PROGRAM_ID);
|
|
87209
89353
|
const ataT22 = getAtaAddress(owner, mintPk, TOKEN_2022_PROGRAM_ID);
|
|
87210
89354
|
const [splInfo, t22Info] = await Promise.allSettled([
|
|
@@ -87276,7 +89420,7 @@ function createPositionsOpenCommand() {
|
|
|
87276
89420
|
}
|
|
87277
89421
|
process.exit(1);
|
|
87278
89422
|
}
|
|
87279
|
-
const publicKey3 = new
|
|
89423
|
+
const publicKey3 = new import_web3125.PublicKey(walletAddress);
|
|
87280
89424
|
const useAmountUsd = !!options.amountUsd;
|
|
87281
89425
|
const useTokenAmount = !!options.amount;
|
|
87282
89426
|
if (useAmountUsd && useTokenAmount) {
|
|
@@ -87571,7 +89715,7 @@ function createPositionsIncreaseCommand() {
|
|
|
87571
89715
|
}
|
|
87572
89716
|
process.exit(1);
|
|
87573
89717
|
}
|
|
87574
|
-
const publicKey3 = new
|
|
89718
|
+
const publicKey3 = new import_web3125.PublicKey(walletAddress);
|
|
87575
89719
|
const useAmountUsd = !!options.amountUsd;
|
|
87576
89720
|
const useTokenAmount = !!options.amount;
|
|
87577
89721
|
if (useAmountUsd && useTokenAmount) {
|
|
@@ -87624,7 +89768,7 @@ function createPositionsIncreaseCommand() {
|
|
|
87624
89768
|
getAmountAFromAmountB: getAmountAFromAmountB2
|
|
87625
89769
|
} = await Promise.resolve().then(() => (init_esm4(), esm_exports));
|
|
87626
89770
|
const chain = getChain2();
|
|
87627
|
-
const nftMint = new
|
|
89771
|
+
const nftMint = new import_web3125.PublicKey(options.nftMint);
|
|
87628
89772
|
const positionInfo = await chain.getPositionInfoByNftMint(nftMint);
|
|
87629
89773
|
if (!positionInfo) {
|
|
87630
89774
|
const errMsg = `Position not found for NFT mint: ${options.nftMint}`;
|
|
@@ -87908,11 +90052,11 @@ function createPositionsDecreaseCommand() {
|
|
|
87908
90052
|
}
|
|
87909
90053
|
process.exit(1);
|
|
87910
90054
|
}
|
|
87911
|
-
const publicKey3 = new
|
|
90055
|
+
const publicKey3 = new import_web3125.PublicKey(walletAddress);
|
|
87912
90056
|
try {
|
|
87913
90057
|
const { getChain: getChain2 } = await Promise.resolve().then(() => (init_init(), init_exports));
|
|
87914
90058
|
const chain = getChain2();
|
|
87915
|
-
const nftMint = new
|
|
90059
|
+
const nftMint = new import_web3125.PublicKey(options.nftMint);
|
|
87916
90060
|
const positionInfo = await chain.getPositionInfoByNftMint(nftMint);
|
|
87917
90061
|
if (!positionInfo) {
|
|
87918
90062
|
const errMsg = `Position not found for NFT mint: ${options.nftMint}`;
|
|
@@ -88095,11 +90239,11 @@ function createPositionsCloseCommand() {
|
|
|
88095
90239
|
}
|
|
88096
90240
|
process.exit(1);
|
|
88097
90241
|
}
|
|
88098
|
-
const publicKey3 = new
|
|
90242
|
+
const publicKey3 = new import_web3125.PublicKey(walletAddress);
|
|
88099
90243
|
try {
|
|
88100
90244
|
const { getChain: getChain2 } = await Promise.resolve().then(() => (init_init(), init_exports));
|
|
88101
90245
|
const chain = getChain2();
|
|
88102
|
-
const nftMint = new
|
|
90246
|
+
const nftMint = new import_web3125.PublicKey(options.nftMint);
|
|
88103
90247
|
const positionInfo = await chain.getPositionInfoByNftMint(nftMint);
|
|
88104
90248
|
if (!positionInfo) {
|
|
88105
90249
|
const errMsg = `Position not found for NFT mint: ${options.nftMint}`;
|
|
@@ -88631,7 +90775,7 @@ Error: ${errMsg}`));
|
|
|
88631
90775
|
const pool = poolResult.value;
|
|
88632
90776
|
const { getChain: getChain2 } = await Promise.resolve().then(() => (init_init(), init_exports));
|
|
88633
90777
|
const chain = getChain2();
|
|
88634
|
-
const nftMint = new
|
|
90778
|
+
const nftMint = new import_web3125.PublicKey(nftMintStr);
|
|
88635
90779
|
const positionInfo = await chain.getPositionInfoByNftMint(nftMint);
|
|
88636
90780
|
if (!positionInfo) {
|
|
88637
90781
|
const errMsg = `Position not found on-chain for NFT mint: ${nftMintStr}`;
|
|
@@ -88829,9 +90973,9 @@ function createCopyPositionCommand() {
|
|
|
88829
90973
|
}
|
|
88830
90974
|
process.exit(1);
|
|
88831
90975
|
}
|
|
88832
|
-
const publicKey3 = new
|
|
90976
|
+
const publicKey3 = new import_web3125.PublicKey(walletAddress);
|
|
88833
90977
|
try {
|
|
88834
|
-
const positionAddress = new
|
|
90978
|
+
const positionAddress = new import_web3125.PublicKey(options.position);
|
|
88835
90979
|
const { getChain: getChain2 } = await Promise.resolve().then(() => (init_init(), init_exports));
|
|
88836
90980
|
const { calculateTokenAmountsFromUsd: calculateTokenAmountsFromUsd2, getRawPositionInfoByAddress: getRawPositionInfoByAddress2 } = await Promise.resolve().then(() => (init_calculate(), calculate_exports));
|
|
88837
90981
|
const chain = getChain2();
|