@project-serum/serum
Advanced tools
Comparing version 0.6.10 to 0.6.11
@@ -1,7 +0,6 @@ | ||
export function initializeMint({ mint, amount, decimals, initialAccount, mintOwner, }: { | ||
export function initializeMint({ mint, decimals, mintAuthority, freezeAuthority, }: { | ||
mint: any; | ||
amount?: number | undefined; | ||
decimals: any; | ||
initialAccount?: any; | ||
mintOwner?: any; | ||
mintAuthority: any; | ||
freezeAuthority?: any; | ||
}): TransactionInstruction; | ||
@@ -25,7 +24,7 @@ export function initializeAccount({ account, mint, owner }: { | ||
}): TransactionInstruction; | ||
export function mintTo({ mint, account, amount, owner }: { | ||
export function mintTo({ mint, destination, amount, mintAuthority }: { | ||
mint: any; | ||
account: any; | ||
destination: any; | ||
amount: any; | ||
owner: any; | ||
mintAuthority: any; | ||
}): TransactionInstruction; | ||
@@ -32,0 +31,0 @@ export const TOKEN_PROGRAM_ID: PublicKey; |
@@ -25,2 +25,3 @@ "use strict"; | ||
const web3_js_1 = require("@solana/web3.js"); | ||
const layout_1 = require("./layout"); | ||
exports.TOKEN_PROGRAM_ID = new web3_js_1.PublicKey('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'); | ||
@@ -30,9 +31,9 @@ exports.WRAPPED_SOL_MINT = new web3_js_1.PublicKey('So11111111111111111111111111111111111111111'); | ||
LAYOUT.addVariant(0, BufferLayout.struct([ | ||
// TODO: does this need to be aligned? | ||
BufferLayout.nu64('amount'), | ||
BufferLayout.u8('decimals'), | ||
layout_1.publicKeyLayout('mintAuthority'), | ||
BufferLayout.u8('freezeAuthorityOption'), | ||
layout_1.publicKeyLayout('freezeAuthority'), | ||
]), 'initializeMint'); | ||
LAYOUT.addVariant(1, BufferLayout.struct([]), 'initializeAccount'); | ||
LAYOUT.addVariant(3, BufferLayout.struct([BufferLayout.nu64('amount')]), 'transfer'); | ||
LAYOUT.addVariant(4, BufferLayout.struct([BufferLayout.nu64('amount')]), 'approve'); | ||
LAYOUT.addVariant(7, BufferLayout.struct([BufferLayout.nu64('amount')]), 'mintTo'); | ||
@@ -46,10 +47,7 @@ LAYOUT.addVariant(8, BufferLayout.struct([BufferLayout.nu64('amount')]), 'burn'); | ||
} | ||
function initializeMint({ mint, amount = 0, decimals, initialAccount = null, mintOwner = null, }) { | ||
const keys = [{ pubkey: mint, isSigner: false, isWritable: true }]; | ||
if (amount) { | ||
keys.push({ pubkey: initialAccount, isSigner: false, isWritable: true }); | ||
} | ||
if (mintOwner) { | ||
keys.push({ pubkey: mintOwner, isSigner: false, isWritable: false }); | ||
} | ||
function initializeMint({ mint, decimals, mintAuthority, freezeAuthority = null, }) { | ||
const keys = [ | ||
{ pubkey: mint, isSigner: false, isWritable: true }, | ||
{ pubkey: web3_js_1.SYSVAR_RENT_PUBKEY, isSigner: false, isWritable: false }, | ||
]; | ||
return new web3_js_1.TransactionInstruction({ | ||
@@ -59,4 +57,6 @@ keys, | ||
initializeMint: { | ||
amount, | ||
decimals, | ||
mintAuthority, | ||
freezeAuthorityOption: !!freezeAuthority, | ||
freezeAuthority: freezeAuthority || new web3_js_1.PublicKey(0), | ||
}, | ||
@@ -73,2 +73,3 @@ }), | ||
{ pubkey: owner, isSigner: false, isWritable: false }, | ||
{ pubkey: web3_js_1.SYSVAR_RENT_PUBKEY, isSigner: false, isWritable: false }, | ||
]; | ||
@@ -114,7 +115,7 @@ return new web3_js_1.TransactionInstruction({ | ||
exports.approve = approve; | ||
function mintTo({ mint, account, amount, owner }) { | ||
function mintTo({ mint, destination, amount, mintAuthority }) { | ||
const keys = [ | ||
{ pubkey: mint, isSigner: false, isWritable: true }, | ||
{ pubkey: account, isSigner: false, isWritable: true }, | ||
{ pubkey: owner, isSigner: true, isWritable: false }, | ||
{ pubkey: destination, isSigner: false, isWritable: true }, | ||
{ pubkey: mintAuthority, isSigner: true, isWritable: false }, | ||
]; | ||
@@ -121,0 +122,0 @@ return new web3_js_1.TransactionInstruction({ |
{ | ||
"name": "@project-serum/serum", | ||
"version": "0.6.10", | ||
"version": "0.6.11", | ||
"description": "Library for interacting with the serum dex", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
122404
0