@paragraph-com/cli 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1974 -1451
- package/package.json +11 -3
package/dist/index.js
CHANGED
|
@@ -2021,7 +2021,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2021
2021
|
/**
|
|
2022
2022
|
* @private
|
|
2023
2023
|
*/
|
|
2024
|
-
_dispatchSubcommand(commandName, operands,
|
|
2024
|
+
_dispatchSubcommand(commandName, operands, unknown2) {
|
|
2025
2025
|
const subCommand = this._findCommand(commandName);
|
|
2026
2026
|
if (!subCommand) this.help({ error: true });
|
|
2027
2027
|
let promiseChain;
|
|
@@ -2032,9 +2032,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2032
2032
|
);
|
|
2033
2033
|
promiseChain = this._chainOrCall(promiseChain, () => {
|
|
2034
2034
|
if (subCommand._executableHandler) {
|
|
2035
|
-
this._executeSubCommand(subCommand, operands.concat(
|
|
2035
|
+
this._executeSubCommand(subCommand, operands.concat(unknown2));
|
|
2036
2036
|
} else {
|
|
2037
|
-
return subCommand._parseCommand(operands,
|
|
2037
|
+
return subCommand._parseCommand(operands, unknown2);
|
|
2038
2038
|
}
|
|
2039
2039
|
});
|
|
2040
2040
|
return promiseChain;
|
|
@@ -2185,25 +2185,25 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2185
2185
|
*
|
|
2186
2186
|
* @private
|
|
2187
2187
|
*/
|
|
2188
|
-
_parseCommand(operands,
|
|
2189
|
-
const parsed = this.parseOptions(
|
|
2188
|
+
_parseCommand(operands, unknown2) {
|
|
2189
|
+
const parsed = this.parseOptions(unknown2);
|
|
2190
2190
|
this._parseOptionsEnv();
|
|
2191
2191
|
this._parseOptionsImplied();
|
|
2192
2192
|
operands = operands.concat(parsed.operands);
|
|
2193
|
-
|
|
2194
|
-
this.args = operands.concat(
|
|
2193
|
+
unknown2 = parsed.unknown;
|
|
2194
|
+
this.args = operands.concat(unknown2);
|
|
2195
2195
|
if (operands && this._findCommand(operands[0])) {
|
|
2196
|
-
return this._dispatchSubcommand(operands[0], operands.slice(1),
|
|
2196
|
+
return this._dispatchSubcommand(operands[0], operands.slice(1), unknown2);
|
|
2197
2197
|
}
|
|
2198
2198
|
if (this._getHelpCommand() && operands[0] === this._getHelpCommand().name()) {
|
|
2199
2199
|
return this._dispatchHelpCommand(operands[1]);
|
|
2200
2200
|
}
|
|
2201
2201
|
if (this._defaultCommandName) {
|
|
2202
|
-
this._outputHelpIfRequested(
|
|
2202
|
+
this._outputHelpIfRequested(unknown2);
|
|
2203
2203
|
return this._dispatchSubcommand(
|
|
2204
2204
|
this._defaultCommandName,
|
|
2205
2205
|
operands,
|
|
2206
|
-
|
|
2206
|
+
unknown2
|
|
2207
2207
|
);
|
|
2208
2208
|
}
|
|
2209
2209
|
if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) {
|
|
@@ -2229,7 +2229,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2229
2229
|
);
|
|
2230
2230
|
if (this.parent) {
|
|
2231
2231
|
promiseChain = this._chainOrCall(promiseChain, () => {
|
|
2232
|
-
this.parent.emit(commandEvent, operands,
|
|
2232
|
+
this.parent.emit(commandEvent, operands, unknown2);
|
|
2233
2233
|
});
|
|
2234
2234
|
}
|
|
2235
2235
|
promiseChain = this._chainOrCallHooks(promiseChain, "postAction");
|
|
@@ -2238,13 +2238,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2238
2238
|
if (this.parent && this.parent.listenerCount(commandEvent)) {
|
|
2239
2239
|
checkForUnknownOptions();
|
|
2240
2240
|
this._processArguments();
|
|
2241
|
-
this.parent.emit(commandEvent, operands,
|
|
2241
|
+
this.parent.emit(commandEvent, operands, unknown2);
|
|
2242
2242
|
} else if (operands.length) {
|
|
2243
2243
|
if (this._findCommand("*")) {
|
|
2244
|
-
return this._dispatchSubcommand("*", operands,
|
|
2244
|
+
return this._dispatchSubcommand("*", operands, unknown2);
|
|
2245
2245
|
}
|
|
2246
2246
|
if (this.listenerCount("command:*")) {
|
|
2247
|
-
this.emit("command:*", operands,
|
|
2247
|
+
this.emit("command:*", operands, unknown2);
|
|
2248
2248
|
} else if (this.commands.length) {
|
|
2249
2249
|
this.unknownCommand();
|
|
2250
2250
|
} else {
|
|
@@ -2349,7 +2349,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2349
2349
|
*/
|
|
2350
2350
|
parseOptions(argv) {
|
|
2351
2351
|
const operands = [];
|
|
2352
|
-
const
|
|
2352
|
+
const unknown2 = [];
|
|
2353
2353
|
let dest = operands;
|
|
2354
2354
|
const args2 = argv.slice();
|
|
2355
2355
|
function maybeOption(arg) {
|
|
@@ -2359,7 +2359,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2359
2359
|
while (args2.length) {
|
|
2360
2360
|
const arg = args2.shift();
|
|
2361
2361
|
if (arg === "--") {
|
|
2362
|
-
if (dest ===
|
|
2362
|
+
if (dest === unknown2) dest.push(arg);
|
|
2363
2363
|
dest.push(...args2);
|
|
2364
2364
|
break;
|
|
2365
2365
|
}
|
|
@@ -2409,20 +2409,20 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2409
2409
|
}
|
|
2410
2410
|
}
|
|
2411
2411
|
if (maybeOption(arg)) {
|
|
2412
|
-
dest =
|
|
2412
|
+
dest = unknown2;
|
|
2413
2413
|
}
|
|
2414
|
-
if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 &&
|
|
2414
|
+
if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown2.length === 0) {
|
|
2415
2415
|
if (this._findCommand(arg)) {
|
|
2416
2416
|
operands.push(arg);
|
|
2417
|
-
if (args2.length > 0)
|
|
2417
|
+
if (args2.length > 0) unknown2.push(...args2);
|
|
2418
2418
|
break;
|
|
2419
2419
|
} else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) {
|
|
2420
2420
|
operands.push(arg);
|
|
2421
2421
|
if (args2.length > 0) operands.push(...args2);
|
|
2422
2422
|
break;
|
|
2423
2423
|
} else if (this._defaultCommandName) {
|
|
2424
|
-
|
|
2425
|
-
if (args2.length > 0)
|
|
2424
|
+
unknown2.push(arg);
|
|
2425
|
+
if (args2.length > 0) unknown2.push(...args2);
|
|
2426
2426
|
break;
|
|
2427
2427
|
}
|
|
2428
2428
|
}
|
|
@@ -2433,7 +2433,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2433
2433
|
}
|
|
2434
2434
|
dest.push(arg);
|
|
2435
2435
|
}
|
|
2436
|
-
return { operands, unknown };
|
|
2436
|
+
return { operands, unknown: unknown2 };
|
|
2437
2437
|
}
|
|
2438
2438
|
/**
|
|
2439
2439
|
* Return an object containing local option values as key-value pairs.
|
|
@@ -3074,17 +3074,17 @@ var require_picocolors = __commonJS({
|
|
|
3074
3074
|
var env = p.env || {};
|
|
3075
3075
|
var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
3076
3076
|
var formatter = (open, close, replace = open) => (input) => {
|
|
3077
|
-
let
|
|
3078
|
-
return ~index2 ? open + replaceClose(
|
|
3077
|
+
let string2 = "" + input, index2 = string2.indexOf(close, open.length);
|
|
3078
|
+
return ~index2 ? open + replaceClose(string2, close, replace, index2) + close : open + string2 + close;
|
|
3079
3079
|
};
|
|
3080
|
-
var replaceClose = (
|
|
3080
|
+
var replaceClose = (string2, close, replace, index2) => {
|
|
3081
3081
|
let result = "", cursor = 0;
|
|
3082
3082
|
do {
|
|
3083
|
-
result +=
|
|
3083
|
+
result += string2.substring(cursor, index2) + replace;
|
|
3084
3084
|
cursor = index2 + close.length;
|
|
3085
|
-
index2 =
|
|
3085
|
+
index2 = string2.indexOf(close, cursor);
|
|
3086
3086
|
} while (~index2);
|
|
3087
|
-
return result +
|
|
3087
|
+
return result + string2.substring(cursor);
|
|
3088
3088
|
};
|
|
3089
3089
|
var createColors = (enabled = isColorSupported) => {
|
|
3090
3090
|
let f = enabled ? formatter : () => String;
|
|
@@ -12941,11 +12941,11 @@ var require_sign = __commonJS({
|
|
|
12941
12941
|
"node_modules/math-intrinsics/sign.js"(exports, module) {
|
|
12942
12942
|
"use strict";
|
|
12943
12943
|
var $isNaN = require_isNaN();
|
|
12944
|
-
module.exports = function sign(
|
|
12945
|
-
if ($isNaN(
|
|
12946
|
-
return
|
|
12944
|
+
module.exports = function sign(number2) {
|
|
12945
|
+
if ($isNaN(number2) || number2 === 0) {
|
|
12946
|
+
return number2;
|
|
12947
12947
|
}
|
|
12948
|
-
return
|
|
12948
|
+
return number2 < 0 ? -1 : 1;
|
|
12949
12949
|
};
|
|
12950
12950
|
}
|
|
12951
12951
|
});
|
|
@@ -13516,17 +13516,17 @@ var require_get_intrinsic = __commonJS({
|
|
|
13516
13516
|
var $exec = bind2.call($call, RegExp.prototype.exec);
|
|
13517
13517
|
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
13518
13518
|
var reEscapeChar = /\\(\\)?/g;
|
|
13519
|
-
var stringToPath = function stringToPath2(
|
|
13520
|
-
var first = $strSlice(
|
|
13521
|
-
var last = $strSlice(
|
|
13519
|
+
var stringToPath = function stringToPath2(string2) {
|
|
13520
|
+
var first = $strSlice(string2, 0, 1);
|
|
13521
|
+
var last = $strSlice(string2, -1);
|
|
13522
13522
|
if (first === "%" && last !== "%") {
|
|
13523
13523
|
throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
|
|
13524
13524
|
} else if (last === "%" && first !== "%") {
|
|
13525
13525
|
throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
|
|
13526
13526
|
}
|
|
13527
13527
|
var result = [];
|
|
13528
|
-
$replace(
|
|
13529
|
-
result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") :
|
|
13528
|
+
$replace(string2, rePropName, function(match, number2, quote, subString) {
|
|
13529
|
+
result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number2 || match;
|
|
13530
13530
|
});
|
|
13531
13531
|
return result;
|
|
13532
13532
|
};
|
|
@@ -13638,22 +13638,22 @@ var require_es_set_tostringtag = __commonJS({
|
|
|
13638
13638
|
var hasOwn = require_hasown();
|
|
13639
13639
|
var $TypeError = require_type();
|
|
13640
13640
|
var toStringTag2 = hasToStringTag ? Symbol.toStringTag : null;
|
|
13641
|
-
module.exports = function setToStringTag(
|
|
13641
|
+
module.exports = function setToStringTag(object2, value) {
|
|
13642
13642
|
var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force;
|
|
13643
13643
|
var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable;
|
|
13644
13644
|
if (typeof overrideIfSet !== "undefined" && typeof overrideIfSet !== "boolean" || typeof nonConfigurable !== "undefined" && typeof nonConfigurable !== "boolean") {
|
|
13645
13645
|
throw new $TypeError("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");
|
|
13646
13646
|
}
|
|
13647
|
-
if (toStringTag2 && (overrideIfSet || !hasOwn(
|
|
13647
|
+
if (toStringTag2 && (overrideIfSet || !hasOwn(object2, toStringTag2))) {
|
|
13648
13648
|
if ($defineProperty) {
|
|
13649
|
-
$defineProperty(
|
|
13649
|
+
$defineProperty(object2, toStringTag2, {
|
|
13650
13650
|
configurable: !nonConfigurable,
|
|
13651
13651
|
enumerable: false,
|
|
13652
13652
|
value,
|
|
13653
13653
|
writable: false
|
|
13654
13654
|
});
|
|
13655
13655
|
} else {
|
|
13656
|
-
|
|
13656
|
+
object2[toStringTag2] = value;
|
|
13657
13657
|
}
|
|
13658
13658
|
}
|
|
13659
13659
|
};
|
|
@@ -19004,8 +19004,8 @@ var init_errors = __esm({
|
|
|
19004
19004
|
});
|
|
19005
19005
|
|
|
19006
19006
|
// node_modules/abitype/dist/esm/regex.js
|
|
19007
|
-
function execTyped(regex,
|
|
19008
|
-
const match = regex.exec(
|
|
19007
|
+
function execTyped(regex, string2) {
|
|
19008
|
+
const match = regex.exec(string2);
|
|
19009
19009
|
return match?.groups;
|
|
19010
19010
|
}
|
|
19011
19011
|
var bytesRegex, integerRegex, isTupleRegex;
|
|
@@ -19744,13 +19744,13 @@ function resolveStructs(abiParameters = [], structs = {}, ancestors = /* @__PURE
|
|
|
19744
19744
|
const match = execTyped(typeWithoutTupleRegex, abiParameter.type);
|
|
19745
19745
|
if (!match?.type)
|
|
19746
19746
|
throw new InvalidAbiTypeParameterError({ abiParameter });
|
|
19747
|
-
const { array, type } = match;
|
|
19747
|
+
const { array: array2, type } = match;
|
|
19748
19748
|
if (type in structs) {
|
|
19749
19749
|
if (ancestors.has(type))
|
|
19750
19750
|
throw new CircularReferenceError({ type });
|
|
19751
19751
|
components.push({
|
|
19752
19752
|
...abiParameter,
|
|
19753
|
-
type: `tuple${
|
|
19753
|
+
type: `tuple${array2 ?? ""}`,
|
|
19754
19754
|
components: resolveStructs(structs[type], structs, /* @__PURE__ */ new Set([...ancestors, type]))
|
|
19755
19755
|
});
|
|
19756
19756
|
} else {
|
|
@@ -20530,8 +20530,8 @@ function hexToBool(hex_, opts = {}) {
|
|
|
20530
20530
|
}
|
|
20531
20531
|
function hexToNumber(hex, opts = {}) {
|
|
20532
20532
|
const value = hexToBigInt(hex, opts);
|
|
20533
|
-
const
|
|
20534
|
-
if (!Number.isSafeInteger(
|
|
20533
|
+
const number2 = Number(value);
|
|
20534
|
+
if (!Number.isSafeInteger(number2))
|
|
20535
20535
|
throw new IntegerOutOfRangeError({
|
|
20536
20536
|
max: `${Number.MAX_SAFE_INTEGER}`,
|
|
20537
20537
|
min: `${Number.MIN_SAFE_INTEGER}`,
|
|
@@ -20539,7 +20539,7 @@ function hexToNumber(hex, opts = {}) {
|
|
|
20539
20539
|
size: opts.size,
|
|
20540
20540
|
value: `${value}n`
|
|
20541
20541
|
});
|
|
20542
|
-
return
|
|
20542
|
+
return number2;
|
|
20543
20543
|
}
|
|
20544
20544
|
var init_fromHex = __esm({
|
|
20545
20545
|
"node_modules/viem/_esm/utils/encoding/fromHex.js"() {
|
|
@@ -20570,11 +20570,11 @@ function boolToHex(value, opts = {}) {
|
|
|
20570
20570
|
return hex;
|
|
20571
20571
|
}
|
|
20572
20572
|
function bytesToHex(value, opts = {}) {
|
|
20573
|
-
let
|
|
20573
|
+
let string2 = "";
|
|
20574
20574
|
for (let i = 0; i < value.length; i++) {
|
|
20575
|
-
|
|
20575
|
+
string2 += hexes[value[i]];
|
|
20576
20576
|
}
|
|
20577
|
-
const hex = `0x${
|
|
20577
|
+
const hex = `0x${string2}`;
|
|
20578
20578
|
if (typeof opts.size === "number") {
|
|
20579
20579
|
assertSize(hex, { size: opts.size });
|
|
20580
20580
|
return pad(hex, { dir: "right", size: opts.size });
|
|
@@ -23983,7 +23983,7 @@ function hexToBytes2(hex) {
|
|
|
23983
23983
|
const al = hl / 2;
|
|
23984
23984
|
if (hl % 2)
|
|
23985
23985
|
throw new Error("hex string expected, got unpadded hex of length " + hl);
|
|
23986
|
-
const
|
|
23986
|
+
const array2 = new Uint8Array(al);
|
|
23987
23987
|
for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {
|
|
23988
23988
|
const n1 = asciiToBase16(hex.charCodeAt(hi));
|
|
23989
23989
|
const n2 = asciiToBase16(hex.charCodeAt(hi + 1));
|
|
@@ -23991,9 +23991,9 @@ function hexToBytes2(hex) {
|
|
|
23991
23991
|
const char = hex[hi] + hex[hi + 1];
|
|
23992
23992
|
throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi);
|
|
23993
23993
|
}
|
|
23994
|
-
|
|
23994
|
+
array2[ai] = n1 * 16 + n2;
|
|
23995
23995
|
}
|
|
23996
|
-
return
|
|
23996
|
+
return array2;
|
|
23997
23997
|
}
|
|
23998
23998
|
function bytesToNumberBE(bytes) {
|
|
23999
23999
|
return hexToNumber2(bytesToHex2(bytes));
|
|
@@ -24107,15 +24107,15 @@ function createHmacDrbg(hashLen, qByteLen, hmacFn) {
|
|
|
24107
24107
|
};
|
|
24108
24108
|
return genUntil;
|
|
24109
24109
|
}
|
|
24110
|
-
function validateObject(
|
|
24110
|
+
function validateObject(object2, validators3, optValidators = {}) {
|
|
24111
24111
|
const checkField = (fieldName, type, isOptional) => {
|
|
24112
24112
|
const checkVal = validatorFns[type];
|
|
24113
24113
|
if (typeof checkVal !== "function")
|
|
24114
24114
|
throw new Error("invalid validator function");
|
|
24115
|
-
const val =
|
|
24115
|
+
const val = object2[fieldName];
|
|
24116
24116
|
if (isOptional && val === void 0)
|
|
24117
24117
|
return;
|
|
24118
|
-
if (!checkVal(val,
|
|
24118
|
+
if (!checkVal(val, object2)) {
|
|
24119
24119
|
throw new Error("param " + String(fieldName) + " is invalid. Expected " + type + ", got " + val);
|
|
24120
24120
|
}
|
|
24121
24121
|
};
|
|
@@ -24123,7 +24123,7 @@ function validateObject(object, validators3, optValidators = {}) {
|
|
|
24123
24123
|
checkField(fieldName, type, false);
|
|
24124
24124
|
for (const [fieldName, type] of Object.entries(optValidators))
|
|
24125
24125
|
checkField(fieldName, type, true);
|
|
24126
|
-
return
|
|
24126
|
+
return object2;
|
|
24127
24127
|
}
|
|
24128
24128
|
function memoized(fn) {
|
|
24129
24129
|
const map = /* @__PURE__ */ new WeakMap();
|
|
@@ -24158,7 +24158,7 @@ var init_utils6 = __esm({
|
|
|
24158
24158
|
stringOrUint8Array: (val) => typeof val === "string" || isBytes2(val),
|
|
24159
24159
|
isSafeInteger: (val) => Number.isSafeInteger(val),
|
|
24160
24160
|
array: (val) => Array.isArray(val),
|
|
24161
|
-
field: (val,
|
|
24161
|
+
field: (val, object2) => object2.Fp.isValid(val),
|
|
24162
24162
|
hash: (val) => typeof val === "function" && Number.isSafeInteger(val.outputLen)
|
|
24163
24163
|
};
|
|
24164
24164
|
}
|
|
@@ -24177,12 +24177,12 @@ function pow2(x, power, modulo) {
|
|
|
24177
24177
|
}
|
|
24178
24178
|
return res;
|
|
24179
24179
|
}
|
|
24180
|
-
function invert(
|
|
24181
|
-
if (
|
|
24180
|
+
function invert(number2, modulo) {
|
|
24181
|
+
if (number2 === _0n3)
|
|
24182
24182
|
throw new Error("invert: expected non-zero number");
|
|
24183
24183
|
if (modulo <= _0n3)
|
|
24184
24184
|
throw new Error("invert: expected positive modulus, got " + modulo);
|
|
24185
|
-
let a = mod(
|
|
24185
|
+
let a = mod(number2, modulo);
|
|
24186
24186
|
let b = modulo;
|
|
24187
24187
|
let x = _0n3, y = _1n3, u = _1n3, v = _0n3;
|
|
24188
24188
|
while (a !== _0n3) {
|
|
@@ -25195,9 +25195,9 @@ function weierstrass(curveDef) {
|
|
|
25195
25195
|
}
|
|
25196
25196
|
}
|
|
25197
25197
|
});
|
|
25198
|
-
function isBiggerThanHalfOrder(
|
|
25198
|
+
function isBiggerThanHalfOrder(number2) {
|
|
25199
25199
|
const HALF = CURVE_ORDER >> _1n5;
|
|
25200
|
-
return
|
|
25200
|
+
return number2 > HALF;
|
|
25201
25201
|
}
|
|
25202
25202
|
function normalizeS(s) {
|
|
25203
25203
|
return isBiggerThanHalfOrder(s) ? modN2(-s) : s;
|
|
@@ -28913,10 +28913,10 @@ function fromBoolean(value, options = {}) {
|
|
|
28913
28913
|
return hex;
|
|
28914
28914
|
}
|
|
28915
28915
|
function fromBytes(value, options = {}) {
|
|
28916
|
-
let
|
|
28916
|
+
let string2 = "";
|
|
28917
28917
|
for (let i = 0; i < value.length; i++)
|
|
28918
|
-
|
|
28919
|
-
const hex = `0x${
|
|
28918
|
+
string2 += hexes3[value[i]];
|
|
28919
|
+
const hex = `0x${string2}`;
|
|
28920
28920
|
if (typeof options.size === "number") {
|
|
28921
28921
|
assertSize3(hex, options.size);
|
|
28922
28922
|
return padRight(hex, options.size);
|
|
@@ -37392,18 +37392,540 @@ var init_chains = __esm({
|
|
|
37392
37392
|
}
|
|
37393
37393
|
});
|
|
37394
37394
|
|
|
37395
|
-
// node_modules/@
|
|
37396
|
-
|
|
37397
|
-
|
|
37398
|
-
|
|
37395
|
+
// node_modules/@paragraph-com/sdk/dist/index.mjs
|
|
37396
|
+
import * as zod from "zod";
|
|
37397
|
+
function singleItemResult(item) {
|
|
37398
|
+
return {
|
|
37399
|
+
items: [item],
|
|
37400
|
+
pagination: {
|
|
37401
|
+
hasMore: false,
|
|
37402
|
+
total: 1
|
|
37403
|
+
}
|
|
37404
|
+
};
|
|
37405
|
+
}
|
|
37406
|
+
function wrapAPIWithAuth(api, apiKey, setCurrentApiKey2) {
|
|
37407
|
+
const wrapped = {};
|
|
37408
|
+
for (const [key, method] of Object.entries(api)) {
|
|
37409
|
+
if (typeof method === "function") {
|
|
37410
|
+
wrapped[key] = (...args2) => {
|
|
37411
|
+
setCurrentApiKey2(apiKey);
|
|
37412
|
+
return method(...args2);
|
|
37413
|
+
};
|
|
37414
|
+
}
|
|
37399
37415
|
}
|
|
37400
|
-
|
|
37401
|
-
|
|
37402
|
-
|
|
37403
|
-
|
|
37404
|
-
|
|
37405
|
-
|
|
37416
|
+
return wrapped;
|
|
37417
|
+
}
|
|
37418
|
+
function getEip712Domain2(chainId, verifyingContract) {
|
|
37419
|
+
return {
|
|
37420
|
+
name: "Permit2",
|
|
37421
|
+
chainId,
|
|
37422
|
+
verifyingContract
|
|
37423
|
+
};
|
|
37424
|
+
}
|
|
37425
|
+
async function signPermit(permit, walletClient, chainId, permit2Address) {
|
|
37426
|
+
const signature = await walletClient.signTypedData({
|
|
37427
|
+
account: walletClient.account,
|
|
37428
|
+
domain: getEip712Domain2(chainId, permit2Address),
|
|
37429
|
+
types: PERMIT2_PERMIT_TYPE,
|
|
37430
|
+
primaryType: "PermitSingle",
|
|
37431
|
+
message: permit
|
|
37432
|
+
});
|
|
37433
|
+
return signature;
|
|
37434
|
+
}
|
|
37435
|
+
var AXIOS_INSTANCE, currentApiKey, setCurrentApiKey, customAxios, getParagraphAPI, QueryResult, executeAbi, permit2Abi, AuthResource, GENERATED_DOPPLER_DEPLOYMENTS, CHAIN_IDS, ZERO_ADDRESS, ADDRESSES, SUPPORTED_CHAIN_IDS, Q96, Q192, PRICE_PRECISION, WAD, SECONDS_PER_DAY, SECONDS_PER_YEAR, DEFAULT_AUCTION_DURATION, DEFAULT_V3_VESTING_DURATION, DEFAULT_V3_INITIAL_SUPPLY, DEFAULT_V3_NUM_TOKENS_TO_SELL, DEFAULT_V3_YEARLY_MINT_RATE, DEFAULT_V3_PRE_MINT, DEFAULT_V3_MAX_SHARE_TO_BE_SOLD, DEFAULT_V4_YEARLY_MINT_RATE, DEFAULT_MULTICURVE_LOWER_TICKS, DEFAULT_MULTICURVE_UPPER_TICKS, DEFAULT_MULTICURVE_NUM_POSITIONS, DEFAULT_MULTICURVE_MAX_SUPPLY_SHARES, FLAG_MASK, DOPPLER_FLAGS, MAX_UINT128, MARKET_CAP_PRESETS, NO_OP_ENABLED_CHAIN_IDS, DEFAULT_AIRLOCK_BENEFICIARY_SHARES, Eth, PERMIT2_PERMIT_TYPE, permit2Abi2, CommandType, PERMIT_STRUCT, ABI_DEFINITION, CommandBuilder, V4ActionType, POOL_KEY_STRUCT, PATH_KEY_STRUCT, ABI_DEFINITION2, CoinsResource, FeedResource, MeResource, PostsResource, PublicationsResource, SearchResource, SubscribersResource, UsersResource, getPublicationByIdParams, getPublicationByIdResponseSlugMax, getPublicationByIdResponseSummaryMax, getPublicationByIdResponse, getPublicationBySlugPathSlugMax, getPublicationBySlugParams, getPublicationBySlugResponseSlugMax, getPublicationBySlugResponseSummaryMax, getPublicationBySlugResponse, getPublicationByDomainParams, getPublicationByDomainResponseSlugMax, getPublicationByDomainResponseSummaryMax, getPublicationByDomainResponse, getSubscriberCountParams, getSubscriberCountResponse, getPostsFeedQueryLimitDefault, getPostsFeedQueryLimitMax, getPostsFeedQueryParams, getPostsFeedResponseItemsItemPostTitleMax, getPostsFeedResponseItemsItemPostSubtitleMax, getPostsFeedResponseItemsItemPostSlugMax, getPostsFeedResponseItemsItemPostAuthorsItemWalletAddressRegExp, getPostsFeedResponseItemsItemPostAuthorsItemBioMax, getPostsFeedResponseItemsItemPublicationSlugMax, getPostsFeedResponseItemsItemPublicationSummaryMax, getPostsFeedResponseItemsItemUserWalletAddressRegExp, getPostsFeedResponseItemsItemUserBioMax, getPostsFeedResponse, getPostsByTagParams, getPostsByTagQueryLimitDefault, getPostsByTagQueryLimitMax, getPostsByTagQueryParams, getPostsByTagResponseItemsItemTitleMax, getPostsByTagResponseItemsItemSubtitleMax, getPostsByTagResponseItemsItemSlugMax, getPostsByTagResponseItemsItemAuthorsItemWalletAddressRegExp, getPostsByTagResponseItemsItemAuthorsItemBioMax, getPostsByTagResponse, getPostsParams, getPostsQueryLimitDefault, getPostsQueryLimitMax, getPostsQueryParams, getPostsResponseItemsItemTitleMax, getPostsResponseItemsItemSubtitleMax, getPostsResponseItemsItemSlugMax, getPostsResponseItemsItemAuthorsItemWalletAddressRegExp, getPostsResponseItemsItemAuthorsItemBioMax, getPostsResponse, getPostByIdParams, getPostByIdQueryParams, getPostByIdResponseTitleMax, getPostByIdResponseSubtitleMax, getPostByIdResponseSlugMax, getPostByIdResponseAuthorsItemWalletAddressRegExp, getPostByIdResponseAuthorsItemBioMax, getPostByIdResponse, updatePostParams, updatePostBodyTitleMax, updatePostBodySubtitleMax, updatePostBodySlugMax, updatePostBodyPostPreviewMax, updatePostBody, updatePostResponse, deletePostParams, deletePostBody, deletePostResponse, getPostByPublicationIdAndPostSlugPathPostSlugMax, getPostByPublicationIdAndPostSlugParams, getPostByPublicationIdAndPostSlugQueryParams, getPostByPublicationIdAndPostSlugResponseTitleMax, getPostByPublicationIdAndPostSlugResponseSubtitleMax, getPostByPublicationIdAndPostSlugResponseSlugMax, getPostByPublicationIdAndPostSlugResponseAuthorsItemWalletAddressRegExp, getPostByPublicationIdAndPostSlugResponseAuthorsItemBioMax, getPostByPublicationIdAndPostSlugResponse, getPostByPublicationSlugAndPostSlugPathPublicationSlugMax, getPostByPublicationSlugAndPostSlugPathPostSlugMax, getPostByPublicationSlugAndPostSlugParams, getPostByPublicationSlugAndPostSlugQueryParams, getPostByPublicationSlugAndPostSlugResponseTitleMax, getPostByPublicationSlugAndPostSlugResponseSubtitleMax, getPostByPublicationSlugAndPostSlugResponseSlugMax, getPostByPublicationSlugAndPostSlugResponseAuthorsItemWalletAddressRegExp, getPostByPublicationSlugAndPostSlugResponseAuthorsItemBioMax, getPostByPublicationSlugAndPostSlugResponse, createPostBodyTitleMax, createPostBodySubtitleMax, createPostBodySlugMax, createPostBodyPostPreviewMax, createPostBody, createPostResponse, listOwnPostsQueryLimitDefault, listOwnPostsQueryLimitMax, listOwnPostsQueryParams, listOwnPostsResponseItemsItemTitleMax, listOwnPostsResponseItemsItemSubtitleMax, listOwnPostsResponseItemsItemSlugMax, listOwnPostsResponseItemsItemAuthorsItemWalletAddressRegExp, listOwnPostsResponseItemsItemAuthorsItemBioMax, listOwnPostsResponse, updatePostBySlugPathSlugMax, updatePostBySlugParams, updatePostBySlugBodyTitleMax, updatePostBySlugBodySubtitleMax, updatePostBySlugBodySlugMax, updatePostBySlugBodyPostPreviewMax, updatePostBySlugBody, updatePostBySlugResponse, deletePostBySlugPathSlugMax, deletePostBySlugParams, deletePostBySlugBody, deletePostBySlugResponse, sendTestEmailParams, sendTestEmailBody, sendTestEmailResponse, getMeResponseSlugMax, getMeResponseSummaryMax, getMeResponse, getUserParams, getUserResponseWalletAddressRegExp, getUserResponseBioMax, getUserResponse, getUserByWalletPathWalletAddressRegExp, getUserByWalletParams, getUserByWalletResponseWalletAddressRegExp, getUserByWalletResponseBioMax, getUserByWalletResponse, getCoinParams, getCoinResponseContractAddressRegExp, getCoinResponse, getCoinByContractPathContractAddressRegExp, getCoinByContractParams, getCoinByContractResponseContractAddressRegExp, getCoinByContractResponse, getCoinHoldersByIdParams, getCoinHoldersByIdQueryLimitDefault, getCoinHoldersByIdQueryLimitMax, getCoinHoldersByIdQueryParams, getCoinHoldersByIdResponseItemsItemWalletAddressRegExp, getCoinHoldersByIdResponseItemsItemBalanceRegExp, getCoinHoldersByIdResponse, getCoinHoldersByContractPathContractAddressRegExp, getCoinHoldersByContractParams, getCoinHoldersByContractQueryLimitDefault, getCoinHoldersByContractQueryLimitMax, getCoinHoldersByContractQueryParams, getCoinHoldersByContractResponseItemsItemWalletAddressRegExp, getCoinHoldersByContractResponseItemsItemBalanceRegExp, getCoinHoldersByContractResponse, getBuyArgsByIdParams, getBuyArgsByIdQueryWalletAddressRegExp, getBuyArgsByIdQueryAmountRegExp, getBuyArgsByIdQueryParams, getBuyArgsByIdResponseCommandsRegExp, getBuyArgsByIdResponseInputsItemRegExp, getBuyArgsByIdResponse, getBuyArgsByContractPathContractAddressRegExp, getBuyArgsByContractParams, getBuyArgsByContractQueryWalletAddressRegExp, getBuyArgsByContractQueryAmountRegExp, getBuyArgsByContractQueryParams, getBuyArgsByContractResponseCommandsRegExp, getBuyArgsByContractResponseInputsItemRegExp, getBuyArgsByContractResponse, getSellArgsByIdParams, getSellArgsByIdQueryWalletAddressRegExp, getSellArgsByIdQueryAmountRegExp, getSellArgsByIdQueryParams, getSellArgsByIdResponseCommandsRegExp, getSellArgsByIdResponseInputsItemRegExp, getSellArgsByIdResponse, getSellArgsByContractPathContractAddressRegExp, getSellArgsByContractParams, getSellArgsByContractQueryWalletAddressRegExp, getSellArgsByContractQueryAmountRegExp, getSellArgsByContractQueryParams, getSellArgsByContractResponseCommandsRegExp, getSellArgsByContractResponseInputsItemRegExp, getSellArgsByContractResponse, getQuoteByIdParams, getQuoteByIdQueryAmountRegExp, getQuoteByIdQueryParams, getQuoteByIdResponse, getQuoteByContractParams, getQuoteByContractQueryAmountRegExp, getQuoteByContractQueryParams, getQuoteByContractResponse, getPopularCoinsResponseCoinsItemContractAddressRegExp, getPopularCoinsResponse, importSubscribersBody, importSubscribersResponse, addSubscriberBodyWalletRegExp, addSubscriberBody, addSubscriberResponse, listSubscribersQueryLimitDefault, listSubscribersQueryLimitMax, listSubscribersQueryParams, listSubscribersResponseItemsItemWalletAddressRegExp, listSubscribersResponse, searchPostsQueryParams, searchPostsResponseItem, searchPostsResponse, searchBlogsQueryParams, searchBlogsResponseItem, searchBlogsResponse, searchCoinsQueryParams, searchCoinsResponseItem, searchCoinsResponse, createAuthSessionBodyDeviceNameMax, createAuthSessionBodyCallbackUrlMax, createAuthSessionBody, getAuthSessionParams, getAuthSessionResponse, deleteAuthSessionParams, deleteAuthSessionResponse, ParagraphAPI;
|
|
37436
|
+
var init_dist = __esm({
|
|
37437
|
+
"node_modules/@paragraph-com/sdk/dist/index.mjs"() {
|
|
37406
37438
|
"use strict";
|
|
37439
|
+
init_axios2();
|
|
37440
|
+
init_esm2();
|
|
37441
|
+
init_esm2();
|
|
37442
|
+
init_chains();
|
|
37443
|
+
init_esm2();
|
|
37444
|
+
init_esm2();
|
|
37445
|
+
init_esm2();
|
|
37446
|
+
init_esm2();
|
|
37447
|
+
AXIOS_INSTANCE = axios_default.create({
|
|
37448
|
+
baseURL: "https://public.api.paragraph.com/api"
|
|
37449
|
+
});
|
|
37450
|
+
setCurrentApiKey = (apiKey) => {
|
|
37451
|
+
currentApiKey = apiKey;
|
|
37452
|
+
};
|
|
37453
|
+
customAxios = (config) => {
|
|
37454
|
+
const source = axios_default.CancelToken.source();
|
|
37455
|
+
const headers = { ...config.headers };
|
|
37456
|
+
if (currentApiKey) {
|
|
37457
|
+
headers.Authorization = `Bearer ${currentApiKey}`;
|
|
37458
|
+
}
|
|
37459
|
+
const promise = AXIOS_INSTANCE({
|
|
37460
|
+
...config,
|
|
37461
|
+
headers,
|
|
37462
|
+
cancelToken: source.token
|
|
37463
|
+
}).then(({ data }) => data);
|
|
37464
|
+
promise.cancel = () => {
|
|
37465
|
+
source.cancel("Query was cancelled");
|
|
37466
|
+
};
|
|
37467
|
+
return promise;
|
|
37468
|
+
};
|
|
37469
|
+
getParagraphAPI = () => {
|
|
37470
|
+
const getPublicationById = (publicationId) => {
|
|
37471
|
+
return customAxios(
|
|
37472
|
+
{
|
|
37473
|
+
url: `/v1/publications/${publicationId}`,
|
|
37474
|
+
method: "GET"
|
|
37475
|
+
}
|
|
37476
|
+
);
|
|
37477
|
+
};
|
|
37478
|
+
const getPublicationBySlug = (slug) => {
|
|
37479
|
+
return customAxios(
|
|
37480
|
+
{
|
|
37481
|
+
url: `/v1/publications/slug/${slug}`,
|
|
37482
|
+
method: "GET"
|
|
37483
|
+
}
|
|
37484
|
+
);
|
|
37485
|
+
};
|
|
37486
|
+
const getPublicationByDomain2 = (domain) => {
|
|
37487
|
+
return customAxios(
|
|
37488
|
+
{
|
|
37489
|
+
url: `/v1/publications/domain/${domain}`,
|
|
37490
|
+
method: "GET"
|
|
37491
|
+
}
|
|
37492
|
+
);
|
|
37493
|
+
};
|
|
37494
|
+
const getSubscriberCount2 = (publicationId) => {
|
|
37495
|
+
return customAxios(
|
|
37496
|
+
{
|
|
37497
|
+
url: `/v1/publications/${publicationId}/subscribers/count`,
|
|
37498
|
+
method: "GET"
|
|
37499
|
+
}
|
|
37500
|
+
);
|
|
37501
|
+
};
|
|
37502
|
+
const getPostsFeed = (params) => {
|
|
37503
|
+
return customAxios(
|
|
37504
|
+
{
|
|
37505
|
+
url: `/v1/posts/feed`,
|
|
37506
|
+
method: "GET",
|
|
37507
|
+
params
|
|
37508
|
+
}
|
|
37509
|
+
);
|
|
37510
|
+
};
|
|
37511
|
+
const getPostsByTag2 = (tag, params) => {
|
|
37512
|
+
return customAxios(
|
|
37513
|
+
{
|
|
37514
|
+
url: `/v1/posts/tag/${tag}`,
|
|
37515
|
+
method: "GET",
|
|
37516
|
+
params
|
|
37517
|
+
}
|
|
37518
|
+
);
|
|
37519
|
+
};
|
|
37520
|
+
const getPosts = (publicationId, params) => {
|
|
37521
|
+
return customAxios(
|
|
37522
|
+
{
|
|
37523
|
+
url: `/v1/publications/${publicationId}/posts`,
|
|
37524
|
+
method: "GET",
|
|
37525
|
+
params
|
|
37526
|
+
}
|
|
37527
|
+
);
|
|
37528
|
+
};
|
|
37529
|
+
const getPostById = (postId, params) => {
|
|
37530
|
+
return customAxios(
|
|
37531
|
+
{
|
|
37532
|
+
url: `/v1/posts/${postId}`,
|
|
37533
|
+
method: "GET",
|
|
37534
|
+
params
|
|
37535
|
+
}
|
|
37536
|
+
);
|
|
37537
|
+
};
|
|
37538
|
+
const updatePost2 = (postId, updatePostBody2) => {
|
|
37539
|
+
return customAxios(
|
|
37540
|
+
{
|
|
37541
|
+
url: `/v1/posts/${postId}`,
|
|
37542
|
+
method: "PUT",
|
|
37543
|
+
headers: { "Content-Type": "application/json" },
|
|
37544
|
+
data: updatePostBody2
|
|
37545
|
+
}
|
|
37546
|
+
);
|
|
37547
|
+
};
|
|
37548
|
+
const deletePost2 = (postId, deletePostBody2) => {
|
|
37549
|
+
return customAxios(
|
|
37550
|
+
{
|
|
37551
|
+
url: `/v1/posts/${postId}`,
|
|
37552
|
+
method: "DELETE",
|
|
37553
|
+
headers: { "Content-Type": "application/json" },
|
|
37554
|
+
data: deletePostBody2
|
|
37555
|
+
}
|
|
37556
|
+
);
|
|
37557
|
+
};
|
|
37558
|
+
const getPostByPublicationIdAndPostSlug = (publicationId, postSlug, params) => {
|
|
37559
|
+
return customAxios(
|
|
37560
|
+
{
|
|
37561
|
+
url: `/v1/publications/${publicationId}/posts/slug/${postSlug}`,
|
|
37562
|
+
method: "GET",
|
|
37563
|
+
params
|
|
37564
|
+
}
|
|
37565
|
+
);
|
|
37566
|
+
};
|
|
37567
|
+
const getPostByPublicationSlugAndPostSlug = (publicationSlug, postSlug, params) => {
|
|
37568
|
+
return customAxios(
|
|
37569
|
+
{
|
|
37570
|
+
url: `/v1/publications/slug/${publicationSlug}/posts/slug/${postSlug}`,
|
|
37571
|
+
method: "GET",
|
|
37572
|
+
params
|
|
37573
|
+
}
|
|
37574
|
+
);
|
|
37575
|
+
};
|
|
37576
|
+
const createPost2 = (createPostBody2) => {
|
|
37577
|
+
return customAxios(
|
|
37578
|
+
{
|
|
37579
|
+
url: `/v1/posts`,
|
|
37580
|
+
method: "POST",
|
|
37581
|
+
headers: { "Content-Type": "application/json" },
|
|
37582
|
+
data: createPostBody2
|
|
37583
|
+
}
|
|
37584
|
+
);
|
|
37585
|
+
};
|
|
37586
|
+
const listOwnPosts = (params) => {
|
|
37587
|
+
return customAxios(
|
|
37588
|
+
{
|
|
37589
|
+
url: `/v1/posts`,
|
|
37590
|
+
method: "GET",
|
|
37591
|
+
params
|
|
37592
|
+
}
|
|
37593
|
+
);
|
|
37594
|
+
};
|
|
37595
|
+
const updatePostBySlug = (slug, updatePostBySlugBody2) => {
|
|
37596
|
+
return customAxios(
|
|
37597
|
+
{
|
|
37598
|
+
url: `/v1/posts/slug/${slug}`,
|
|
37599
|
+
method: "PUT",
|
|
37600
|
+
headers: { "Content-Type": "application/json" },
|
|
37601
|
+
data: updatePostBySlugBody2
|
|
37602
|
+
}
|
|
37603
|
+
);
|
|
37604
|
+
};
|
|
37605
|
+
const deletePostBySlug = (slug, deletePostBySlugBody2) => {
|
|
37606
|
+
return customAxios(
|
|
37607
|
+
{
|
|
37608
|
+
url: `/v1/posts/slug/${slug}`,
|
|
37609
|
+
method: "DELETE",
|
|
37610
|
+
headers: { "Content-Type": "application/json" },
|
|
37611
|
+
data: deletePostBySlugBody2
|
|
37612
|
+
}
|
|
37613
|
+
);
|
|
37614
|
+
};
|
|
37615
|
+
const sendTestEmail2 = (postId, sendTestEmailBody2) => {
|
|
37616
|
+
return customAxios(
|
|
37617
|
+
{
|
|
37618
|
+
url: `/v1/posts/${postId}/test-email`,
|
|
37619
|
+
method: "POST",
|
|
37620
|
+
headers: { "Content-Type": "application/json" },
|
|
37621
|
+
data: sendTestEmailBody2
|
|
37622
|
+
}
|
|
37623
|
+
);
|
|
37624
|
+
};
|
|
37625
|
+
const getMe = () => {
|
|
37626
|
+
return customAxios(
|
|
37627
|
+
{
|
|
37628
|
+
url: `/v1/me`,
|
|
37629
|
+
method: "GET"
|
|
37630
|
+
}
|
|
37631
|
+
);
|
|
37632
|
+
};
|
|
37633
|
+
const getUser2 = (userId) => {
|
|
37634
|
+
return customAxios(
|
|
37635
|
+
{
|
|
37636
|
+
url: `/v1/users/${userId}`,
|
|
37637
|
+
method: "GET"
|
|
37638
|
+
}
|
|
37639
|
+
);
|
|
37640
|
+
};
|
|
37641
|
+
const getUserByWallet = (walletAddress) => {
|
|
37642
|
+
return customAxios(
|
|
37643
|
+
{
|
|
37644
|
+
url: `/v1/users/wallet/${walletAddress}`,
|
|
37645
|
+
method: "GET"
|
|
37646
|
+
}
|
|
37647
|
+
);
|
|
37648
|
+
};
|
|
37649
|
+
const getCoin2 = (id) => {
|
|
37650
|
+
return customAxios(
|
|
37651
|
+
{
|
|
37652
|
+
url: `/v1/coins/${id}`,
|
|
37653
|
+
method: "GET"
|
|
37654
|
+
}
|
|
37655
|
+
);
|
|
37656
|
+
};
|
|
37657
|
+
const getCoinByContract = (contractAddress) => {
|
|
37658
|
+
return customAxios(
|
|
37659
|
+
{
|
|
37660
|
+
url: `/v1/coins/contract/${contractAddress}`,
|
|
37661
|
+
method: "GET"
|
|
37662
|
+
}
|
|
37663
|
+
);
|
|
37664
|
+
};
|
|
37665
|
+
const getCoinHoldersById = (id, params) => {
|
|
37666
|
+
return customAxios(
|
|
37667
|
+
{
|
|
37668
|
+
url: `/v1/coins/${id}/holders`,
|
|
37669
|
+
method: "GET",
|
|
37670
|
+
params
|
|
37671
|
+
}
|
|
37672
|
+
);
|
|
37673
|
+
};
|
|
37674
|
+
const getCoinHoldersByContract = (contractAddress, params) => {
|
|
37675
|
+
return customAxios(
|
|
37676
|
+
{
|
|
37677
|
+
url: `/v1/coins/contract/${contractAddress}/holders`,
|
|
37678
|
+
method: "GET",
|
|
37679
|
+
params
|
|
37680
|
+
}
|
|
37681
|
+
);
|
|
37682
|
+
};
|
|
37683
|
+
const getBuyArgsById = (id, params) => {
|
|
37684
|
+
return customAxios(
|
|
37685
|
+
{
|
|
37686
|
+
url: `/v1/coins/buy/${id}`,
|
|
37687
|
+
method: "GET",
|
|
37688
|
+
params
|
|
37689
|
+
}
|
|
37690
|
+
);
|
|
37691
|
+
};
|
|
37692
|
+
const getBuyArgsByContract = (contractAddress, params) => {
|
|
37693
|
+
return customAxios(
|
|
37694
|
+
{
|
|
37695
|
+
url: `/v1/coins/buy/contract/${contractAddress}`,
|
|
37696
|
+
method: "GET",
|
|
37697
|
+
params
|
|
37698
|
+
}
|
|
37699
|
+
);
|
|
37700
|
+
};
|
|
37701
|
+
const getSellArgsById = (id, params) => {
|
|
37702
|
+
return customAxios(
|
|
37703
|
+
{
|
|
37704
|
+
url: `/v1/coins/sell/${id}`,
|
|
37705
|
+
method: "GET",
|
|
37706
|
+
params
|
|
37707
|
+
}
|
|
37708
|
+
);
|
|
37709
|
+
};
|
|
37710
|
+
const getSellArgsByContract = (contractAddress, params) => {
|
|
37711
|
+
return customAxios(
|
|
37712
|
+
{
|
|
37713
|
+
url: `/v1/coins/sell/contract/${contractAddress}`,
|
|
37714
|
+
method: "GET",
|
|
37715
|
+
params
|
|
37716
|
+
}
|
|
37717
|
+
);
|
|
37718
|
+
};
|
|
37719
|
+
const getQuoteById = (id, params) => {
|
|
37720
|
+
return customAxios(
|
|
37721
|
+
{
|
|
37722
|
+
url: `/v1/coins/quote/${id}`,
|
|
37723
|
+
method: "GET",
|
|
37724
|
+
params
|
|
37725
|
+
}
|
|
37726
|
+
);
|
|
37727
|
+
};
|
|
37728
|
+
const getQuoteByContract = (contractAddress, params) => {
|
|
37729
|
+
return customAxios(
|
|
37730
|
+
{
|
|
37731
|
+
url: `/v1/coins/quote/contract/${contractAddress}`,
|
|
37732
|
+
method: "GET",
|
|
37733
|
+
params
|
|
37734
|
+
}
|
|
37735
|
+
);
|
|
37736
|
+
};
|
|
37737
|
+
const getPopularCoins2 = () => {
|
|
37738
|
+
return customAxios(
|
|
37739
|
+
{
|
|
37740
|
+
url: `/v1/coins/list/popular`,
|
|
37741
|
+
method: "GET"
|
|
37742
|
+
}
|
|
37743
|
+
);
|
|
37744
|
+
};
|
|
37745
|
+
const importSubscribers2 = (importSubscribersBody2) => {
|
|
37746
|
+
const formData = new FormData();
|
|
37747
|
+
if (importSubscribersBody2.file !== void 0) {
|
|
37748
|
+
formData.append(`file`, importSubscribersBody2.file);
|
|
37749
|
+
}
|
|
37750
|
+
return customAxios(
|
|
37751
|
+
{
|
|
37752
|
+
url: `/v1/subscribers/import`,
|
|
37753
|
+
method: "POST",
|
|
37754
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
37755
|
+
data: formData
|
|
37756
|
+
}
|
|
37757
|
+
);
|
|
37758
|
+
};
|
|
37759
|
+
const addSubscriber2 = (addSubscriberBody2) => {
|
|
37760
|
+
return customAxios(
|
|
37761
|
+
{
|
|
37762
|
+
url: `/v1/subscribers`,
|
|
37763
|
+
method: "POST",
|
|
37764
|
+
headers: { "Content-Type": "application/json" },
|
|
37765
|
+
data: addSubscriberBody2
|
|
37766
|
+
}
|
|
37767
|
+
);
|
|
37768
|
+
};
|
|
37769
|
+
const listSubscribers2 = (params) => {
|
|
37770
|
+
return customAxios(
|
|
37771
|
+
{
|
|
37772
|
+
url: `/v1/subscribers`,
|
|
37773
|
+
method: "GET",
|
|
37774
|
+
params
|
|
37775
|
+
}
|
|
37776
|
+
);
|
|
37777
|
+
};
|
|
37778
|
+
const searchPosts2 = (params) => {
|
|
37779
|
+
return customAxios(
|
|
37780
|
+
{
|
|
37781
|
+
url: `/v1/discover/search`,
|
|
37782
|
+
method: "GET",
|
|
37783
|
+
params
|
|
37784
|
+
}
|
|
37785
|
+
);
|
|
37786
|
+
};
|
|
37787
|
+
const searchBlogs2 = (params) => {
|
|
37788
|
+
return customAxios(
|
|
37789
|
+
{
|
|
37790
|
+
url: `/v1/discover/blogs/search`,
|
|
37791
|
+
method: "GET",
|
|
37792
|
+
params
|
|
37793
|
+
}
|
|
37794
|
+
);
|
|
37795
|
+
};
|
|
37796
|
+
const searchCoins2 = (params) => {
|
|
37797
|
+
return customAxios(
|
|
37798
|
+
{
|
|
37799
|
+
url: `/v1/discover/coins/search`,
|
|
37800
|
+
method: "GET",
|
|
37801
|
+
params
|
|
37802
|
+
}
|
|
37803
|
+
);
|
|
37804
|
+
};
|
|
37805
|
+
const createAuthSession = (createAuthSessionBody2) => {
|
|
37806
|
+
return customAxios(
|
|
37807
|
+
{
|
|
37808
|
+
url: `/v1/api/auth/sessions`,
|
|
37809
|
+
method: "POST",
|
|
37810
|
+
headers: { "Content-Type": "application/json" },
|
|
37811
|
+
data: createAuthSessionBody2
|
|
37812
|
+
}
|
|
37813
|
+
);
|
|
37814
|
+
};
|
|
37815
|
+
const getAuthSession = (sessionId) => {
|
|
37816
|
+
return customAxios(
|
|
37817
|
+
{
|
|
37818
|
+
url: `/v1/api/auth/sessions/${sessionId}`,
|
|
37819
|
+
method: "GET"
|
|
37820
|
+
}
|
|
37821
|
+
);
|
|
37822
|
+
};
|
|
37823
|
+
const deleteAuthSession = (sessionId) => {
|
|
37824
|
+
return customAxios(
|
|
37825
|
+
{
|
|
37826
|
+
url: `/v1/api/auth/sessions/${sessionId}`,
|
|
37827
|
+
method: "DELETE"
|
|
37828
|
+
}
|
|
37829
|
+
);
|
|
37830
|
+
};
|
|
37831
|
+
return { getPublicationById, getPublicationBySlug, getPublicationByDomain: getPublicationByDomain2, getSubscriberCount: getSubscriberCount2, getPostsFeed, getPostsByTag: getPostsByTag2, getPosts, getPostById, updatePost: updatePost2, deletePost: deletePost2, getPostByPublicationIdAndPostSlug, getPostByPublicationSlugAndPostSlug, createPost: createPost2, listOwnPosts, updatePostBySlug, deletePostBySlug, sendTestEmail: sendTestEmail2, getMe, getUser: getUser2, getUserByWallet, getCoin: getCoin2, getCoinByContract, getCoinHoldersById, getCoinHoldersByContract, getBuyArgsById, getBuyArgsByContract, getSellArgsById, getSellArgsByContract, getQuoteById, getQuoteByContract, getPopularCoins: getPopularCoins2, importSubscribers: importSubscribers2, addSubscriber: addSubscriber2, listSubscribers: listSubscribers2, searchPosts: searchPosts2, searchBlogs: searchBlogs2, searchCoins: searchCoins2, createAuthSession, getAuthSession, deleteAuthSession };
|
|
37832
|
+
};
|
|
37833
|
+
QueryResult = class {
|
|
37834
|
+
constructor(promise) {
|
|
37835
|
+
this.promise = promise;
|
|
37836
|
+
}
|
|
37837
|
+
/**
|
|
37838
|
+
* Implements PromiseLike interface, allowing QueryResult to be awaited directly.
|
|
37839
|
+
*/
|
|
37840
|
+
then(onfulfilled, onrejected) {
|
|
37841
|
+
return this.promise.then(onfulfilled, onrejected);
|
|
37842
|
+
}
|
|
37843
|
+
/**
|
|
37844
|
+
* Returns the first item from the result.
|
|
37845
|
+
* Use this when you expect a single result (e.g., getting by ID).
|
|
37846
|
+
*
|
|
37847
|
+
* @throws Error if no items are returned
|
|
37848
|
+
* @returns A promise that resolves to a single item
|
|
37849
|
+
*/
|
|
37850
|
+
async single() {
|
|
37851
|
+
const result = await this.promise;
|
|
37852
|
+
if (result.items.length === 0) {
|
|
37853
|
+
throw new Error("No items found");
|
|
37854
|
+
}
|
|
37855
|
+
return result.items[0];
|
|
37856
|
+
}
|
|
37857
|
+
};
|
|
37858
|
+
executeAbi = [
|
|
37859
|
+
{
|
|
37860
|
+
type: "function",
|
|
37861
|
+
name: "execute",
|
|
37862
|
+
inputs: [
|
|
37863
|
+
{ name: "commands", type: "bytes", internalType: "bytes" },
|
|
37864
|
+
{ name: "inputs", type: "bytes[]", internalType: "bytes[]" }
|
|
37865
|
+
],
|
|
37866
|
+
outputs: [],
|
|
37867
|
+
stateMutability: "payable"
|
|
37868
|
+
}
|
|
37869
|
+
];
|
|
37870
|
+
permit2Abi = parseAbi([
|
|
37871
|
+
"function allowance(address user, address token, address spender) external view returns (uint160 amount, uint48 expiration, uint48 nonce)"
|
|
37872
|
+
]);
|
|
37873
|
+
AuthResource = class {
|
|
37874
|
+
constructor(api) {
|
|
37875
|
+
this.api = api;
|
|
37876
|
+
}
|
|
37877
|
+
/**
|
|
37878
|
+
* Creates a new browser-based auth session for CLI or other API clients.
|
|
37879
|
+
* The returned verification URL should be opened in the user's browser to complete authentication.
|
|
37880
|
+
*
|
|
37881
|
+
* @example
|
|
37882
|
+
* ```ts
|
|
37883
|
+
* const api = new ParagraphAPI();
|
|
37884
|
+
* const session = await api.auth.createSession({ deviceName: "my-cli" });
|
|
37885
|
+
* console.log("Open this URL to authenticate:", session.verificationUrl);
|
|
37886
|
+
* ```
|
|
37887
|
+
*
|
|
37888
|
+
* @param body - Optional body with a device name.
|
|
37889
|
+
* @returns A promise that resolves to the session ID, verification URL, and expiry.
|
|
37890
|
+
*/
|
|
37891
|
+
createSession(body = {}) {
|
|
37892
|
+
return this.api.createAuthSession(body);
|
|
37893
|
+
}
|
|
37894
|
+
/**
|
|
37895
|
+
* Polls the status of an auth session.
|
|
37896
|
+
* Returns the API key once the session has been approved in the browser.
|
|
37897
|
+
*
|
|
37898
|
+
* @example
|
|
37899
|
+
* ```ts
|
|
37900
|
+
* const api = new ParagraphAPI();
|
|
37901
|
+
* const status = await api.auth.getSession("sessionId");
|
|
37902
|
+
* if (status.status === "completed") {
|
|
37903
|
+
* console.log("API key:", status.apiKey);
|
|
37904
|
+
* }
|
|
37905
|
+
* ```
|
|
37906
|
+
*
|
|
37907
|
+
* @param sessionId - The session ID returned from `createSession`.
|
|
37908
|
+
* @returns A promise that resolves to the session status (pending, completed with apiKey, or expired).
|
|
37909
|
+
*/
|
|
37910
|
+
getSession(sessionId) {
|
|
37911
|
+
return this.api.getAuthSession(sessionId);
|
|
37912
|
+
}
|
|
37913
|
+
/**
|
|
37914
|
+
* Cancels a pending auth session. Only pending sessions can be denied.
|
|
37915
|
+
*
|
|
37916
|
+
* @example
|
|
37917
|
+
* ```ts
|
|
37918
|
+
* const api = new ParagraphAPI();
|
|
37919
|
+
* await api.auth.deleteSession("sessionId");
|
|
37920
|
+
* ```
|
|
37921
|
+
*
|
|
37922
|
+
* @param sessionId - The session ID to deny.
|
|
37923
|
+
* @returns A promise that resolves to `{ success: true }` on success.
|
|
37924
|
+
*/
|
|
37925
|
+
deleteSession(sessionId) {
|
|
37926
|
+
return this.api.deleteAuthSession(sessionId);
|
|
37927
|
+
}
|
|
37928
|
+
};
|
|
37407
37929
|
GENERATED_DOPPLER_DEPLOYMENTS = {
|
|
37408
37930
|
"130": {
|
|
37409
37931
|
"Airlock": "0x77EbfBAE15AD200758E9E2E61597c0B07d731254",
|
|
@@ -37544,15 +38066,6 @@ var init_chunk_FPAI4QYW = __esm({
|
|
|
37544
38066
|
"WETH": "0x660eAaEdEBc968f8f3694354FA8EC0b4c5Ba8D12"
|
|
37545
38067
|
}
|
|
37546
38068
|
};
|
|
37547
|
-
}
|
|
37548
|
-
});
|
|
37549
|
-
|
|
37550
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-AW3WR2D3.mjs
|
|
37551
|
-
var CHAIN_IDS, ZERO_ADDRESS, ADDRESSES, SUPPORTED_CHAIN_IDS;
|
|
37552
|
-
var init_chunk_AW3WR2D3 = __esm({
|
|
37553
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-AW3WR2D3.mjs"() {
|
|
37554
|
-
"use strict";
|
|
37555
|
-
init_chunk_FPAI4QYW();
|
|
37556
38069
|
CHAIN_IDS = {
|
|
37557
38070
|
MAINNET: 1,
|
|
37558
38071
|
BASE: 8453,
|
|
@@ -37774,92 +38287,9 @@ var init_chunk_AW3WR2D3 = __esm({
|
|
|
37774
38287
|
}
|
|
37775
38288
|
};
|
|
37776
38289
|
SUPPORTED_CHAIN_IDS = Object.values(CHAIN_IDS);
|
|
37777
|
-
}
|
|
37778
|
-
});
|
|
37779
|
-
|
|
37780
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-J5BFFL3X.mjs
|
|
37781
|
-
var init_chunk_J5BFFL3X = __esm({
|
|
37782
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-J5BFFL3X.mjs"() {
|
|
37783
|
-
"use strict";
|
|
37784
|
-
init_chunk_OTG75GVH();
|
|
37785
|
-
init_chunk_AW3WR2D3();
|
|
37786
|
-
}
|
|
37787
|
-
});
|
|
37788
|
-
|
|
37789
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-ZH44DHVR.mjs
|
|
37790
|
-
var init_chunk_ZH44DHVR = __esm({
|
|
37791
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-ZH44DHVR.mjs"() {
|
|
37792
|
-
"use strict";
|
|
37793
|
-
}
|
|
37794
|
-
});
|
|
37795
|
-
|
|
37796
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-MNXD45J7.mjs
|
|
37797
|
-
var init_chunk_MNXD45J7 = __esm({
|
|
37798
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-MNXD45J7.mjs"() {
|
|
37799
|
-
"use strict";
|
|
37800
|
-
init_chunk_ZH44DHVR();
|
|
37801
|
-
init_chunk_OTG75GVH();
|
|
37802
|
-
init_chunk_AW3WR2D3();
|
|
37803
|
-
}
|
|
37804
|
-
});
|
|
37805
|
-
|
|
37806
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-AKSEBAR7.mjs
|
|
37807
|
-
var init_chunk_AKSEBAR7 = __esm({
|
|
37808
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-AKSEBAR7.mjs"() {
|
|
37809
|
-
"use strict";
|
|
37810
|
-
init_chunk_OTG75GVH();
|
|
37811
|
-
init_chunk_AW3WR2D3();
|
|
37812
|
-
}
|
|
37813
|
-
});
|
|
37814
|
-
|
|
37815
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-EDJBZPMW.mjs
|
|
37816
|
-
var init_chunk_EDJBZPMW = __esm({
|
|
37817
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-EDJBZPMW.mjs"() {
|
|
37818
|
-
"use strict";
|
|
37819
|
-
init_chunk_OTG75GVH();
|
|
37820
|
-
init_chunk_AW3WR2D3();
|
|
37821
|
-
}
|
|
37822
|
-
});
|
|
37823
|
-
|
|
37824
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-NZ4BJ2IC.mjs
|
|
37825
|
-
var init_chunk_NZ4BJ2IC = __esm({
|
|
37826
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-NZ4BJ2IC.mjs"() {
|
|
37827
|
-
"use strict";
|
|
37828
|
-
init_chunk_OTG75GVH();
|
|
37829
|
-
}
|
|
37830
|
-
});
|
|
37831
|
-
|
|
37832
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-MNJ5OYPE.mjs
|
|
37833
|
-
var init_chunk_MNJ5OYPE = __esm({
|
|
37834
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-MNJ5OYPE.mjs"() {
|
|
37835
|
-
"use strict";
|
|
37836
|
-
}
|
|
37837
|
-
});
|
|
37838
|
-
|
|
37839
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-NNNCVFOH.mjs
|
|
37840
|
-
var init_chunk_NNNCVFOH = __esm({
|
|
37841
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-NNNCVFOH.mjs"() {
|
|
37842
|
-
"use strict";
|
|
37843
|
-
}
|
|
37844
|
-
});
|
|
37845
|
-
|
|
37846
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-KDT76YQE.mjs
|
|
37847
|
-
var Q96, Q192, PRICE_PRECISION;
|
|
37848
|
-
var init_chunk_KDT76YQE = __esm({
|
|
37849
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-KDT76YQE.mjs"() {
|
|
37850
|
-
"use strict";
|
|
37851
38290
|
Q96 = 2n ** 96n;
|
|
37852
38291
|
Q192 = Q96 * Q96;
|
|
37853
38292
|
PRICE_PRECISION = 10n ** 18n;
|
|
37854
|
-
}
|
|
37855
|
-
});
|
|
37856
|
-
|
|
37857
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-QKO2FZGN.mjs
|
|
37858
|
-
var WAD, SECONDS_PER_DAY, SECONDS_PER_YEAR, DEFAULT_AUCTION_DURATION, DEFAULT_V3_VESTING_DURATION, DEFAULT_V3_INITIAL_SUPPLY, DEFAULT_V3_NUM_TOKENS_TO_SELL, DEFAULT_V3_YEARLY_MINT_RATE, DEFAULT_V3_PRE_MINT, DEFAULT_V3_MAX_SHARE_TO_BE_SOLD, DEFAULT_V4_YEARLY_MINT_RATE, DEFAULT_MULTICURVE_LOWER_TICKS, DEFAULT_MULTICURVE_UPPER_TICKS, DEFAULT_MULTICURVE_NUM_POSITIONS, DEFAULT_MULTICURVE_MAX_SUPPLY_SHARES, FLAG_MASK, DOPPLER_FLAGS;
|
|
37859
|
-
var init_chunk_QKO2FZGN = __esm({
|
|
37860
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-QKO2FZGN.mjs"() {
|
|
37861
|
-
"use strict";
|
|
37862
|
-
init_esm2();
|
|
37863
38293
|
WAD = 10n ** 18n;
|
|
37864
38294
|
SECONDS_PER_DAY = 86400;
|
|
37865
38295
|
SECONDS_PER_YEAR = 365 * SECONDS_PER_DAY;
|
|
@@ -37892,39 +38322,7 @@ var init_chunk_QKO2FZGN = __esm({
|
|
|
37892
38322
|
1 << 5
|
|
37893
38323
|
// BEFORE_DONATE_FLAG
|
|
37894
38324
|
);
|
|
37895
|
-
}
|
|
37896
|
-
});
|
|
37897
|
-
|
|
37898
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-4TROGENW.mjs
|
|
37899
|
-
var init_chunk_4TROGENW = __esm({
|
|
37900
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-4TROGENW.mjs"() {
|
|
37901
|
-
"use strict";
|
|
37902
|
-
}
|
|
37903
|
-
});
|
|
37904
|
-
|
|
37905
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-TKSHYEYA.mjs
|
|
37906
|
-
var MAX_UINT128;
|
|
37907
|
-
var init_chunk_TKSHYEYA = __esm({
|
|
37908
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-TKSHYEYA.mjs"() {
|
|
37909
|
-
"use strict";
|
|
37910
|
-
init_chunk_MNJ5OYPE();
|
|
37911
|
-
init_chunk_NNNCVFOH();
|
|
37912
|
-
init_chunk_KDT76YQE();
|
|
37913
|
-
init_chunk_OTG75GVH();
|
|
37914
|
-
init_chunk_QKO2FZGN();
|
|
37915
|
-
init_chunk_AW3WR2D3();
|
|
37916
|
-
init_chunk_4TROGENW();
|
|
37917
38325
|
MAX_UINT128 = (1n << 128n) - 1n;
|
|
37918
|
-
}
|
|
37919
|
-
});
|
|
37920
|
-
|
|
37921
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-Q5ERW5ZW.mjs
|
|
37922
|
-
var MARKET_CAP_PRESETS;
|
|
37923
|
-
var init_chunk_Q5ERW5ZW = __esm({
|
|
37924
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-Q5ERW5ZW.mjs"() {
|
|
37925
|
-
"use strict";
|
|
37926
|
-
init_chunk_KDT76YQE();
|
|
37927
|
-
init_chunk_QKO2FZGN();
|
|
37928
38326
|
MARKET_CAP_PRESETS = {
|
|
37929
38327
|
low: {
|
|
37930
38328
|
tickLower: DEFAULT_MULTICURVE_LOWER_TICKS[0],
|
|
@@ -37945,24 +38343,6 @@ var init_chunk_Q5ERW5ZW = __esm({
|
|
|
37945
38343
|
shares: DEFAULT_MULTICURVE_MAX_SUPPLY_SHARES[2]
|
|
37946
38344
|
}
|
|
37947
38345
|
};
|
|
37948
|
-
}
|
|
37949
|
-
});
|
|
37950
|
-
|
|
37951
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-64AWG57M.mjs
|
|
37952
|
-
var init_chunk_64AWG57M = __esm({
|
|
37953
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-64AWG57M.mjs"() {
|
|
37954
|
-
"use strict";
|
|
37955
|
-
init_chunk_NNNCVFOH();
|
|
37956
|
-
init_chunk_KDT76YQE();
|
|
37957
|
-
}
|
|
37958
|
-
});
|
|
37959
|
-
|
|
37960
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-OZ6DGBRL.mjs
|
|
37961
|
-
var NO_OP_ENABLED_CHAIN_IDS;
|
|
37962
|
-
var init_chunk_OZ6DGBRL = __esm({
|
|
37963
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-OZ6DGBRL.mjs"() {
|
|
37964
|
-
"use strict";
|
|
37965
|
-
init_chunk_AW3WR2D3();
|
|
37966
38346
|
NO_OP_ENABLED_CHAIN_IDS = [
|
|
37967
38347
|
CHAIN_IDS.BASE,
|
|
37968
38348
|
CHAIN_IDS.BASE_SEPOLIA,
|
|
@@ -37971,76 +38351,7 @@ var init_chunk_OZ6DGBRL = __esm({
|
|
|
37971
38351
|
CHAIN_IDS.MONAD_TESTNET,
|
|
37972
38352
|
CHAIN_IDS.MONAD_MAINNET
|
|
37973
38353
|
];
|
|
37974
|
-
}
|
|
37975
|
-
});
|
|
37976
|
-
|
|
37977
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-MCOK3UFR.mjs
|
|
37978
|
-
var init_chunk_MCOK3UFR = __esm({
|
|
37979
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-MCOK3UFR.mjs"() {
|
|
37980
|
-
"use strict";
|
|
37981
|
-
init_chunk_Q5ERW5ZW();
|
|
37982
|
-
init_chunk_MNJ5OYPE();
|
|
37983
|
-
init_chunk_64AWG57M();
|
|
37984
|
-
init_chunk_QKO2FZGN();
|
|
37985
|
-
init_chunk_OZ6DGBRL();
|
|
37986
|
-
}
|
|
37987
|
-
});
|
|
37988
|
-
|
|
37989
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-AULFBXM5.mjs
|
|
37990
|
-
var init_chunk_AULFBXM5 = __esm({
|
|
37991
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-AULFBXM5.mjs"() {
|
|
37992
|
-
"use strict";
|
|
37993
|
-
init_chunk_Q5ERW5ZW();
|
|
37994
|
-
init_chunk_64AWG57M();
|
|
37995
|
-
init_chunk_QKO2FZGN();
|
|
37996
|
-
init_chunk_OZ6DGBRL();
|
|
37997
|
-
}
|
|
37998
|
-
});
|
|
37999
|
-
|
|
38000
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-SP5M57BG.mjs
|
|
38001
|
-
var init_chunk_SP5M57BG = __esm({
|
|
38002
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-SP5M57BG.mjs"() {
|
|
38003
|
-
"use strict";
|
|
38004
|
-
init_chunk_Q5ERW5ZW();
|
|
38005
|
-
init_chunk_64AWG57M();
|
|
38006
|
-
init_chunk_QKO2FZGN();
|
|
38007
|
-
init_chunk_OZ6DGBRL();
|
|
38008
|
-
}
|
|
38009
|
-
});
|
|
38010
|
-
|
|
38011
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-M4WMHD3X.mjs
|
|
38012
|
-
var DEFAULT_AIRLOCK_BENEFICIARY_SHARES;
|
|
38013
|
-
var init_chunk_M4WMHD3X = __esm({
|
|
38014
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-M4WMHD3X.mjs"() {
|
|
38015
|
-
"use strict";
|
|
38016
|
-
init_chunk_AW3WR2D3();
|
|
38017
38354
|
DEFAULT_AIRLOCK_BENEFICIARY_SHARES = BigInt(5e16);
|
|
38018
|
-
}
|
|
38019
|
-
});
|
|
38020
|
-
|
|
38021
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-D2RBCFNW.mjs
|
|
38022
|
-
var init_chunk_D2RBCFNW = __esm({
|
|
38023
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-D2RBCFNW.mjs"() {
|
|
38024
|
-
"use strict";
|
|
38025
|
-
init_chunk_J5BFFL3X();
|
|
38026
|
-
init_chunk_MNXD45J7();
|
|
38027
|
-
init_chunk_AKSEBAR7();
|
|
38028
|
-
init_chunk_EDJBZPMW();
|
|
38029
|
-
init_chunk_NZ4BJ2IC();
|
|
38030
|
-
init_chunk_TKSHYEYA();
|
|
38031
|
-
init_chunk_MCOK3UFR();
|
|
38032
|
-
init_chunk_AULFBXM5();
|
|
38033
|
-
init_chunk_SP5M57BG();
|
|
38034
|
-
init_chunk_M4WMHD3X();
|
|
38035
|
-
}
|
|
38036
|
-
});
|
|
38037
|
-
|
|
38038
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-PAPXGPJB.mjs
|
|
38039
|
-
var Eth;
|
|
38040
|
-
var init_chunk_PAPXGPJB = __esm({
|
|
38041
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-PAPXGPJB.mjs"() {
|
|
38042
|
-
"use strict";
|
|
38043
|
-
init_esm2();
|
|
38044
38355
|
Eth = class {
|
|
38045
38356
|
get rpc() {
|
|
38046
38357
|
return this.publicClient;
|
|
@@ -38075,999 +38386,363 @@ var init_chunk_PAPXGPJB = __esm({
|
|
|
38075
38386
|
*
|
|
38076
38387
|
* @remarks
|
|
38077
38388
|
* ETH doesn't have an allowance mechanism, so this returns max uint256 value
|
|
38078
|
-
* to represent unlimited approval in systems expecting ERC20-like interfaces
|
|
38079
|
-
*/
|
|
38080
|
-
async getAllowance() {
|
|
38081
|
-
return 2n ** 256n - 1n;
|
|
38082
|
-
}
|
|
38083
|
-
/**
|
|
38084
|
-
* Get the ETH balance of a specified account
|
|
38085
|
-
* @param account - Address of the account to query
|
|
38086
|
-
* @returns Promise resolving to the account's ETH balance in wei
|
|
38087
|
-
*/
|
|
38088
|
-
async getBalanceOf(account) {
|
|
38089
|
-
return await this.rpc.getBalance({
|
|
38090
|
-
address: account
|
|
38091
|
-
});
|
|
38092
|
-
}
|
|
38093
|
-
};
|
|
38094
|
-
Eth.address = zeroAddress;
|
|
38095
|
-
|
|
38096
|
-
|
|
38097
|
-
|
|
38098
|
-
|
|
38099
|
-
|
|
38100
|
-
|
|
38101
|
-
"use strict";
|
|
38102
|
-
init_chunk_4TROGENW();
|
|
38103
|
-
}
|
|
38104
|
-
});
|
|
38105
|
-
|
|
38106
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-ECD4FV3A.mjs
|
|
38107
|
-
var init_chunk_ECD4FV3A = __esm({
|
|
38108
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-ECD4FV3A.mjs"() {
|
|
38109
|
-
"use strict";
|
|
38110
|
-
}
|
|
38111
|
-
});
|
|
38112
|
-
|
|
38113
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/chunk-CLEQO6GU.mjs
|
|
38114
|
-
var init_chunk_CLEQO6GU = __esm({
|
|
38115
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/chunk-CLEQO6GU.mjs"() {
|
|
38116
|
-
"use strict";
|
|
38117
|
-
init_chunk_KDT76YQE();
|
|
38118
|
-
}
|
|
38119
|
-
});
|
|
38120
|
-
|
|
38121
|
-
// node_modules/@whetstone-research/doppler-sdk/dist/index.mjs
|
|
38122
|
-
var init_dist = __esm({
|
|
38123
|
-
"node_modules/@whetstone-research/doppler-sdk/dist/index.mjs"() {
|
|
38124
|
-
"use strict";
|
|
38125
|
-
init_chunk_D2RBCFNW();
|
|
38126
|
-
init_chunk_J5BFFL3X();
|
|
38127
|
-
init_chunk_MNXD45J7();
|
|
38128
|
-
init_chunk_AKSEBAR7();
|
|
38129
|
-
init_chunk_EDJBZPMW();
|
|
38130
|
-
init_chunk_NZ4BJ2IC();
|
|
38131
|
-
init_chunk_PAPXGPJB();
|
|
38132
|
-
init_chunk_TKSHYEYA();
|
|
38133
|
-
init_chunk_MCOK3UFR();
|
|
38134
|
-
init_chunk_AULFBXM5();
|
|
38135
|
-
init_chunk_SP5M57BG();
|
|
38136
|
-
init_chunk_Q5ERW5ZW();
|
|
38137
|
-
init_chunk_XUE3CIJ5();
|
|
38138
|
-
init_chunk_ECD4FV3A();
|
|
38139
|
-
init_chunk_MNJ5OYPE();
|
|
38140
|
-
init_chunk_64AWG57M();
|
|
38141
|
-
init_chunk_NNNCVFOH();
|
|
38142
|
-
init_chunk_ZH44DHVR();
|
|
38143
|
-
init_chunk_CLEQO6GU();
|
|
38144
|
-
init_chunk_KDT76YQE();
|
|
38145
|
-
init_chunk_OTG75GVH();
|
|
38146
|
-
init_chunk_M4WMHD3X();
|
|
38147
|
-
init_chunk_QKO2FZGN();
|
|
38148
|
-
init_chunk_OZ6DGBRL();
|
|
38149
|
-
init_chunk_AW3WR2D3();
|
|
38150
|
-
init_chunk_FPAI4QYW();
|
|
38151
|
-
init_chunk_4TROGENW();
|
|
38152
|
-
}
|
|
38153
|
-
});
|
|
38154
|
-
|
|
38155
|
-
// node_modules/doppler-router/dist/Permit2.js
|
|
38156
|
-
function getEip712Domain2(chainId, verifyingContract) {
|
|
38157
|
-
return {
|
|
38158
|
-
name: "Permit2",
|
|
38159
|
-
chainId,
|
|
38160
|
-
verifyingContract
|
|
38161
|
-
};
|
|
38162
|
-
}
|
|
38163
|
-
async function signPermit(permit, walletClient, chainId, permit2Address) {
|
|
38164
|
-
const signature = await walletClient.signTypedData({
|
|
38165
|
-
account: walletClient.account,
|
|
38166
|
-
domain: getEip712Domain2(chainId, permit2Address),
|
|
38167
|
-
types: PERMIT2_PERMIT_TYPE,
|
|
38168
|
-
primaryType: "PermitSingle",
|
|
38169
|
-
message: permit
|
|
38170
|
-
});
|
|
38171
|
-
return signature;
|
|
38172
|
-
}
|
|
38173
|
-
var PERMIT2_PERMIT_TYPE, permit2Abi;
|
|
38174
|
-
var init_Permit2 = __esm({
|
|
38175
|
-
"node_modules/doppler-router/dist/Permit2.js"() {
|
|
38176
|
-
"use strict";
|
|
38177
|
-
init_esm2();
|
|
38178
|
-
PERMIT2_PERMIT_TYPE = {
|
|
38179
|
-
PermitDetails: [
|
|
38180
|
-
{ name: "token", type: "address" },
|
|
38181
|
-
{ name: "amount", type: "uint160" },
|
|
38182
|
-
{ name: "expiration", type: "uint48" },
|
|
38183
|
-
{ name: "nonce", type: "uint48" }
|
|
38184
|
-
],
|
|
38185
|
-
PermitSingle: [
|
|
38186
|
-
{ name: "details", type: "PermitDetails" },
|
|
38187
|
-
{ name: "spender", type: "address" },
|
|
38188
|
-
{ name: "sigDeadline", type: "uint256" }
|
|
38189
|
-
]
|
|
38190
|
-
};
|
|
38191
|
-
permit2Abi = parseAbi([
|
|
38192
|
-
"function allowance(address user, address token, address spender) external view returns (uint160 amount, uint48 expiration, uint48 nonce)"
|
|
38193
|
-
]);
|
|
38194
|
-
}
|
|
38195
|
-
});
|
|
38196
|
-
|
|
38197
|
-
// node_modules/doppler-router/dist/CommandBuilder.js
|
|
38198
|
-
var CommandType, PERMIT_STRUCT, ABI_DEFINITION, CommandBuilder;
|
|
38199
|
-
var init_CommandBuilder = __esm({
|
|
38200
|
-
"node_modules/doppler-router/dist/CommandBuilder.js"() {
|
|
38201
|
-
"use strict";
|
|
38202
|
-
init_esm2();
|
|
38203
|
-
(function(CommandType2) {
|
|
38204
|
-
CommandType2[CommandType2["V3_SWAP_EXACT_IN"] = 0] = "V3_SWAP_EXACT_IN";
|
|
38205
|
-
CommandType2[CommandType2["V3_SWAP_EXACT_OUT"] = 1] = "V3_SWAP_EXACT_OUT";
|
|
38206
|
-
CommandType2[CommandType2["PERMIT2_TRANSFER_FROM"] = 2] = "PERMIT2_TRANSFER_FROM";
|
|
38207
|
-
CommandType2[CommandType2["SWEEP"] = 4] = "SWEEP";
|
|
38208
|
-
CommandType2[CommandType2["PAY_PORTION"] = 6] = "PAY_PORTION";
|
|
38209
|
-
CommandType2[CommandType2["V2_SWAP_EXACT_IN"] = 8] = "V2_SWAP_EXACT_IN";
|
|
38210
|
-
CommandType2[CommandType2["V2_SWAP_EXACT_OUT"] = 9] = "V2_SWAP_EXACT_OUT";
|
|
38211
|
-
CommandType2[CommandType2["PERMIT2_PERMIT"] = 10] = "PERMIT2_PERMIT";
|
|
38212
|
-
CommandType2[CommandType2["WRAP_ETH"] = 11] = "WRAP_ETH";
|
|
38213
|
-
CommandType2[CommandType2["UNWRAP_WETH"] = 12] = "UNWRAP_WETH";
|
|
38214
|
-
CommandType2[CommandType2["V4_SWAP"] = 16] = "V4_SWAP";
|
|
38215
|
-
})(CommandType || (CommandType = {}));
|
|
38216
|
-
PERMIT_STRUCT = {
|
|
38217
|
-
name: "permit",
|
|
38218
|
-
type: "tuple",
|
|
38219
|
-
components: [
|
|
38220
|
-
{
|
|
38221
|
-
name: "details",
|
|
38222
|
-
type: "tuple",
|
|
38223
|
-
components: [
|
|
38224
|
-
{ name: "token", type: "address" },
|
|
38225
|
-
{ name: "amount", type: "uint160" },
|
|
38226
|
-
{ name: "expiration", type: "uint48" },
|
|
38227
|
-
{ name: "nonce", type: "uint48" }
|
|
38228
|
-
]
|
|
38229
|
-
},
|
|
38230
|
-
{ name: "spender", type: "address" },
|
|
38231
|
-
{ name: "sigDeadline", type: "uint256" }
|
|
38232
|
-
]
|
|
38233
|
-
};
|
|
38234
|
-
ABI_DEFINITION = {
|
|
38235
|
-
[CommandType.V3_SWAP_EXACT_IN]: [
|
|
38236
|
-
{ type: "address" },
|
|
38237
|
-
{ type: "uint256" },
|
|
38238
|
-
{ type: "uint256" },
|
|
38239
|
-
{ type: "bytes" },
|
|
38240
|
-
{ type: "bool" }
|
|
38241
|
-
],
|
|
38242
|
-
[CommandType.V3_SWAP_EXACT_OUT]: [
|
|
38243
|
-
{ type: "address" },
|
|
38244
|
-
{ type: "uint256" },
|
|
38245
|
-
{ type: "uint256" },
|
|
38246
|
-
{ type: "bytes" },
|
|
38247
|
-
{ type: "bool" }
|
|
38248
|
-
],
|
|
38249
|
-
[CommandType.PERMIT2_PERMIT]: [PERMIT_STRUCT, { type: "bytes" }],
|
|
38250
|
-
[CommandType.PERMIT2_TRANSFER_FROM]: [
|
|
38251
|
-
{ type: "address" },
|
|
38252
|
-
{ type: "address" },
|
|
38253
|
-
{ type: "uint256" }
|
|
38254
|
-
],
|
|
38255
|
-
[CommandType.V4_SWAP]: [{ type: "bytes" }, { type: "bytes[]" }],
|
|
38256
|
-
[CommandType.WRAP_ETH]: [{ type: "address" }, { type: "uint256" }],
|
|
38257
|
-
[CommandType.UNWRAP_WETH]: [{ type: "address" }, { type: "uint256" }],
|
|
38258
|
-
[CommandType.V2_SWAP_EXACT_IN]: [
|
|
38259
|
-
{ type: "address" },
|
|
38260
|
-
{ type: "uint256" },
|
|
38261
|
-
{ type: "uint256" },
|
|
38262
|
-
{ type: "address[]" },
|
|
38263
|
-
{ type: "bool" }
|
|
38264
|
-
],
|
|
38265
|
-
[CommandType.V2_SWAP_EXACT_OUT]: [
|
|
38266
|
-
{ type: "address" },
|
|
38267
|
-
{ type: "uint256" },
|
|
38268
|
-
{ type: "uint256" },
|
|
38269
|
-
{ type: "address[]" },
|
|
38270
|
-
{ type: "bool" }
|
|
38271
|
-
],
|
|
38272
|
-
[CommandType.SWEEP]: [
|
|
38273
|
-
{ type: "address" },
|
|
38274
|
-
{ type: "address" },
|
|
38275
|
-
{ type: "uint256" }
|
|
38276
|
-
],
|
|
38277
|
-
[CommandType.PAY_PORTION]: [
|
|
38278
|
-
{ type: "address" },
|
|
38279
|
-
{ type: "address" },
|
|
38280
|
-
{ type: "uint256" }
|
|
38281
|
-
]
|
|
38282
|
-
};
|
|
38283
|
-
CommandBuilder = class {
|
|
38284
|
-
constructor() {
|
|
38285
|
-
this.commands = "0x";
|
|
38286
|
-
this.inputs = [];
|
|
38287
|
-
}
|
|
38288
|
-
addCommand(type, parameters) {
|
|
38289
|
-
const encoded = encodeAbiParameters(ABI_DEFINITION[type], parameters);
|
|
38290
|
-
this.commands += type.toString(16).padStart(2, "0");
|
|
38291
|
-
this.inputs.push(encoded);
|
|
38292
|
-
return this;
|
|
38293
|
-
}
|
|
38294
|
-
addPermit2Permit(permit, signature) {
|
|
38295
|
-
return this.addCommand(CommandType.PERMIT2_PERMIT, [permit, signature]);
|
|
38296
|
-
}
|
|
38297
|
-
addWrapEth(recipient, amount) {
|
|
38298
|
-
return this.addCommand(CommandType.WRAP_ETH, [recipient, amount]);
|
|
38299
|
-
}
|
|
38300
|
-
addUnwrapWeth(recipient, amount) {
|
|
38301
|
-
return this.addCommand(CommandType.UNWRAP_WETH, [recipient, amount]);
|
|
38302
|
-
}
|
|
38303
|
-
addV3SwapExactIn(recipient, amountIn, amountOutMinimum, path2, unwrap3) {
|
|
38304
|
-
return this.addCommand(CommandType.V3_SWAP_EXACT_IN, [
|
|
38305
|
-
recipient,
|
|
38306
|
-
amountIn,
|
|
38307
|
-
amountOutMinimum,
|
|
38308
|
-
path2,
|
|
38309
|
-
unwrap3
|
|
38310
|
-
]);
|
|
38311
|
-
}
|
|
38312
|
-
addV3SwapExactOut(recipient, amountOut, amountInMaximum, path2, payerIsMsgSender) {
|
|
38313
|
-
return this.addCommand(CommandType.V3_SWAP_EXACT_OUT, [
|
|
38314
|
-
recipient,
|
|
38315
|
-
amountOut,
|
|
38316
|
-
amountInMaximum,
|
|
38317
|
-
path2,
|
|
38318
|
-
payerIsMsgSender
|
|
38319
|
-
]);
|
|
38320
|
-
}
|
|
38321
|
-
addPermit2TransferFrom(token, recipient, amount) {
|
|
38322
|
-
return this.addCommand(CommandType.PERMIT2_TRANSFER_FROM, [
|
|
38323
|
-
token,
|
|
38324
|
-
recipient,
|
|
38325
|
-
amount
|
|
38326
|
-
]);
|
|
38327
|
-
}
|
|
38328
|
-
addV2SwapExactIn(recipient, amountIn, amountOutMinimum, path2, payerIsMsgSender) {
|
|
38329
|
-
return this.addCommand(CommandType.V2_SWAP_EXACT_IN, [
|
|
38330
|
-
recipient,
|
|
38331
|
-
amountIn,
|
|
38332
|
-
amountOutMinimum,
|
|
38333
|
-
path2,
|
|
38334
|
-
payerIsMsgSender
|
|
38335
|
-
]);
|
|
38336
|
-
}
|
|
38337
|
-
addV2SwapExactOut(recipient, amountOut, amountInMaximum, path2, payerIsMsgSender) {
|
|
38338
|
-
return this.addCommand(CommandType.V2_SWAP_EXACT_OUT, [
|
|
38339
|
-
recipient,
|
|
38340
|
-
amountOut,
|
|
38341
|
-
amountInMaximum,
|
|
38342
|
-
path2,
|
|
38343
|
-
payerIsMsgSender
|
|
38344
|
-
]);
|
|
38345
|
-
}
|
|
38346
|
-
addV4Swap(actions, params) {
|
|
38347
|
-
return this.addCommand(CommandType.V4_SWAP, [actions, params]);
|
|
38348
|
-
}
|
|
38349
|
-
addSweep(asset, recipient, amount) {
|
|
38350
|
-
return this.addCommand(CommandType.SWEEP, [asset, recipient, amount]);
|
|
38351
|
-
}
|
|
38352
|
-
addPayPortion(asset, recipient, bips) {
|
|
38353
|
-
return this.addCommand(CommandType.PAY_PORTION, [asset, recipient, bips]);
|
|
38354
|
-
}
|
|
38355
|
-
build() {
|
|
38356
|
-
return [this.commands, this.inputs];
|
|
38357
|
-
}
|
|
38358
|
-
};
|
|
38359
|
-
}
|
|
38360
|
-
});
|
|
38361
|
-
|
|
38362
|
-
// node_modules/doppler-router/dist/SwapRouter02Encoder.js
|
|
38363
|
-
var init_SwapRouter02Encoder = __esm({
|
|
38364
|
-
"node_modules/doppler-router/dist/SwapRouter02Encoder.js"() {
|
|
38365
|
-
"use strict";
|
|
38366
|
-
}
|
|
38367
|
-
});
|
|
38368
|
-
|
|
38369
|
-
// node_modules/doppler-router/dist/V4ActionBuilder.js
|
|
38370
|
-
var V4ActionType, POOL_KEY_STRUCT, PATH_KEY_STRUCT, ABI_DEFINITION2;
|
|
38371
|
-
var init_V4ActionBuilder = __esm({
|
|
38372
|
-
"node_modules/doppler-router/dist/V4ActionBuilder.js"() {
|
|
38373
|
-
"use strict";
|
|
38374
|
-
(function(V4ActionType2) {
|
|
38375
|
-
V4ActionType2[V4ActionType2["INCREASE_LIQUIDITY"] = 0] = "INCREASE_LIQUIDITY";
|
|
38376
|
-
V4ActionType2[V4ActionType2["DECREASE_LIQUIDITY"] = 1] = "DECREASE_LIQUIDITY";
|
|
38377
|
-
V4ActionType2[V4ActionType2["MINT_POSITION"] = 2] = "MINT_POSITION";
|
|
38378
|
-
V4ActionType2[V4ActionType2["BURN_POSITION"] = 3] = "BURN_POSITION";
|
|
38379
|
-
V4ActionType2[V4ActionType2["INCREASE_LIQUIDITY_FROM_DELTAS"] = 4] = "INCREASE_LIQUIDITY_FROM_DELTAS";
|
|
38380
|
-
V4ActionType2[V4ActionType2["MINT_POSITION_FROM_DELTAS"] = 5] = "MINT_POSITION_FROM_DELTAS";
|
|
38381
|
-
V4ActionType2[V4ActionType2["SWAP_EXACT_IN_SINGLE"] = 6] = "SWAP_EXACT_IN_SINGLE";
|
|
38382
|
-
V4ActionType2[V4ActionType2["SWAP_EXACT_IN"] = 7] = "SWAP_EXACT_IN";
|
|
38383
|
-
V4ActionType2[V4ActionType2["SWAP_EXACT_OUT_SINGLE"] = 8] = "SWAP_EXACT_OUT_SINGLE";
|
|
38384
|
-
V4ActionType2[V4ActionType2["SWAP_EXACT_OUT"] = 9] = "SWAP_EXACT_OUT";
|
|
38385
|
-
V4ActionType2[V4ActionType2["SETTLE"] = 11] = "SETTLE";
|
|
38386
|
-
V4ActionType2[V4ActionType2["SETTLE_ALL"] = 12] = "SETTLE_ALL";
|
|
38387
|
-
V4ActionType2[V4ActionType2["TAKE"] = 14] = "TAKE";
|
|
38388
|
-
V4ActionType2[V4ActionType2["TAKE_ALL"] = 15] = "TAKE_ALL";
|
|
38389
|
-
V4ActionType2[V4ActionType2["TAKE_PORTION"] = 16] = "TAKE_PORTION";
|
|
38390
|
-
V4ActionType2[V4ActionType2["CLOSE_CURRENCY"] = 18] = "CLOSE_CURRENCY";
|
|
38391
|
-
V4ActionType2[V4ActionType2["SWEEP"] = 20] = "SWEEP";
|
|
38392
|
-
V4ActionType2[V4ActionType2["WRAP"] = 21] = "WRAP";
|
|
38393
|
-
V4ActionType2[V4ActionType2["UNWRAP"] = 22] = "UNWRAP";
|
|
38394
|
-
})(V4ActionType || (V4ActionType = {}));
|
|
38395
|
-
POOL_KEY_STRUCT = {
|
|
38396
|
-
name: "poolKey",
|
|
38397
|
-
type: "tuple",
|
|
38398
|
-
components: [
|
|
38399
|
-
{ name: "currency0", type: "address" },
|
|
38400
|
-
{ name: "currency1", type: "address" },
|
|
38401
|
-
{ name: "fee", type: "uint24" },
|
|
38402
|
-
{ name: "tickSpacing", type: "int24" },
|
|
38403
|
-
{ name: "hooks", type: "address" }
|
|
38404
|
-
]
|
|
38405
|
-
};
|
|
38406
|
-
PATH_KEY_STRUCT = {
|
|
38407
|
-
name: "pathKey",
|
|
38408
|
-
type: "tuple",
|
|
38409
|
-
components: [
|
|
38410
|
-
{ name: "intermediateCurrency", type: "address" },
|
|
38411
|
-
{ name: "fee", type: "uint256" },
|
|
38412
|
-
{ name: "tickSpacing", type: "int24" },
|
|
38413
|
-
{ name: "hooks", type: "address" },
|
|
38414
|
-
{ name: "hookData", type: "bytes" }
|
|
38415
|
-
]
|
|
38416
|
-
};
|
|
38417
|
-
ABI_DEFINITION2 = {
|
|
38418
|
-
[V4ActionType.INCREASE_LIQUIDITY]: [
|
|
38419
|
-
{ type: "uint256" },
|
|
38420
|
-
{ type: "uint256" },
|
|
38421
|
-
{ type: "uint128" },
|
|
38422
|
-
{ type: "uint128" },
|
|
38423
|
-
{ type: "bytes" }
|
|
38424
|
-
],
|
|
38425
|
-
[V4ActionType.DECREASE_LIQUIDITY]: [
|
|
38426
|
-
{ type: "uint256" },
|
|
38427
|
-
{ type: "uint256" },
|
|
38428
|
-
{ type: "uint128" },
|
|
38429
|
-
{ type: "uint128" },
|
|
38430
|
-
{ type: "bytes" }
|
|
38431
|
-
],
|
|
38432
|
-
[V4ActionType.MINT_POSITION]: [
|
|
38433
|
-
POOL_KEY_STRUCT,
|
|
38434
|
-
{ type: "int24" },
|
|
38435
|
-
{ type: "int24" },
|
|
38436
|
-
{ type: "uint256" },
|
|
38437
|
-
{ type: "uint128" },
|
|
38438
|
-
{ type: "uint128" },
|
|
38439
|
-
{ type: "address" },
|
|
38440
|
-
{ type: "bytes" }
|
|
38441
|
-
],
|
|
38442
|
-
[V4ActionType.BURN_POSITION]: [
|
|
38443
|
-
{ type: "uint256" },
|
|
38444
|
-
{ type: "uint128" },
|
|
38445
|
-
{ type: "uint128" },
|
|
38446
|
-
{ type: "bytes" }
|
|
38447
|
-
],
|
|
38448
|
-
[V4ActionType.INCREASE_LIQUIDITY_FROM_DELTAS]: [
|
|
38449
|
-
{ type: "uint256" },
|
|
38450
|
-
{ type: "uint128" },
|
|
38451
|
-
{ type: "uint128" },
|
|
38452
|
-
{ type: "bytes" }
|
|
38453
|
-
],
|
|
38454
|
-
[V4ActionType.MINT_POSITION_FROM_DELTAS]: [
|
|
38455
|
-
POOL_KEY_STRUCT,
|
|
38456
|
-
{ type: "int24" },
|
|
38457
|
-
{ type: "int24" },
|
|
38458
|
-
{ type: "uint128" },
|
|
38459
|
-
{ type: "uint128" },
|
|
38460
|
-
{ type: "address" },
|
|
38461
|
-
{ type: "bytes" }
|
|
38462
|
-
],
|
|
38463
|
-
[V4ActionType.SWAP_EXACT_IN_SINGLE]: [
|
|
38464
|
-
{
|
|
38465
|
-
name: "swapParams",
|
|
38466
|
-
type: "tuple",
|
|
38467
|
-
components: [
|
|
38468
|
-
POOL_KEY_STRUCT,
|
|
38469
|
-
{ name: "zeroForOne", type: "bool" },
|
|
38470
|
-
{ name: "amountIn", type: "uint128" },
|
|
38471
|
-
{ name: "amountOutMinimum", type: "uint128" },
|
|
38472
|
-
{ name: "hookData", type: "bytes" }
|
|
38473
|
-
]
|
|
38474
|
-
}
|
|
38475
|
-
],
|
|
38476
|
-
[V4ActionType.SWAP_EXACT_IN]: [
|
|
38477
|
-
{
|
|
38478
|
-
name: "swapParams",
|
|
38479
|
-
type: "tuple",
|
|
38480
|
-
components: [
|
|
38481
|
-
{ name: "currencyIn", type: "address" },
|
|
38482
|
-
{
|
|
38483
|
-
name: "path",
|
|
38484
|
-
type: "tuple[]",
|
|
38485
|
-
components: PATH_KEY_STRUCT.components
|
|
38486
|
-
},
|
|
38487
|
-
{ name: "amountIn", type: "uint128" },
|
|
38488
|
-
{ name: "amountOutMinimum", type: "uint128" }
|
|
38489
|
-
]
|
|
38490
|
-
}
|
|
38491
|
-
],
|
|
38492
|
-
[V4ActionType.SWAP_EXACT_OUT_SINGLE]: [
|
|
38493
|
-
{
|
|
38494
|
-
name: "swapParams",
|
|
38495
|
-
type: "tuple",
|
|
38496
|
-
components: [
|
|
38497
|
-
POOL_KEY_STRUCT,
|
|
38498
|
-
{ name: "zeroForOne", type: "bool" },
|
|
38499
|
-
{ name: "amountOut", type: "uint128" },
|
|
38500
|
-
{ name: "amountInMaximum", type: "uint128" },
|
|
38501
|
-
{ name: "hookData", type: "bytes" }
|
|
38502
|
-
]
|
|
38503
|
-
}
|
|
38389
|
+
* to represent unlimited approval in systems expecting ERC20-like interfaces
|
|
38390
|
+
*/
|
|
38391
|
+
async getAllowance() {
|
|
38392
|
+
return 2n ** 256n - 1n;
|
|
38393
|
+
}
|
|
38394
|
+
/**
|
|
38395
|
+
* Get the ETH balance of a specified account
|
|
38396
|
+
* @param account - Address of the account to query
|
|
38397
|
+
* @returns Promise resolving to the account's ETH balance in wei
|
|
38398
|
+
*/
|
|
38399
|
+
async getBalanceOf(account) {
|
|
38400
|
+
return await this.rpc.getBalance({
|
|
38401
|
+
address: account
|
|
38402
|
+
});
|
|
38403
|
+
}
|
|
38404
|
+
};
|
|
38405
|
+
Eth.address = zeroAddress;
|
|
38406
|
+
PERMIT2_PERMIT_TYPE = {
|
|
38407
|
+
PermitDetails: [
|
|
38408
|
+
{ name: "token", type: "address" },
|
|
38409
|
+
{ name: "amount", type: "uint160" },
|
|
38410
|
+
{ name: "expiration", type: "uint48" },
|
|
38411
|
+
{ name: "nonce", type: "uint48" }
|
|
38504
38412
|
],
|
|
38505
|
-
|
|
38413
|
+
PermitSingle: [
|
|
38414
|
+
{ name: "details", type: "PermitDetails" },
|
|
38415
|
+
{ name: "spender", type: "address" },
|
|
38416
|
+
{ name: "sigDeadline", type: "uint256" }
|
|
38417
|
+
]
|
|
38418
|
+
};
|
|
38419
|
+
permit2Abi2 = parseAbi([
|
|
38420
|
+
"function allowance(address user, address token, address spender) external view returns (uint160 amount, uint48 expiration, uint48 nonce)"
|
|
38421
|
+
]);
|
|
38422
|
+
(function(CommandType2) {
|
|
38423
|
+
CommandType2[CommandType2["V3_SWAP_EXACT_IN"] = 0] = "V3_SWAP_EXACT_IN";
|
|
38424
|
+
CommandType2[CommandType2["V3_SWAP_EXACT_OUT"] = 1] = "V3_SWAP_EXACT_OUT";
|
|
38425
|
+
CommandType2[CommandType2["PERMIT2_TRANSFER_FROM"] = 2] = "PERMIT2_TRANSFER_FROM";
|
|
38426
|
+
CommandType2[CommandType2["SWEEP"] = 4] = "SWEEP";
|
|
38427
|
+
CommandType2[CommandType2["PAY_PORTION"] = 6] = "PAY_PORTION";
|
|
38428
|
+
CommandType2[CommandType2["V2_SWAP_EXACT_IN"] = 8] = "V2_SWAP_EXACT_IN";
|
|
38429
|
+
CommandType2[CommandType2["V2_SWAP_EXACT_OUT"] = 9] = "V2_SWAP_EXACT_OUT";
|
|
38430
|
+
CommandType2[CommandType2["PERMIT2_PERMIT"] = 10] = "PERMIT2_PERMIT";
|
|
38431
|
+
CommandType2[CommandType2["WRAP_ETH"] = 11] = "WRAP_ETH";
|
|
38432
|
+
CommandType2[CommandType2["UNWRAP_WETH"] = 12] = "UNWRAP_WETH";
|
|
38433
|
+
CommandType2[CommandType2["V4_SWAP"] = 16] = "V4_SWAP";
|
|
38434
|
+
})(CommandType || (CommandType = {}));
|
|
38435
|
+
PERMIT_STRUCT = {
|
|
38436
|
+
name: "permit",
|
|
38437
|
+
type: "tuple",
|
|
38438
|
+
components: [
|
|
38506
38439
|
{
|
|
38507
|
-
name: "
|
|
38440
|
+
name: "details",
|
|
38508
38441
|
type: "tuple",
|
|
38509
38442
|
components: [
|
|
38510
|
-
{ name: "
|
|
38511
|
-
{
|
|
38512
|
-
|
|
38513
|
-
|
|
38514
|
-
components: PATH_KEY_STRUCT.components
|
|
38515
|
-
},
|
|
38516
|
-
{ name: "amountOut", type: "uint128" },
|
|
38517
|
-
{ name: "amountInMaximum", type: "uint128" }
|
|
38443
|
+
{ name: "token", type: "address" },
|
|
38444
|
+
{ name: "amount", type: "uint160" },
|
|
38445
|
+
{ name: "expiration", type: "uint48" },
|
|
38446
|
+
{ name: "nonce", type: "uint48" }
|
|
38518
38447
|
]
|
|
38519
|
-
}
|
|
38448
|
+
},
|
|
38449
|
+
{ name: "spender", type: "address" },
|
|
38450
|
+
{ name: "sigDeadline", type: "uint256" }
|
|
38451
|
+
]
|
|
38452
|
+
};
|
|
38453
|
+
ABI_DEFINITION = {
|
|
38454
|
+
[CommandType.V3_SWAP_EXACT_IN]: [
|
|
38455
|
+
{ type: "address" },
|
|
38456
|
+
{ type: "uint256" },
|
|
38457
|
+
{ type: "uint256" },
|
|
38458
|
+
{ type: "bytes" },
|
|
38459
|
+
{ type: "bool" }
|
|
38520
38460
|
],
|
|
38521
|
-
[
|
|
38461
|
+
[CommandType.V3_SWAP_EXACT_OUT]: [
|
|
38522
38462
|
{ type: "address" },
|
|
38523
38463
|
{ type: "uint256" },
|
|
38464
|
+
{ type: "uint256" },
|
|
38465
|
+
{ type: "bytes" },
|
|
38524
38466
|
{ type: "bool" }
|
|
38525
38467
|
],
|
|
38526
|
-
[
|
|
38527
|
-
[
|
|
38468
|
+
[CommandType.PERMIT2_PERMIT]: [PERMIT_STRUCT, { type: "bytes" }],
|
|
38469
|
+
[CommandType.PERMIT2_TRANSFER_FROM]: [
|
|
38528
38470
|
{ type: "address" },
|
|
38529
38471
|
{ type: "address" },
|
|
38530
38472
|
{ type: "uint256" }
|
|
38531
38473
|
],
|
|
38532
|
-
[
|
|
38533
|
-
[
|
|
38474
|
+
[CommandType.V4_SWAP]: [{ type: "bytes" }, { type: "bytes[]" }],
|
|
38475
|
+
[CommandType.WRAP_ETH]: [{ type: "address" }, { type: "uint256" }],
|
|
38476
|
+
[CommandType.UNWRAP_WETH]: [{ type: "address" }, { type: "uint256" }],
|
|
38477
|
+
[CommandType.V2_SWAP_EXACT_IN]: [
|
|
38478
|
+
{ type: "address" },
|
|
38479
|
+
{ type: "uint256" },
|
|
38480
|
+
{ type: "uint256" },
|
|
38481
|
+
{ type: "address[]" },
|
|
38482
|
+
{ type: "bool" }
|
|
38483
|
+
],
|
|
38484
|
+
[CommandType.V2_SWAP_EXACT_OUT]: [
|
|
38485
|
+
{ type: "address" },
|
|
38486
|
+
{ type: "uint256" },
|
|
38487
|
+
{ type: "uint256" },
|
|
38488
|
+
{ type: "address[]" },
|
|
38489
|
+
{ type: "bool" }
|
|
38490
|
+
],
|
|
38491
|
+
[CommandType.SWEEP]: [
|
|
38534
38492
|
{ type: "address" },
|
|
38535
38493
|
{ type: "address" },
|
|
38536
38494
|
{ type: "uint256" }
|
|
38537
38495
|
],
|
|
38538
|
-
[
|
|
38539
|
-
|
|
38540
|
-
|
|
38541
|
-
|
|
38542
|
-
|
|
38543
|
-
}
|
|
38544
|
-
});
|
|
38545
|
-
|
|
38546
|
-
// node_modules/doppler-router/dist/index.js
|
|
38547
|
-
var init_dist2 = __esm({
|
|
38548
|
-
"node_modules/doppler-router/dist/index.js"() {
|
|
38549
|
-
"use strict";
|
|
38550
|
-
init_CommandBuilder();
|
|
38551
|
-
init_Permit2();
|
|
38552
|
-
init_SwapRouter02Encoder();
|
|
38553
|
-
init_V4ActionBuilder();
|
|
38554
|
-
}
|
|
38555
|
-
});
|
|
38556
|
-
|
|
38557
|
-
// node_modules/@paragraph-com/sdk/dist/index.mjs
|
|
38558
|
-
function singleItemResult(item) {
|
|
38559
|
-
return {
|
|
38560
|
-
items: [item],
|
|
38561
|
-
pagination: {
|
|
38562
|
-
hasMore: false,
|
|
38563
|
-
total: 1
|
|
38564
|
-
}
|
|
38565
|
-
};
|
|
38566
|
-
}
|
|
38567
|
-
function wrapAPIWithAuth(api, apiKey, setCurrentApiKey2) {
|
|
38568
|
-
const wrapped = {};
|
|
38569
|
-
for (const [key, method] of Object.entries(api)) {
|
|
38570
|
-
if (typeof method === "function") {
|
|
38571
|
-
wrapped[key] = (...args2) => {
|
|
38572
|
-
setCurrentApiKey2(apiKey);
|
|
38573
|
-
return method(...args2);
|
|
38574
|
-
};
|
|
38575
|
-
}
|
|
38576
|
-
}
|
|
38577
|
-
return wrapped;
|
|
38578
|
-
}
|
|
38579
|
-
var AXIOS_INSTANCE, currentApiKey, setCurrentApiKey, customAxios, getParagraphAPI, QueryResult, executeAbi, permit2Abi2, AuthResource, CoinsResource, FeedResource, MeResource, PostsResource, PublicationsResource, SearchResource, SubscribersResource, UsersResource, ParagraphAPI;
|
|
38580
|
-
var init_dist3 = __esm({
|
|
38581
|
-
"node_modules/@paragraph-com/sdk/dist/index.mjs"() {
|
|
38582
|
-
"use strict";
|
|
38583
|
-
init_axios2();
|
|
38584
|
-
init_esm2();
|
|
38585
|
-
init_esm2();
|
|
38586
|
-
init_chains();
|
|
38587
|
-
init_dist();
|
|
38588
|
-
init_Permit2();
|
|
38589
|
-
init_dist2();
|
|
38590
|
-
AXIOS_INSTANCE = axios_default.create({
|
|
38591
|
-
baseURL: "https://public.api.paragraph.com/api"
|
|
38592
|
-
});
|
|
38593
|
-
setCurrentApiKey = (apiKey) => {
|
|
38594
|
-
currentApiKey = apiKey;
|
|
38595
|
-
};
|
|
38596
|
-
customAxios = (config) => {
|
|
38597
|
-
const source = axios_default.CancelToken.source();
|
|
38598
|
-
const headers = { ...config.headers };
|
|
38599
|
-
if (currentApiKey) {
|
|
38600
|
-
headers.Authorization = `Bearer ${currentApiKey}`;
|
|
38601
|
-
}
|
|
38602
|
-
const promise = AXIOS_INSTANCE({
|
|
38603
|
-
...config,
|
|
38604
|
-
headers,
|
|
38605
|
-
cancelToken: source.token
|
|
38606
|
-
}).then(({ data }) => data);
|
|
38607
|
-
promise.cancel = () => {
|
|
38608
|
-
source.cancel("Query was cancelled");
|
|
38609
|
-
};
|
|
38610
|
-
return promise;
|
|
38611
|
-
};
|
|
38612
|
-
getParagraphAPI = () => {
|
|
38613
|
-
const getPublicationById = (publicationId) => {
|
|
38614
|
-
return customAxios(
|
|
38615
|
-
{
|
|
38616
|
-
url: `/v1/publications/${publicationId}`,
|
|
38617
|
-
method: "GET"
|
|
38618
|
-
}
|
|
38619
|
-
);
|
|
38620
|
-
};
|
|
38621
|
-
const getPublicationBySlug = (slug) => {
|
|
38622
|
-
return customAxios(
|
|
38623
|
-
{
|
|
38624
|
-
url: `/v1/publications/slug/${slug}`,
|
|
38625
|
-
method: "GET"
|
|
38626
|
-
}
|
|
38627
|
-
);
|
|
38628
|
-
};
|
|
38629
|
-
const getPublicationByDomain2 = (domain) => {
|
|
38630
|
-
return customAxios(
|
|
38631
|
-
{
|
|
38632
|
-
url: `/v1/publications/domain/${domain}`,
|
|
38633
|
-
method: "GET"
|
|
38634
|
-
}
|
|
38635
|
-
);
|
|
38636
|
-
};
|
|
38637
|
-
const getSubscriberCount2 = (publicationId) => {
|
|
38638
|
-
return customAxios(
|
|
38639
|
-
{
|
|
38640
|
-
url: `/v1/publications/${publicationId}/subscribers/count`,
|
|
38641
|
-
method: "GET"
|
|
38642
|
-
}
|
|
38643
|
-
);
|
|
38644
|
-
};
|
|
38645
|
-
const getPostsFeed = (params) => {
|
|
38646
|
-
return customAxios(
|
|
38647
|
-
{
|
|
38648
|
-
url: `/v1/posts/feed`,
|
|
38649
|
-
method: "GET",
|
|
38650
|
-
params
|
|
38651
|
-
}
|
|
38652
|
-
);
|
|
38653
|
-
};
|
|
38654
|
-
const getPostsByTag2 = (tag, params) => {
|
|
38655
|
-
return customAxios(
|
|
38656
|
-
{
|
|
38657
|
-
url: `/v1/posts/tag/${tag}`,
|
|
38658
|
-
method: "GET",
|
|
38659
|
-
params
|
|
38660
|
-
}
|
|
38661
|
-
);
|
|
38662
|
-
};
|
|
38663
|
-
const getPosts = (publicationId, params) => {
|
|
38664
|
-
return customAxios(
|
|
38665
|
-
{
|
|
38666
|
-
url: `/v1/publications/${publicationId}/posts`,
|
|
38667
|
-
method: "GET",
|
|
38668
|
-
params
|
|
38669
|
-
}
|
|
38670
|
-
);
|
|
38671
|
-
};
|
|
38672
|
-
const getPostById = (postId, params) => {
|
|
38673
|
-
return customAxios(
|
|
38674
|
-
{
|
|
38675
|
-
url: `/v1/posts/${postId}`,
|
|
38676
|
-
method: "GET",
|
|
38677
|
-
params
|
|
38678
|
-
}
|
|
38679
|
-
);
|
|
38680
|
-
};
|
|
38681
|
-
const updatePost2 = (postId, updatePostBody) => {
|
|
38682
|
-
return customAxios(
|
|
38683
|
-
{
|
|
38684
|
-
url: `/v1/posts/${postId}`,
|
|
38685
|
-
method: "PUT",
|
|
38686
|
-
headers: { "Content-Type": "application/json" },
|
|
38687
|
-
data: updatePostBody
|
|
38688
|
-
}
|
|
38689
|
-
);
|
|
38690
|
-
};
|
|
38691
|
-
const deletePost2 = (postId, deletePostBody) => {
|
|
38692
|
-
return customAxios(
|
|
38693
|
-
{
|
|
38694
|
-
url: `/v1/posts/${postId}`,
|
|
38695
|
-
method: "DELETE",
|
|
38696
|
-
headers: { "Content-Type": "application/json" },
|
|
38697
|
-
data: deletePostBody
|
|
38698
|
-
}
|
|
38699
|
-
);
|
|
38700
|
-
};
|
|
38701
|
-
const getPostByPublicationIdAndPostSlug = (publicationId, postSlug, params) => {
|
|
38702
|
-
return customAxios(
|
|
38703
|
-
{
|
|
38704
|
-
url: `/v1/publications/${publicationId}/posts/slug/${postSlug}`,
|
|
38705
|
-
method: "GET",
|
|
38706
|
-
params
|
|
38707
|
-
}
|
|
38708
|
-
);
|
|
38709
|
-
};
|
|
38710
|
-
const getPostByPublicationSlugAndPostSlug = (publicationSlug, postSlug, params) => {
|
|
38711
|
-
return customAxios(
|
|
38712
|
-
{
|
|
38713
|
-
url: `/v1/publications/slug/${publicationSlug}/posts/slug/${postSlug}`,
|
|
38714
|
-
method: "GET",
|
|
38715
|
-
params
|
|
38716
|
-
}
|
|
38717
|
-
);
|
|
38718
|
-
};
|
|
38719
|
-
const createPost2 = (createPostBody) => {
|
|
38720
|
-
return customAxios(
|
|
38721
|
-
{
|
|
38722
|
-
url: `/v1/posts`,
|
|
38723
|
-
method: "POST",
|
|
38724
|
-
headers: { "Content-Type": "application/json" },
|
|
38725
|
-
data: createPostBody
|
|
38726
|
-
}
|
|
38727
|
-
);
|
|
38728
|
-
};
|
|
38729
|
-
const listOwnPosts = (params) => {
|
|
38730
|
-
return customAxios(
|
|
38731
|
-
{
|
|
38732
|
-
url: `/v1/posts`,
|
|
38733
|
-
method: "GET",
|
|
38734
|
-
params
|
|
38735
|
-
}
|
|
38736
|
-
);
|
|
38737
|
-
};
|
|
38738
|
-
const updatePostBySlug = (slug, updatePostBySlugBody) => {
|
|
38739
|
-
return customAxios(
|
|
38740
|
-
{
|
|
38741
|
-
url: `/v1/posts/slug/${slug}`,
|
|
38742
|
-
method: "PUT",
|
|
38743
|
-
headers: { "Content-Type": "application/json" },
|
|
38744
|
-
data: updatePostBySlugBody
|
|
38745
|
-
}
|
|
38746
|
-
);
|
|
38747
|
-
};
|
|
38748
|
-
const deletePostBySlug = (slug, deletePostBySlugBody) => {
|
|
38749
|
-
return customAxios(
|
|
38750
|
-
{
|
|
38751
|
-
url: `/v1/posts/slug/${slug}`,
|
|
38752
|
-
method: "DELETE",
|
|
38753
|
-
headers: { "Content-Type": "application/json" },
|
|
38754
|
-
data: deletePostBySlugBody
|
|
38755
|
-
}
|
|
38756
|
-
);
|
|
38757
|
-
};
|
|
38758
|
-
const sendTestEmail2 = (postId, sendTestEmailBody) => {
|
|
38759
|
-
return customAxios(
|
|
38760
|
-
{
|
|
38761
|
-
url: `/v1/posts/${postId}/test-email`,
|
|
38762
|
-
method: "POST",
|
|
38763
|
-
headers: { "Content-Type": "application/json" },
|
|
38764
|
-
data: sendTestEmailBody
|
|
38765
|
-
}
|
|
38766
|
-
);
|
|
38767
|
-
};
|
|
38768
|
-
const getMe = () => {
|
|
38769
|
-
return customAxios(
|
|
38770
|
-
{
|
|
38771
|
-
url: `/v1/me`,
|
|
38772
|
-
method: "GET"
|
|
38773
|
-
}
|
|
38774
|
-
);
|
|
38775
|
-
};
|
|
38776
|
-
const getUser2 = (userId) => {
|
|
38777
|
-
return customAxios(
|
|
38778
|
-
{
|
|
38779
|
-
url: `/v1/users/${userId}`,
|
|
38780
|
-
method: "GET"
|
|
38781
|
-
}
|
|
38782
|
-
);
|
|
38783
|
-
};
|
|
38784
|
-
const getUserByWallet = (walletAddress) => {
|
|
38785
|
-
return customAxios(
|
|
38786
|
-
{
|
|
38787
|
-
url: `/v1/users/wallet/${walletAddress}`,
|
|
38788
|
-
method: "GET"
|
|
38789
|
-
}
|
|
38790
|
-
);
|
|
38791
|
-
};
|
|
38792
|
-
const getCoin2 = (id) => {
|
|
38793
|
-
return customAxios(
|
|
38794
|
-
{
|
|
38795
|
-
url: `/v1/coins/${id}`,
|
|
38796
|
-
method: "GET"
|
|
38797
|
-
}
|
|
38798
|
-
);
|
|
38799
|
-
};
|
|
38800
|
-
const getCoinByContract = (contractAddress) => {
|
|
38801
|
-
return customAxios(
|
|
38802
|
-
{
|
|
38803
|
-
url: `/v1/coins/contract/${contractAddress}`,
|
|
38804
|
-
method: "GET"
|
|
38805
|
-
}
|
|
38806
|
-
);
|
|
38807
|
-
};
|
|
38808
|
-
const getCoinHoldersById = (id, params) => {
|
|
38809
|
-
return customAxios(
|
|
38810
|
-
{
|
|
38811
|
-
url: `/v1/coins/${id}/holders`,
|
|
38812
|
-
method: "GET",
|
|
38813
|
-
params
|
|
38814
|
-
}
|
|
38815
|
-
);
|
|
38816
|
-
};
|
|
38817
|
-
const getCoinHoldersByContract = (contractAddress, params) => {
|
|
38818
|
-
return customAxios(
|
|
38819
|
-
{
|
|
38820
|
-
url: `/v1/coins/contract/${contractAddress}/holders`,
|
|
38821
|
-
method: "GET",
|
|
38822
|
-
params
|
|
38823
|
-
}
|
|
38824
|
-
);
|
|
38825
|
-
};
|
|
38826
|
-
const getBuyArgsById = (id, params) => {
|
|
38827
|
-
return customAxios(
|
|
38828
|
-
{
|
|
38829
|
-
url: `/v1/coins/buy/${id}`,
|
|
38830
|
-
method: "GET",
|
|
38831
|
-
params
|
|
38832
|
-
}
|
|
38833
|
-
);
|
|
38834
|
-
};
|
|
38835
|
-
const getBuyArgsByContract = (contractAddress, params) => {
|
|
38836
|
-
return customAxios(
|
|
38837
|
-
{
|
|
38838
|
-
url: `/v1/coins/buy/contract/${contractAddress}`,
|
|
38839
|
-
method: "GET",
|
|
38840
|
-
params
|
|
38841
|
-
}
|
|
38842
|
-
);
|
|
38843
|
-
};
|
|
38844
|
-
const getSellArgsById = (id, params) => {
|
|
38845
|
-
return customAxios(
|
|
38846
|
-
{
|
|
38847
|
-
url: `/v1/coins/sell/${id}`,
|
|
38848
|
-
method: "GET",
|
|
38849
|
-
params
|
|
38850
|
-
}
|
|
38851
|
-
);
|
|
38852
|
-
};
|
|
38853
|
-
const getSellArgsByContract = (contractAddress, params) => {
|
|
38854
|
-
return customAxios(
|
|
38855
|
-
{
|
|
38856
|
-
url: `/v1/coins/sell/contract/${contractAddress}`,
|
|
38857
|
-
method: "GET",
|
|
38858
|
-
params
|
|
38859
|
-
}
|
|
38860
|
-
);
|
|
38861
|
-
};
|
|
38862
|
-
const getQuoteById = (id, params) => {
|
|
38863
|
-
return customAxios(
|
|
38864
|
-
{
|
|
38865
|
-
url: `/v1/coins/quote/${id}`,
|
|
38866
|
-
method: "GET",
|
|
38867
|
-
params
|
|
38868
|
-
}
|
|
38869
|
-
);
|
|
38870
|
-
};
|
|
38871
|
-
const getQuoteByContract = (contractAddress, params) => {
|
|
38872
|
-
return customAxios(
|
|
38873
|
-
{
|
|
38874
|
-
url: `/v1/coins/quote/contract/${contractAddress}`,
|
|
38875
|
-
method: "GET",
|
|
38876
|
-
params
|
|
38877
|
-
}
|
|
38878
|
-
);
|
|
38879
|
-
};
|
|
38880
|
-
const getPopularCoins2 = () => {
|
|
38881
|
-
return customAxios(
|
|
38882
|
-
{
|
|
38883
|
-
url: `/v1/coins/list/popular`,
|
|
38884
|
-
method: "GET"
|
|
38885
|
-
}
|
|
38886
|
-
);
|
|
38887
|
-
};
|
|
38888
|
-
const importSubscribers2 = (importSubscribersBody) => {
|
|
38889
|
-
const formData = new FormData();
|
|
38890
|
-
if (importSubscribersBody.file !== void 0) {
|
|
38891
|
-
formData.append(`file`, importSubscribersBody.file);
|
|
38892
|
-
}
|
|
38893
|
-
return customAxios(
|
|
38894
|
-
{
|
|
38895
|
-
url: `/v1/subscribers/import`,
|
|
38896
|
-
method: "POST",
|
|
38897
|
-
headers: { "Content-Type": "multipart/form-data" },
|
|
38898
|
-
data: formData
|
|
38899
|
-
}
|
|
38900
|
-
);
|
|
38901
|
-
};
|
|
38902
|
-
const addSubscriber2 = (addSubscriberBody) => {
|
|
38903
|
-
return customAxios(
|
|
38904
|
-
{
|
|
38905
|
-
url: `/v1/subscribers`,
|
|
38906
|
-
method: "POST",
|
|
38907
|
-
headers: { "Content-Type": "application/json" },
|
|
38908
|
-
data: addSubscriberBody
|
|
38909
|
-
}
|
|
38910
|
-
);
|
|
38911
|
-
};
|
|
38912
|
-
const listSubscribers2 = (params) => {
|
|
38913
|
-
return customAxios(
|
|
38914
|
-
{
|
|
38915
|
-
url: `/v1/subscribers`,
|
|
38916
|
-
method: "GET",
|
|
38917
|
-
params
|
|
38918
|
-
}
|
|
38919
|
-
);
|
|
38920
|
-
};
|
|
38921
|
-
const searchPosts2 = (params) => {
|
|
38922
|
-
return customAxios(
|
|
38923
|
-
{
|
|
38924
|
-
url: `/v1/discover/search`,
|
|
38925
|
-
method: "GET",
|
|
38926
|
-
params
|
|
38927
|
-
}
|
|
38928
|
-
);
|
|
38929
|
-
};
|
|
38930
|
-
const searchBlogs2 = (params) => {
|
|
38931
|
-
return customAxios(
|
|
38932
|
-
{
|
|
38933
|
-
url: `/v1/discover/blogs/search`,
|
|
38934
|
-
method: "GET",
|
|
38935
|
-
params
|
|
38936
|
-
}
|
|
38937
|
-
);
|
|
38938
|
-
};
|
|
38939
|
-
const searchCoins2 = (params) => {
|
|
38940
|
-
return customAxios(
|
|
38941
|
-
{
|
|
38942
|
-
url: `/v1/discover/coins/search`,
|
|
38943
|
-
method: "GET",
|
|
38944
|
-
params
|
|
38945
|
-
}
|
|
38946
|
-
);
|
|
38947
|
-
};
|
|
38948
|
-
const createAuthSession = (createAuthSessionBody) => {
|
|
38949
|
-
return customAxios(
|
|
38950
|
-
{
|
|
38951
|
-
url: `/v1/api/auth/sessions`,
|
|
38952
|
-
method: "POST",
|
|
38953
|
-
headers: { "Content-Type": "application/json" },
|
|
38954
|
-
data: createAuthSessionBody
|
|
38955
|
-
}
|
|
38956
|
-
);
|
|
38957
|
-
};
|
|
38958
|
-
const getAuthSession = (sessionId) => {
|
|
38959
|
-
return customAxios(
|
|
38960
|
-
{
|
|
38961
|
-
url: `/v1/api/auth/sessions/${sessionId}`,
|
|
38962
|
-
method: "GET"
|
|
38963
|
-
}
|
|
38964
|
-
);
|
|
38965
|
-
};
|
|
38966
|
-
const deleteAuthSession = (sessionId) => {
|
|
38967
|
-
return customAxios(
|
|
38968
|
-
{
|
|
38969
|
-
url: `/v1/api/auth/sessions/${sessionId}`,
|
|
38970
|
-
method: "DELETE"
|
|
38971
|
-
}
|
|
38972
|
-
);
|
|
38973
|
-
};
|
|
38974
|
-
return { getPublicationById, getPublicationBySlug, getPublicationByDomain: getPublicationByDomain2, getSubscriberCount: getSubscriberCount2, getPostsFeed, getPostsByTag: getPostsByTag2, getPosts, getPostById, updatePost: updatePost2, deletePost: deletePost2, getPostByPublicationIdAndPostSlug, getPostByPublicationSlugAndPostSlug, createPost: createPost2, listOwnPosts, updatePostBySlug, deletePostBySlug, sendTestEmail: sendTestEmail2, getMe, getUser: getUser2, getUserByWallet, getCoin: getCoin2, getCoinByContract, getCoinHoldersById, getCoinHoldersByContract, getBuyArgsById, getBuyArgsByContract, getSellArgsById, getSellArgsByContract, getQuoteById, getQuoteByContract, getPopularCoins: getPopularCoins2, importSubscribers: importSubscribers2, addSubscriber: addSubscriber2, listSubscribers: listSubscribers2, searchPosts: searchPosts2, searchBlogs: searchBlogs2, searchCoins: searchCoins2, createAuthSession, getAuthSession, deleteAuthSession };
|
|
38496
|
+
[CommandType.PAY_PORTION]: [
|
|
38497
|
+
{ type: "address" },
|
|
38498
|
+
{ type: "address" },
|
|
38499
|
+
{ type: "uint256" }
|
|
38500
|
+
]
|
|
38975
38501
|
};
|
|
38976
|
-
|
|
38977
|
-
constructor(
|
|
38978
|
-
this.
|
|
38502
|
+
CommandBuilder = class {
|
|
38503
|
+
constructor() {
|
|
38504
|
+
this.commands = "0x";
|
|
38505
|
+
this.inputs = [];
|
|
38979
38506
|
}
|
|
38980
|
-
|
|
38981
|
-
|
|
38982
|
-
|
|
38983
|
-
|
|
38984
|
-
return this
|
|
38507
|
+
addCommand(type, parameters) {
|
|
38508
|
+
const encoded = encodeAbiParameters(ABI_DEFINITION[type], parameters);
|
|
38509
|
+
this.commands += type.toString(16).padStart(2, "0");
|
|
38510
|
+
this.inputs.push(encoded);
|
|
38511
|
+
return this;
|
|
38985
38512
|
}
|
|
38986
|
-
|
|
38987
|
-
|
|
38988
|
-
* Use this when you expect a single result (e.g., getting by ID).
|
|
38989
|
-
*
|
|
38990
|
-
* @throws Error if no items are returned
|
|
38991
|
-
* @returns A promise that resolves to a single item
|
|
38992
|
-
*/
|
|
38993
|
-
async single() {
|
|
38994
|
-
const result = await this.promise;
|
|
38995
|
-
if (result.items.length === 0) {
|
|
38996
|
-
throw new Error("No items found");
|
|
38997
|
-
}
|
|
38998
|
-
return result.items[0];
|
|
38513
|
+
addPermit2Permit(permit, signature) {
|
|
38514
|
+
return this.addCommand(CommandType.PERMIT2_PERMIT, [permit, signature]);
|
|
38999
38515
|
}
|
|
39000
|
-
|
|
39001
|
-
|
|
39002
|
-
{
|
|
39003
|
-
type: "function",
|
|
39004
|
-
name: "execute",
|
|
39005
|
-
inputs: [
|
|
39006
|
-
{ name: "commands", type: "bytes", internalType: "bytes" },
|
|
39007
|
-
{ name: "inputs", type: "bytes[]", internalType: "bytes[]" }
|
|
39008
|
-
],
|
|
39009
|
-
outputs: [],
|
|
39010
|
-
stateMutability: "payable"
|
|
38516
|
+
addWrapEth(recipient, amount) {
|
|
38517
|
+
return this.addCommand(CommandType.WRAP_ETH, [recipient, amount]);
|
|
39011
38518
|
}
|
|
39012
|
-
|
|
39013
|
-
|
|
39014
|
-
"function allowance(address user, address token, address spender) external view returns (uint160 amount, uint48 expiration, uint48 nonce)"
|
|
39015
|
-
]);
|
|
39016
|
-
AuthResource = class {
|
|
39017
|
-
constructor(api) {
|
|
39018
|
-
this.api = api;
|
|
38519
|
+
addUnwrapWeth(recipient, amount) {
|
|
38520
|
+
return this.addCommand(CommandType.UNWRAP_WETH, [recipient, amount]);
|
|
39019
38521
|
}
|
|
39020
|
-
|
|
39021
|
-
|
|
39022
|
-
|
|
39023
|
-
|
|
39024
|
-
|
|
39025
|
-
|
|
39026
|
-
|
|
39027
|
-
|
|
39028
|
-
* console.log("Open this URL to authenticate:", session.verificationUrl);
|
|
39029
|
-
* ```
|
|
39030
|
-
*
|
|
39031
|
-
* @param body - Optional body with a device name.
|
|
39032
|
-
* @returns A promise that resolves to the session ID, verification URL, and expiry.
|
|
39033
|
-
*/
|
|
39034
|
-
createSession(body = {}) {
|
|
39035
|
-
return this.api.createAuthSession(body);
|
|
38522
|
+
addV3SwapExactIn(recipient, amountIn, amountOutMinimum, path2, unwrap3) {
|
|
38523
|
+
return this.addCommand(CommandType.V3_SWAP_EXACT_IN, [
|
|
38524
|
+
recipient,
|
|
38525
|
+
amountIn,
|
|
38526
|
+
amountOutMinimum,
|
|
38527
|
+
path2,
|
|
38528
|
+
unwrap3
|
|
38529
|
+
]);
|
|
39036
38530
|
}
|
|
39037
|
-
|
|
39038
|
-
|
|
39039
|
-
|
|
39040
|
-
|
|
39041
|
-
|
|
39042
|
-
|
|
39043
|
-
|
|
39044
|
-
|
|
39045
|
-
* if (status.status === "completed") {
|
|
39046
|
-
* console.log("API key:", status.apiKey);
|
|
39047
|
-
* }
|
|
39048
|
-
* ```
|
|
39049
|
-
*
|
|
39050
|
-
* @param sessionId - The session ID returned from `createSession`.
|
|
39051
|
-
* @returns A promise that resolves to the session status (pending, completed with apiKey, or expired).
|
|
39052
|
-
*/
|
|
39053
|
-
getSession(sessionId) {
|
|
39054
|
-
return this.api.getAuthSession(sessionId);
|
|
38531
|
+
addV3SwapExactOut(recipient, amountOut, amountInMaximum, path2, payerIsMsgSender) {
|
|
38532
|
+
return this.addCommand(CommandType.V3_SWAP_EXACT_OUT, [
|
|
38533
|
+
recipient,
|
|
38534
|
+
amountOut,
|
|
38535
|
+
amountInMaximum,
|
|
38536
|
+
path2,
|
|
38537
|
+
payerIsMsgSender
|
|
38538
|
+
]);
|
|
39055
38539
|
}
|
|
39056
|
-
|
|
39057
|
-
|
|
39058
|
-
|
|
39059
|
-
|
|
39060
|
-
|
|
39061
|
-
|
|
39062
|
-
|
|
39063
|
-
|
|
39064
|
-
|
|
39065
|
-
|
|
39066
|
-
|
|
39067
|
-
|
|
39068
|
-
|
|
39069
|
-
|
|
38540
|
+
addPermit2TransferFrom(token, recipient, amount) {
|
|
38541
|
+
return this.addCommand(CommandType.PERMIT2_TRANSFER_FROM, [
|
|
38542
|
+
token,
|
|
38543
|
+
recipient,
|
|
38544
|
+
amount
|
|
38545
|
+
]);
|
|
38546
|
+
}
|
|
38547
|
+
addV2SwapExactIn(recipient, amountIn, amountOutMinimum, path2, payerIsMsgSender) {
|
|
38548
|
+
return this.addCommand(CommandType.V2_SWAP_EXACT_IN, [
|
|
38549
|
+
recipient,
|
|
38550
|
+
amountIn,
|
|
38551
|
+
amountOutMinimum,
|
|
38552
|
+
path2,
|
|
38553
|
+
payerIsMsgSender
|
|
38554
|
+
]);
|
|
38555
|
+
}
|
|
38556
|
+
addV2SwapExactOut(recipient, amountOut, amountInMaximum, path2, payerIsMsgSender) {
|
|
38557
|
+
return this.addCommand(CommandType.V2_SWAP_EXACT_OUT, [
|
|
38558
|
+
recipient,
|
|
38559
|
+
amountOut,
|
|
38560
|
+
amountInMaximum,
|
|
38561
|
+
path2,
|
|
38562
|
+
payerIsMsgSender
|
|
38563
|
+
]);
|
|
38564
|
+
}
|
|
38565
|
+
addV4Swap(actions, params) {
|
|
38566
|
+
return this.addCommand(CommandType.V4_SWAP, [actions, params]);
|
|
38567
|
+
}
|
|
38568
|
+
addSweep(asset, recipient, amount) {
|
|
38569
|
+
return this.addCommand(CommandType.SWEEP, [asset, recipient, amount]);
|
|
38570
|
+
}
|
|
38571
|
+
addPayPortion(asset, recipient, bips) {
|
|
38572
|
+
return this.addCommand(CommandType.PAY_PORTION, [asset, recipient, bips]);
|
|
39070
38573
|
}
|
|
38574
|
+
build() {
|
|
38575
|
+
return [this.commands, this.inputs];
|
|
38576
|
+
}
|
|
38577
|
+
};
|
|
38578
|
+
(function(V4ActionType2) {
|
|
38579
|
+
V4ActionType2[V4ActionType2["INCREASE_LIQUIDITY"] = 0] = "INCREASE_LIQUIDITY";
|
|
38580
|
+
V4ActionType2[V4ActionType2["DECREASE_LIQUIDITY"] = 1] = "DECREASE_LIQUIDITY";
|
|
38581
|
+
V4ActionType2[V4ActionType2["MINT_POSITION"] = 2] = "MINT_POSITION";
|
|
38582
|
+
V4ActionType2[V4ActionType2["BURN_POSITION"] = 3] = "BURN_POSITION";
|
|
38583
|
+
V4ActionType2[V4ActionType2["INCREASE_LIQUIDITY_FROM_DELTAS"] = 4] = "INCREASE_LIQUIDITY_FROM_DELTAS";
|
|
38584
|
+
V4ActionType2[V4ActionType2["MINT_POSITION_FROM_DELTAS"] = 5] = "MINT_POSITION_FROM_DELTAS";
|
|
38585
|
+
V4ActionType2[V4ActionType2["SWAP_EXACT_IN_SINGLE"] = 6] = "SWAP_EXACT_IN_SINGLE";
|
|
38586
|
+
V4ActionType2[V4ActionType2["SWAP_EXACT_IN"] = 7] = "SWAP_EXACT_IN";
|
|
38587
|
+
V4ActionType2[V4ActionType2["SWAP_EXACT_OUT_SINGLE"] = 8] = "SWAP_EXACT_OUT_SINGLE";
|
|
38588
|
+
V4ActionType2[V4ActionType2["SWAP_EXACT_OUT"] = 9] = "SWAP_EXACT_OUT";
|
|
38589
|
+
V4ActionType2[V4ActionType2["SETTLE"] = 11] = "SETTLE";
|
|
38590
|
+
V4ActionType2[V4ActionType2["SETTLE_ALL"] = 12] = "SETTLE_ALL";
|
|
38591
|
+
V4ActionType2[V4ActionType2["TAKE"] = 14] = "TAKE";
|
|
38592
|
+
V4ActionType2[V4ActionType2["TAKE_ALL"] = 15] = "TAKE_ALL";
|
|
38593
|
+
V4ActionType2[V4ActionType2["TAKE_PORTION"] = 16] = "TAKE_PORTION";
|
|
38594
|
+
V4ActionType2[V4ActionType2["CLOSE_CURRENCY"] = 18] = "CLOSE_CURRENCY";
|
|
38595
|
+
V4ActionType2[V4ActionType2["SWEEP"] = 20] = "SWEEP";
|
|
38596
|
+
V4ActionType2[V4ActionType2["WRAP"] = 21] = "WRAP";
|
|
38597
|
+
V4ActionType2[V4ActionType2["UNWRAP"] = 22] = "UNWRAP";
|
|
38598
|
+
})(V4ActionType || (V4ActionType = {}));
|
|
38599
|
+
POOL_KEY_STRUCT = {
|
|
38600
|
+
name: "poolKey",
|
|
38601
|
+
type: "tuple",
|
|
38602
|
+
components: [
|
|
38603
|
+
{ name: "currency0", type: "address" },
|
|
38604
|
+
{ name: "currency1", type: "address" },
|
|
38605
|
+
{ name: "fee", type: "uint24" },
|
|
38606
|
+
{ name: "tickSpacing", type: "int24" },
|
|
38607
|
+
{ name: "hooks", type: "address" }
|
|
38608
|
+
]
|
|
38609
|
+
};
|
|
38610
|
+
PATH_KEY_STRUCT = {
|
|
38611
|
+
name: "pathKey",
|
|
38612
|
+
type: "tuple",
|
|
38613
|
+
components: [
|
|
38614
|
+
{ name: "intermediateCurrency", type: "address" },
|
|
38615
|
+
{ name: "fee", type: "uint256" },
|
|
38616
|
+
{ name: "tickSpacing", type: "int24" },
|
|
38617
|
+
{ name: "hooks", type: "address" },
|
|
38618
|
+
{ name: "hookData", type: "bytes" }
|
|
38619
|
+
]
|
|
38620
|
+
};
|
|
38621
|
+
ABI_DEFINITION2 = {
|
|
38622
|
+
[V4ActionType.INCREASE_LIQUIDITY]: [
|
|
38623
|
+
{ type: "uint256" },
|
|
38624
|
+
{ type: "uint256" },
|
|
38625
|
+
{ type: "uint128" },
|
|
38626
|
+
{ type: "uint128" },
|
|
38627
|
+
{ type: "bytes" }
|
|
38628
|
+
],
|
|
38629
|
+
[V4ActionType.DECREASE_LIQUIDITY]: [
|
|
38630
|
+
{ type: "uint256" },
|
|
38631
|
+
{ type: "uint256" },
|
|
38632
|
+
{ type: "uint128" },
|
|
38633
|
+
{ type: "uint128" },
|
|
38634
|
+
{ type: "bytes" }
|
|
38635
|
+
],
|
|
38636
|
+
[V4ActionType.MINT_POSITION]: [
|
|
38637
|
+
POOL_KEY_STRUCT,
|
|
38638
|
+
{ type: "int24" },
|
|
38639
|
+
{ type: "int24" },
|
|
38640
|
+
{ type: "uint256" },
|
|
38641
|
+
{ type: "uint128" },
|
|
38642
|
+
{ type: "uint128" },
|
|
38643
|
+
{ type: "address" },
|
|
38644
|
+
{ type: "bytes" }
|
|
38645
|
+
],
|
|
38646
|
+
[V4ActionType.BURN_POSITION]: [
|
|
38647
|
+
{ type: "uint256" },
|
|
38648
|
+
{ type: "uint128" },
|
|
38649
|
+
{ type: "uint128" },
|
|
38650
|
+
{ type: "bytes" }
|
|
38651
|
+
],
|
|
38652
|
+
[V4ActionType.INCREASE_LIQUIDITY_FROM_DELTAS]: [
|
|
38653
|
+
{ type: "uint256" },
|
|
38654
|
+
{ type: "uint128" },
|
|
38655
|
+
{ type: "uint128" },
|
|
38656
|
+
{ type: "bytes" }
|
|
38657
|
+
],
|
|
38658
|
+
[V4ActionType.MINT_POSITION_FROM_DELTAS]: [
|
|
38659
|
+
POOL_KEY_STRUCT,
|
|
38660
|
+
{ type: "int24" },
|
|
38661
|
+
{ type: "int24" },
|
|
38662
|
+
{ type: "uint128" },
|
|
38663
|
+
{ type: "uint128" },
|
|
38664
|
+
{ type: "address" },
|
|
38665
|
+
{ type: "bytes" }
|
|
38666
|
+
],
|
|
38667
|
+
[V4ActionType.SWAP_EXACT_IN_SINGLE]: [
|
|
38668
|
+
{
|
|
38669
|
+
name: "swapParams",
|
|
38670
|
+
type: "tuple",
|
|
38671
|
+
components: [
|
|
38672
|
+
POOL_KEY_STRUCT,
|
|
38673
|
+
{ name: "zeroForOne", type: "bool" },
|
|
38674
|
+
{ name: "amountIn", type: "uint128" },
|
|
38675
|
+
{ name: "amountOutMinimum", type: "uint128" },
|
|
38676
|
+
{ name: "hookData", type: "bytes" }
|
|
38677
|
+
]
|
|
38678
|
+
}
|
|
38679
|
+
],
|
|
38680
|
+
[V4ActionType.SWAP_EXACT_IN]: [
|
|
38681
|
+
{
|
|
38682
|
+
name: "swapParams",
|
|
38683
|
+
type: "tuple",
|
|
38684
|
+
components: [
|
|
38685
|
+
{ name: "currencyIn", type: "address" },
|
|
38686
|
+
{
|
|
38687
|
+
name: "path",
|
|
38688
|
+
type: "tuple[]",
|
|
38689
|
+
components: PATH_KEY_STRUCT.components
|
|
38690
|
+
},
|
|
38691
|
+
{ name: "amountIn", type: "uint128" },
|
|
38692
|
+
{ name: "amountOutMinimum", type: "uint128" }
|
|
38693
|
+
]
|
|
38694
|
+
}
|
|
38695
|
+
],
|
|
38696
|
+
[V4ActionType.SWAP_EXACT_OUT_SINGLE]: [
|
|
38697
|
+
{
|
|
38698
|
+
name: "swapParams",
|
|
38699
|
+
type: "tuple",
|
|
38700
|
+
components: [
|
|
38701
|
+
POOL_KEY_STRUCT,
|
|
38702
|
+
{ name: "zeroForOne", type: "bool" },
|
|
38703
|
+
{ name: "amountOut", type: "uint128" },
|
|
38704
|
+
{ name: "amountInMaximum", type: "uint128" },
|
|
38705
|
+
{ name: "hookData", type: "bytes" }
|
|
38706
|
+
]
|
|
38707
|
+
}
|
|
38708
|
+
],
|
|
38709
|
+
[V4ActionType.SWAP_EXACT_OUT]: [
|
|
38710
|
+
{
|
|
38711
|
+
name: "swapParams",
|
|
38712
|
+
type: "tuple",
|
|
38713
|
+
components: [
|
|
38714
|
+
{ name: "currencyOut", type: "address" },
|
|
38715
|
+
{
|
|
38716
|
+
name: "path",
|
|
38717
|
+
type: "tuple[]",
|
|
38718
|
+
components: PATH_KEY_STRUCT.components
|
|
38719
|
+
},
|
|
38720
|
+
{ name: "amountOut", type: "uint128" },
|
|
38721
|
+
{ name: "amountInMaximum", type: "uint128" }
|
|
38722
|
+
]
|
|
38723
|
+
}
|
|
38724
|
+
],
|
|
38725
|
+
[V4ActionType.SETTLE]: [
|
|
38726
|
+
{ type: "address" },
|
|
38727
|
+
{ type: "uint256" },
|
|
38728
|
+
{ type: "bool" }
|
|
38729
|
+
],
|
|
38730
|
+
[V4ActionType.SETTLE_ALL]: [{ type: "address" }, { type: "uint256" }],
|
|
38731
|
+
[V4ActionType.TAKE]: [
|
|
38732
|
+
{ type: "address" },
|
|
38733
|
+
{ type: "address" },
|
|
38734
|
+
{ type: "uint256" }
|
|
38735
|
+
],
|
|
38736
|
+
[V4ActionType.TAKE_ALL]: [{ type: "address" }, { type: "uint256" }],
|
|
38737
|
+
[V4ActionType.TAKE_PORTION]: [
|
|
38738
|
+
{ type: "address" },
|
|
38739
|
+
{ type: "address" },
|
|
38740
|
+
{ type: "uint256" }
|
|
38741
|
+
],
|
|
38742
|
+
[V4ActionType.CLOSE_CURRENCY]: [{ type: "address" }],
|
|
38743
|
+
[V4ActionType.SWEEP]: [{ type: "address" }, { type: "address" }],
|
|
38744
|
+
[V4ActionType.WRAP]: [{ type: "uint256" }],
|
|
38745
|
+
[V4ActionType.UNWRAP]: [{ type: "uint256" }]
|
|
39071
38746
|
};
|
|
39072
38747
|
CoinsResource = class {
|
|
39073
38748
|
constructor(api) {
|
|
@@ -39269,7 +38944,7 @@ var init_dist3 = __esm({
|
|
|
39269
38944
|
publicClient.getBlock(),
|
|
39270
38945
|
publicClient.readContract({
|
|
39271
38946
|
address: ADDRESSES[base.id].permit2,
|
|
39272
|
-
abi:
|
|
38947
|
+
abi: permit2Abi,
|
|
39273
38948
|
functionName: "allowance",
|
|
39274
38949
|
args: [
|
|
39275
38950
|
account.address,
|
|
@@ -39916,6 +39591,916 @@ var init_dist3 = __esm({
|
|
|
39916
39591
|
throw new Error("Invalid identifier provided to get.");
|
|
39917
39592
|
}
|
|
39918
39593
|
};
|
|
39594
|
+
getPublicationByIdParams = zod.object({
|
|
39595
|
+
"publicationId": zod.string().describe("Unique identifier of the publication")
|
|
39596
|
+
});
|
|
39597
|
+
getPublicationByIdResponseSlugMax = 256;
|
|
39598
|
+
getPublicationByIdResponseSummaryMax = 500;
|
|
39599
|
+
getPublicationByIdResponse = zod.object({
|
|
39600
|
+
"id": zod.string().describe("Unique identifier for the publication"),
|
|
39601
|
+
"name": zod.string().describe("Display name of the publication"),
|
|
39602
|
+
"ownerUserId": zod.string().describe("ID of the user who owns this publication"),
|
|
39603
|
+
"slug": zod.string().min(1).max(getPublicationByIdResponseSlugMax).describe("URL-friendly identifier for the publication; accessible at paragraph.com/@[slug]"),
|
|
39604
|
+
"customDomain": zod.string().url().optional().describe("Custom domain configured for this publication"),
|
|
39605
|
+
"summary": zod.string().max(getPublicationByIdResponseSummaryMax).optional().describe("Brief description of the publication (max 500 characters)"),
|
|
39606
|
+
"logoUrl": zod.string().url().optional().describe("URL to the publication's logo image")
|
|
39607
|
+
});
|
|
39608
|
+
getPublicationBySlugPathSlugMax = 256;
|
|
39609
|
+
getPublicationBySlugParams = zod.object({
|
|
39610
|
+
"slug": zod.string().min(1).max(getPublicationBySlugPathSlugMax).describe("URL-friendly identifier of the publication")
|
|
39611
|
+
});
|
|
39612
|
+
getPublicationBySlugResponseSlugMax = 256;
|
|
39613
|
+
getPublicationBySlugResponseSummaryMax = 500;
|
|
39614
|
+
getPublicationBySlugResponse = zod.object({
|
|
39615
|
+
"id": zod.string().describe("Unique identifier for the publication"),
|
|
39616
|
+
"name": zod.string().describe("Display name of the publication"),
|
|
39617
|
+
"ownerUserId": zod.string().describe("ID of the user who owns this publication"),
|
|
39618
|
+
"slug": zod.string().min(1).max(getPublicationBySlugResponseSlugMax).describe("URL-friendly identifier for the publication; accessible at paragraph.com/@[slug]"),
|
|
39619
|
+
"customDomain": zod.string().url().optional().describe("Custom domain configured for this publication"),
|
|
39620
|
+
"summary": zod.string().max(getPublicationBySlugResponseSummaryMax).optional().describe("Brief description of the publication (max 500 characters)"),
|
|
39621
|
+
"logoUrl": zod.string().url().optional().describe("URL to the publication's logo image")
|
|
39622
|
+
});
|
|
39623
|
+
getPublicationByDomainParams = zod.object({
|
|
39624
|
+
"domain": zod.string().describe("Custom domain of the publication")
|
|
39625
|
+
});
|
|
39626
|
+
getPublicationByDomainResponseSlugMax = 256;
|
|
39627
|
+
getPublicationByDomainResponseSummaryMax = 500;
|
|
39628
|
+
getPublicationByDomainResponse = zod.object({
|
|
39629
|
+
"id": zod.string().describe("Unique identifier for the publication"),
|
|
39630
|
+
"name": zod.string().describe("Display name of the publication"),
|
|
39631
|
+
"ownerUserId": zod.string().describe("ID of the user who owns this publication"),
|
|
39632
|
+
"slug": zod.string().min(1).max(getPublicationByDomainResponseSlugMax).describe("URL-friendly identifier for the publication; accessible at paragraph.com/@[slug]"),
|
|
39633
|
+
"customDomain": zod.string().url().optional().describe("Custom domain configured for this publication"),
|
|
39634
|
+
"summary": zod.string().max(getPublicationByDomainResponseSummaryMax).optional().describe("Brief description of the publication (max 500 characters)"),
|
|
39635
|
+
"logoUrl": zod.string().url().optional().describe("URL to the publication's logo image")
|
|
39636
|
+
});
|
|
39637
|
+
getSubscriberCountParams = zod.object({
|
|
39638
|
+
"publicationId": zod.string().describe("Unique identifier of the publication")
|
|
39639
|
+
});
|
|
39640
|
+
getSubscriberCountResponse = zod.object({
|
|
39641
|
+
"count": zod.number().describe("Total number of subscribers")
|
|
39642
|
+
});
|
|
39643
|
+
getPostsFeedQueryLimitDefault = 20;
|
|
39644
|
+
getPostsFeedQueryLimitMax = 60;
|
|
39645
|
+
getPostsFeedQueryParams = zod.object({
|
|
39646
|
+
"cursor": zod.string().optional().describe("Cursor for pagination"),
|
|
39647
|
+
"limit": zod.number().min(1).max(getPostsFeedQueryLimitMax).default(getPostsFeedQueryLimitDefault).describe("Maximum number of items to return (1-60, default: 20)"),
|
|
39648
|
+
"includeContent": zod.union([zod.boolean(), zod.string()]).optional().describe("Include full content fields (json, staticHtml, markdown) in the post. Default: false")
|
|
39649
|
+
});
|
|
39650
|
+
getPostsFeedResponseItemsItemPostTitleMax = 200;
|
|
39651
|
+
getPostsFeedResponseItemsItemPostSubtitleMax = 300;
|
|
39652
|
+
getPostsFeedResponseItemsItemPostSlugMax = 256;
|
|
39653
|
+
getPostsFeedResponseItemsItemPostAuthorsItemWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
39654
|
+
getPostsFeedResponseItemsItemPostAuthorsItemBioMax = 500;
|
|
39655
|
+
getPostsFeedResponseItemsItemPublicationSlugMax = 256;
|
|
39656
|
+
getPostsFeedResponseItemsItemPublicationSummaryMax = 500;
|
|
39657
|
+
getPostsFeedResponseItemsItemUserWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
39658
|
+
getPostsFeedResponseItemsItemUserBioMax = 500;
|
|
39659
|
+
getPostsFeedResponse = zod.object({
|
|
39660
|
+
"items": zod.array(zod.object({
|
|
39661
|
+
"post": zod.object({
|
|
39662
|
+
"id": zod.string().describe("Unique identifier for the post"),
|
|
39663
|
+
"title": zod.string().max(getPostsFeedResponseItemsItemPostTitleMax).describe("Title of the post"),
|
|
39664
|
+
"imageUrl": zod.string().url().optional().describe("Optional URL to the post's main image"),
|
|
39665
|
+
"publishedAt": zod.string().optional().describe("Epoch timestamp when the post was published"),
|
|
39666
|
+
"updatedAt": zod.string().optional().describe("Epoch timestamp when the post was last updated"),
|
|
39667
|
+
"subtitle": zod.string().max(getPostsFeedResponseItemsItemPostSubtitleMax).optional().describe("Optional subtitle or brief summary"),
|
|
39668
|
+
"slug": zod.string().min(1).max(getPostsFeedResponseItemsItemPostSlugMax).describe("URL-friendly identifier for the post; accessible at paragraph.com/@[publicationSlug]/[slug]"),
|
|
39669
|
+
"staticHtml": zod.string().optional().describe("Rendered HTML content of the post"),
|
|
39670
|
+
"json": zod.string().optional().describe("TipTap JSON representation of the post content structure. This is the source of truth that the staticHtml and markdown is generated from"),
|
|
39671
|
+
"markdown": zod.string().optional().describe("Markdown source of the post content"),
|
|
39672
|
+
"coinId": zod.string().optional().describe("ID of the associated coin, if the post is coined"),
|
|
39673
|
+
"categories": zod.array(zod.string()).optional().describe("Categories/tags associated with this post"),
|
|
39674
|
+
"authors": zod.array(zod.object({
|
|
39675
|
+
"id": zod.string().describe("Unique identifier for the user"),
|
|
39676
|
+
"walletAddress": zod.string().regex(getPostsFeedResponseItemsItemPostAuthorsItemWalletAddressRegExp).optional().describe("Wallet address of the user"),
|
|
39677
|
+
"avatarUrl": zod.string().url().optional().describe("URL to the user's avatar image"),
|
|
39678
|
+
"publicationId": zod.string().describe("ID of the publication this user belongs to"),
|
|
39679
|
+
"name": zod.string().optional().describe("Display name of the user"),
|
|
39680
|
+
"bio": zod.string().max(getPostsFeedResponseItemsItemPostAuthorsItemBioMax).optional().describe("Brief biography of the user (max 500 characters)"),
|
|
39681
|
+
"farcaster": zod.object({
|
|
39682
|
+
"username": zod.string().describe("Farcaster username"),
|
|
39683
|
+
"displayName": zod.string().describe("Farcaster display name"),
|
|
39684
|
+
"fid": zod.number().describe("Farcaster fid")
|
|
39685
|
+
}).optional().describe("Farcaster profile information, if linked")
|
|
39686
|
+
})).optional().describe("Authors of this post"),
|
|
39687
|
+
"authorIds": zod.array(zod.string()).optional().describe("IDs of the authors of this post"),
|
|
39688
|
+
"views": zod.number().optional().describe("Total page views. Only included when fetching your own posts via GET /v1/posts")
|
|
39689
|
+
}).describe("The post content"),
|
|
39690
|
+
"publication": zod.object({
|
|
39691
|
+
"id": zod.string().describe("Unique identifier for the publication"),
|
|
39692
|
+
"name": zod.string().describe("Display name of the publication"),
|
|
39693
|
+
"ownerUserId": zod.string().describe("ID of the user who owns this publication"),
|
|
39694
|
+
"slug": zod.string().min(1).max(getPostsFeedResponseItemsItemPublicationSlugMax).describe("URL-friendly identifier for the publication; accessible at paragraph.com/@[slug]"),
|
|
39695
|
+
"customDomain": zod.string().url().optional().describe("Custom domain configured for this publication"),
|
|
39696
|
+
"summary": zod.string().max(getPostsFeedResponseItemsItemPublicationSummaryMax).optional().describe("Brief description of the publication (max 500 characters)"),
|
|
39697
|
+
"logoUrl": zod.string().url().optional().describe("URL to the publication's logo image")
|
|
39698
|
+
}).describe("The publication this post belongs to"),
|
|
39699
|
+
"user": zod.object({
|
|
39700
|
+
"id": zod.string().describe("Unique identifier for the user"),
|
|
39701
|
+
"walletAddress": zod.string().regex(getPostsFeedResponseItemsItemUserWalletAddressRegExp).optional().describe("Wallet address of the user"),
|
|
39702
|
+
"avatarUrl": zod.string().url().optional().describe("URL to the user's avatar image"),
|
|
39703
|
+
"publicationId": zod.string().describe("ID of the publication this user belongs to"),
|
|
39704
|
+
"name": zod.string().optional().describe("Display name of the user"),
|
|
39705
|
+
"bio": zod.string().max(getPostsFeedResponseItemsItemUserBioMax).optional().describe("Brief biography of the user (max 500 characters)"),
|
|
39706
|
+
"farcaster": zod.object({
|
|
39707
|
+
"username": zod.string().describe("Farcaster username"),
|
|
39708
|
+
"displayName": zod.string().describe("Farcaster display name"),
|
|
39709
|
+
"fid": zod.number().describe("Farcaster fid")
|
|
39710
|
+
}).optional().describe("Farcaster profile information, if linked")
|
|
39711
|
+
}).describe("The user who owns the publication this post belongs to")
|
|
39712
|
+
})).describe("Array of items in this page"),
|
|
39713
|
+
"pagination": zod.object({
|
|
39714
|
+
"cursor": zod.string().optional().describe("Cursor for fetching the next page of results"),
|
|
39715
|
+
"hasMore": zod.boolean().describe("Whether more results are available"),
|
|
39716
|
+
"total": zod.number().optional().describe("Total number of items available")
|
|
39717
|
+
})
|
|
39718
|
+
});
|
|
39719
|
+
getPostsByTagParams = zod.object({
|
|
39720
|
+
"tag": zod.string().min(1).describe("Tag to filter posts by")
|
|
39721
|
+
});
|
|
39722
|
+
getPostsByTagQueryLimitDefault = 10;
|
|
39723
|
+
getPostsByTagQueryLimitMax = 100;
|
|
39724
|
+
getPostsByTagQueryParams = zod.object({
|
|
39725
|
+
"cursor": zod.string().optional().describe("Cursor for pagination"),
|
|
39726
|
+
"limit": zod.number().min(1).max(getPostsByTagQueryLimitMax).default(getPostsByTagQueryLimitDefault).describe("Maximum number of items to return (1-100, default: 10)"),
|
|
39727
|
+
"includeContent": zod.union([zod.boolean(), zod.string()]).optional().describe("Include full content fields (json, staticHtml, markdown) in the post. Default: false")
|
|
39728
|
+
});
|
|
39729
|
+
getPostsByTagResponseItemsItemTitleMax = 200;
|
|
39730
|
+
getPostsByTagResponseItemsItemSubtitleMax = 300;
|
|
39731
|
+
getPostsByTagResponseItemsItemSlugMax = 256;
|
|
39732
|
+
getPostsByTagResponseItemsItemAuthorsItemWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
39733
|
+
getPostsByTagResponseItemsItemAuthorsItemBioMax = 500;
|
|
39734
|
+
getPostsByTagResponse = zod.object({
|
|
39735
|
+
"items": zod.array(zod.object({
|
|
39736
|
+
"id": zod.string().describe("Unique identifier for the post"),
|
|
39737
|
+
"title": zod.string().max(getPostsByTagResponseItemsItemTitleMax).describe("Title of the post"),
|
|
39738
|
+
"imageUrl": zod.string().url().optional().describe("Optional URL to the post's main image"),
|
|
39739
|
+
"publishedAt": zod.string().optional().describe("Epoch timestamp when the post was published"),
|
|
39740
|
+
"updatedAt": zod.string().optional().describe("Epoch timestamp when the post was last updated"),
|
|
39741
|
+
"subtitle": zod.string().max(getPostsByTagResponseItemsItemSubtitleMax).optional().describe("Optional subtitle or brief summary"),
|
|
39742
|
+
"slug": zod.string().min(1).max(getPostsByTagResponseItemsItemSlugMax).describe("URL-friendly identifier for the post; accessible at paragraph.com/@[publicationSlug]/[slug]"),
|
|
39743
|
+
"staticHtml": zod.string().optional().describe("Rendered HTML content of the post"),
|
|
39744
|
+
"json": zod.string().optional().describe("TipTap JSON representation of the post content structure. This is the source of truth that the staticHtml and markdown is generated from"),
|
|
39745
|
+
"markdown": zod.string().optional().describe("Markdown source of the post content"),
|
|
39746
|
+
"coinId": zod.string().optional().describe("ID of the associated coin, if the post is coined"),
|
|
39747
|
+
"categories": zod.array(zod.string()).optional().describe("Categories/tags associated with this post"),
|
|
39748
|
+
"authors": zod.array(zod.object({
|
|
39749
|
+
"id": zod.string().describe("Unique identifier for the user"),
|
|
39750
|
+
"walletAddress": zod.string().regex(getPostsByTagResponseItemsItemAuthorsItemWalletAddressRegExp).optional().describe("Wallet address of the user"),
|
|
39751
|
+
"avatarUrl": zod.string().url().optional().describe("URL to the user's avatar image"),
|
|
39752
|
+
"publicationId": zod.string().describe("ID of the publication this user belongs to"),
|
|
39753
|
+
"name": zod.string().optional().describe("Display name of the user"),
|
|
39754
|
+
"bio": zod.string().max(getPostsByTagResponseItemsItemAuthorsItemBioMax).optional().describe("Brief biography of the user (max 500 characters)"),
|
|
39755
|
+
"farcaster": zod.object({
|
|
39756
|
+
"username": zod.string().describe("Farcaster username"),
|
|
39757
|
+
"displayName": zod.string().describe("Farcaster display name"),
|
|
39758
|
+
"fid": zod.number().describe("Farcaster fid")
|
|
39759
|
+
}).optional().describe("Farcaster profile information, if linked")
|
|
39760
|
+
})).optional().describe("Authors of this post"),
|
|
39761
|
+
"authorIds": zod.array(zod.string()).optional().describe("IDs of the authors of this post"),
|
|
39762
|
+
"views": zod.number().optional().describe("Total page views. Only included when fetching your own posts via GET /v1/posts")
|
|
39763
|
+
})).describe("Array of items in this page"),
|
|
39764
|
+
"pagination": zod.object({
|
|
39765
|
+
"cursor": zod.string().optional().describe("Cursor for fetching the next page of results"),
|
|
39766
|
+
"hasMore": zod.boolean().describe("Whether more results are available"),
|
|
39767
|
+
"total": zod.number().optional().describe("Total number of items available")
|
|
39768
|
+
})
|
|
39769
|
+
});
|
|
39770
|
+
getPostsParams = zod.object({
|
|
39771
|
+
"publicationId": zod.string().describe("Unique identifier of the publication")
|
|
39772
|
+
});
|
|
39773
|
+
getPostsQueryLimitDefault = 10;
|
|
39774
|
+
getPostsQueryLimitMax = 100;
|
|
39775
|
+
getPostsQueryParams = zod.object({
|
|
39776
|
+
"cursor": zod.string().optional().describe("Cursor for pagination"),
|
|
39777
|
+
"limit": zod.number().min(1).max(getPostsQueryLimitMax).default(getPostsQueryLimitDefault).describe("Maximum number of items to return (1-100, default: 10)"),
|
|
39778
|
+
"includeContent": zod.union([zod.boolean(), zod.string()]).optional().describe("Include full content fields (markdown, json, staticHtml). Default: false")
|
|
39779
|
+
});
|
|
39780
|
+
getPostsResponseItemsItemTitleMax = 200;
|
|
39781
|
+
getPostsResponseItemsItemSubtitleMax = 300;
|
|
39782
|
+
getPostsResponseItemsItemSlugMax = 256;
|
|
39783
|
+
getPostsResponseItemsItemAuthorsItemWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
39784
|
+
getPostsResponseItemsItemAuthorsItemBioMax = 500;
|
|
39785
|
+
getPostsResponse = zod.object({
|
|
39786
|
+
"items": zod.array(zod.object({
|
|
39787
|
+
"id": zod.string().describe("Unique identifier for the post"),
|
|
39788
|
+
"title": zod.string().max(getPostsResponseItemsItemTitleMax).describe("Title of the post"),
|
|
39789
|
+
"imageUrl": zod.string().url().optional().describe("Optional URL to the post's main image"),
|
|
39790
|
+
"publishedAt": zod.string().optional().describe("Epoch timestamp when the post was published"),
|
|
39791
|
+
"updatedAt": zod.string().optional().describe("Epoch timestamp when the post was last updated"),
|
|
39792
|
+
"subtitle": zod.string().max(getPostsResponseItemsItemSubtitleMax).optional().describe("Optional subtitle or brief summary"),
|
|
39793
|
+
"slug": zod.string().min(1).max(getPostsResponseItemsItemSlugMax).describe("URL-friendly identifier for the post; accessible at paragraph.com/@[publicationSlug]/[slug]"),
|
|
39794
|
+
"staticHtml": zod.string().optional().describe("Rendered HTML content of the post"),
|
|
39795
|
+
"json": zod.string().optional().describe("TipTap JSON representation of the post content structure. This is the source of truth that the staticHtml and markdown is generated from"),
|
|
39796
|
+
"markdown": zod.string().optional().describe("Markdown source of the post content"),
|
|
39797
|
+
"coinId": zod.string().optional().describe("ID of the associated coin, if the post is coined"),
|
|
39798
|
+
"categories": zod.array(zod.string()).optional().describe("Categories/tags associated with this post"),
|
|
39799
|
+
"authors": zod.array(zod.object({
|
|
39800
|
+
"id": zod.string().describe("Unique identifier for the user"),
|
|
39801
|
+
"walletAddress": zod.string().regex(getPostsResponseItemsItemAuthorsItemWalletAddressRegExp).optional().describe("Wallet address of the user"),
|
|
39802
|
+
"avatarUrl": zod.string().url().optional().describe("URL to the user's avatar image"),
|
|
39803
|
+
"publicationId": zod.string().describe("ID of the publication this user belongs to"),
|
|
39804
|
+
"name": zod.string().optional().describe("Display name of the user"),
|
|
39805
|
+
"bio": zod.string().max(getPostsResponseItemsItemAuthorsItemBioMax).optional().describe("Brief biography of the user (max 500 characters)"),
|
|
39806
|
+
"farcaster": zod.object({
|
|
39807
|
+
"username": zod.string().describe("Farcaster username"),
|
|
39808
|
+
"displayName": zod.string().describe("Farcaster display name"),
|
|
39809
|
+
"fid": zod.number().describe("Farcaster fid")
|
|
39810
|
+
}).optional().describe("Farcaster profile information, if linked")
|
|
39811
|
+
})).optional().describe("Authors of this post"),
|
|
39812
|
+
"authorIds": zod.array(zod.string()).optional().describe("IDs of the authors of this post"),
|
|
39813
|
+
"views": zod.number().optional().describe("Total page views. Only included when fetching your own posts via GET /v1/posts")
|
|
39814
|
+
})).describe("Array of items in this page"),
|
|
39815
|
+
"pagination": zod.object({
|
|
39816
|
+
"cursor": zod.string().optional().describe("Cursor for fetching the next page of results"),
|
|
39817
|
+
"hasMore": zod.boolean().describe("Whether more results are available"),
|
|
39818
|
+
"total": zod.number().optional().describe("Total number of items available")
|
|
39819
|
+
})
|
|
39820
|
+
});
|
|
39821
|
+
getPostByIdParams = zod.object({
|
|
39822
|
+
"postId": zod.string().describe("Unique identifier of the post")
|
|
39823
|
+
});
|
|
39824
|
+
getPostByIdQueryParams = zod.object({
|
|
39825
|
+
"includeContent": zod.union([zod.boolean(), zod.string()]).optional().describe("Include full content fields (markdown, json, staticHtml). Default: false")
|
|
39826
|
+
});
|
|
39827
|
+
getPostByIdResponseTitleMax = 200;
|
|
39828
|
+
getPostByIdResponseSubtitleMax = 300;
|
|
39829
|
+
getPostByIdResponseSlugMax = 256;
|
|
39830
|
+
getPostByIdResponseAuthorsItemWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
39831
|
+
getPostByIdResponseAuthorsItemBioMax = 500;
|
|
39832
|
+
getPostByIdResponse = zod.object({
|
|
39833
|
+
"id": zod.string().describe("Unique identifier for the post"),
|
|
39834
|
+
"title": zod.string().max(getPostByIdResponseTitleMax).describe("Title of the post"),
|
|
39835
|
+
"imageUrl": zod.string().url().optional().describe("Optional URL to the post's main image"),
|
|
39836
|
+
"publishedAt": zod.string().optional().describe("Epoch timestamp when the post was published"),
|
|
39837
|
+
"updatedAt": zod.string().optional().describe("Epoch timestamp when the post was last updated"),
|
|
39838
|
+
"subtitle": zod.string().max(getPostByIdResponseSubtitleMax).optional().describe("Optional subtitle or brief summary"),
|
|
39839
|
+
"slug": zod.string().min(1).max(getPostByIdResponseSlugMax).describe("URL-friendly identifier for the post; accessible at paragraph.com/@[publicationSlug]/[slug]"),
|
|
39840
|
+
"staticHtml": zod.string().optional().describe("Rendered HTML content of the post"),
|
|
39841
|
+
"json": zod.string().optional().describe("TipTap JSON representation of the post content structure. This is the source of truth that the staticHtml and markdown is generated from"),
|
|
39842
|
+
"markdown": zod.string().optional().describe("Markdown source of the post content"),
|
|
39843
|
+
"coinId": zod.string().optional().describe("ID of the associated coin, if the post is coined"),
|
|
39844
|
+
"categories": zod.array(zod.string()).optional().describe("Categories/tags associated with this post"),
|
|
39845
|
+
"authors": zod.array(zod.object({
|
|
39846
|
+
"id": zod.string().describe("Unique identifier for the user"),
|
|
39847
|
+
"walletAddress": zod.string().regex(getPostByIdResponseAuthorsItemWalletAddressRegExp).optional().describe("Wallet address of the user"),
|
|
39848
|
+
"avatarUrl": zod.string().url().optional().describe("URL to the user's avatar image"),
|
|
39849
|
+
"publicationId": zod.string().describe("ID of the publication this user belongs to"),
|
|
39850
|
+
"name": zod.string().optional().describe("Display name of the user"),
|
|
39851
|
+
"bio": zod.string().max(getPostByIdResponseAuthorsItemBioMax).optional().describe("Brief biography of the user (max 500 characters)"),
|
|
39852
|
+
"farcaster": zod.object({
|
|
39853
|
+
"username": zod.string().describe("Farcaster username"),
|
|
39854
|
+
"displayName": zod.string().describe("Farcaster display name"),
|
|
39855
|
+
"fid": zod.number().describe("Farcaster fid")
|
|
39856
|
+
}).optional().describe("Farcaster profile information, if linked")
|
|
39857
|
+
})).optional().describe("Authors of this post"),
|
|
39858
|
+
"authorIds": zod.array(zod.string()).optional().describe("IDs of the authors of this post"),
|
|
39859
|
+
"views": zod.number().optional().describe("Total page views. Only included when fetching your own posts via GET /v1/posts")
|
|
39860
|
+
});
|
|
39861
|
+
updatePostParams = zod.object({
|
|
39862
|
+
"postId": zod.string().describe("Unique identifier of the post to update")
|
|
39863
|
+
});
|
|
39864
|
+
updatePostBodyTitleMax = 200;
|
|
39865
|
+
updatePostBodySubtitleMax = 300;
|
|
39866
|
+
updatePostBodySlugMax = 256;
|
|
39867
|
+
updatePostBodyPostPreviewMax = 500;
|
|
39868
|
+
updatePostBody = zod.object({
|
|
39869
|
+
"markdown": zod.string().optional().describe("Post content in Markdown format. Replaces full content \u2014 rich blocks created in the editor will be lost"),
|
|
39870
|
+
"title": zod.string().max(updatePostBodyTitleMax).optional().describe("Title of the post"),
|
|
39871
|
+
"subtitle": zod.string().max(updatePostBodySubtitleMax).optional().describe("Optional subtitle or brief summary"),
|
|
39872
|
+
"slug": zod.string().min(1).max(updatePostBodySlugMax).optional().describe("URL-friendly identifier for the post"),
|
|
39873
|
+
"postPreview": zod.string().max(updatePostBodyPostPreviewMax).optional().describe("Preview text for the post"),
|
|
39874
|
+
"categories": zod.union([zod.array(zod.string()), zod.string()]).optional().describe("Category tags for the post. Can also be a comma-separated string."),
|
|
39875
|
+
"status": zod.enum(["draft", "published", "archived"]).optional().describe("Set to 'published' to publish, 'draft' to unpublish, or 'archived' to archive")
|
|
39876
|
+
});
|
|
39877
|
+
updatePostResponse = zod.object({
|
|
39878
|
+
"success": zod.literal(true).describe("Whether the update succeeded")
|
|
39879
|
+
});
|
|
39880
|
+
deletePostParams = zod.object({
|
|
39881
|
+
"postId": zod.string().describe("Unique identifier of the post to delete")
|
|
39882
|
+
});
|
|
39883
|
+
deletePostBody = zod.object({});
|
|
39884
|
+
deletePostResponse = zod.object({
|
|
39885
|
+
"success": zod.literal(true).describe("Whether the deletion succeeded")
|
|
39886
|
+
});
|
|
39887
|
+
getPostByPublicationIdAndPostSlugPathPostSlugMax = 256;
|
|
39888
|
+
getPostByPublicationIdAndPostSlugParams = zod.object({
|
|
39889
|
+
"publicationId": zod.string().describe("Unique identifier of the publication"),
|
|
39890
|
+
"postSlug": zod.string().min(1).max(getPostByPublicationIdAndPostSlugPathPostSlugMax).describe("URL-friendly identifier of the post")
|
|
39891
|
+
});
|
|
39892
|
+
getPostByPublicationIdAndPostSlugQueryParams = zod.object({
|
|
39893
|
+
"includeContent": zod.union([zod.boolean(), zod.string()]).optional().describe("Include full content fields (markdown, json, staticHtml). Default: false")
|
|
39894
|
+
});
|
|
39895
|
+
getPostByPublicationIdAndPostSlugResponseTitleMax = 200;
|
|
39896
|
+
getPostByPublicationIdAndPostSlugResponseSubtitleMax = 300;
|
|
39897
|
+
getPostByPublicationIdAndPostSlugResponseSlugMax = 256;
|
|
39898
|
+
getPostByPublicationIdAndPostSlugResponseAuthorsItemWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
39899
|
+
getPostByPublicationIdAndPostSlugResponseAuthorsItemBioMax = 500;
|
|
39900
|
+
getPostByPublicationIdAndPostSlugResponse = zod.object({
|
|
39901
|
+
"id": zod.string().describe("Unique identifier for the post"),
|
|
39902
|
+
"title": zod.string().max(getPostByPublicationIdAndPostSlugResponseTitleMax).describe("Title of the post"),
|
|
39903
|
+
"imageUrl": zod.string().url().optional().describe("Optional URL to the post's main image"),
|
|
39904
|
+
"publishedAt": zod.string().optional().describe("Epoch timestamp when the post was published"),
|
|
39905
|
+
"updatedAt": zod.string().optional().describe("Epoch timestamp when the post was last updated"),
|
|
39906
|
+
"subtitle": zod.string().max(getPostByPublicationIdAndPostSlugResponseSubtitleMax).optional().describe("Optional subtitle or brief summary"),
|
|
39907
|
+
"slug": zod.string().min(1).max(getPostByPublicationIdAndPostSlugResponseSlugMax).describe("URL-friendly identifier for the post; accessible at paragraph.com/@[publicationSlug]/[slug]"),
|
|
39908
|
+
"staticHtml": zod.string().optional().describe("Rendered HTML content of the post"),
|
|
39909
|
+
"json": zod.string().optional().describe("TipTap JSON representation of the post content structure. This is the source of truth that the staticHtml and markdown is generated from"),
|
|
39910
|
+
"markdown": zod.string().optional().describe("Markdown source of the post content"),
|
|
39911
|
+
"coinId": zod.string().optional().describe("ID of the associated coin, if the post is coined"),
|
|
39912
|
+
"categories": zod.array(zod.string()).optional().describe("Categories/tags associated with this post"),
|
|
39913
|
+
"authors": zod.array(zod.object({
|
|
39914
|
+
"id": zod.string().describe("Unique identifier for the user"),
|
|
39915
|
+
"walletAddress": zod.string().regex(getPostByPublicationIdAndPostSlugResponseAuthorsItemWalletAddressRegExp).optional().describe("Wallet address of the user"),
|
|
39916
|
+
"avatarUrl": zod.string().url().optional().describe("URL to the user's avatar image"),
|
|
39917
|
+
"publicationId": zod.string().describe("ID of the publication this user belongs to"),
|
|
39918
|
+
"name": zod.string().optional().describe("Display name of the user"),
|
|
39919
|
+
"bio": zod.string().max(getPostByPublicationIdAndPostSlugResponseAuthorsItemBioMax).optional().describe("Brief biography of the user (max 500 characters)"),
|
|
39920
|
+
"farcaster": zod.object({
|
|
39921
|
+
"username": zod.string().describe("Farcaster username"),
|
|
39922
|
+
"displayName": zod.string().describe("Farcaster display name"),
|
|
39923
|
+
"fid": zod.number().describe("Farcaster fid")
|
|
39924
|
+
}).optional().describe("Farcaster profile information, if linked")
|
|
39925
|
+
})).optional().describe("Authors of this post"),
|
|
39926
|
+
"authorIds": zod.array(zod.string()).optional().describe("IDs of the authors of this post"),
|
|
39927
|
+
"views": zod.number().optional().describe("Total page views. Only included when fetching your own posts via GET /v1/posts")
|
|
39928
|
+
});
|
|
39929
|
+
getPostByPublicationSlugAndPostSlugPathPublicationSlugMax = 256;
|
|
39930
|
+
getPostByPublicationSlugAndPostSlugPathPostSlugMax = 256;
|
|
39931
|
+
getPostByPublicationSlugAndPostSlugParams = zod.object({
|
|
39932
|
+
"publicationSlug": zod.string().min(1).max(getPostByPublicationSlugAndPostSlugPathPublicationSlugMax).describe("URL-friendly identifier of the publication, e.g. 'blog'"),
|
|
39933
|
+
"postSlug": zod.string().min(1).max(getPostByPublicationSlugAndPostSlugPathPostSlugMax).describe("URL-friendly identifier of the post, e.g. 'my-first-post'")
|
|
39934
|
+
});
|
|
39935
|
+
getPostByPublicationSlugAndPostSlugQueryParams = zod.object({
|
|
39936
|
+
"includeContent": zod.union([zod.boolean(), zod.string()]).optional().describe("Include full content fields (markdown, json, staticHtml). Default: false")
|
|
39937
|
+
});
|
|
39938
|
+
getPostByPublicationSlugAndPostSlugResponseTitleMax = 200;
|
|
39939
|
+
getPostByPublicationSlugAndPostSlugResponseSubtitleMax = 300;
|
|
39940
|
+
getPostByPublicationSlugAndPostSlugResponseSlugMax = 256;
|
|
39941
|
+
getPostByPublicationSlugAndPostSlugResponseAuthorsItemWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
39942
|
+
getPostByPublicationSlugAndPostSlugResponseAuthorsItemBioMax = 500;
|
|
39943
|
+
getPostByPublicationSlugAndPostSlugResponse = zod.object({
|
|
39944
|
+
"id": zod.string().describe("Unique identifier for the post"),
|
|
39945
|
+
"title": zod.string().max(getPostByPublicationSlugAndPostSlugResponseTitleMax).describe("Title of the post"),
|
|
39946
|
+
"imageUrl": zod.string().url().optional().describe("Optional URL to the post's main image"),
|
|
39947
|
+
"publishedAt": zod.string().optional().describe("Epoch timestamp when the post was published"),
|
|
39948
|
+
"updatedAt": zod.string().optional().describe("Epoch timestamp when the post was last updated"),
|
|
39949
|
+
"subtitle": zod.string().max(getPostByPublicationSlugAndPostSlugResponseSubtitleMax).optional().describe("Optional subtitle or brief summary"),
|
|
39950
|
+
"slug": zod.string().min(1).max(getPostByPublicationSlugAndPostSlugResponseSlugMax).describe("URL-friendly identifier for the post; accessible at paragraph.com/@[publicationSlug]/[slug]"),
|
|
39951
|
+
"staticHtml": zod.string().optional().describe("Rendered HTML content of the post"),
|
|
39952
|
+
"json": zod.string().optional().describe("TipTap JSON representation of the post content structure. This is the source of truth that the staticHtml and markdown is generated from"),
|
|
39953
|
+
"markdown": zod.string().optional().describe("Markdown source of the post content"),
|
|
39954
|
+
"coinId": zod.string().optional().describe("ID of the associated coin, if the post is coined"),
|
|
39955
|
+
"categories": zod.array(zod.string()).optional().describe("Categories/tags associated with this post"),
|
|
39956
|
+
"authors": zod.array(zod.object({
|
|
39957
|
+
"id": zod.string().describe("Unique identifier for the user"),
|
|
39958
|
+
"walletAddress": zod.string().regex(getPostByPublicationSlugAndPostSlugResponseAuthorsItemWalletAddressRegExp).optional().describe("Wallet address of the user"),
|
|
39959
|
+
"avatarUrl": zod.string().url().optional().describe("URL to the user's avatar image"),
|
|
39960
|
+
"publicationId": zod.string().describe("ID of the publication this user belongs to"),
|
|
39961
|
+
"name": zod.string().optional().describe("Display name of the user"),
|
|
39962
|
+
"bio": zod.string().max(getPostByPublicationSlugAndPostSlugResponseAuthorsItemBioMax).optional().describe("Brief biography of the user (max 500 characters)"),
|
|
39963
|
+
"farcaster": zod.object({
|
|
39964
|
+
"username": zod.string().describe("Farcaster username"),
|
|
39965
|
+
"displayName": zod.string().describe("Farcaster display name"),
|
|
39966
|
+
"fid": zod.number().describe("Farcaster fid")
|
|
39967
|
+
}).optional().describe("Farcaster profile information, if linked")
|
|
39968
|
+
})).optional().describe("Authors of this post"),
|
|
39969
|
+
"authorIds": zod.array(zod.string()).optional().describe("IDs of the authors of this post"),
|
|
39970
|
+
"views": zod.number().optional().describe("Total page views. Only included when fetching your own posts via GET /v1/posts")
|
|
39971
|
+
});
|
|
39972
|
+
createPostBodyTitleMax = 200;
|
|
39973
|
+
createPostBodySubtitleMax = 300;
|
|
39974
|
+
createPostBodySlugMax = 256;
|
|
39975
|
+
createPostBodyPostPreviewMax = 500;
|
|
39976
|
+
createPostBody = zod.object({
|
|
39977
|
+
"markdown": zod.string().describe("Post content in Markdown format"),
|
|
39978
|
+
"title": zod.string().max(createPostBodyTitleMax).describe("Title of the post"),
|
|
39979
|
+
"subtitle": zod.string().max(createPostBodySubtitleMax).optional().describe("Optional subtitle or brief summary"),
|
|
39980
|
+
"imageUrl": zod.string().url().optional().describe("Optional URL to the post's cover image"),
|
|
39981
|
+
"sendNewsletter": zod.union([zod.boolean(), zod.enum(["true", "false", "1", "0"])]).optional().describe("Whether to send an email newsletter to subscribers. Default: false"),
|
|
39982
|
+
"status": zod.enum(["published", "draft"]).optional().describe("Status of the post. Default: published"),
|
|
39983
|
+
"slug": zod.string().min(1).max(createPostBodySlugMax).optional().describe("Optional URL-friendly identifier for the post. If not provided, will be generated from title"),
|
|
39984
|
+
"postPreview": zod.string().max(createPostBodyPostPreviewMax).optional().describe("Optional preview text for the post. If not provided, will be generated from content"),
|
|
39985
|
+
"categories": zod.union([zod.array(zod.string()), zod.string()]).optional().describe("Optional array of category tags for the post. Can also be a comma-separated string.")
|
|
39986
|
+
});
|
|
39987
|
+
createPostResponse = zod.object({
|
|
39988
|
+
"id": zod.string().describe("The ID of the created post")
|
|
39989
|
+
});
|
|
39990
|
+
listOwnPostsQueryLimitDefault = 10;
|
|
39991
|
+
listOwnPostsQueryLimitMax = 100;
|
|
39992
|
+
listOwnPostsQueryParams = zod.object({
|
|
39993
|
+
"cursor": zod.string().optional().describe("Cursor for pagination"),
|
|
39994
|
+
"limit": zod.number().min(1).max(listOwnPostsQueryLimitMax).default(listOwnPostsQueryLimitDefault).describe("Maximum number of items to return (1-100, default: 10)"),
|
|
39995
|
+
"includeContent": zod.union([zod.boolean(), zod.string()]).optional().describe("Include full content fields (markdown, json, staticHtml). Default: false"),
|
|
39996
|
+
"status": zod.enum(["published", "draft", "scheduled", "archived"]).optional().describe("Filter by post status. Default: published")
|
|
39997
|
+
});
|
|
39998
|
+
listOwnPostsResponseItemsItemTitleMax = 200;
|
|
39999
|
+
listOwnPostsResponseItemsItemSubtitleMax = 300;
|
|
40000
|
+
listOwnPostsResponseItemsItemSlugMax = 256;
|
|
40001
|
+
listOwnPostsResponseItemsItemAuthorsItemWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40002
|
+
listOwnPostsResponseItemsItemAuthorsItemBioMax = 500;
|
|
40003
|
+
listOwnPostsResponse = zod.object({
|
|
40004
|
+
"items": zod.array(zod.object({
|
|
40005
|
+
"id": zod.string().describe("Unique identifier for the post"),
|
|
40006
|
+
"title": zod.string().max(listOwnPostsResponseItemsItemTitleMax).describe("Title of the post"),
|
|
40007
|
+
"imageUrl": zod.string().url().optional().describe("Optional URL to the post's main image"),
|
|
40008
|
+
"publishedAt": zod.string().optional().describe("Epoch timestamp when the post was published"),
|
|
40009
|
+
"updatedAt": zod.string().optional().describe("Epoch timestamp when the post was last updated"),
|
|
40010
|
+
"subtitle": zod.string().max(listOwnPostsResponseItemsItemSubtitleMax).optional().describe("Optional subtitle or brief summary"),
|
|
40011
|
+
"slug": zod.string().min(1).max(listOwnPostsResponseItemsItemSlugMax).describe("URL-friendly identifier for the post; accessible at paragraph.com/@[publicationSlug]/[slug]"),
|
|
40012
|
+
"staticHtml": zod.string().optional().describe("Rendered HTML content of the post"),
|
|
40013
|
+
"json": zod.string().optional().describe("TipTap JSON representation of the post content structure. This is the source of truth that the staticHtml and markdown is generated from"),
|
|
40014
|
+
"markdown": zod.string().optional().describe("Markdown source of the post content"),
|
|
40015
|
+
"coinId": zod.string().optional().describe("ID of the associated coin, if the post is coined"),
|
|
40016
|
+
"categories": zod.array(zod.string()).optional().describe("Categories/tags associated with this post"),
|
|
40017
|
+
"authors": zod.array(zod.object({
|
|
40018
|
+
"id": zod.string().describe("Unique identifier for the user"),
|
|
40019
|
+
"walletAddress": zod.string().regex(listOwnPostsResponseItemsItemAuthorsItemWalletAddressRegExp).optional().describe("Wallet address of the user"),
|
|
40020
|
+
"avatarUrl": zod.string().url().optional().describe("URL to the user's avatar image"),
|
|
40021
|
+
"publicationId": zod.string().describe("ID of the publication this user belongs to"),
|
|
40022
|
+
"name": zod.string().optional().describe("Display name of the user"),
|
|
40023
|
+
"bio": zod.string().max(listOwnPostsResponseItemsItemAuthorsItemBioMax).optional().describe("Brief biography of the user (max 500 characters)"),
|
|
40024
|
+
"farcaster": zod.object({
|
|
40025
|
+
"username": zod.string().describe("Farcaster username"),
|
|
40026
|
+
"displayName": zod.string().describe("Farcaster display name"),
|
|
40027
|
+
"fid": zod.number().describe("Farcaster fid")
|
|
40028
|
+
}).optional().describe("Farcaster profile information, if linked")
|
|
40029
|
+
})).optional().describe("Authors of this post"),
|
|
40030
|
+
"authorIds": zod.array(zod.string()).optional().describe("IDs of the authors of this post"),
|
|
40031
|
+
"views": zod.number().optional().describe("Total page views. Only included when fetching your own posts via GET /v1/posts")
|
|
40032
|
+
})).describe("Array of items in this page"),
|
|
40033
|
+
"pagination": zod.object({
|
|
40034
|
+
"cursor": zod.string().optional().describe("Cursor for fetching the next page of results"),
|
|
40035
|
+
"hasMore": zod.boolean().describe("Whether more results are available"),
|
|
40036
|
+
"total": zod.number().optional().describe("Total number of items available")
|
|
40037
|
+
})
|
|
40038
|
+
});
|
|
40039
|
+
updatePostBySlugPathSlugMax = 256;
|
|
40040
|
+
updatePostBySlugParams = zod.object({
|
|
40041
|
+
"slug": zod.string().min(1).max(updatePostBySlugPathSlugMax).describe("URL-friendly identifier of the post to update")
|
|
40042
|
+
});
|
|
40043
|
+
updatePostBySlugBodyTitleMax = 200;
|
|
40044
|
+
updatePostBySlugBodySubtitleMax = 300;
|
|
40045
|
+
updatePostBySlugBodySlugMax = 256;
|
|
40046
|
+
updatePostBySlugBodyPostPreviewMax = 500;
|
|
40047
|
+
updatePostBySlugBody = zod.object({
|
|
40048
|
+
"markdown": zod.string().optional().describe("Post content in Markdown format. Replaces full content \u2014 rich blocks created in the editor will be lost"),
|
|
40049
|
+
"title": zod.string().max(updatePostBySlugBodyTitleMax).optional().describe("Title of the post"),
|
|
40050
|
+
"subtitle": zod.string().max(updatePostBySlugBodySubtitleMax).optional().describe("Optional subtitle or brief summary"),
|
|
40051
|
+
"slug": zod.string().min(1).max(updatePostBySlugBodySlugMax).optional().describe("URL-friendly identifier for the post"),
|
|
40052
|
+
"postPreview": zod.string().max(updatePostBySlugBodyPostPreviewMax).optional().describe("Preview text for the post"),
|
|
40053
|
+
"categories": zod.union([zod.array(zod.string()), zod.string()]).optional().describe("Category tags for the post. Can also be a comma-separated string."),
|
|
40054
|
+
"status": zod.enum(["draft", "published", "archived"]).optional().describe("Set to 'published' to publish, 'draft' to unpublish, or 'archived' to archive")
|
|
40055
|
+
});
|
|
40056
|
+
updatePostBySlugResponse = zod.object({
|
|
40057
|
+
"success": zod.literal(true).describe("Whether the update succeeded")
|
|
40058
|
+
});
|
|
40059
|
+
deletePostBySlugPathSlugMax = 256;
|
|
40060
|
+
deletePostBySlugParams = zod.object({
|
|
40061
|
+
"slug": zod.string().min(1).max(deletePostBySlugPathSlugMax).describe("URL-friendly identifier of the post to delete")
|
|
40062
|
+
});
|
|
40063
|
+
deletePostBySlugBody = zod.object({});
|
|
40064
|
+
deletePostBySlugResponse = zod.object({
|
|
40065
|
+
"success": zod.literal(true).describe("Whether the deletion succeeded")
|
|
40066
|
+
});
|
|
40067
|
+
sendTestEmailParams = zod.object({
|
|
40068
|
+
"postId": zod.string().describe("Unique identifier of the post to preview")
|
|
40069
|
+
});
|
|
40070
|
+
sendTestEmailBody = zod.object({});
|
|
40071
|
+
sendTestEmailResponse = zod.object({
|
|
40072
|
+
"success": zod.literal(true).describe("Whether the email was sent")
|
|
40073
|
+
});
|
|
40074
|
+
getMeResponseSlugMax = 256;
|
|
40075
|
+
getMeResponseSummaryMax = 500;
|
|
40076
|
+
getMeResponse = zod.object({
|
|
40077
|
+
"id": zod.string().describe("Unique identifier for the publication"),
|
|
40078
|
+
"name": zod.string().describe("Display name of the publication"),
|
|
40079
|
+
"ownerUserId": zod.string().describe("ID of the user who owns this publication"),
|
|
40080
|
+
"slug": zod.string().min(1).max(getMeResponseSlugMax).describe("URL-friendly identifier for the publication; accessible at paragraph.com/@[slug]"),
|
|
40081
|
+
"customDomain": zod.string().url().optional().describe("Custom domain configured for this publication"),
|
|
40082
|
+
"summary": zod.string().max(getMeResponseSummaryMax).optional().describe("Brief description of the publication (max 500 characters)"),
|
|
40083
|
+
"logoUrl": zod.string().url().optional().describe("URL to the publication's logo image")
|
|
40084
|
+
});
|
|
40085
|
+
getUserParams = zod.object({
|
|
40086
|
+
"userId": zod.string().describe("Unique identifier of the user")
|
|
40087
|
+
});
|
|
40088
|
+
getUserResponseWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40089
|
+
getUserResponseBioMax = 500;
|
|
40090
|
+
getUserResponse = zod.object({
|
|
40091
|
+
"id": zod.string().describe("Unique identifier for the user"),
|
|
40092
|
+
"walletAddress": zod.string().regex(getUserResponseWalletAddressRegExp).optional().describe("Wallet address of the user"),
|
|
40093
|
+
"avatarUrl": zod.string().url().optional().describe("URL to the user's avatar image"),
|
|
40094
|
+
"publicationId": zod.string().describe("ID of the publication this user belongs to"),
|
|
40095
|
+
"name": zod.string().optional().describe("Display name of the user"),
|
|
40096
|
+
"bio": zod.string().max(getUserResponseBioMax).optional().describe("Brief biography of the user (max 500 characters)"),
|
|
40097
|
+
"farcaster": zod.object({
|
|
40098
|
+
"username": zod.string().describe("Farcaster username"),
|
|
40099
|
+
"displayName": zod.string().describe("Farcaster display name"),
|
|
40100
|
+
"fid": zod.number().describe("Farcaster fid")
|
|
40101
|
+
}).optional().describe("Farcaster profile information, if linked")
|
|
40102
|
+
});
|
|
40103
|
+
getUserByWalletPathWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40104
|
+
getUserByWalletParams = zod.object({
|
|
40105
|
+
"walletAddress": zod.string().regex(getUserByWalletPathWalletAddressRegExp).describe("Ethereum wallet address")
|
|
40106
|
+
});
|
|
40107
|
+
getUserByWalletResponseWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40108
|
+
getUserByWalletResponseBioMax = 500;
|
|
40109
|
+
getUserByWalletResponse = zod.object({
|
|
40110
|
+
"id": zod.string().describe("Unique identifier for the user"),
|
|
40111
|
+
"walletAddress": zod.string().regex(getUserByWalletResponseWalletAddressRegExp).optional().describe("Wallet address of the user"),
|
|
40112
|
+
"avatarUrl": zod.string().url().optional().describe("URL to the user's avatar image"),
|
|
40113
|
+
"publicationId": zod.string().describe("ID of the publication this user belongs to"),
|
|
40114
|
+
"name": zod.string().optional().describe("Display name of the user"),
|
|
40115
|
+
"bio": zod.string().max(getUserByWalletResponseBioMax).optional().describe("Brief biography of the user (max 500 characters)"),
|
|
40116
|
+
"farcaster": zod.object({
|
|
40117
|
+
"username": zod.string().describe("Farcaster username"),
|
|
40118
|
+
"displayName": zod.string().describe("Farcaster display name"),
|
|
40119
|
+
"fid": zod.number().describe("Farcaster fid")
|
|
40120
|
+
}).optional().describe("Farcaster profile information, if linked")
|
|
40121
|
+
});
|
|
40122
|
+
getCoinParams = zod.object({
|
|
40123
|
+
"id": zod.string().describe("Paragraph-internal unique identifier for the coin")
|
|
40124
|
+
});
|
|
40125
|
+
getCoinResponseContractAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40126
|
+
getCoinResponse = zod.object({
|
|
40127
|
+
"id": zod.string().describe("Unique identifier for the coin"),
|
|
40128
|
+
"contractAddress": zod.string().regex(getCoinResponseContractAddressRegExp).describe("Base contract address for the coin"),
|
|
40129
|
+
"metadata": zod.object({
|
|
40130
|
+
"name": zod.string().describe("Name of the coin"),
|
|
40131
|
+
"symbol": zod.string().describe("Symbol of the coin"),
|
|
40132
|
+
"decimals": zod.number().describe("Number of decimals of the coin"),
|
|
40133
|
+
"description": zod.string().describe("Description of the coin"),
|
|
40134
|
+
"image": zod.string().optional().describe("Image url of the logo associated with the coin"),
|
|
40135
|
+
"logoURI": zod.string().optional().describe("Image url of the logo associated with the coin"),
|
|
40136
|
+
"chainId": zod.number().describe("Chain id number of the coin"),
|
|
40137
|
+
"external_url": zod.string().describe("External url associated with the coin"),
|
|
40138
|
+
"links": zod.array(zod.object({
|
|
40139
|
+
"name": zod.string().describe("Name of the link"),
|
|
40140
|
+
"url": zod.string().describe("URL of the link")
|
|
40141
|
+
})),
|
|
40142
|
+
"tags": zod.array(zod.string()).describe("Tags associated with the coin"),
|
|
40143
|
+
"extensions": zod.object({
|
|
40144
|
+
"coinType": zod.string().describe("Type of the coin"),
|
|
40145
|
+
"paragraph": zod.object({
|
|
40146
|
+
"blogId": zod.string().describe("ID of the blog associated with this coin"),
|
|
40147
|
+
"blogUrl": zod.string().describe("URL of the blog associated with this coin"),
|
|
40148
|
+
"authorName": zod.string().optional().describe("Name of the author associated with this coin"),
|
|
40149
|
+
"noteId": zod.string().optional().describe("ID of the note associated with this coin"),
|
|
40150
|
+
"postSlug": zod.string().optional().describe("Slug of the post associated with this coin")
|
|
40151
|
+
})
|
|
40152
|
+
}),
|
|
40153
|
+
"attributes": zod.array(zod.object({
|
|
40154
|
+
"trait_type": zod.string(),
|
|
40155
|
+
"value": zod.string()
|
|
40156
|
+
}))
|
|
40157
|
+
})
|
|
40158
|
+
});
|
|
40159
|
+
getCoinByContractPathContractAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40160
|
+
getCoinByContractParams = zod.object({
|
|
40161
|
+
"contractAddress": zod.string().regex(getCoinByContractPathContractAddressRegExp).describe("Contract address")
|
|
40162
|
+
});
|
|
40163
|
+
getCoinByContractResponseContractAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40164
|
+
getCoinByContractResponse = zod.object({
|
|
40165
|
+
"id": zod.string().describe("Unique identifier for the coin"),
|
|
40166
|
+
"contractAddress": zod.string().regex(getCoinByContractResponseContractAddressRegExp).describe("Base contract address for the coin"),
|
|
40167
|
+
"metadata": zod.object({
|
|
40168
|
+
"name": zod.string().describe("Name of the coin"),
|
|
40169
|
+
"symbol": zod.string().describe("Symbol of the coin"),
|
|
40170
|
+
"decimals": zod.number().describe("Number of decimals of the coin"),
|
|
40171
|
+
"description": zod.string().describe("Description of the coin"),
|
|
40172
|
+
"image": zod.string().optional().describe("Image url of the logo associated with the coin"),
|
|
40173
|
+
"logoURI": zod.string().optional().describe("Image url of the logo associated with the coin"),
|
|
40174
|
+
"chainId": zod.number().describe("Chain id number of the coin"),
|
|
40175
|
+
"external_url": zod.string().describe("External url associated with the coin"),
|
|
40176
|
+
"links": zod.array(zod.object({
|
|
40177
|
+
"name": zod.string().describe("Name of the link"),
|
|
40178
|
+
"url": zod.string().describe("URL of the link")
|
|
40179
|
+
})),
|
|
40180
|
+
"tags": zod.array(zod.string()).describe("Tags associated with the coin"),
|
|
40181
|
+
"extensions": zod.object({
|
|
40182
|
+
"coinType": zod.string().describe("Type of the coin"),
|
|
40183
|
+
"paragraph": zod.object({
|
|
40184
|
+
"blogId": zod.string().describe("ID of the blog associated with this coin"),
|
|
40185
|
+
"blogUrl": zod.string().describe("URL of the blog associated with this coin"),
|
|
40186
|
+
"authorName": zod.string().optional().describe("Name of the author associated with this coin"),
|
|
40187
|
+
"noteId": zod.string().optional().describe("ID of the note associated with this coin"),
|
|
40188
|
+
"postSlug": zod.string().optional().describe("Slug of the post associated with this coin")
|
|
40189
|
+
})
|
|
40190
|
+
}),
|
|
40191
|
+
"attributes": zod.array(zod.object({
|
|
40192
|
+
"trait_type": zod.string(),
|
|
40193
|
+
"value": zod.string()
|
|
40194
|
+
}))
|
|
40195
|
+
})
|
|
40196
|
+
});
|
|
40197
|
+
getCoinHoldersByIdParams = zod.object({
|
|
40198
|
+
"id": zod.string().describe("Unique ID of the coin")
|
|
40199
|
+
});
|
|
40200
|
+
getCoinHoldersByIdQueryLimitDefault = 10;
|
|
40201
|
+
getCoinHoldersByIdQueryLimitMax = 100;
|
|
40202
|
+
getCoinHoldersByIdQueryParams = zod.object({
|
|
40203
|
+
"cursor": zod.string().optional().describe("Cursor for pagination"),
|
|
40204
|
+
"limit": zod.number().min(1).max(getCoinHoldersByIdQueryLimitMax).default(getCoinHoldersByIdQueryLimitDefault).describe("Maximum number of items to return (1-100, default: 10)")
|
|
40205
|
+
});
|
|
40206
|
+
getCoinHoldersByIdResponseItemsItemWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40207
|
+
getCoinHoldersByIdResponseItemsItemBalanceRegExp = new RegExp("^[0-9]+$");
|
|
40208
|
+
getCoinHoldersByIdResponse = zod.object({
|
|
40209
|
+
"items": zod.array(zod.object({
|
|
40210
|
+
"walletAddress": zod.string().regex(getCoinHoldersByIdResponseItemsItemWalletAddressRegExp).describe("Wallet address of the holder"),
|
|
40211
|
+
"userId": zod.string().optional().describe("Paragraph user ID if the holder is a registered user"),
|
|
40212
|
+
"balance": zod.string().regex(getCoinHoldersByIdResponseItemsItemBalanceRegExp).describe("Token balance held (in wei)"),
|
|
40213
|
+
"avatarUrl": zod.string().url().optional().describe("URL to the user's avatar image, if available")
|
|
40214
|
+
})).describe("Array of items in this page"),
|
|
40215
|
+
"pagination": zod.object({
|
|
40216
|
+
"cursor": zod.string().optional().describe("Cursor for fetching the next page of results"),
|
|
40217
|
+
"hasMore": zod.boolean().describe("Whether more results are available"),
|
|
40218
|
+
"total": zod.number().optional().describe("Total number of items available")
|
|
40219
|
+
})
|
|
40220
|
+
});
|
|
40221
|
+
getCoinHoldersByContractPathContractAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40222
|
+
getCoinHoldersByContractParams = zod.object({
|
|
40223
|
+
"contractAddress": zod.string().regex(getCoinHoldersByContractPathContractAddressRegExp).describe("Contract address")
|
|
40224
|
+
});
|
|
40225
|
+
getCoinHoldersByContractQueryLimitDefault = 10;
|
|
40226
|
+
getCoinHoldersByContractQueryLimitMax = 100;
|
|
40227
|
+
getCoinHoldersByContractQueryParams = zod.object({
|
|
40228
|
+
"cursor": zod.string().optional().describe("Cursor for pagination"),
|
|
40229
|
+
"limit": zod.number().min(1).max(getCoinHoldersByContractQueryLimitMax).default(getCoinHoldersByContractQueryLimitDefault).describe("Maximum number of items to return (1-100, default: 10)")
|
|
40230
|
+
});
|
|
40231
|
+
getCoinHoldersByContractResponseItemsItemWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40232
|
+
getCoinHoldersByContractResponseItemsItemBalanceRegExp = new RegExp("^[0-9]+$");
|
|
40233
|
+
getCoinHoldersByContractResponse = zod.object({
|
|
40234
|
+
"items": zod.array(zod.object({
|
|
40235
|
+
"walletAddress": zod.string().regex(getCoinHoldersByContractResponseItemsItemWalletAddressRegExp).describe("Wallet address of the holder"),
|
|
40236
|
+
"userId": zod.string().optional().describe("Paragraph user ID if the holder is a registered user"),
|
|
40237
|
+
"balance": zod.string().regex(getCoinHoldersByContractResponseItemsItemBalanceRegExp).describe("Token balance held (in wei)"),
|
|
40238
|
+
"avatarUrl": zod.string().url().optional().describe("URL to the user's avatar image, if available")
|
|
40239
|
+
})).describe("Array of items in this page"),
|
|
40240
|
+
"pagination": zod.object({
|
|
40241
|
+
"cursor": zod.string().optional().describe("Cursor for fetching the next page of results"),
|
|
40242
|
+
"hasMore": zod.boolean().describe("Whether more results are available"),
|
|
40243
|
+
"total": zod.number().optional().describe("Total number of items available")
|
|
40244
|
+
})
|
|
40245
|
+
});
|
|
40246
|
+
getBuyArgsByIdParams = zod.object({
|
|
40247
|
+
"id": zod.string().describe("Id of the coin")
|
|
40248
|
+
});
|
|
40249
|
+
getBuyArgsByIdQueryWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40250
|
+
getBuyArgsByIdQueryAmountRegExp = new RegExp("[0-9]+");
|
|
40251
|
+
getBuyArgsByIdQueryParams = zod.object({
|
|
40252
|
+
"walletAddress": zod.string().regex(getBuyArgsByIdQueryWalletAddressRegExp).describe("Address of the wallet that is going to buy the coin"),
|
|
40253
|
+
"amount": zod.string().regex(getBuyArgsByIdQueryAmountRegExp).describe("Amount of Base ETH in wei that is going to be swapped for the coin")
|
|
40254
|
+
});
|
|
40255
|
+
getBuyArgsByIdResponseCommandsRegExp = new RegExp("^0x[a-fA-F0-9]*");
|
|
40256
|
+
getBuyArgsByIdResponseInputsItemRegExp = new RegExp("^0x[a-fA-F0-9]*");
|
|
40257
|
+
getBuyArgsByIdResponse = zod.object({
|
|
40258
|
+
"commands": zod.string().regex(getBuyArgsByIdResponseCommandsRegExp).describe("Commands needed to do a token swap"),
|
|
40259
|
+
"inputs": zod.array(zod.string().regex(getBuyArgsByIdResponseInputsItemRegExp)).describe("Inputs needed to do a token swap")
|
|
40260
|
+
});
|
|
40261
|
+
getBuyArgsByContractPathContractAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40262
|
+
getBuyArgsByContractParams = zod.object({
|
|
40263
|
+
"contractAddress": zod.string().regex(getBuyArgsByContractPathContractAddressRegExp).describe("Contract address of the coin")
|
|
40264
|
+
});
|
|
40265
|
+
getBuyArgsByContractQueryWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40266
|
+
getBuyArgsByContractQueryAmountRegExp = new RegExp("[0-9]+");
|
|
40267
|
+
getBuyArgsByContractQueryParams = zod.object({
|
|
40268
|
+
"walletAddress": zod.string().regex(getBuyArgsByContractQueryWalletAddressRegExp).describe("Address of the wallet that is going to buy the coin"),
|
|
40269
|
+
"amount": zod.string().regex(getBuyArgsByContractQueryAmountRegExp).describe("Amount of Base ETH in wei that is going to be swapped for the coin")
|
|
40270
|
+
});
|
|
40271
|
+
getBuyArgsByContractResponseCommandsRegExp = new RegExp("^0x[a-fA-F0-9]*");
|
|
40272
|
+
getBuyArgsByContractResponseInputsItemRegExp = new RegExp("^0x[a-fA-F0-9]*");
|
|
40273
|
+
getBuyArgsByContractResponse = zod.object({
|
|
40274
|
+
"commands": zod.string().regex(getBuyArgsByContractResponseCommandsRegExp).describe("Commands needed to do a token swap"),
|
|
40275
|
+
"inputs": zod.array(zod.string().regex(getBuyArgsByContractResponseInputsItemRegExp)).describe("Inputs needed to do a token swap")
|
|
40276
|
+
});
|
|
40277
|
+
getSellArgsByIdParams = zod.object({
|
|
40278
|
+
"id": zod.string().describe("Id of the coin")
|
|
40279
|
+
});
|
|
40280
|
+
getSellArgsByIdQueryWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40281
|
+
getSellArgsByIdQueryAmountRegExp = new RegExp("[0-9]+");
|
|
40282
|
+
getSellArgsByIdQueryParams = zod.object({
|
|
40283
|
+
"walletAddress": zod.string().regex(getSellArgsByIdQueryWalletAddressRegExp).describe("Address of the wallet that is going to sell the coin"),
|
|
40284
|
+
"amount": zod.string().regex(getSellArgsByIdQueryAmountRegExp).describe("Amount of coin in wei that is going to be swapped to WETH")
|
|
40285
|
+
});
|
|
40286
|
+
getSellArgsByIdResponseCommandsRegExp = new RegExp("^0x[a-fA-F0-9]*");
|
|
40287
|
+
getSellArgsByIdResponseInputsItemRegExp = new RegExp("^0x[a-fA-F0-9]*");
|
|
40288
|
+
getSellArgsByIdResponse = zod.object({
|
|
40289
|
+
"commands": zod.string().regex(getSellArgsByIdResponseCommandsRegExp).describe("Commands needed to do a token swap"),
|
|
40290
|
+
"inputs": zod.array(zod.string().regex(getSellArgsByIdResponseInputsItemRegExp)).describe("Inputs needed to do a token swap")
|
|
40291
|
+
});
|
|
40292
|
+
getSellArgsByContractPathContractAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40293
|
+
getSellArgsByContractParams = zod.object({
|
|
40294
|
+
"contractAddress": zod.string().regex(getSellArgsByContractPathContractAddressRegExp).describe("Contract address of the coin")
|
|
40295
|
+
});
|
|
40296
|
+
getSellArgsByContractQueryWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40297
|
+
getSellArgsByContractQueryAmountRegExp = new RegExp("[0-9]+");
|
|
40298
|
+
getSellArgsByContractQueryParams = zod.object({
|
|
40299
|
+
"walletAddress": zod.string().regex(getSellArgsByContractQueryWalletAddressRegExp).describe("Address of the wallet that is going to sell the coin"),
|
|
40300
|
+
"amount": zod.string().regex(getSellArgsByContractQueryAmountRegExp).describe("Amount of coin in wei that is going to be swapped to WETH")
|
|
40301
|
+
});
|
|
40302
|
+
getSellArgsByContractResponseCommandsRegExp = new RegExp("^0x[a-fA-F0-9]*");
|
|
40303
|
+
getSellArgsByContractResponseInputsItemRegExp = new RegExp("^0x[a-fA-F0-9]*");
|
|
40304
|
+
getSellArgsByContractResponse = zod.object({
|
|
40305
|
+
"commands": zod.string().regex(getSellArgsByContractResponseCommandsRegExp).describe("Commands needed to do a token swap"),
|
|
40306
|
+
"inputs": zod.array(zod.string().regex(getSellArgsByContractResponseInputsItemRegExp)).describe("Inputs needed to do a token swap")
|
|
40307
|
+
});
|
|
40308
|
+
getQuoteByIdParams = zod.object({
|
|
40309
|
+
"id": zod.string().describe("Paragraph-internal unique identifier for the coin")
|
|
40310
|
+
});
|
|
40311
|
+
getQuoteByIdQueryAmountRegExp = new RegExp("[0-9]+");
|
|
40312
|
+
getQuoteByIdQueryParams = zod.object({
|
|
40313
|
+
"amount": zod.string().regex(getQuoteByIdQueryAmountRegExp).describe("Amount of Base ETH in wei that is going to be swapped for the coin")
|
|
40314
|
+
});
|
|
40315
|
+
getQuoteByIdResponse = zod.object({
|
|
40316
|
+
"quote": zod.string().describe("Approximate number of coins that could be received in exchange of the amount of ETH entered")
|
|
40317
|
+
});
|
|
40318
|
+
getQuoteByContractParams = zod.object({
|
|
40319
|
+
"contractAddress": zod.string().describe("Contract address of the coin")
|
|
40320
|
+
});
|
|
40321
|
+
getQuoteByContractQueryAmountRegExp = new RegExp("[0-9]+");
|
|
40322
|
+
getQuoteByContractQueryParams = zod.object({
|
|
40323
|
+
"amount": zod.string().regex(getQuoteByContractQueryAmountRegExp).describe("Amount of Base ETH in wei that is going to be swapped for the coin")
|
|
40324
|
+
});
|
|
40325
|
+
getQuoteByContractResponse = zod.object({
|
|
40326
|
+
"quote": zod.string().describe("Approximate number of coins that could be received in exchange of the amount of ETH entered")
|
|
40327
|
+
});
|
|
40328
|
+
getPopularCoinsResponseCoinsItemContractAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40329
|
+
getPopularCoinsResponse = zod.object({
|
|
40330
|
+
"coins": zod.array(zod.object({
|
|
40331
|
+
"id": zod.string().describe("Unique identifier for the coin"),
|
|
40332
|
+
"contractAddress": zod.string().regex(getPopularCoinsResponseCoinsItemContractAddressRegExp).describe("Base contract address for the coin"),
|
|
40333
|
+
"metadata": zod.object({
|
|
40334
|
+
"name": zod.string().describe("Name of the coin"),
|
|
40335
|
+
"symbol": zod.string().describe("Symbol of the coin"),
|
|
40336
|
+
"decimals": zod.number().describe("Number of decimals of the coin"),
|
|
40337
|
+
"description": zod.string().describe("Description of the coin"),
|
|
40338
|
+
"image": zod.string().optional().describe("Image url of the logo associated with the coin"),
|
|
40339
|
+
"logoURI": zod.string().optional().describe("Image url of the logo associated with the coin"),
|
|
40340
|
+
"chainId": zod.number().describe("Chain id number of the coin"),
|
|
40341
|
+
"external_url": zod.string().describe("External url associated with the coin"),
|
|
40342
|
+
"links": zod.array(zod.object({
|
|
40343
|
+
"name": zod.string().describe("Name of the link"),
|
|
40344
|
+
"url": zod.string().describe("URL of the link")
|
|
40345
|
+
})),
|
|
40346
|
+
"tags": zod.array(zod.string()).describe("Tags associated with the coin"),
|
|
40347
|
+
"extensions": zod.object({
|
|
40348
|
+
"coinType": zod.string().describe("Type of the coin"),
|
|
40349
|
+
"paragraph": zod.object({
|
|
40350
|
+
"blogId": zod.string().describe("ID of the blog associated with this coin"),
|
|
40351
|
+
"blogUrl": zod.string().describe("URL of the blog associated with this coin"),
|
|
40352
|
+
"authorName": zod.string().optional().describe("Name of the author associated with this coin"),
|
|
40353
|
+
"noteId": zod.string().optional().describe("ID of the note associated with this coin"),
|
|
40354
|
+
"postSlug": zod.string().optional().describe("Slug of the post associated with this coin")
|
|
40355
|
+
})
|
|
40356
|
+
}),
|
|
40357
|
+
"attributes": zod.array(zod.object({
|
|
40358
|
+
"trait_type": zod.string(),
|
|
40359
|
+
"value": zod.string()
|
|
40360
|
+
}))
|
|
40361
|
+
})
|
|
40362
|
+
}))
|
|
40363
|
+
});
|
|
40364
|
+
importSubscribersBody = zod.object({
|
|
40365
|
+
"file": zod.unknown().optional().describe("CSV file containing subscriber data (max 10MB)")
|
|
40366
|
+
});
|
|
40367
|
+
importSubscribersResponse = zod.object({
|
|
40368
|
+
"success": zod.literal(true).describe("Whether the import was started")
|
|
40369
|
+
});
|
|
40370
|
+
addSubscriberBodyWalletRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40371
|
+
addSubscriberBody = zod.object({
|
|
40372
|
+
"email": zod.string().email().optional().describe("Email address of the subscriber"),
|
|
40373
|
+
"wallet": zod.string().regex(addSubscriberBodyWalletRegExp).optional().describe("Wallet address of the subscriber (0x format)"),
|
|
40374
|
+
"createdAt": zod.number().optional().describe("Timestamp (in milliseconds) when the subscription was created. Defaults to current time.")
|
|
40375
|
+
});
|
|
40376
|
+
addSubscriberResponse = zod.object({
|
|
40377
|
+
"success": zod.literal(true).describe("Whether the subscriber was added")
|
|
40378
|
+
});
|
|
40379
|
+
listSubscribersQueryLimitDefault = 10;
|
|
40380
|
+
listSubscribersQueryLimitMax = 100;
|
|
40381
|
+
listSubscribersQueryParams = zod.object({
|
|
40382
|
+
"cursor": zod.string().optional().describe("Cursor for pagination"),
|
|
40383
|
+
"limit": zod.number().min(1).max(listSubscribersQueryLimitMax).default(listSubscribersQueryLimitDefault).describe("Maximum number of items to return (1-100, default: 10)")
|
|
40384
|
+
});
|
|
40385
|
+
listSubscribersResponseItemsItemWalletAddressRegExp = new RegExp("^0x[a-fA-F0-9]{40}$");
|
|
40386
|
+
listSubscribersResponse = zod.object({
|
|
40387
|
+
"items": zod.array(zod.object({
|
|
40388
|
+
"email": zod.string().email().optional().describe("Email address of the subscriber"),
|
|
40389
|
+
"walletAddress": zod.string().regex(listSubscribersResponseItemsItemWalletAddressRegExp).optional().describe("Wallet address of the subscriber"),
|
|
40390
|
+
"createdAt": zod.number().describe("Timestamp when the subscription was created")
|
|
40391
|
+
})).describe("Array of items in this page"),
|
|
40392
|
+
"pagination": zod.object({
|
|
40393
|
+
"cursor": zod.string().optional().describe("Cursor for fetching the next page of results"),
|
|
40394
|
+
"hasMore": zod.boolean().describe("Whether more results are available"),
|
|
40395
|
+
"total": zod.number().optional().describe("Total number of items available")
|
|
40396
|
+
})
|
|
40397
|
+
});
|
|
40398
|
+
searchPostsQueryParams = zod.object({
|
|
40399
|
+
"q": zod.string().optional().describe("Search query string"),
|
|
40400
|
+
"blogId": zod.string().optional().describe("Optional publication ID to restrict search to a specific publication")
|
|
40401
|
+
});
|
|
40402
|
+
searchPostsResponseItem = zod.object({
|
|
40403
|
+
"post": zod.object({
|
|
40404
|
+
"postId": zod.string().describe("Unique identifier for the post"),
|
|
40405
|
+
"blogId": zod.string().describe("ID of the publication this post belongs to"),
|
|
40406
|
+
"createdAt": zod.string().describe("Timestamp when the post was created"),
|
|
40407
|
+
"publishedAt": zod.string().nullable().describe("Timestamp when the post was published"),
|
|
40408
|
+
"title": zod.string().nullable().describe("Title of the post"),
|
|
40409
|
+
"subtitle": zod.string().nullable().describe("Subtitle of the post"),
|
|
40410
|
+
"postPreview": zod.string().nullable().describe("Preview text of the post"),
|
|
40411
|
+
"coverImageUrl": zod.string().nullable().describe("URL to the post's cover image"),
|
|
40412
|
+
"slug": zod.string().nullable().describe("URL-friendly identifier for the post"),
|
|
40413
|
+
"coinId": zod.string().nullable().describe("Associated coin ID, if any")
|
|
40414
|
+
}).describe("The matched post"),
|
|
40415
|
+
"blog": zod.object({
|
|
40416
|
+
"blogId": zod.string().describe("Unique identifier for the publication"),
|
|
40417
|
+
"userId": zod.string().describe("ID of the publication owner"),
|
|
40418
|
+
"name": zod.string().nullable().describe("Display name of the publication"),
|
|
40419
|
+
"url": zod.string().nullable().describe("URL of the publication"),
|
|
40420
|
+
"slug": zod.string().nullable().describe("URL-friendly slug of the publication"),
|
|
40421
|
+
"logoUrl": zod.string().nullable().describe("URL to the publication's logo"),
|
|
40422
|
+
"coinId": zod.string().nullable().describe("Associated coin ID, if any"),
|
|
40423
|
+
"customDomain": zod.string().nullish().describe("Custom domain for the publication"),
|
|
40424
|
+
"summary": zod.string().nullish().describe("Brief description of the publication")
|
|
40425
|
+
}).describe("The publication this post belongs to"),
|
|
40426
|
+
"user": zod.object({
|
|
40427
|
+
"userId": zod.string().describe("Unique identifier for the user"),
|
|
40428
|
+
"name": zod.string().nullable().describe("Display name of the author"),
|
|
40429
|
+
"bio": zod.string().nullish().describe("Brief biography of the author"),
|
|
40430
|
+
"avatarUrl": zod.string().nullish().describe("URL to the author's avatar"),
|
|
40431
|
+
"walletAddress": zod.string().nullish().describe("Wallet address of the author")
|
|
40432
|
+
}).describe("The author of the post")
|
|
40433
|
+
});
|
|
40434
|
+
searchPostsResponse = zod.array(searchPostsResponseItem);
|
|
40435
|
+
searchBlogsQueryParams = zod.object({
|
|
40436
|
+
"q": zod.string().optional().describe("Search query string")
|
|
40437
|
+
});
|
|
40438
|
+
searchBlogsResponseItem = zod.object({
|
|
40439
|
+
"blog": zod.object({
|
|
40440
|
+
"blogId": zod.string().describe("Unique identifier for the publication"),
|
|
40441
|
+
"userId": zod.string().describe("ID of the publication owner"),
|
|
40442
|
+
"name": zod.string().nullable().describe("Display name of the publication"),
|
|
40443
|
+
"url": zod.string().nullable().describe("URL of the publication"),
|
|
40444
|
+
"slug": zod.string().nullable().describe("URL-friendly slug of the publication"),
|
|
40445
|
+
"logoUrl": zod.string().nullable().describe("URL to the publication's logo"),
|
|
40446
|
+
"coinId": zod.string().nullable().describe("Associated coin ID, if any"),
|
|
40447
|
+
"customDomain": zod.string().nullish().describe("Custom domain for the publication"),
|
|
40448
|
+
"summary": zod.string().nullish().describe("Brief description of the publication")
|
|
40449
|
+
}).describe("The matched publication"),
|
|
40450
|
+
"user": zod.object({
|
|
40451
|
+
"userId": zod.string().describe("Unique identifier for the user"),
|
|
40452
|
+
"name": zod.string().nullable().describe("Display name of the author"),
|
|
40453
|
+
"bio": zod.string().nullish().describe("Brief biography of the author"),
|
|
40454
|
+
"avatarUrl": zod.string().nullish().describe("URL to the author's avatar"),
|
|
40455
|
+
"walletAddress": zod.string().nullish().describe("Wallet address of the author")
|
|
40456
|
+
}).describe("The publication owner"),
|
|
40457
|
+
"activeSubscriberCount": zod.number().describe("Number of active subscribers to this publication")
|
|
40458
|
+
});
|
|
40459
|
+
searchBlogsResponse = zod.array(searchBlogsResponseItem);
|
|
40460
|
+
searchCoinsQueryParams = zod.object({
|
|
40461
|
+
"q": zod.string().optional().describe("Search query string")
|
|
40462
|
+
});
|
|
40463
|
+
searchCoinsResponseItem = zod.object({
|
|
40464
|
+
"coin": zod.object({
|
|
40465
|
+
"coinId": zod.string().describe("Unique identifier for the coin"),
|
|
40466
|
+
"ticker": zod.string().nullable().describe("Ticker symbol of the coin"),
|
|
40467
|
+
"contractAddress": zod.string().nullable().describe("Contract address of the coin"),
|
|
40468
|
+
"blogId": zod.string().describe("ID of the associated publication")
|
|
40469
|
+
}).describe("The matched coin"),
|
|
40470
|
+
"blog": zod.object({
|
|
40471
|
+
"blogId": zod.string().describe("Unique identifier for the publication"),
|
|
40472
|
+
"name": zod.string().nullable().describe("Display name of the publication"),
|
|
40473
|
+
"slug": zod.string().nullable().describe("URL-friendly slug of the publication"),
|
|
40474
|
+
"logoUrl": zod.string().nullable().describe("URL to the publication's logo")
|
|
40475
|
+
}).describe("The associated publication"),
|
|
40476
|
+
"activeSubscriberCount": zod.number().describe("Number of active subscribers to this publication")
|
|
40477
|
+
});
|
|
40478
|
+
searchCoinsResponse = zod.array(searchCoinsResponseItem);
|
|
40479
|
+
createAuthSessionBodyDeviceNameMax = 100;
|
|
40480
|
+
createAuthSessionBodyCallbackUrlMax = 2048;
|
|
40481
|
+
createAuthSessionBody = zod.object({
|
|
40482
|
+
"deviceName": zod.string().max(createAuthSessionBodyDeviceNameMax).optional().describe("Name of the device requesting access (e.g. user@MacBook-Pro.local)"),
|
|
40483
|
+
"callbackUrl": zod.string().url().max(createAuthSessionBodyCallbackUrlMax).optional().describe("HTTPS callback URL to redirect the user to after approving the session")
|
|
40484
|
+
});
|
|
40485
|
+
getAuthSessionParams = zod.object({
|
|
40486
|
+
"sessionId": zod.string().describe("Session ID returned from create")
|
|
40487
|
+
});
|
|
40488
|
+
getAuthSessionResponse = zod.union([zod.object({
|
|
40489
|
+
"status": zod.enum(["pending"]),
|
|
40490
|
+
"deviceName": zod.string(),
|
|
40491
|
+
"callbackUrl": zod.string().optional()
|
|
40492
|
+
}), zod.object({
|
|
40493
|
+
"status": zod.enum(["completed"]),
|
|
40494
|
+
"apiKey": zod.string()
|
|
40495
|
+
}), zod.object({
|
|
40496
|
+
"status": zod.enum(["expired"])
|
|
40497
|
+
})]);
|
|
40498
|
+
deleteAuthSessionParams = zod.object({
|
|
40499
|
+
"sessionId": zod.string().describe("Session ID to deny")
|
|
40500
|
+
});
|
|
40501
|
+
deleteAuthSessionResponse = zod.object({
|
|
40502
|
+
"success": zod.literal(true)
|
|
40503
|
+
});
|
|
39919
40504
|
ParagraphAPI = class {
|
|
39920
40505
|
/**
|
|
39921
40506
|
* Initializes a new instance of the Paragraph API client.
|
|
@@ -39952,7 +40537,7 @@ function createClient2(apiKey) {
|
|
|
39952
40537
|
var init_client = __esm({
|
|
39953
40538
|
"src/services/client.ts"() {
|
|
39954
40539
|
"use strict";
|
|
39955
|
-
|
|
40540
|
+
init_dist();
|
|
39956
40541
|
}
|
|
39957
40542
|
});
|
|
39958
40543
|
|
|
@@ -40114,7 +40699,7 @@ var require_strip_ansi = __commonJS({
|
|
|
40114
40699
|
"node_modules/cli-table3/node_modules/strip-ansi/index.js"(exports, module) {
|
|
40115
40700
|
"use strict";
|
|
40116
40701
|
var ansiRegex = require_ansi_regex();
|
|
40117
|
-
module.exports = (
|
|
40702
|
+
module.exports = (string2) => typeof string2 === "string" ? string2.replace(ansiRegex(), "") : string2;
|
|
40118
40703
|
}
|
|
40119
40704
|
});
|
|
40120
40705
|
|
|
@@ -40168,18 +40753,18 @@ var require_string_width = __commonJS({
|
|
|
40168
40753
|
var stripAnsi = require_strip_ansi();
|
|
40169
40754
|
var isFullwidthCodePoint = require_is_fullwidth_code_point();
|
|
40170
40755
|
var emojiRegex = require_emoji_regex();
|
|
40171
|
-
var stringWidth = (
|
|
40172
|
-
if (typeof
|
|
40756
|
+
var stringWidth = (string2) => {
|
|
40757
|
+
if (typeof string2 !== "string" || string2.length === 0) {
|
|
40173
40758
|
return 0;
|
|
40174
40759
|
}
|
|
40175
|
-
|
|
40176
|
-
if (
|
|
40760
|
+
string2 = stripAnsi(string2);
|
|
40761
|
+
if (string2.length === 0) {
|
|
40177
40762
|
return 0;
|
|
40178
40763
|
}
|
|
40179
|
-
|
|
40764
|
+
string2 = string2.replace(emojiRegex(), " ");
|
|
40180
40765
|
let width = 0;
|
|
40181
|
-
for (let i = 0; i <
|
|
40182
|
-
const code =
|
|
40766
|
+
for (let i = 0; i < string2.length; i++) {
|
|
40767
|
+
const code = string2.codePointAt(i);
|
|
40183
40768
|
if (code <= 31 || code >= 127 && code <= 159) {
|
|
40184
40769
|
continue;
|
|
40185
40770
|
}
|
|
@@ -41822,17 +42407,17 @@ var require_table = __commonJS({
|
|
|
41822
42407
|
}
|
|
41823
42408
|
}
|
|
41824
42409
|
toString() {
|
|
41825
|
-
let
|
|
42410
|
+
let array2 = this;
|
|
41826
42411
|
let headersPresent = this.options.head && this.options.head.length;
|
|
41827
42412
|
if (headersPresent) {
|
|
41828
|
-
|
|
42413
|
+
array2 = [this.options.head];
|
|
41829
42414
|
if (this.length) {
|
|
41830
|
-
|
|
42415
|
+
array2.push.apply(array2, this);
|
|
41831
42416
|
}
|
|
41832
42417
|
} else {
|
|
41833
42418
|
this.options.style.head = [];
|
|
41834
42419
|
}
|
|
41835
|
-
let cells = tableLayout.makeTableLayout(
|
|
42420
|
+
let cells = tableLayout.makeTableLayout(array2);
|
|
41836
42421
|
cells.forEach(function(row) {
|
|
41837
42422
|
row.forEach(function(cell) {
|
|
41838
42423
|
cell.mergeTableOptions(this.options, cells);
|
|
@@ -41948,6 +42533,7 @@ var init_output = __esm({
|
|
|
41948
42533
|
});
|
|
41949
42534
|
|
|
41950
42535
|
// src/cli/lib/error.ts
|
|
42536
|
+
import { ZodError } from "zod";
|
|
41951
42537
|
function isAxiosError3(err) {
|
|
41952
42538
|
return typeof err === "object" && err !== null && "isAxiosError" in err && err.isAxiosError === true;
|
|
41953
42539
|
}
|
|
@@ -41967,6 +42553,10 @@ function errorCode(status) {
|
|
|
41967
42553
|
return "REQUEST_FAILED";
|
|
41968
42554
|
}
|
|
41969
42555
|
function extractError(err) {
|
|
42556
|
+
if (err instanceof ZodError) {
|
|
42557
|
+
const messages = err.issues.map((i) => `${i.path.join(".")}: ${i.message}`);
|
|
42558
|
+
return { message: "Validation failed: " + messages.join("; "), code: "VALIDATION_ERROR" };
|
|
42559
|
+
}
|
|
41970
42560
|
if (isAxiosError3(err)) {
|
|
41971
42561
|
const status = err.response?.status;
|
|
41972
42562
|
const message = err.response?.data?.message || err.message;
|
|
@@ -42148,7 +42738,7 @@ async function getPublication(idOrSlug, apiKey) {
|
|
|
42148
42738
|
}
|
|
42149
42739
|
async function getPublicationByDomain(domain) {
|
|
42150
42740
|
const client = createClient2();
|
|
42151
|
-
return
|
|
42741
|
+
return client.publications.get({ domain }).single();
|
|
42152
42742
|
}
|
|
42153
42743
|
async function resolvePublication(identifier, apiKey) {
|
|
42154
42744
|
if (identifier.includes(".")) {
|
|
@@ -42173,31 +42763,24 @@ async function listPosts(params) {
|
|
|
42173
42763
|
let pubId = params.publicationId;
|
|
42174
42764
|
if (isSlug(pubId)) {
|
|
42175
42765
|
const pub = await getPublication(pubId);
|
|
42176
|
-
pubId =
|
|
42766
|
+
pubId = pub.id;
|
|
42177
42767
|
}
|
|
42178
|
-
const
|
|
42179
|
-
|
|
42180
|
-
|
|
42181
|
-
const result2 = await client.posts.get(
|
|
42182
|
-
query
|
|
42768
|
+
const { items: items9, pagination: pagination2 } = await client.posts.get(
|
|
42769
|
+
{ publicationId: pubId },
|
|
42770
|
+
{ limit: params.limit, cursor: params.cursor }
|
|
42183
42771
|
);
|
|
42184
|
-
|
|
42185
|
-
|
|
42186
|
-
}
|
|
42187
|
-
|
|
42188
|
-
|
|
42189
|
-
|
|
42190
|
-
|
|
42191
|
-
|
|
42192
|
-
queryParams
|
|
42193
|
-
);
|
|
42194
|
-
const data = result;
|
|
42195
|
-
return { items: data.items, cursor: data.pagination?.cursor };
|
|
42772
|
+
return { items: items9, cursor: pagination2.cursor };
|
|
42773
|
+
}
|
|
42774
|
+
const { items: items8, pagination } = await client.posts.list({
|
|
42775
|
+
status: params.status,
|
|
42776
|
+
limit: params.limit,
|
|
42777
|
+
cursor: params.cursor
|
|
42778
|
+
});
|
|
42779
|
+
return { items: items8, cursor: pagination.cursor };
|
|
42196
42780
|
}
|
|
42197
42781
|
async function getPost(id, apiKey) {
|
|
42198
42782
|
const client = createClient2(apiKey);
|
|
42199
|
-
|
|
42200
|
-
return post;
|
|
42783
|
+
return client.posts.get({ id }, { includeContent: true }).single();
|
|
42201
42784
|
}
|
|
42202
42785
|
async function resolvePost(identifier, apiKey) {
|
|
42203
42786
|
const urlMatch = identifier.match(/^https?:\/\/[^/]+\/@([^/]+)\/([^/?#]+)/);
|
|
@@ -42228,69 +42811,56 @@ async function resolveOwnPost(idOrSlug, apiKey) {
|
|
|
42228
42811
|
}
|
|
42229
42812
|
async function getPostBySlugs(publicationSlug, postSlug, apiKey) {
|
|
42230
42813
|
const client = createClient2(apiKey);
|
|
42231
|
-
|
|
42232
|
-
return post;
|
|
42814
|
+
return client.posts.get({ publicationSlug, postSlug }, { includeContent: true }).single();
|
|
42233
42815
|
}
|
|
42234
42816
|
async function getPostByPubIdAndSlug(publicationId, postSlug, apiKey) {
|
|
42235
42817
|
const client = createClient2(apiKey);
|
|
42236
|
-
|
|
42237
|
-
return post;
|
|
42818
|
+
return client.posts.get({ publicationId, postSlug }, { includeContent: true }).single();
|
|
42238
42819
|
}
|
|
42239
42820
|
async function getPostsByTag(tag, pagination) {
|
|
42240
42821
|
const client = createClient2();
|
|
42241
|
-
const
|
|
42242
|
-
|
|
42243
|
-
|
|
42244
|
-
const result = await client.posts.get(
|
|
42245
|
-
query
|
|
42822
|
+
const { items: items8, pagination: pag } = await client.posts.get(
|
|
42823
|
+
{ tag },
|
|
42824
|
+
{ limit: pagination?.limit, cursor: pagination?.cursor }
|
|
42246
42825
|
);
|
|
42247
|
-
|
|
42248
|
-
return { items: data.items, cursor: data.pagination?.cursor };
|
|
42826
|
+
return { items: items8, cursor: pag.cursor };
|
|
42249
42827
|
}
|
|
42250
42828
|
async function getFeed(pagination) {
|
|
42251
42829
|
const client = createClient2();
|
|
42252
|
-
const
|
|
42253
|
-
|
|
42254
|
-
|
|
42255
|
-
|
|
42256
|
-
|
|
42257
|
-
const data = result;
|
|
42258
|
-
return { items: data.items, cursor: data.pagination?.cursor };
|
|
42830
|
+
const { items: items8, pagination: pag } = await client.feed.get({
|
|
42831
|
+
limit: pagination?.limit || 20,
|
|
42832
|
+
cursor: pagination?.cursor
|
|
42833
|
+
});
|
|
42834
|
+
return { items: items8, cursor: pag.cursor };
|
|
42259
42835
|
}
|
|
42260
42836
|
async function createPost(params) {
|
|
42261
|
-
const client = createClient2(params.apiKey);
|
|
42262
42837
|
const body = {
|
|
42263
42838
|
title: params.title,
|
|
42264
42839
|
markdown: params.markdown,
|
|
42265
|
-
status: "draft"
|
|
42840
|
+
status: "draft",
|
|
42841
|
+
subtitle: params.subtitle,
|
|
42842
|
+
categories: params.tags
|
|
42266
42843
|
};
|
|
42267
|
-
|
|
42268
|
-
|
|
42269
|
-
|
|
42270
|
-
body
|
|
42271
|
-
);
|
|
42272
|
-
return post;
|
|
42844
|
+
createPostBody.parse(body);
|
|
42845
|
+
const client = createClient2(params.apiKey);
|
|
42846
|
+
return client.posts.create(body);
|
|
42273
42847
|
}
|
|
42274
42848
|
async function updatePost(idOrSlug, params) {
|
|
42849
|
+
const body = {
|
|
42850
|
+
title: params.title,
|
|
42851
|
+
subtitle: params.subtitle,
|
|
42852
|
+
markdown: params.markdown,
|
|
42853
|
+
categories: params.tags
|
|
42854
|
+
};
|
|
42855
|
+
updatePostBody.parse(body);
|
|
42275
42856
|
const client = createClient2(params.apiKey);
|
|
42276
|
-
const body = {};
|
|
42277
|
-
if (params.title) body.title = params.title;
|
|
42278
|
-
if (params.subtitle) body.subtitle = params.subtitle;
|
|
42279
|
-
if (params.markdown) body.markdown = params.markdown;
|
|
42280
|
-
if (params.tags) body.categories = params.tags;
|
|
42281
42857
|
try {
|
|
42282
|
-
await client.posts.update({
|
|
42283
|
-
id: idOrSlug,
|
|
42284
|
-
...body
|
|
42285
|
-
});
|
|
42858
|
+
await client.posts.update({ id: idOrSlug, ...body });
|
|
42286
42859
|
return;
|
|
42287
42860
|
} catch {
|
|
42288
42861
|
if (!isSlug(idOrSlug)) throw new Error(`Post not found: ${idOrSlug}`);
|
|
42289
42862
|
}
|
|
42290
|
-
await client.posts.update({
|
|
42291
|
-
slug: idOrSlug,
|
|
42292
|
-
...body
|
|
42293
|
-
});
|
|
42863
|
+
await client.posts.update({ slug: idOrSlug, ...body });
|
|
42294
42864
|
}
|
|
42295
42865
|
async function sendTestEmail(postId, apiKey) {
|
|
42296
42866
|
const client = createClient2(apiKey);
|
|
@@ -42308,25 +42878,19 @@ async function deletePost(idOrSlug, apiKey) {
|
|
|
42308
42878
|
}
|
|
42309
42879
|
async function updatePostStatus(idOrSlug, status, apiKey, sendNewsletter) {
|
|
42310
42880
|
const client = createClient2(apiKey);
|
|
42311
|
-
const body = { status };
|
|
42312
|
-
if (sendNewsletter) body.sendNewsletter = true;
|
|
42881
|
+
const body = { status, sendNewsletter: sendNewsletter || void 0 };
|
|
42313
42882
|
try {
|
|
42314
|
-
await client.posts.update({
|
|
42315
|
-
id: idOrSlug,
|
|
42316
|
-
...body
|
|
42317
|
-
});
|
|
42883
|
+
await client.posts.update({ id: idOrSlug, ...body });
|
|
42318
42884
|
return;
|
|
42319
42885
|
} catch {
|
|
42320
42886
|
if (!isSlug(idOrSlug)) throw new Error(`Post not found: ${idOrSlug}`);
|
|
42321
42887
|
}
|
|
42322
|
-
await client.posts.update({
|
|
42323
|
-
slug: idOrSlug,
|
|
42324
|
-
...body
|
|
42325
|
-
});
|
|
42888
|
+
await client.posts.update({ slug: idOrSlug, ...body });
|
|
42326
42889
|
}
|
|
42327
42890
|
var init_posts = __esm({
|
|
42328
42891
|
"src/services/posts.ts"() {
|
|
42329
42892
|
"use strict";
|
|
42893
|
+
init_dist();
|
|
42330
42894
|
init_client();
|
|
42331
42895
|
init_publications();
|
|
42332
42896
|
}
|
|
@@ -42449,13 +43013,12 @@ Examples:
|
|
|
42449
43013
|
subtitle: opts.subtitle,
|
|
42450
43014
|
tags: opts.tags?.split(",").map((t) => t.trim())
|
|
42451
43015
|
});
|
|
42452
|
-
writeSuccess(`Post created: ${
|
|
43016
|
+
writeSuccess(`Post created: ${opts.title}`);
|
|
42453
43017
|
outputData(
|
|
42454
43018
|
this,
|
|
42455
43019
|
{
|
|
42456
43020
|
ID: data.id,
|
|
42457
|
-
Title:
|
|
42458
|
-
Slug: data.slug
|
|
43021
|
+
Title: opts.title
|
|
42459
43022
|
},
|
|
42460
43023
|
data
|
|
42461
43024
|
);
|
|
@@ -42487,8 +43050,8 @@ Examples:
|
|
|
42487
43050
|
});
|
|
42488
43051
|
const headers = ["ID", "Title", "Date"];
|
|
42489
43052
|
const rows = result.items.map((p) => [
|
|
42490
|
-
|
|
42491
|
-
|
|
43053
|
+
p.id,
|
|
43054
|
+
p.title,
|
|
42492
43055
|
formatDate(p)
|
|
42493
43056
|
]);
|
|
42494
43057
|
outputTable(this, headers, rows, result.items, { cursor: result.cursor });
|
|
@@ -42519,8 +43082,7 @@ Examples:
|
|
|
42519
43082
|
if (process.stdout.isTTY) process.stdout.write("\n");
|
|
42520
43083
|
return;
|
|
42521
43084
|
}
|
|
42522
|
-
const
|
|
42523
|
-
const preview = markdown ? markdown.length > 200 ? markdown.slice(0, 200) + "..." : markdown : "";
|
|
43085
|
+
const preview = data.markdown ? data.markdown.length > 200 ? data.markdown.slice(0, 200) + "..." : data.markdown : "";
|
|
42524
43086
|
outputData(
|
|
42525
43087
|
this,
|
|
42526
43088
|
{
|
|
@@ -42559,10 +43121,7 @@ Examples:
|
|
|
42559
43121
|
tags: opts.tags?.split(",").map((t) => t.trim())
|
|
42560
43122
|
});
|
|
42561
43123
|
writeSuccess(`Post updated: ${id}`);
|
|
42562
|
-
|
|
42563
|
-
if (opts.title) result.title = opts.title;
|
|
42564
|
-
if (opts.subtitle) result.subtitle = opts.subtitle;
|
|
42565
|
-
outputData(this, { ID: id }, result);
|
|
43124
|
+
outputData(this, { ID: id }, { id, updated: true, title: opts.title, subtitle: opts.subtitle });
|
|
42566
43125
|
} catch (err) {
|
|
42567
43126
|
handleError(err);
|
|
42568
43127
|
}
|
|
@@ -42627,8 +43186,8 @@ Examples:
|
|
|
42627
43186
|
this,
|
|
42628
43187
|
["ID", "Title", "Date"],
|
|
42629
43188
|
result.items.map((p) => [
|
|
42630
|
-
|
|
42631
|
-
|
|
43189
|
+
p.id,
|
|
43190
|
+
p.title,
|
|
42632
43191
|
formatDate(p)
|
|
42633
43192
|
]),
|
|
42634
43193
|
result.items,
|
|
@@ -42654,15 +43213,11 @@ Examples:
|
|
|
42654
43213
|
outputTable(
|
|
42655
43214
|
this,
|
|
42656
43215
|
["Title", "Publication", "Date"],
|
|
42657
|
-
result.items.map((item) =>
|
|
42658
|
-
|
|
42659
|
-
|
|
42660
|
-
|
|
42661
|
-
|
|
42662
|
-
String(pub?.name || ""),
|
|
42663
|
-
formatDate(p || {})
|
|
42664
|
-
];
|
|
42665
|
-
}),
|
|
43216
|
+
result.items.map((item) => [
|
|
43217
|
+
item.post.title,
|
|
43218
|
+
item.publication.name,
|
|
43219
|
+
formatDate(item.post)
|
|
43220
|
+
]),
|
|
42666
43221
|
result.items,
|
|
42667
43222
|
{ cursor: result.cursor }
|
|
42668
43223
|
);
|
|
@@ -42802,10 +43357,10 @@ Examples:
|
|
|
42802
43357
|
outputData(
|
|
42803
43358
|
this,
|
|
42804
43359
|
{
|
|
42805
|
-
Name: pub.name
|
|
42806
|
-
Slug: pub.slug
|
|
42807
|
-
Domain: pub.customDomain
|
|
42808
|
-
Description: pub.
|
|
43360
|
+
Name: pub.name,
|
|
43361
|
+
Slug: pub.slug,
|
|
43362
|
+
Domain: pub.customDomain,
|
|
43363
|
+
Description: pub.summary
|
|
42809
43364
|
},
|
|
42810
43365
|
pub
|
|
42811
43366
|
);
|
|
@@ -42828,11 +43383,11 @@ var init_publication = __esm({
|
|
|
42828
43383
|
// src/services/search.ts
|
|
42829
43384
|
async function searchPosts(query) {
|
|
42830
43385
|
const client = createClient2();
|
|
42831
|
-
return
|
|
43386
|
+
return client.search.posts(query);
|
|
42832
43387
|
}
|
|
42833
43388
|
async function searchBlogs(query) {
|
|
42834
43389
|
const client = createClient2();
|
|
42835
|
-
return
|
|
43390
|
+
return client.search.blogs(query);
|
|
42836
43391
|
}
|
|
42837
43392
|
var init_search = __esm({
|
|
42838
43393
|
"src/services/search.ts"() {
|
|
@@ -42853,15 +43408,11 @@ Examples:
|
|
|
42853
43408
|
outputTable(
|
|
42854
43409
|
this,
|
|
42855
43410
|
["Title", "Publication", "Slug"],
|
|
42856
|
-
items8.map((r) =>
|
|
42857
|
-
|
|
42858
|
-
|
|
42859
|
-
|
|
42860
|
-
|
|
42861
|
-
String(blog?.name || ""),
|
|
42862
|
-
String(post?.slug || "")
|
|
42863
|
-
];
|
|
42864
|
-
}),
|
|
43411
|
+
items8.map((r) => [
|
|
43412
|
+
r.post.title || "",
|
|
43413
|
+
r.blog.name || "",
|
|
43414
|
+
r.post.slug || ""
|
|
43415
|
+
]),
|
|
42865
43416
|
items8
|
|
42866
43417
|
);
|
|
42867
43418
|
} catch (err) {
|
|
@@ -42877,14 +43428,11 @@ Examples:
|
|
|
42877
43428
|
outputTable(
|
|
42878
43429
|
this,
|
|
42879
43430
|
["Name", "Slug", "Subscribers"],
|
|
42880
|
-
items8.map((r) =>
|
|
42881
|
-
|
|
42882
|
-
|
|
42883
|
-
|
|
42884
|
-
|
|
42885
|
-
String(r.activeSubscriberCount || "")
|
|
42886
|
-
];
|
|
42887
|
-
}),
|
|
43431
|
+
items8.map((r) => [
|
|
43432
|
+
r.blog.name || "",
|
|
43433
|
+
r.blog.slug || "",
|
|
43434
|
+
String(r.activeSubscriberCount || "")
|
|
43435
|
+
]),
|
|
42888
43436
|
items8
|
|
42889
43437
|
);
|
|
42890
43438
|
} catch (err) {
|
|
@@ -42905,23 +43453,19 @@ var init_search2 = __esm({
|
|
|
42905
43453
|
import * as fs3 from "fs";
|
|
42906
43454
|
async function listSubscribers(apiKey, pagination) {
|
|
42907
43455
|
const client = createClient2(apiKey);
|
|
42908
|
-
const query = {};
|
|
42909
|
-
if (pagination?.limit) query.limit = pagination.limit;
|
|
42910
|
-
if (pagination?.cursor) query.cursor = pagination.cursor;
|
|
42911
43456
|
const result = await client.subscribers.get(
|
|
42912
|
-
|
|
43457
|
+
pagination?.limit || pagination?.cursor ? pagination : void 0
|
|
42913
43458
|
);
|
|
42914
43459
|
const data = result;
|
|
42915
43460
|
return { items: data.items, cursor: data.pagination?.cursor };
|
|
42916
43461
|
}
|
|
42917
43462
|
async function getSubscriberCount(publicationId) {
|
|
42918
43463
|
const client = createClient2();
|
|
42919
|
-
const result = await client.subscribers.getCount({
|
|
42920
|
-
id: publicationId
|
|
42921
|
-
});
|
|
43464
|
+
const result = await client.subscribers.getCount({ id: publicationId });
|
|
42922
43465
|
return result.count || 0;
|
|
42923
43466
|
}
|
|
42924
43467
|
async function addSubscriber(email, apiKey) {
|
|
43468
|
+
addSubscriberBody.parse({ email });
|
|
42925
43469
|
const client = createClient2(apiKey);
|
|
42926
43470
|
await client.subscribers.create({ email });
|
|
42927
43471
|
}
|
|
@@ -42934,6 +43478,7 @@ async function importSubscribers(csvPath, apiKey) {
|
|
|
42934
43478
|
var init_subscribers = __esm({
|
|
42935
43479
|
"src/services/subscribers.ts"() {
|
|
42936
43480
|
"use strict";
|
|
43481
|
+
init_dist();
|
|
42937
43482
|
init_client();
|
|
42938
43483
|
}
|
|
42939
43484
|
});
|
|
@@ -42957,9 +43502,9 @@ Examples:
|
|
|
42957
43502
|
this,
|
|
42958
43503
|
["Email", "Wallet", "Date"],
|
|
42959
43504
|
result.items.map((s) => [
|
|
42960
|
-
|
|
42961
|
-
|
|
42962
|
-
formatDate(s)
|
|
43505
|
+
s.email || "",
|
|
43506
|
+
s.walletAddress || "",
|
|
43507
|
+
formatDate({ createdAt: s.createdAt })
|
|
42963
43508
|
]),
|
|
42964
43509
|
result.items,
|
|
42965
43510
|
{ cursor: result.cursor }
|
|
@@ -43028,40 +43573,29 @@ function coinIdentifier(idOrAddress) {
|
|
|
43028
43573
|
}
|
|
43029
43574
|
async function getCoin(idOrAddress) {
|
|
43030
43575
|
const client = createClient2();
|
|
43031
|
-
|
|
43032
|
-
return coin;
|
|
43576
|
+
return client.coins.get(coinIdentifier(idOrAddress)).single();
|
|
43033
43577
|
}
|
|
43034
43578
|
async function getPopularCoins(pagination) {
|
|
43035
43579
|
const client = createClient2();
|
|
43036
|
-
const
|
|
43037
|
-
|
|
43038
|
-
if (pagination?.cursor) query.cursor = pagination.cursor;
|
|
43039
|
-
const result = await client.coins.get(
|
|
43040
|
-
query
|
|
43041
|
-
);
|
|
43042
|
-
const data = result;
|
|
43043
|
-
return { items: data.items, cursor: data.pagination?.cursor };
|
|
43580
|
+
const { items: items8, pagination: pag } = await client.coins.get({ sortBy: "popular" });
|
|
43581
|
+
return { items: items8, cursor: pag.cursor };
|
|
43044
43582
|
}
|
|
43045
43583
|
async function searchCoins(query) {
|
|
43046
43584
|
const client = createClient2();
|
|
43047
|
-
return
|
|
43585
|
+
return client.search.coins(query);
|
|
43048
43586
|
}
|
|
43049
43587
|
async function getCoinQuote(idOrAddress, amount) {
|
|
43050
43588
|
const client = createClient2();
|
|
43051
|
-
|
|
43589
|
+
return client.coins.getQuote(
|
|
43052
43590
|
coinIdentifier(idOrAddress),
|
|
43053
43591
|
BigInt(amount)
|
|
43054
43592
|
);
|
|
43055
|
-
return result;
|
|
43056
43593
|
}
|
|
43057
43594
|
async function getCoinHolders(idOrAddress, pagination) {
|
|
43058
43595
|
const client = createClient2();
|
|
43059
|
-
const query = {};
|
|
43060
|
-
if (pagination?.limit) query.limit = pagination.limit;
|
|
43061
|
-
if (pagination?.cursor) query.cursor = pagination.cursor;
|
|
43062
43596
|
const result = await client.coins.getHolders(
|
|
43063
43597
|
coinIdentifier(idOrAddress),
|
|
43064
|
-
|
|
43598
|
+
pagination?.limit || pagination?.cursor ? { limit: pagination?.limit, cursor: pagination?.cursor } : void 0
|
|
43065
43599
|
);
|
|
43066
43600
|
const data = result;
|
|
43067
43601
|
return { items: data.items, cursor: data.pagination?.cursor };
|
|
@@ -43084,15 +43618,13 @@ Examples:
|
|
|
43084
43618
|
try {
|
|
43085
43619
|
const id = requireArg(positionalId, opts.id, "coin ID or address");
|
|
43086
43620
|
const data = await getCoin(id);
|
|
43087
|
-
const metadata = data.metadata;
|
|
43088
43621
|
outputData(
|
|
43089
43622
|
this,
|
|
43090
43623
|
{
|
|
43091
43624
|
ID: data.id,
|
|
43092
|
-
Name:
|
|
43093
|
-
Ticker: metadata
|
|
43094
|
-
Contract: data.contractAddress
|
|
43095
|
-
Publication: data.publicationId
|
|
43625
|
+
Name: data.metadata.name,
|
|
43626
|
+
Ticker: data.metadata.symbol,
|
|
43627
|
+
Contract: data.contractAddress
|
|
43096
43628
|
},
|
|
43097
43629
|
data
|
|
43098
43630
|
);
|
|
@@ -43113,14 +43645,11 @@ Examples:
|
|
|
43113
43645
|
outputTable(
|
|
43114
43646
|
this,
|
|
43115
43647
|
["Name", "Ticker", "Contract"],
|
|
43116
|
-
result.items.map((c) =>
|
|
43117
|
-
|
|
43118
|
-
|
|
43119
|
-
|
|
43120
|
-
|
|
43121
|
-
String(c.contractAddress || "")
|
|
43122
|
-
];
|
|
43123
|
-
}),
|
|
43648
|
+
result.items.map((c) => [
|
|
43649
|
+
c.metadata.name,
|
|
43650
|
+
c.metadata.symbol,
|
|
43651
|
+
c.contractAddress
|
|
43652
|
+
]),
|
|
43124
43653
|
result.items,
|
|
43125
43654
|
{ cursor: result.cursor }
|
|
43126
43655
|
);
|
|
@@ -43140,15 +43669,11 @@ Examples:
|
|
|
43140
43669
|
outputTable(
|
|
43141
43670
|
this,
|
|
43142
43671
|
["Ticker", "Publication", "Contract"],
|
|
43143
|
-
items8.map((r) =>
|
|
43144
|
-
|
|
43145
|
-
|
|
43146
|
-
|
|
43147
|
-
|
|
43148
|
-
String(blog?.name || ""),
|
|
43149
|
-
String(c?.contractAddress || "")
|
|
43150
|
-
];
|
|
43151
|
-
}),
|
|
43672
|
+
items8.map((r) => [
|
|
43673
|
+
r.coin.ticker || "",
|
|
43674
|
+
r.blog.name || "",
|
|
43675
|
+
r.coin.contractAddress || ""
|
|
43676
|
+
]),
|
|
43152
43677
|
items8
|
|
43153
43678
|
);
|
|
43154
43679
|
} catch (err) {
|
|
@@ -43170,8 +43695,8 @@ Examples:
|
|
|
43170
43695
|
this,
|
|
43171
43696
|
["Wallet", "Balance"],
|
|
43172
43697
|
result.items.map((h) => [
|
|
43173
|
-
|
|
43174
|
-
|
|
43698
|
+
h.walletAddress,
|
|
43699
|
+
h.balance
|
|
43175
43700
|
]),
|
|
43176
43701
|
result.items,
|
|
43177
43702
|
{ cursor: result.cursor }
|
|
@@ -43211,8 +43736,7 @@ var init_coin = __esm({
|
|
|
43211
43736
|
async function getUser(idOrWallet) {
|
|
43212
43737
|
const client = createClient2();
|
|
43213
43738
|
const identifier = idOrWallet.startsWith("0x") ? { wallet: idOrWallet } : { id: idOrWallet };
|
|
43214
|
-
|
|
43215
|
-
return user;
|
|
43739
|
+
return client.users.get(identifier).single();
|
|
43216
43740
|
}
|
|
43217
43741
|
var init_users = __esm({
|
|
43218
43742
|
"src/services/users.ts"() {
|
|
@@ -43261,7 +43785,7 @@ var init_user = __esm({
|
|
|
43261
43785
|
// src/cli/program.ts
|
|
43262
43786
|
function createProgram() {
|
|
43263
43787
|
const program2 = new Command();
|
|
43264
|
-
program2.name("paragraph").description("CLI for Paragraph").version("0.0.
|
|
43788
|
+
program2.name("paragraph").description("CLI for Paragraph").version("0.0.2", "-v, --version").option("--json", "Output as JSON").option("--verbose", "Show detailed output for debugging").exitOverride().configureOutput({
|
|
43265
43789
|
writeOut: (str) => process.stdout.write(str),
|
|
43266
43790
|
writeErr: (str) => {
|
|
43267
43791
|
if (process.argv.includes("--json")) {
|
|
@@ -44476,8 +45000,8 @@ function PostList() {
|
|
|
44476
45000
|
{
|
|
44477
45001
|
options: data.items.map((p) => ({
|
|
44478
45002
|
label: `${p.title || "Untitled"}`,
|
|
44479
|
-
value:
|
|
44480
|
-
description:
|
|
45003
|
+
value: p.id,
|
|
45004
|
+
description: formatDate4(p.publishedAt || p.updatedAt)
|
|
44481
45005
|
})),
|
|
44482
45006
|
onChange: (id) => navigate({ name: "post-detail", params: { id } })
|
|
44483
45007
|
}
|
|
@@ -44508,7 +45032,6 @@ function PostDetail() {
|
|
|
44508
45032
|
useInput16((_input, key) => {
|
|
44509
45033
|
if (key.escape) goBack();
|
|
44510
45034
|
});
|
|
44511
|
-
const markdown = data?.markdown;
|
|
44512
45035
|
return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", children: [
|
|
44513
45036
|
/* @__PURE__ */ jsx22(Header, { title: "Post Detail" }),
|
|
44514
45037
|
loading && /* @__PURE__ */ jsx22(Spinner8, { label: "Loading post..." }),
|
|
@@ -44520,14 +45043,14 @@ function PostDetail() {
|
|
|
44520
45043
|
data: {
|
|
44521
45044
|
Title: data.title,
|
|
44522
45045
|
Subtitle: data.subtitle,
|
|
44523
|
-
|
|
44524
|
-
Date: data.
|
|
45046
|
+
Slug: data.slug,
|
|
45047
|
+
Date: data.publishedAt || data.updatedAt
|
|
44525
45048
|
}
|
|
44526
45049
|
}
|
|
44527
45050
|
),
|
|
44528
|
-
markdown && /* @__PURE__ */ jsxs20(Box20, { marginTop: 1, flexDirection: "column", children: [
|
|
45051
|
+
data.markdown && /* @__PURE__ */ jsxs20(Box20, { marginTop: 1, flexDirection: "column", children: [
|
|
44529
45052
|
/* @__PURE__ */ jsx22(Text13, { dimColor: true, children: "\u2500".repeat(50) }),
|
|
44530
|
-
/* @__PURE__ */ jsx22(Text13, { children: markdown })
|
|
45053
|
+
/* @__PURE__ */ jsx22(Text13, { children: data.markdown })
|
|
44531
45054
|
] })
|
|
44532
45055
|
] })
|
|
44533
45056
|
] });
|
|
@@ -44582,7 +45105,7 @@ function PostCreate() {
|
|
|
44582
45105
|
subtitle: subtitle || void 0,
|
|
44583
45106
|
tags: tags ? tags.split(",").map((t) => t.trim()) : void 0
|
|
44584
45107
|
});
|
|
44585
|
-
setMessage(`Post created: ${
|
|
45108
|
+
setMessage(`Post created: ${title}`);
|
|
44586
45109
|
setStep("done");
|
|
44587
45110
|
} catch (err) {
|
|
44588
45111
|
setErrorMsg(err instanceof Error ? err.message : String(err));
|
|
@@ -44972,10 +45495,10 @@ function MyPublication() {
|
|
|
44972
45495
|
DataView2,
|
|
44973
45496
|
{
|
|
44974
45497
|
data: {
|
|
44975
|
-
Name: data.name
|
|
44976
|
-
Slug: data.slug
|
|
44977
|
-
Domain: data.customDomain
|
|
44978
|
-
Description: data.
|
|
45498
|
+
Name: data.name,
|
|
45499
|
+
Slug: data.slug,
|
|
45500
|
+
Domain: data.customDomain,
|
|
45501
|
+
Description: data.summary
|
|
44979
45502
|
}
|
|
44980
45503
|
}
|
|
44981
45504
|
)
|
|
@@ -45223,8 +45746,8 @@ function SubscriberList() {
|
|
|
45223
45746
|
{
|
|
45224
45747
|
headers: ["Email", "Wallet", "Date"],
|
|
45225
45748
|
rows: data.items.map((s) => [
|
|
45226
|
-
|
|
45227
|
-
|
|
45749
|
+
s.email || "",
|
|
45750
|
+
s.walletAddress || "",
|
|
45228
45751
|
s.createdAt ? new Date(s.createdAt).toLocaleDateString() : ""
|
|
45229
45752
|
])
|
|
45230
45753
|
}
|