@debridge-finance/solana-utils 6.2.3 → 6.2.4
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 +230 -107
- package/dist/browser/index.js.map +1 -1
- package/dist/cjs/spl.js +2 -2
- package/dist/cjs/spl.js.map +1 -1
- package/dist/esm/spl.js +2 -2
- package/dist/esm/spl.js.map +1 -1
- package/dist/types/spl.d.ts +2 -2
- package/dist/types/spl.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/browser/index.js
CHANGED
|
@@ -9975,7 +9975,7 @@ Layout$4.utf8 = ((maxSpan, property) => new UTF8$1(maxSpan, property));
|
|
|
9975
9975
|
/** Factory for {@link Constant} values. */
|
|
9976
9976
|
Layout$4.constant = ((value, property) => new Constant$1(value, property));
|
|
9977
9977
|
|
|
9978
|
-
const encodeDecode$
|
|
9978
|
+
const encodeDecode$2 = (layout) => {
|
|
9979
9979
|
const decode = layout.decode.bind(layout);
|
|
9980
9980
|
const encode = layout.encode.bind(layout);
|
|
9981
9981
|
return { decode, encode };
|
|
@@ -10015,7 +10015,7 @@ function toBigIntBE(buf) {
|
|
|
10015
10015
|
return BigInt(`0x${hex}`);
|
|
10016
10016
|
}
|
|
10017
10017
|
}
|
|
10018
|
-
browser.toBigIntBE = toBigIntBE;
|
|
10018
|
+
var toBigIntBE_1 = browser.toBigIntBE = toBigIntBE;
|
|
10019
10019
|
/**
|
|
10020
10020
|
* Convert a BigInt to a little-endian buffer.
|
|
10021
10021
|
* @param num The BigInt to convert.
|
|
@@ -10043,27 +10043,45 @@ function toBufferBE(num, width) {
|
|
|
10043
10043
|
return Buffer.from(hex.padStart(width * 2, '0').slice(0, width * 2), 'hex');
|
|
10044
10044
|
}
|
|
10045
10045
|
}
|
|
10046
|
-
browser.toBufferBE = toBufferBE;
|
|
10046
|
+
var toBufferBE_1 = browser.toBufferBE = toBufferBE;
|
|
10047
10047
|
|
|
10048
|
-
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
|
|
10054
|
-
|
|
10055
|
-
|
|
10056
|
-
|
|
10057
|
-
const
|
|
10058
|
-
|
|
10048
|
+
// https://github.com/no2chem/bigint-buffer/issues/59
|
|
10049
|
+
function assertValidBigInteger(untrustedInput) {
|
|
10050
|
+
if (typeof untrustedInput !== 'bigint') {
|
|
10051
|
+
throw new Error('Expected a `BigInt`');
|
|
10052
|
+
}
|
|
10053
|
+
}
|
|
10054
|
+
function bigInt_IMPL(littleEndian, length) {
|
|
10055
|
+
return (property) => {
|
|
10056
|
+
const layout = blob$1(length, property);
|
|
10057
|
+
const { encode, decode } = encodeDecode$2(layout);
|
|
10058
|
+
const bigIntLayout = layout;
|
|
10059
|
+
bigIntLayout.decode = (buffer$1, offset) => {
|
|
10060
|
+
const src = decode(buffer$1, offset);
|
|
10061
|
+
return littleEndian ? toBigIntLE_1(buffer.Buffer.from(src)) : toBigIntBE_1(buffer.Buffer.from(src));
|
|
10062
|
+
};
|
|
10063
|
+
bigIntLayout.encode = (bigInt, buffer$1, offset) => {
|
|
10064
|
+
assertValidBigInteger(bigInt);
|
|
10065
|
+
let src;
|
|
10066
|
+
if (length === 0) {
|
|
10067
|
+
// https://github.com/no2chem/bigint-buffer/issues/40
|
|
10068
|
+
// `toBuffer{BE|LE}` crashes when passed zero for the `length` argument.
|
|
10069
|
+
src = buffer.Buffer.alloc(0);
|
|
10070
|
+
}
|
|
10071
|
+
else {
|
|
10072
|
+
src = littleEndian ? toBufferLE_1(bigInt, length) : toBufferBE_1(bigInt, length);
|
|
10073
|
+
}
|
|
10074
|
+
return encode(src, buffer$1, offset);
|
|
10075
|
+
};
|
|
10076
|
+
return bigIntLayout;
|
|
10059
10077
|
};
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
const u64$
|
|
10078
|
+
}
|
|
10079
|
+
const bigInt$1 = /* @__PURE__ */ bigInt_IMPL.bind(null, /* littleEndian */ true);
|
|
10080
|
+
const u64$2 = /* @__PURE__ */ bigInt$1(8);
|
|
10063
10081
|
|
|
10064
10082
|
const bool$1 = (property) => {
|
|
10065
10083
|
const layout = u8$1(property);
|
|
10066
|
-
const { encode, decode } = encodeDecode$
|
|
10084
|
+
const { encode, decode } = encodeDecode$2(layout);
|
|
10067
10085
|
const boolLayout = layout;
|
|
10068
10086
|
boolLayout.decode = (buffer, offset) => {
|
|
10069
10087
|
const src = decode(buffer, offset);
|
|
@@ -10076,9 +10094,9 @@ const bool$1 = (property) => {
|
|
|
10076
10094
|
return boolLayout;
|
|
10077
10095
|
};
|
|
10078
10096
|
|
|
10079
|
-
const publicKey$
|
|
10097
|
+
const publicKey$5 = (property) => {
|
|
10080
10098
|
const layout = blob$1(32, property);
|
|
10081
|
-
const { encode, decode } = encodeDecode$
|
|
10099
|
+
const { encode, decode } = encodeDecode$2(layout);
|
|
10082
10100
|
const publicKeyLayout = layout;
|
|
10083
10101
|
publicKeyLayout.decode = (buffer, offset) => {
|
|
10084
10102
|
const src = decode(buffer, offset);
|
|
@@ -10174,12 +10192,14 @@ var TokenInstruction;
|
|
|
10174
10192
|
// ConfidentialMintBurnExtension = 42,
|
|
10175
10193
|
TokenInstruction[TokenInstruction["ScaledUiAmountExtension"] = 43] = "ScaledUiAmountExtension";
|
|
10176
10194
|
TokenInstruction[TokenInstruction["PausableExtension"] = 44] = "PausableExtension";
|
|
10195
|
+
TokenInstruction[TokenInstruction["UnwrapLamports"] = 45] = "UnwrapLamports";
|
|
10196
|
+
TokenInstruction[TokenInstruction["PermissionedBurnExtension"] = 46] = "PermissionedBurnExtension";
|
|
10177
10197
|
})(TokenInstruction || (TokenInstruction = {}));
|
|
10178
10198
|
|
|
10179
10199
|
/** TODO: docs */
|
|
10180
10200
|
struct$1([
|
|
10181
10201
|
u8$1('instruction'),
|
|
10182
|
-
u64$
|
|
10202
|
+
u64$2('amount'),
|
|
10183
10203
|
]);
|
|
10184
10204
|
|
|
10185
10205
|
var AccountType$1;
|
|
@@ -10195,17 +10215,17 @@ const MultisigLayout = struct$1([
|
|
|
10195
10215
|
u8$1('m'),
|
|
10196
10216
|
u8$1('n'),
|
|
10197
10217
|
bool$1('isInitialized'),
|
|
10198
|
-
publicKey$
|
|
10199
|
-
publicKey$
|
|
10200
|
-
publicKey$
|
|
10201
|
-
publicKey$
|
|
10202
|
-
publicKey$
|
|
10203
|
-
publicKey$
|
|
10204
|
-
publicKey$
|
|
10205
|
-
publicKey$
|
|
10206
|
-
publicKey$
|
|
10207
|
-
publicKey$
|
|
10208
|
-
publicKey$
|
|
10218
|
+
publicKey$5('signer1'),
|
|
10219
|
+
publicKey$5('signer2'),
|
|
10220
|
+
publicKey$5('signer3'),
|
|
10221
|
+
publicKey$5('signer4'),
|
|
10222
|
+
publicKey$5('signer5'),
|
|
10223
|
+
publicKey$5('signer6'),
|
|
10224
|
+
publicKey$5('signer7'),
|
|
10225
|
+
publicKey$5('signer8'),
|
|
10226
|
+
publicKey$5('signer9'),
|
|
10227
|
+
publicKey$5('signer10'),
|
|
10228
|
+
publicKey$5('signer11'),
|
|
10209
10229
|
]);
|
|
10210
10230
|
/** Byte length of a multisig */
|
|
10211
10231
|
const MULTISIG_SIZE = MultisigLayout.span;
|
|
@@ -10219,17 +10239,17 @@ var AccountState$1;
|
|
|
10219
10239
|
})(AccountState$1 || (AccountState$1 = {}));
|
|
10220
10240
|
/** Buffer layout for de/serializing a token account */
|
|
10221
10241
|
const AccountLayout$1 = struct$1([
|
|
10222
|
-
publicKey$
|
|
10223
|
-
publicKey$
|
|
10224
|
-
u64$
|
|
10242
|
+
publicKey$5('mint'),
|
|
10243
|
+
publicKey$5('owner'),
|
|
10244
|
+
u64$2('amount'),
|
|
10225
10245
|
u32$1('delegateOption'),
|
|
10226
|
-
publicKey$
|
|
10246
|
+
publicKey$5('delegate'),
|
|
10227
10247
|
u8$1('state'),
|
|
10228
10248
|
u32$1('isNativeOption'),
|
|
10229
|
-
u64$
|
|
10230
|
-
u64$
|
|
10249
|
+
u64$2('isNative'),
|
|
10250
|
+
u64$2('delegatedAmount'),
|
|
10231
10251
|
u32$1('closeAuthorityOption'),
|
|
10232
|
-
publicKey$
|
|
10252
|
+
publicKey$5('closeAuthority'),
|
|
10233
10253
|
]);
|
|
10234
10254
|
/** Byte length of a token account */
|
|
10235
10255
|
const ACCOUNT_SIZE = AccountLayout$1.span;
|
|
@@ -10795,15 +10815,15 @@ tokenGroupMemberCodec.fixedSize;
|
|
|
10795
10815
|
|
|
10796
10816
|
/** Buffer layout for de/serializing a Group Pointer extension */
|
|
10797
10817
|
const GroupMemberPointerLayout = struct$1([
|
|
10798
|
-
publicKey$
|
|
10799
|
-
publicKey$
|
|
10818
|
+
publicKey$5('authority'),
|
|
10819
|
+
publicKey$5('memberAddress'),
|
|
10800
10820
|
]);
|
|
10801
10821
|
GroupMemberPointerLayout.span;
|
|
10802
10822
|
|
|
10803
10823
|
/** Buffer layout for de/serializing a GroupPointer extension */
|
|
10804
10824
|
const GroupPointerLayout = struct$1([
|
|
10805
|
-
publicKey$
|
|
10806
|
-
publicKey$
|
|
10825
|
+
publicKey$5('authority'),
|
|
10826
|
+
publicKey$5('groupAddress'),
|
|
10807
10827
|
]);
|
|
10808
10828
|
GroupPointerLayout.span;
|
|
10809
10829
|
|
|
@@ -10812,7 +10832,7 @@ const ImmutableOwnerLayout = struct$1([]);
|
|
|
10812
10832
|
ImmutableOwnerLayout.span;
|
|
10813
10833
|
|
|
10814
10834
|
const InterestBearingMintConfigStateLayout = struct$1([
|
|
10815
|
-
publicKey$
|
|
10835
|
+
publicKey$5('rateAuthority'),
|
|
10816
10836
|
ns64$1('initializationTimestamp'),
|
|
10817
10837
|
s16('preUpdateAverageRate'),
|
|
10818
10838
|
ns64$1('lastUpdateTimestamp'),
|
|
@@ -10837,8 +10857,8 @@ MemoTransferLayout.span;
|
|
|
10837
10857
|
|
|
10838
10858
|
/** Buffer layout for de/serializing a Metadata Pointer extension */
|
|
10839
10859
|
const MetadataPointerLayout = struct$1([
|
|
10840
|
-
publicKey$
|
|
10841
|
-
publicKey$
|
|
10860
|
+
publicKey$5('authority'),
|
|
10861
|
+
publicKey$5('metadataAddress'),
|
|
10842
10862
|
]);
|
|
10843
10863
|
MetadataPointerLayout.span;
|
|
10844
10864
|
function getMetadataPointerState(mint) {
|
|
@@ -10857,7 +10877,7 @@ function getMetadataPointerState(mint) {
|
|
|
10857
10877
|
}
|
|
10858
10878
|
|
|
10859
10879
|
/** Buffer layout for de/serializing a mint */
|
|
10860
|
-
const MintCloseAuthorityLayout = struct$1([publicKey$
|
|
10880
|
+
const MintCloseAuthorityLayout = struct$1([publicKey$5('closeAuthority')]);
|
|
10861
10881
|
MintCloseAuthorityLayout.span;
|
|
10862
10882
|
|
|
10863
10883
|
/** Buffer layout for de/serializing an account */
|
|
@@ -10874,22 +10894,26 @@ var PausableInstruction;
|
|
|
10874
10894
|
struct$1([
|
|
10875
10895
|
u8$1('instruction'),
|
|
10876
10896
|
u8$1('pausableInstruction'),
|
|
10877
|
-
publicKey$
|
|
10897
|
+
publicKey$5('authority'),
|
|
10878
10898
|
]);
|
|
10879
10899
|
struct$1([u8$1('instruction'), u8$1('pausableInstruction')]);
|
|
10880
10900
|
struct$1([u8$1('instruction'), u8$1('pausableInstruction')]);
|
|
10881
10901
|
|
|
10882
10902
|
/** Buffer layout for de/serializing a pausable config */
|
|
10883
|
-
const PausableConfigLayout = struct$1([publicKey$
|
|
10903
|
+
const PausableConfigLayout = struct$1([publicKey$5('authority'), bool$1('paused')]);
|
|
10884
10904
|
PausableConfigLayout.span;
|
|
10885
10905
|
/** Buffer layout for de/serializing a pausable account */
|
|
10886
10906
|
const PausableAccountLayout = struct$1([]); // esline-disable-line
|
|
10887
10907
|
PausableAccountLayout.span;
|
|
10888
10908
|
|
|
10889
10909
|
/** Buffer layout for de/serializing a mint */
|
|
10890
|
-
const PermanentDelegateLayout = struct$1([publicKey$
|
|
10910
|
+
const PermanentDelegateLayout = struct$1([publicKey$5('delegate')]);
|
|
10891
10911
|
PermanentDelegateLayout.span;
|
|
10892
10912
|
|
|
10913
|
+
/** Buffer layout for de/serializing a permissioned burn config */
|
|
10914
|
+
const PermissionedBurnLayout = struct$1([publicKey$5('authority')]);
|
|
10915
|
+
PermissionedBurnLayout.span;
|
|
10916
|
+
|
|
10893
10917
|
var ScaledUiAmountInstruction;
|
|
10894
10918
|
(function (ScaledUiAmountInstruction) {
|
|
10895
10919
|
ScaledUiAmountInstruction[ScaledUiAmountInstruction["Initialize"] = 0] = "Initialize";
|
|
@@ -10898,20 +10922,20 @@ var ScaledUiAmountInstruction;
|
|
|
10898
10922
|
struct$1([
|
|
10899
10923
|
u8$1('instruction'),
|
|
10900
10924
|
u8$1('scaledUiAmountInstruction'),
|
|
10901
|
-
publicKey$
|
|
10925
|
+
publicKey$5('authority'),
|
|
10902
10926
|
f64('multiplier'),
|
|
10903
10927
|
]);
|
|
10904
10928
|
struct$1([
|
|
10905
10929
|
u8$1('instruction'),
|
|
10906
10930
|
u8$1('scaledUiAmountInstruction'),
|
|
10907
10931
|
f64('multiplier'),
|
|
10908
|
-
u64$
|
|
10932
|
+
u64$2('effectiveTimestamp'),
|
|
10909
10933
|
]);
|
|
10910
10934
|
|
|
10911
10935
|
const ScaledUiAmountConfigLayout = struct$1([
|
|
10912
|
-
publicKey$
|
|
10936
|
+
publicKey$5('authority'),
|
|
10913
10937
|
f64('multiplier'),
|
|
10914
|
-
u64$
|
|
10938
|
+
u64$2('newMultiplierEffectiveTimestamp'),
|
|
10915
10939
|
f64('newMultiplier'),
|
|
10916
10940
|
]);
|
|
10917
10941
|
ScaledUiAmountConfigLayout.span;
|
|
@@ -10919,7 +10943,7 @@ ScaledUiAmountConfigLayout.span;
|
|
|
10919
10943
|
class COptionPublicKeyLayout extends Layout_2$1 {
|
|
10920
10944
|
constructor(property) {
|
|
10921
10945
|
super(-1, property);
|
|
10922
|
-
this.publicKeyLayout = publicKey$
|
|
10946
|
+
this.publicKeyLayout = publicKey$5();
|
|
10923
10947
|
}
|
|
10924
10948
|
decode(buffer, offset = 0) {
|
|
10925
10949
|
const option = buffer[offset];
|
|
@@ -10947,6 +10971,37 @@ class COptionPublicKeyLayout extends Layout_2$1 {
|
|
|
10947
10971
|
throw new RangeError('Buffer must be provided');
|
|
10948
10972
|
}
|
|
10949
10973
|
}
|
|
10974
|
+
class COptionU64Layout extends Layout_2$1 {
|
|
10975
|
+
constructor(property) {
|
|
10976
|
+
super(-1, property);
|
|
10977
|
+
this.u64Layout = u64$2();
|
|
10978
|
+
}
|
|
10979
|
+
decode(buffer, offset = 0) {
|
|
10980
|
+
const option = buffer[offset];
|
|
10981
|
+
if (option === 0) {
|
|
10982
|
+
return null;
|
|
10983
|
+
}
|
|
10984
|
+
return this.u64Layout.decode(buffer, offset + 1);
|
|
10985
|
+
}
|
|
10986
|
+
encode(src, buffer, offset = 0) {
|
|
10987
|
+
if (src === null) {
|
|
10988
|
+
buffer[offset] = 0;
|
|
10989
|
+
return 1;
|
|
10990
|
+
}
|
|
10991
|
+
else {
|
|
10992
|
+
buffer[offset] = 1;
|
|
10993
|
+
this.u64Layout.encode(src, buffer, offset + 1);
|
|
10994
|
+
return 9;
|
|
10995
|
+
}
|
|
10996
|
+
}
|
|
10997
|
+
getSpan(buffer, offset = 0) {
|
|
10998
|
+
if (buffer) {
|
|
10999
|
+
const option = buffer[offset];
|
|
11000
|
+
return option === 0 ? 1 : 1 + this.u64Layout.span;
|
|
11001
|
+
}
|
|
11002
|
+
throw new RangeError('Buffer must be provided');
|
|
11003
|
+
}
|
|
11004
|
+
}
|
|
10950
11005
|
|
|
10951
11006
|
var TransferFeeInstruction;
|
|
10952
11007
|
(function (TransferFeeInstruction) {
|
|
@@ -10964,14 +11019,14 @@ struct$1([
|
|
|
10964
11019
|
new COptionPublicKeyLayout('transferFeeConfigAuthority'),
|
|
10965
11020
|
new COptionPublicKeyLayout('withdrawWithheldAuthority'),
|
|
10966
11021
|
u16('transferFeeBasisPoints'),
|
|
10967
|
-
u64$
|
|
11022
|
+
u64$2('maximumFee'),
|
|
10968
11023
|
]);
|
|
10969
11024
|
struct$1([
|
|
10970
11025
|
u8$1('instruction'),
|
|
10971
11026
|
u8$1('transferFeeInstruction'),
|
|
10972
|
-
u64$
|
|
11027
|
+
u64$2('amount'),
|
|
10973
11028
|
u8$1('decimals'),
|
|
10974
|
-
u64$
|
|
11029
|
+
u64$2('fee'),
|
|
10975
11030
|
]);
|
|
10976
11031
|
struct$1([
|
|
10977
11032
|
u8$1('instruction'),
|
|
@@ -10990,37 +11045,37 @@ struct$1([
|
|
|
10990
11045
|
u8$1('instruction'),
|
|
10991
11046
|
u8$1('transferFeeInstruction'),
|
|
10992
11047
|
u16('transferFeeBasisPoints'),
|
|
10993
|
-
u64$
|
|
11048
|
+
u64$2('maximumFee'),
|
|
10994
11049
|
]);
|
|
10995
11050
|
|
|
10996
11051
|
const MAX_FEE_BASIS_POINTS = 10000;
|
|
10997
11052
|
BigInt(MAX_FEE_BASIS_POINTS);
|
|
10998
11053
|
/** Buffer layout for de/serializing a transfer fee */
|
|
10999
11054
|
function transferFeeLayout(property) {
|
|
11000
|
-
return struct$1([u64$
|
|
11055
|
+
return struct$1([u64$2('epoch'), u64$2('maximumFee'), u16('transferFeeBasisPoints')], property);
|
|
11001
11056
|
}
|
|
11002
11057
|
/** Buffer layout for de/serializing a transfer fee config extension */
|
|
11003
11058
|
const TransferFeeConfigLayout = struct$1([
|
|
11004
|
-
publicKey$
|
|
11005
|
-
publicKey$
|
|
11006
|
-
u64$
|
|
11059
|
+
publicKey$5('transferFeeConfigAuthority'),
|
|
11060
|
+
publicKey$5('withdrawWithheldAuthority'),
|
|
11061
|
+
u64$2('withheldAmount'),
|
|
11007
11062
|
transferFeeLayout('olderTransferFee'),
|
|
11008
11063
|
transferFeeLayout('newerTransferFee'),
|
|
11009
11064
|
]);
|
|
11010
11065
|
TransferFeeConfigLayout.span;
|
|
11011
11066
|
/** Buffer layout for de/serializing */
|
|
11012
|
-
const TransferFeeAmountLayout = struct$1([u64$
|
|
11067
|
+
const TransferFeeAmountLayout = struct$1([u64$2('withheldAmount')]);
|
|
11013
11068
|
TransferFeeAmountLayout.span;
|
|
11014
11069
|
|
|
11015
11070
|
/** TODO: docs */
|
|
11016
11071
|
struct$1([
|
|
11017
11072
|
u8$1('instruction'),
|
|
11018
|
-
u64$
|
|
11073
|
+
u64$2('amount'),
|
|
11019
11074
|
u8$1('decimals'),
|
|
11020
11075
|
]);
|
|
11021
11076
|
|
|
11022
11077
|
/** Buffer layout for de/serializing a transfer hook extension */
|
|
11023
|
-
const TransferHookLayout = struct$1([publicKey$
|
|
11078
|
+
const TransferHookLayout = struct$1([publicKey$5('authority'), publicKey$5('programId')]);
|
|
11024
11079
|
TransferHookLayout.span;
|
|
11025
11080
|
/** Buffer layout for de/serializing a transfer hook account extension */
|
|
11026
11081
|
const TransferHookAccountLayout = struct$1([bool$1('transferring')]);
|
|
@@ -11039,7 +11094,7 @@ const ExtraAccountMetaListLayout = struct$1([
|
|
|
11039
11094
|
]);
|
|
11040
11095
|
/** Buffer layout for de/serializing an ExtraAccountMetaAccountData */
|
|
11041
11096
|
struct$1([
|
|
11042
|
-
u64$
|
|
11097
|
+
u64$2('instructionDiscriminator'),
|
|
11043
11098
|
u32$1('length'),
|
|
11044
11099
|
ExtraAccountMetaListLayout.replicate('extraAccountsList'),
|
|
11045
11100
|
]);
|
|
@@ -11053,14 +11108,14 @@ var TransferHookInstruction;
|
|
|
11053
11108
|
struct$1([
|
|
11054
11109
|
u8$1('instruction'),
|
|
11055
11110
|
u8$1('transferHookInstruction'),
|
|
11056
|
-
publicKey$
|
|
11057
|
-
publicKey$
|
|
11111
|
+
publicKey$5('authority'),
|
|
11112
|
+
publicKey$5('transferHookProgramId'),
|
|
11058
11113
|
]);
|
|
11059
11114
|
/** The struct that represents the instruction data as it is read by the program */
|
|
11060
11115
|
struct$1([
|
|
11061
11116
|
u8$1('instruction'),
|
|
11062
11117
|
u8$1('transferHookInstruction'),
|
|
11063
|
-
publicKey$
|
|
11118
|
+
publicKey$5('transferHookProgramId'),
|
|
11064
11119
|
]);
|
|
11065
11120
|
|
|
11066
11121
|
// Sequence from https://github.com/solana-labs/solana-program-library/blob/master/token/program-2022/src/extension/mod.rs#L903
|
|
@@ -11094,6 +11149,7 @@ var ExtensionType;
|
|
|
11094
11149
|
ExtensionType[ExtensionType["ScaledUiAmountConfig"] = 25] = "ScaledUiAmountConfig";
|
|
11095
11150
|
ExtensionType[ExtensionType["PausableConfig"] = 26] = "PausableConfig";
|
|
11096
11151
|
ExtensionType[ExtensionType["PausableAccount"] = 27] = "PausableAccount";
|
|
11152
|
+
ExtensionType[ExtensionType["PermissionedBurn"] = 28] = "PermissionedBurn";
|
|
11097
11153
|
})(ExtensionType || (ExtensionType = {}));
|
|
11098
11154
|
const TYPE_SIZE = 2;
|
|
11099
11155
|
const LENGTH_SIZE = 2;
|
|
@@ -11128,12 +11184,12 @@ function getExtensionTypes(tlvData) {
|
|
|
11128
11184
|
/** Buffer layout for de/serializing a mint */
|
|
11129
11185
|
const MintLayout = struct$1([
|
|
11130
11186
|
u32$1('mintAuthorityOption'),
|
|
11131
|
-
publicKey$
|
|
11132
|
-
u64$
|
|
11187
|
+
publicKey$5('mintAuthority'),
|
|
11188
|
+
u64$2('supply'),
|
|
11133
11189
|
u8$1('decimals'),
|
|
11134
11190
|
bool$1('isInitialized'),
|
|
11135
11191
|
u32$1('freezeAuthorityOption'),
|
|
11136
|
-
publicKey$
|
|
11192
|
+
publicKey$5('freezeAuthority'),
|
|
11137
11193
|
]);
|
|
11138
11194
|
/** Byte length of a mint */
|
|
11139
11195
|
const MINT_SIZE = MintLayout.span;
|
|
@@ -11178,22 +11234,22 @@ function unpackMint(address, info, programId = TOKEN_PROGRAM_ID) {
|
|
|
11178
11234
|
new PublicKey('SysvarC1ock11111111111111111111111111111111');
|
|
11179
11235
|
|
|
11180
11236
|
/** TODO: docs */
|
|
11181
|
-
struct$1([u8$1('instruction'), u64$
|
|
11237
|
+
struct$1([u8$1('instruction'), u64$2('amount')]);
|
|
11182
11238
|
|
|
11183
11239
|
/** TODO: docs */
|
|
11184
11240
|
struct$1([
|
|
11185
11241
|
u8$1('instruction'),
|
|
11186
|
-
u64$
|
|
11242
|
+
u64$2('amount'),
|
|
11187
11243
|
u8$1('decimals'),
|
|
11188
11244
|
]);
|
|
11189
11245
|
|
|
11190
11246
|
/** TODO: docs */
|
|
11191
|
-
struct$1([u8$1('instruction'), u64$
|
|
11247
|
+
struct$1([u8$1('instruction'), u64$2('amount')]);
|
|
11192
11248
|
|
|
11193
11249
|
/** TODO: docs */
|
|
11194
11250
|
struct$1([
|
|
11195
11251
|
u8$1('instruction'),
|
|
11196
|
-
u64$
|
|
11252
|
+
u64$2('amount'),
|
|
11197
11253
|
u8$1('decimals'),
|
|
11198
11254
|
]);
|
|
11199
11255
|
|
|
@@ -11207,7 +11263,7 @@ struct$1([u8$1('instruction')]);
|
|
|
11207
11263
|
struct$1([
|
|
11208
11264
|
u8$1('instruction'),
|
|
11209
11265
|
u8$1('decimals'),
|
|
11210
|
-
publicKey$
|
|
11266
|
+
publicKey$5('mintAuthority'),
|
|
11211
11267
|
new COptionPublicKeyLayout('freezeAuthority'),
|
|
11212
11268
|
]);
|
|
11213
11269
|
|
|
@@ -11227,12 +11283,12 @@ struct$1([u8$1('instruction')]);
|
|
|
11227
11283
|
struct$1([u8$1('instruction')]);
|
|
11228
11284
|
|
|
11229
11285
|
/** TODO: docs */
|
|
11230
|
-
struct$1([u8$1('instruction'), u64$
|
|
11286
|
+
struct$1([u8$1('instruction'), u64$2('amount')]);
|
|
11231
11287
|
|
|
11232
11288
|
/** TODO: docs */
|
|
11233
11289
|
struct$1([
|
|
11234
11290
|
u8$1('instruction'),
|
|
11235
|
-
u64$
|
|
11291
|
+
u64$2('amount'),
|
|
11236
11292
|
u8$1('decimals'),
|
|
11237
11293
|
]);
|
|
11238
11294
|
|
|
@@ -11259,6 +11315,7 @@ var AuthorityType;
|
|
|
11259
11315
|
AuthorityType[AuthorityType["GroupMemberPointer"] = 14] = "GroupMemberPointer";
|
|
11260
11316
|
AuthorityType[AuthorityType["ScaledUiAmountConfig"] = 15] = "ScaledUiAmountConfig";
|
|
11261
11317
|
AuthorityType[AuthorityType["PausableConfig"] = 16] = "PausableConfig";
|
|
11318
|
+
AuthorityType[AuthorityType["PermissionedBurn"] = 17] = "PermissionedBurn";
|
|
11262
11319
|
})(AuthorityType || (AuthorityType = {}));
|
|
11263
11320
|
/** TODO: docs */
|
|
11264
11321
|
struct$1([
|
|
@@ -11271,7 +11328,13 @@ struct$1([
|
|
|
11271
11328
|
struct$1([u8$1('instruction')]);
|
|
11272
11329
|
|
|
11273
11330
|
/** TODO: docs */
|
|
11274
|
-
struct$1([u8$1('instruction'), u64$
|
|
11331
|
+
struct$1([u8$1('instruction'), u64$2('amount')]);
|
|
11332
|
+
|
|
11333
|
+
/** TODO: docs */
|
|
11334
|
+
struct$1([
|
|
11335
|
+
u8$1('instruction'),
|
|
11336
|
+
new COptionU64Layout('amount'),
|
|
11337
|
+
]);
|
|
11275
11338
|
|
|
11276
11339
|
var GroupMemberPointerInstruction;
|
|
11277
11340
|
(function (GroupMemberPointerInstruction) {
|
|
@@ -11282,14 +11345,14 @@ struct$1([
|
|
|
11282
11345
|
// prettier-ignore
|
|
11283
11346
|
u8$1('instruction'),
|
|
11284
11347
|
u8$1('groupMemberPointerInstruction'),
|
|
11285
|
-
publicKey$
|
|
11286
|
-
publicKey$
|
|
11348
|
+
publicKey$5('authority'),
|
|
11349
|
+
publicKey$5('memberAddress'),
|
|
11287
11350
|
]);
|
|
11288
11351
|
struct$1([
|
|
11289
11352
|
// prettier-ignore
|
|
11290
11353
|
u8$1('instruction'),
|
|
11291
11354
|
u8$1('groupMemberPointerInstruction'),
|
|
11292
|
-
publicKey$
|
|
11355
|
+
publicKey$5('memberAddress'),
|
|
11293
11356
|
]);
|
|
11294
11357
|
|
|
11295
11358
|
var GroupPointerInstruction;
|
|
@@ -11301,21 +11364,21 @@ struct$1([
|
|
|
11301
11364
|
// prettier-ignore
|
|
11302
11365
|
u8$1('instruction'),
|
|
11303
11366
|
u8$1('groupPointerInstruction'),
|
|
11304
|
-
publicKey$
|
|
11305
|
-
publicKey$
|
|
11367
|
+
publicKey$5('authority'),
|
|
11368
|
+
publicKey$5('groupAddress'),
|
|
11306
11369
|
]);
|
|
11307
11370
|
struct$1([
|
|
11308
11371
|
// prettier-ignore
|
|
11309
11372
|
u8$1('instruction'),
|
|
11310
11373
|
u8$1('groupPointerInstruction'),
|
|
11311
|
-
publicKey$
|
|
11374
|
+
publicKey$5('groupAddress'),
|
|
11312
11375
|
]);
|
|
11313
11376
|
|
|
11314
11377
|
/** TODO: docs */
|
|
11315
11378
|
struct$1([
|
|
11316
11379
|
u8$1('instruction'),
|
|
11317
11380
|
u8$1('decimals'),
|
|
11318
|
-
publicKey$
|
|
11381
|
+
publicKey$5('mintAuthority'),
|
|
11319
11382
|
new COptionPublicKeyLayout('freezeAuthority'),
|
|
11320
11383
|
]);
|
|
11321
11384
|
|
|
@@ -11328,7 +11391,7 @@ struct$1([
|
|
|
11328
11391
|
u8$1('instruction'),
|
|
11329
11392
|
u8$1('interestBearingMintInstruction'),
|
|
11330
11393
|
// TODO: Make this an optional public key
|
|
11331
|
-
publicKey$
|
|
11394
|
+
publicKey$5('rateAuthority'),
|
|
11332
11395
|
s16('rate'),
|
|
11333
11396
|
]);
|
|
11334
11397
|
struct$1([
|
|
@@ -11346,14 +11409,14 @@ struct$1([
|
|
|
11346
11409
|
// prettier-ignore
|
|
11347
11410
|
u8$1('instruction'),
|
|
11348
11411
|
u8$1('metadataPointerInstruction'),
|
|
11349
|
-
publicKey$
|
|
11350
|
-
publicKey$
|
|
11412
|
+
publicKey$5('authority'),
|
|
11413
|
+
publicKey$5('metadataAddress'),
|
|
11351
11414
|
]);
|
|
11352
11415
|
struct$1([
|
|
11353
11416
|
// prettier-ignore
|
|
11354
11417
|
u8$1('instruction'),
|
|
11355
11418
|
u8$1('metadataPointerInstruction'),
|
|
11356
|
-
publicKey$
|
|
11419
|
+
publicKey$5('metadataAddress'),
|
|
11357
11420
|
]);
|
|
11358
11421
|
|
|
11359
11422
|
var Field;
|
|
@@ -11405,14 +11468,37 @@ function unpack(buffer) {
|
|
|
11405
11468
|
};
|
|
11406
11469
|
}
|
|
11407
11470
|
|
|
11471
|
+
var PermissionedBurnInstruction;
|
|
11472
|
+
(function (PermissionedBurnInstruction) {
|
|
11473
|
+
PermissionedBurnInstruction[PermissionedBurnInstruction["Initialize"] = 0] = "Initialize";
|
|
11474
|
+
PermissionedBurnInstruction[PermissionedBurnInstruction["Burn"] = 1] = "Burn";
|
|
11475
|
+
PermissionedBurnInstruction[PermissionedBurnInstruction["BurnChecked"] = 2] = "BurnChecked";
|
|
11476
|
+
})(PermissionedBurnInstruction || (PermissionedBurnInstruction = {}));
|
|
11477
|
+
struct$1([
|
|
11478
|
+
u8$1('instruction'),
|
|
11479
|
+
u8$1('permissionedBurnInstruction'),
|
|
11480
|
+
publicKey$5('authority'),
|
|
11481
|
+
]);
|
|
11482
|
+
struct$1([
|
|
11483
|
+
u8$1('instruction'),
|
|
11484
|
+
u8$1('permissionedBurnInstruction'),
|
|
11485
|
+
u64$2('amount'),
|
|
11486
|
+
]);
|
|
11487
|
+
struct$1([
|
|
11488
|
+
u8$1('instruction'),
|
|
11489
|
+
u8$1('permissionedBurnInstruction'),
|
|
11490
|
+
u64$2('amount'),
|
|
11491
|
+
u8$1('decimals'),
|
|
11492
|
+
]);
|
|
11493
|
+
|
|
11408
11494
|
struct$1([
|
|
11409
11495
|
u8$1('instruction'),
|
|
11410
|
-
publicKey$
|
|
11496
|
+
publicKey$5('owner'),
|
|
11411
11497
|
]);
|
|
11412
11498
|
|
|
11413
11499
|
struct$1([
|
|
11414
11500
|
u8$1('instruction'),
|
|
11415
|
-
publicKey$
|
|
11501
|
+
publicKey$5('owner'),
|
|
11416
11502
|
]);
|
|
11417
11503
|
|
|
11418
11504
|
/** The struct that represents the instruction data as it is read by the program */
|
|
@@ -11434,9 +11520,46 @@ struct$1([
|
|
|
11434
11520
|
/** TODO: docs */
|
|
11435
11521
|
struct$1([
|
|
11436
11522
|
u8$1('instruction'),
|
|
11437
|
-
publicKey$
|
|
11523
|
+
publicKey$5('delegate'),
|
|
11438
11524
|
]);
|
|
11439
11525
|
|
|
11526
|
+
const encodeDecode$1 = (layout) => {
|
|
11527
|
+
const decode = layout.decode.bind(layout);
|
|
11528
|
+
const encode = layout.encode.bind(layout);
|
|
11529
|
+
return { decode, encode };
|
|
11530
|
+
};
|
|
11531
|
+
|
|
11532
|
+
const bigInt = (length) => (property) => {
|
|
11533
|
+
const layout = blob$1(length, property);
|
|
11534
|
+
const { encode, decode } = encodeDecode$1(layout);
|
|
11535
|
+
const bigIntLayout = layout;
|
|
11536
|
+
bigIntLayout.decode = (buffer, offset) => {
|
|
11537
|
+
const src = decode(buffer, offset);
|
|
11538
|
+
return toBigIntLE_1(Buffer.from(src));
|
|
11539
|
+
};
|
|
11540
|
+
bigIntLayout.encode = (bigInt, buffer, offset) => {
|
|
11541
|
+
const src = toBufferLE_1(bigInt, length);
|
|
11542
|
+
return encode(src, buffer, offset);
|
|
11543
|
+
};
|
|
11544
|
+
return bigIntLayout;
|
|
11545
|
+
};
|
|
11546
|
+
const u64$1 = bigInt(8);
|
|
11547
|
+
|
|
11548
|
+
const publicKey$4 = (property) => {
|
|
11549
|
+
const layout = blob$1(32, property);
|
|
11550
|
+
const { encode, decode } = encodeDecode$1(layout);
|
|
11551
|
+
const publicKeyLayout = layout;
|
|
11552
|
+
publicKeyLayout.decode = (buffer, offset) => {
|
|
11553
|
+
const src = decode(buffer, offset);
|
|
11554
|
+
return new PublicKey(src);
|
|
11555
|
+
};
|
|
11556
|
+
publicKeyLayout.encode = (publicKey, buffer, offset) => {
|
|
11557
|
+
const src = publicKey.toBuffer();
|
|
11558
|
+
return encode(src, buffer, offset);
|
|
11559
|
+
};
|
|
11560
|
+
return publicKeyLayout;
|
|
11561
|
+
};
|
|
11562
|
+
|
|
11440
11563
|
var nodeCache = {exports: {}};
|
|
11441
11564
|
|
|
11442
11565
|
var node_cache = {exports: {}};
|
|
@@ -13333,9 +13456,9 @@ function getAssocSPLWalletBalance(connection, originalWallet, tokenMint) {
|
|
|
13333
13456
|
* Returns balance of specified wallets. null if account doesn't exist
|
|
13334
13457
|
* @param wallet spl-tokens wallet address
|
|
13335
13458
|
*/
|
|
13336
|
-
function getWalletsBalances(connection, wallets) {
|
|
13459
|
+
function getWalletsBalances(connection, wallets, commitment) {
|
|
13337
13460
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13338
|
-
const infos = yield connection.getMultipleAccountsInfo(wallets.map((w) => new PublicKey(w)),
|
|
13461
|
+
const infos = yield connection.getMultipleAccountsInfo(wallets.map((w) => new PublicKey(w)), commitment);
|
|
13339
13462
|
const results = [];
|
|
13340
13463
|
for (const info of infos) {
|
|
13341
13464
|
if (!info || info.lamports === 0) {
|
|
@@ -30750,16 +30873,16 @@ function generateLogsParsingRegex() {
|
|
|
30750
30873
|
"Program consumption: {} units remaining"
|
|
30751
30874
|
];
|
|
30752
30875
|
const prepareLineForRegex = (l) => l.replaceAll("{}", ".*").replaceAll("(", "\\(").replaceAll(")", "\\)").replaceAll("]", "\\]").replaceAll("[", "\\[");
|
|
30753
|
-
const regexTemplate = `\
|
|
30754
|
-
(?<logTruncated>^Log truncated$)|\
|
|
30755
|
-
(?<programInvoke>^Program (?<invokeProgramId>[1-9A-HJ-NP-Za-km-z]{32,}) invoke \\[(?<level>\\d+)\\]$)|\
|
|
30756
|
-
(?<programSuccessResult>^Program (?<successResultProgramId>[1-9A-HJ-NP-Za-km-z]{32,}) success$)|\
|
|
30757
|
-
(?<programFailedResult>^Program (?<failedResultProgramId>[1-9A-HJ-NP-Za-km-z]{32,}) failed: (?<failedResultErr>.*)$)|\
|
|
30758
|
-
(?<programCompleteFailedResult>^Program failed to complete: (?<failedCompleteError>.*)$)|\
|
|
30759
|
-
(?<programLog>^Program log: (?<logMessage>.*)$)|\
|
|
30760
|
-
(?<programData>^Program data: (?<data>.*)$)|\
|
|
30761
|
-
(?<programConsumed>^Program (?<consumedProgramId>[1-9A-HJ-NP-Za-km-z]{32,}) consumed (?<consumedComputeUnits>\\d*) of (?<allComputedUnits>\\d*) compute units$)|\
|
|
30762
|
-
(?<programReturn>^Program return: (?<returnProgramId>[1-9A-HJ-NP-Za-km-z]{32,}) (?<returnMessage>.*)$)|\
|
|
30876
|
+
const regexTemplate = `\
|
|
30877
|
+
(?<logTruncated>^Log truncated$)|\
|
|
30878
|
+
(?<programInvoke>^Program (?<invokeProgramId>[1-9A-HJ-NP-Za-km-z]{32,}) invoke \\[(?<level>\\d+)\\]$)|\
|
|
30879
|
+
(?<programSuccessResult>^Program (?<successResultProgramId>[1-9A-HJ-NP-Za-km-z]{32,}) success$)|\
|
|
30880
|
+
(?<programFailedResult>^Program (?<failedResultProgramId>[1-9A-HJ-NP-Za-km-z]{32,}) failed: (?<failedResultErr>.*)$)|\
|
|
30881
|
+
(?<programCompleteFailedResult>^Program failed to complete: (?<failedCompleteError>.*)$)|\
|
|
30882
|
+
(?<programLog>^Program log: (?<logMessage>.*)$)|\
|
|
30883
|
+
(?<programData>^Program data: (?<data>.*)$)|\
|
|
30884
|
+
(?<programConsumed>^Program (?<consumedProgramId>[1-9A-HJ-NP-Za-km-z]{32,}) consumed (?<consumedComputeUnits>\\d*) of (?<allComputedUnits>\\d*) compute units$)|\
|
|
30885
|
+
(?<programReturn>^Program return: (?<returnProgramId>[1-9A-HJ-NP-Za-km-z]{32,}) (?<returnMessage>.*)$)|\
|
|
30763
30886
|
(?<errorMessage>^(${knownMsgs.map(prepareLineForRegex).join("|")})$)`;
|
|
30764
30887
|
return new RegExp(regexTemplate, "s");
|
|
30765
30888
|
}
|