@orca-so/common-sdk
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -13,5 +13,6 @@ import { u64 } from "@solana/spl-token"; | ||
* @param wrappedSolAmountIn Optional. Only use for input/source token that could be SOL | ||
* @param payer Payer that would pay the rent for the creation of the ATAs | ||
* @returns | ||
*/ | ||
export declare function resolveOrCreateATA(connection: Connection, ownerAddress: PublicKey, tokenMint: PublicKey, getAccountRentExempt: () => Promise<number>, wrappedSolAmountIn?: u64): Promise<ResolvedTokenAddressInstruction>; | ||
export declare function resolveOrCreateATA(connection: Connection, ownerAddress: PublicKey, tokenMint: PublicKey, getAccountRentExempt: () => Promise<number>, wrappedSolAmountIn?: u64, payer?: PublicKey): Promise<ResolvedTokenAddressInstruction>; | ||
declare type ResolvedTokenAddressRequest = { | ||
@@ -30,6 +31,7 @@ tokenMint: PublicKey; | ||
* @param wrappedSolAmountIn Optional. Only use for input/source token that could be SOL | ||
* @param payer Payer that would pay the rent for the creation of the ATAs | ||
* @returns | ||
*/ | ||
export declare function resolveOrCreateATAs(connection: Connection, ownerAddress: PublicKey, requests: ResolvedTokenAddressRequest[], getAccountRentExempt: () => Promise<number>): Promise<ResolvedTokenAddressInstruction[]>; | ||
export declare function resolveOrCreateATAs(connection: Connection, ownerAddress: PublicKey, requests: ResolvedTokenAddressRequest[], getAccountRentExempt: () => Promise<number>, payer?: PublicKey): Promise<ResolvedTokenAddressInstruction[]>; | ||
export declare function deriveATA(ownerAddress: PublicKey, tokenMint: PublicKey): Promise<PublicKey>; | ||
export {}; |
@@ -26,7 +26,8 @@ "use strict"; | ||
* @param wrappedSolAmountIn Optional. Only use for input/source token that could be SOL | ||
* @param payer Payer that would pay the rent for the creation of the ATAs | ||
* @returns | ||
*/ | ||
function resolveOrCreateATA(connection, ownerAddress, tokenMint, getAccountRentExempt, wrappedSolAmountIn = new spl_token_1.u64(0)) { | ||
function resolveOrCreateATA(connection, ownerAddress, tokenMint, getAccountRentExempt, wrappedSolAmountIn = new spl_token_1.u64(0), payer = ownerAddress) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const instructions = yield resolveOrCreateATAs(connection, ownerAddress, [{ tokenMint, wrappedSolAmountIn }], getAccountRentExempt); | ||
const instructions = yield resolveOrCreateATAs(connection, ownerAddress, [{ tokenMint, wrappedSolAmountIn }], getAccountRentExempt, payer); | ||
return instructions[0]; | ||
@@ -45,5 +46,6 @@ }); | ||
* @param wrappedSolAmountIn Optional. Only use for input/source token that could be SOL | ||
* @param payer Payer that would pay the rent for the creation of the ATAs | ||
* @returns | ||
*/ | ||
function resolveOrCreateATAs(connection, ownerAddress, requests, getAccountRentExempt) { | ||
function resolveOrCreateATAs(connection, ownerAddress, requests, getAccountRentExempt, payer = ownerAddress) { | ||
var _a; | ||
@@ -68,3 +70,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
else { | ||
const createAtaInstruction = spl_token_1.Token.createAssociatedTokenAccountInstruction(spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, spl_token_1.TOKEN_PROGRAM_ID, nonNativeMints[index].tokenMint, ataAddress, ownerAddress, ownerAddress); | ||
const createAtaInstruction = spl_token_1.Token.createAssociatedTokenAccountInstruction(spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, spl_token_1.TOKEN_PROGRAM_ID, nonNativeMints[index].tokenMint, ataAddress, ownerAddress, payer); | ||
resolvedInstruction = { | ||
@@ -71,0 +73,0 @@ address: ataAddress, |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import { AccountInfo } from "@solana/spl-token"; | ||
@@ -2,0 +3,0 @@ /** |
{ | ||
"name": "@orca-so/common-sdk", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Common Typescript components across Orca", | ||
@@ -12,5 +12,8 @@ "repository": "https://github.com/orca-so/common-sdk", | ||
"@project-serum/anchor": "0.20.1", | ||
"@solana/spl-token": "^0.1.8", | ||
"@solana/spl-token": "0.1.8", | ||
"decimal.js": "^10.3.1" | ||
}, | ||
"resolutions": { | ||
"@solana/web3.js": "1.43.1" | ||
}, | ||
"devDependencies": { | ||
@@ -17,0 +20,0 @@ "@types/bn.js": "^4.11.6", |
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
Mixed license
License(Experimental) Package contains multiple licenses.
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
74582
32
1
939
Updated@solana/spl-token@0.1.8