@debridge-finance/solana-utils 5.3.0 → 5.3.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/browser/index.js +25 -18
- package/dist/browser/index.js.map +1 -1
- package/package.json +2 -2
package/dist/browser/index.js
CHANGED
|
@@ -11841,8 +11841,12 @@ function base$1 (ALPHABET) {
|
|
|
11841
11841
|
var b256 = new Uint8Array(size);
|
|
11842
11842
|
// Process the characters.
|
|
11843
11843
|
while (psz < source.length) {
|
|
11844
|
+
// Find code of next character
|
|
11845
|
+
var charCode = source.charCodeAt(psz);
|
|
11846
|
+
// Base map can not be indexed using char code
|
|
11847
|
+
if (charCode > 255) { return }
|
|
11844
11848
|
// Decode character
|
|
11845
|
-
var carry = BASE_MAP[
|
|
11849
|
+
var carry = BASE_MAP[charCode];
|
|
11846
11850
|
// Invalid character
|
|
11847
11851
|
if (carry === 255) { return }
|
|
11848
11852
|
var i = 0;
|
|
@@ -14611,7 +14615,23 @@ Layout$2.const = ((value, property) => new Constant(value, property));
|
|
|
14611
14615
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14612
14616
|
};
|
|
14613
14617
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14614
|
-
exports.
|
|
14618
|
+
exports.struct = exports.f64 = exports.f32 = exports.i32 = exports.u32 = exports.i16 = exports.u16 = exports.i8 = exports.u8 = void 0;
|
|
14619
|
+
exports.u64 = u64;
|
|
14620
|
+
exports.i64 = i64;
|
|
14621
|
+
exports.u128 = u128;
|
|
14622
|
+
exports.i128 = i128;
|
|
14623
|
+
exports.u256 = u256;
|
|
14624
|
+
exports.i256 = i256;
|
|
14625
|
+
exports.publicKey = publicKey;
|
|
14626
|
+
exports.option = option;
|
|
14627
|
+
exports.bool = bool;
|
|
14628
|
+
exports.vec = vec;
|
|
14629
|
+
exports.tagged = tagged;
|
|
14630
|
+
exports.vecU8 = vecU8;
|
|
14631
|
+
exports.str = str;
|
|
14632
|
+
exports.rustEnum = rustEnum;
|
|
14633
|
+
exports.array = array;
|
|
14634
|
+
exports.map = map;
|
|
14615
14635
|
const buffer_layout_1 = Layout$2;
|
|
14616
14636
|
const web3_js_1 = require$$1;
|
|
14617
14637
|
const bn_js_1 = __importDefault(bn.exports);
|
|
@@ -14648,27 +14668,21 @@ Layout$2.const = ((value, property) => new Constant(value, property));
|
|
|
14648
14668
|
function u64(property) {
|
|
14649
14669
|
return new BNLayout(8, false, property);
|
|
14650
14670
|
}
|
|
14651
|
-
exports.u64 = u64;
|
|
14652
14671
|
function i64(property) {
|
|
14653
14672
|
return new BNLayout(8, true, property);
|
|
14654
14673
|
}
|
|
14655
|
-
exports.i64 = i64;
|
|
14656
14674
|
function u128(property) {
|
|
14657
14675
|
return new BNLayout(16, false, property);
|
|
14658
14676
|
}
|
|
14659
|
-
exports.u128 = u128;
|
|
14660
14677
|
function i128(property) {
|
|
14661
14678
|
return new BNLayout(16, true, property);
|
|
14662
14679
|
}
|
|
14663
|
-
exports.i128 = i128;
|
|
14664
14680
|
function u256(property) {
|
|
14665
14681
|
return new BNLayout(32, false, property);
|
|
14666
14682
|
}
|
|
14667
|
-
exports.u256 = u256;
|
|
14668
14683
|
function i256(property) {
|
|
14669
14684
|
return new BNLayout(32, true, property);
|
|
14670
14685
|
}
|
|
14671
|
-
exports.i256 = i256;
|
|
14672
14686
|
class WrappedLayout extends buffer_layout_1.Layout {
|
|
14673
14687
|
constructor(layout, decoder, encoder, property) {
|
|
14674
14688
|
super(layout.span, property);
|
|
@@ -14689,7 +14703,6 @@ Layout$2.const = ((value, property) => new Constant(value, property));
|
|
|
14689
14703
|
function publicKey(property) {
|
|
14690
14704
|
return new WrappedLayout((0, buffer_layout_1.blob)(32), (b) => new web3_js_1.PublicKey(b), (key) => key.toBuffer(), property);
|
|
14691
14705
|
}
|
|
14692
|
-
exports.publicKey = publicKey;
|
|
14693
14706
|
class OptionLayout extends buffer_layout_1.Layout {
|
|
14694
14707
|
constructor(layout, property) {
|
|
14695
14708
|
super(-1, property);
|
|
@@ -14727,11 +14740,9 @@ Layout$2.const = ((value, property) => new Constant(value, property));
|
|
|
14727
14740
|
function option(layout, property) {
|
|
14728
14741
|
return new OptionLayout(layout, property);
|
|
14729
14742
|
}
|
|
14730
|
-
exports.option = option;
|
|
14731
14743
|
function bool(property) {
|
|
14732
14744
|
return new WrappedLayout((0, buffer_layout_1.u8)(), decodeBool, encodeBool, property);
|
|
14733
14745
|
}
|
|
14734
|
-
exports.bool = bool;
|
|
14735
14746
|
function decodeBool(value) {
|
|
14736
14747
|
if (value === 0) {
|
|
14737
14748
|
return false;
|
|
@@ -14752,7 +14763,6 @@ Layout$2.const = ((value, property) => new Constant(value, property));
|
|
|
14752
14763
|
]);
|
|
14753
14764
|
return new WrappedLayout(layout, ({ values }) => values, (values) => ({ values }), property);
|
|
14754
14765
|
}
|
|
14755
|
-
exports.vec = vec;
|
|
14756
14766
|
function tagged(tag, layout, property) {
|
|
14757
14767
|
const wrappedLayout = (0, buffer_layout_1.struct)([
|
|
14758
14768
|
u64("tag"),
|
|
@@ -14769,7 +14779,6 @@ Layout$2.const = ((value, property) => new Constant(value, property));
|
|
|
14769
14779
|
}
|
|
14770
14780
|
return new WrappedLayout(wrappedLayout, decodeTag, (data) => ({ tag, data }), property);
|
|
14771
14781
|
}
|
|
14772
|
-
exports.tagged = tagged;
|
|
14773
14782
|
function vecU8(property) {
|
|
14774
14783
|
const length = (0, buffer_layout_1.u32)("length");
|
|
14775
14784
|
const layout = (0, buffer_layout_1.struct)([
|
|
@@ -14778,24 +14787,20 @@ Layout$2.const = ((value, property) => new Constant(value, property));
|
|
|
14778
14787
|
]);
|
|
14779
14788
|
return new WrappedLayout(layout, ({ data }) => data, (data) => ({ data }), property);
|
|
14780
14789
|
}
|
|
14781
|
-
exports.vecU8 = vecU8;
|
|
14782
14790
|
function str(property) {
|
|
14783
14791
|
return new WrappedLayout(vecU8(), (data) => data.toString("utf-8"), (s) => Buffer.from(s, "utf-8"), property);
|
|
14784
14792
|
}
|
|
14785
|
-
exports.str = str;
|
|
14786
14793
|
function rustEnum(variants, property, discriminant) {
|
|
14787
14794
|
const unionLayout = (0, buffer_layout_1.union)(discriminant !== null && discriminant !== void 0 ? discriminant : (0, buffer_layout_1.u8)(), property);
|
|
14788
14795
|
variants.forEach((variant, index) => unionLayout.addVariant(index, variant, variant.property));
|
|
14789
14796
|
return unionLayout;
|
|
14790
14797
|
}
|
|
14791
|
-
exports.rustEnum = rustEnum;
|
|
14792
14798
|
function array(elementLayout, length, property) {
|
|
14793
14799
|
const layout = (0, buffer_layout_1.struct)([
|
|
14794
14800
|
(0, buffer_layout_1.seq)(elementLayout, length, "values"),
|
|
14795
14801
|
]);
|
|
14796
14802
|
return new WrappedLayout(layout, ({ values }) => values, (values) => ({ values }), property);
|
|
14797
14803
|
}
|
|
14798
|
-
exports.array = array;
|
|
14799
14804
|
class MapEntryLayout extends buffer_layout_1.Layout {
|
|
14800
14805
|
constructor(keyLayout, valueLayout, property) {
|
|
14801
14806
|
super(keyLayout.span + valueLayout.span, property);
|
|
@@ -14826,7 +14831,6 @@ Layout$2.const = ((value, property) => new Constant(value, property));
|
|
|
14826
14831
|
]);
|
|
14827
14832
|
return new WrappedLayout(layout, ({ values }) => new Map(values), (values) => ({ values: Array.from(values.entries()) }), property);
|
|
14828
14833
|
}
|
|
14829
|
-
exports.map = map;
|
|
14830
14834
|
|
|
14831
14835
|
} (dist$1));
|
|
14832
14836
|
|
|
@@ -28781,6 +28785,7 @@ function generateLogsParsingRegex() {
|
|
|
28781
28785
|
"Lookup table cannot be the recipient of reclaimed lamports",
|
|
28782
28786
|
"Lookup table is not deactivated",
|
|
28783
28787
|
"Table cannot be closed until it's fully deactivated in {} blocks",
|
|
28788
|
+
"Program consumption: {} units remaining"
|
|
28784
28789
|
];
|
|
28785
28790
|
const prepareLineForRegex = (l) => l.replaceAll("{}", ".*").replaceAll("(", "\\(").replaceAll(")", "\\)").replaceAll("]", "\\]").replaceAll("[", "\\[");
|
|
28786
28791
|
const regexTemplate = `\
|
|
@@ -28934,6 +28939,8 @@ if __name__ == "__main__":
|
|
|
28934
28939
|
|
|
28935
28940
|
*/
|
|
28936
28941
|
|
|
28942
|
+
new PublicKey("ComputeBudget111111111111111111111111111111");
|
|
28943
|
+
|
|
28937
28944
|
function simulateTransaction(connection, tx, simulateConfig) {
|
|
28938
28945
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28939
28946
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|