@lightprotocol/compressed-token 0.15.2 → 0.15.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/cjs/browser/index.cjs +14 -18
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/node/index.cjs +14 -18
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/es/browser/index.js +14 -18
- package/dist/es/browser/index.js.map +1 -1
- package/dist/types/index.d.ts +34 -27
- package/package.json +4 -3
package/dist/cjs/node/index.cjs
CHANGED
|
@@ -4686,6 +4686,20 @@ class CompressedTokenProgram {
|
|
|
4686
4686
|
* @internal
|
|
4687
4687
|
*/
|
|
4688
4688
|
constructor() { }
|
|
4689
|
+
/**
|
|
4690
|
+
* Set a custom programId via PublicKey or base58 encoded string.
|
|
4691
|
+
* This method is not required for regular usage.
|
|
4692
|
+
*
|
|
4693
|
+
* Use this only if you know what you are doing.
|
|
4694
|
+
*/
|
|
4695
|
+
static setProgramId(programId) {
|
|
4696
|
+
this.programId =
|
|
4697
|
+
typeof programId === 'string'
|
|
4698
|
+
? new web3_js.PublicKey(programId)
|
|
4699
|
+
: programId;
|
|
4700
|
+
// Reset program when programId changes
|
|
4701
|
+
this._program = null;
|
|
4702
|
+
}
|
|
4689
4703
|
/** @internal */
|
|
4690
4704
|
static get program() {
|
|
4691
4705
|
if (!this._program) {
|
|
@@ -5046,24 +5060,6 @@ class CompressedTokenProgram {
|
|
|
5046
5060
|
}
|
|
5047
5061
|
static async compressSplTokenAccount(params) {
|
|
5048
5062
|
const { feePayer, authority, tokenAccount, mint, remainingAmount, outputStateTree, } = params;
|
|
5049
|
-
// const outputData: TokenTransferOutputData[] = [
|
|
5050
|
-
// {
|
|
5051
|
-
// owner: authority,
|
|
5052
|
-
// amount: remainingAmount ?? new BN(0),
|
|
5053
|
-
// lamports: bn(subremainingAmount),
|
|
5054
|
-
// tlv: null,
|
|
5055
|
-
// },
|
|
5056
|
-
// ];
|
|
5057
|
-
// const {
|
|
5058
|
-
// inputTokenDataWithContext,
|
|
5059
|
-
// packedOutputTokenData,
|
|
5060
|
-
// remainingAccountMetas,
|
|
5061
|
-
// } = packCompressedTokenAccounts({
|
|
5062
|
-
// inputCompressedTokenAccounts: [],
|
|
5063
|
-
// outputStateTrees: outputStateTree,
|
|
5064
|
-
// rootIndices: [],
|
|
5065
|
-
// tokenTransferOutputs,
|
|
5066
|
-
// });
|
|
5067
5063
|
const remainingAccountMetas = [
|
|
5068
5064
|
{
|
|
5069
5065
|
pubkey: outputStateTree,
|