@debridge-finance/solana-utils 5.3.0 → 5.3.1
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/browser/index.js +20 -17
- package/dist/browser/index.js.map +1 -1
- package/package.json +2 -2
package/dist/browser/index.js
CHANGED
|
@@ -14611,7 +14611,23 @@ Layout$2.const = ((value, property) => new Constant(value, property));
|
|
|
14611
14611
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14612
14612
|
};
|
|
14613
14613
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14614
|
-
exports.
|
|
14614
|
+
exports.struct = exports.f64 = exports.f32 = exports.i32 = exports.u32 = exports.i16 = exports.u16 = exports.i8 = exports.u8 = void 0;
|
|
14615
|
+
exports.u64 = u64;
|
|
14616
|
+
exports.i64 = i64;
|
|
14617
|
+
exports.u128 = u128;
|
|
14618
|
+
exports.i128 = i128;
|
|
14619
|
+
exports.u256 = u256;
|
|
14620
|
+
exports.i256 = i256;
|
|
14621
|
+
exports.publicKey = publicKey;
|
|
14622
|
+
exports.option = option;
|
|
14623
|
+
exports.bool = bool;
|
|
14624
|
+
exports.vec = vec;
|
|
14625
|
+
exports.tagged = tagged;
|
|
14626
|
+
exports.vecU8 = vecU8;
|
|
14627
|
+
exports.str = str;
|
|
14628
|
+
exports.rustEnum = rustEnum;
|
|
14629
|
+
exports.array = array;
|
|
14630
|
+
exports.map = map;
|
|
14615
14631
|
const buffer_layout_1 = Layout$2;
|
|
14616
14632
|
const web3_js_1 = require$$1;
|
|
14617
14633
|
const bn_js_1 = __importDefault(bn.exports);
|
|
@@ -14648,27 +14664,21 @@ Layout$2.const = ((value, property) => new Constant(value, property));
|
|
|
14648
14664
|
function u64(property) {
|
|
14649
14665
|
return new BNLayout(8, false, property);
|
|
14650
14666
|
}
|
|
14651
|
-
exports.u64 = u64;
|
|
14652
14667
|
function i64(property) {
|
|
14653
14668
|
return new BNLayout(8, true, property);
|
|
14654
14669
|
}
|
|
14655
|
-
exports.i64 = i64;
|
|
14656
14670
|
function u128(property) {
|
|
14657
14671
|
return new BNLayout(16, false, property);
|
|
14658
14672
|
}
|
|
14659
|
-
exports.u128 = u128;
|
|
14660
14673
|
function i128(property) {
|
|
14661
14674
|
return new BNLayout(16, true, property);
|
|
14662
14675
|
}
|
|
14663
|
-
exports.i128 = i128;
|
|
14664
14676
|
function u256(property) {
|
|
14665
14677
|
return new BNLayout(32, false, property);
|
|
14666
14678
|
}
|
|
14667
|
-
exports.u256 = u256;
|
|
14668
14679
|
function i256(property) {
|
|
14669
14680
|
return new BNLayout(32, true, property);
|
|
14670
14681
|
}
|
|
14671
|
-
exports.i256 = i256;
|
|
14672
14682
|
class WrappedLayout extends buffer_layout_1.Layout {
|
|
14673
14683
|
constructor(layout, decoder, encoder, property) {
|
|
14674
14684
|
super(layout.span, property);
|
|
@@ -14689,7 +14699,6 @@ Layout$2.const = ((value, property) => new Constant(value, property));
|
|
|
14689
14699
|
function publicKey(property) {
|
|
14690
14700
|
return new WrappedLayout((0, buffer_layout_1.blob)(32), (b) => new web3_js_1.PublicKey(b), (key) => key.toBuffer(), property);
|
|
14691
14701
|
}
|
|
14692
|
-
exports.publicKey = publicKey;
|
|
14693
14702
|
class OptionLayout extends buffer_layout_1.Layout {
|
|
14694
14703
|
constructor(layout, property) {
|
|
14695
14704
|
super(-1, property);
|
|
@@ -14727,11 +14736,9 @@ Layout$2.const = ((value, property) => new Constant(value, property));
|
|
|
14727
14736
|
function option(layout, property) {
|
|
14728
14737
|
return new OptionLayout(layout, property);
|
|
14729
14738
|
}
|
|
14730
|
-
exports.option = option;
|
|
14731
14739
|
function bool(property) {
|
|
14732
14740
|
return new WrappedLayout((0, buffer_layout_1.u8)(), decodeBool, encodeBool, property);
|
|
14733
14741
|
}
|
|
14734
|
-
exports.bool = bool;
|
|
14735
14742
|
function decodeBool(value) {
|
|
14736
14743
|
if (value === 0) {
|
|
14737
14744
|
return false;
|
|
@@ -14752,7 +14759,6 @@ Layout$2.const = ((value, property) => new Constant(value, property));
|
|
|
14752
14759
|
]);
|
|
14753
14760
|
return new WrappedLayout(layout, ({ values }) => values, (values) => ({ values }), property);
|
|
14754
14761
|
}
|
|
14755
|
-
exports.vec = vec;
|
|
14756
14762
|
function tagged(tag, layout, property) {
|
|
14757
14763
|
const wrappedLayout = (0, buffer_layout_1.struct)([
|
|
14758
14764
|
u64("tag"),
|
|
@@ -14769,7 +14775,6 @@ Layout$2.const = ((value, property) => new Constant(value, property));
|
|
|
14769
14775
|
}
|
|
14770
14776
|
return new WrappedLayout(wrappedLayout, decodeTag, (data) => ({ tag, data }), property);
|
|
14771
14777
|
}
|
|
14772
|
-
exports.tagged = tagged;
|
|
14773
14778
|
function vecU8(property) {
|
|
14774
14779
|
const length = (0, buffer_layout_1.u32)("length");
|
|
14775
14780
|
const layout = (0, buffer_layout_1.struct)([
|
|
@@ -14778,24 +14783,20 @@ Layout$2.const = ((value, property) => new Constant(value, property));
|
|
|
14778
14783
|
]);
|
|
14779
14784
|
return new WrappedLayout(layout, ({ data }) => data, (data) => ({ data }), property);
|
|
14780
14785
|
}
|
|
14781
|
-
exports.vecU8 = vecU8;
|
|
14782
14786
|
function str(property) {
|
|
14783
14787
|
return new WrappedLayout(vecU8(), (data) => data.toString("utf-8"), (s) => Buffer.from(s, "utf-8"), property);
|
|
14784
14788
|
}
|
|
14785
|
-
exports.str = str;
|
|
14786
14789
|
function rustEnum(variants, property, discriminant) {
|
|
14787
14790
|
const unionLayout = (0, buffer_layout_1.union)(discriminant !== null && discriminant !== void 0 ? discriminant : (0, buffer_layout_1.u8)(), property);
|
|
14788
14791
|
variants.forEach((variant, index) => unionLayout.addVariant(index, variant, variant.property));
|
|
14789
14792
|
return unionLayout;
|
|
14790
14793
|
}
|
|
14791
|
-
exports.rustEnum = rustEnum;
|
|
14792
14794
|
function array(elementLayout, length, property) {
|
|
14793
14795
|
const layout = (0, buffer_layout_1.struct)([
|
|
14794
14796
|
(0, buffer_layout_1.seq)(elementLayout, length, "values"),
|
|
14795
14797
|
]);
|
|
14796
14798
|
return new WrappedLayout(layout, ({ values }) => values, (values) => ({ values }), property);
|
|
14797
14799
|
}
|
|
14798
|
-
exports.array = array;
|
|
14799
14800
|
class MapEntryLayout extends buffer_layout_1.Layout {
|
|
14800
14801
|
constructor(keyLayout, valueLayout, property) {
|
|
14801
14802
|
super(keyLayout.span + valueLayout.span, property);
|
|
@@ -14826,7 +14827,6 @@ Layout$2.const = ((value, property) => new Constant(value, property));
|
|
|
14826
14827
|
]);
|
|
14827
14828
|
return new WrappedLayout(layout, ({ values }) => new Map(values), (values) => ({ values: Array.from(values.entries()) }), property);
|
|
14828
14829
|
}
|
|
14829
|
-
exports.map = map;
|
|
14830
14830
|
|
|
14831
14831
|
} (dist$1));
|
|
14832
14832
|
|
|
@@ -28781,6 +28781,7 @@ function generateLogsParsingRegex() {
|
|
|
28781
28781
|
"Lookup table cannot be the recipient of reclaimed lamports",
|
|
28782
28782
|
"Lookup table is not deactivated",
|
|
28783
28783
|
"Table cannot be closed until it's fully deactivated in {} blocks",
|
|
28784
|
+
"Program consumption: {} units remaining"
|
|
28784
28785
|
];
|
|
28785
28786
|
const prepareLineForRegex = (l) => l.replaceAll("{}", ".*").replaceAll("(", "\\(").replaceAll(")", "\\)").replaceAll("]", "\\]").replaceAll("[", "\\[");
|
|
28786
28787
|
const regexTemplate = `\
|
|
@@ -28934,6 +28935,8 @@ if __name__ == "__main__":
|
|
|
28934
28935
|
|
|
28935
28936
|
*/
|
|
28936
28937
|
|
|
28938
|
+
new PublicKey("ComputeBudget111111111111111111111111111111");
|
|
28939
|
+
|
|
28937
28940
|
function simulateTransaction(connection, tx, simulateConfig) {
|
|
28938
28941
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28939
28942
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|