Skip to content

Commit

Permalink
update: release v0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
POPPIN-FUMI committed Oct 16, 2023
1 parent 2228238 commit ab20fb3
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 42 deletions.
38 changes: 19 additions & 19 deletions dist/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/lib/solanaUtils/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export declare class SolanaUtils {
constructor(options: SolanaUtilsOptions);
getStakeAccountBalance(this: SolanaUtils, stakeAccountAddress: string): Promise<number>;
getLastStakingReward(this: SolanaUtils, stakeAccountAddress: string): Promise<import("./solanaUtilsTypes").StakeRewardParams | null>;
getOwnerNFTAddresses(this: SolanaUtils, userWalletAddress: string, collectionAddress: string): Promise<string[]>;
getOwnerNFTs(this: SolanaUtils, userWalletAddress: string): Promise<import("@metaplex-foundation/mpl-token-metadata").DigitalAsset[]>;
checkNFTsOwner(this: SolanaUtils, userWalletAddress: string, collectionAddress: string, nftAddresses: string[]): Promise<{
status: boolean;
Expand Down
2 changes: 1 addition & 1 deletion dist/lib/version.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const VERSION = "0.1.3";
export declare const VERSION = "0.1.4";
2 changes: 1 addition & 1 deletion docs/assets/search.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 29 additions & 10 deletions docs/classes/SolanaUtils.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/functions/checkOwnerNFTs.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h5><span class="tsd-kind-parameter">collectionAddress</span>: <span class="tsd-
<h5><span class="tsd-kind-parameter">nftAddresses</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-symbol">{ </span><br/><span>    </span><span class="tsd-kind-property">message</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><span class="tsd-kind-property">status</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/elsoul/skeet-solana-utils/blob/8e20754/src/lib/solanaUtils/nftOwnerAddress.ts#L48">lib/solanaUtils/nftOwnerAddress.ts:48</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/elsoul/skeet-solana-utils/blob/2228238/src/lib/solanaUtils/nftOwnerAddress.ts#L48">lib/solanaUtils/nftOwnerAddress.ts:48</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion docs/functions/lastStakingReward.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h5><span class="tsd-kind-parameter">solanaUtils</span>: <a href="../classes/Sol
<h5><span class="tsd-kind-parameter">stakeAccountAddress</span>: <span class="tsd-signature-type">string</span></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">StakeRewardParams</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/elsoul/skeet-solana-utils/blob/8e20754/src/lib/solanaUtils/lastStakingReward.ts#L5">lib/solanaUtils/lastStakingReward.ts:5</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/elsoul/skeet-solana-utils/blob/2228238/src/lib/solanaUtils/lastStakingReward.ts#L5">lib/solanaUtils/lastStakingReward.ts:5</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion docs/functions/nftOwnerAddress.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h5><span class="tsd-kind-parameter">solanaUtils</span>: <a href="../classes/Sol
<h5><span class="tsd-kind-parameter">userWalletAddress</span>: <span class="tsd-signature-type">string</span></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type ">DigitalAsset</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/elsoul/skeet-solana-utils/blob/8e20754/src/lib/solanaUtils/nftOwnerAddress.ts#L7">lib/solanaUtils/nftOwnerAddress.ts:7</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/elsoul/skeet-solana-utils/blob/2228238/src/lib/solanaUtils/nftOwnerAddress.ts#L7">lib/solanaUtils/nftOwnerAddress.ts:7</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion docs/functions/stakeAccountBalance.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h5><span class="tsd-kind-parameter">solanaUtils</span>: <a href="../classes/Sol
<h5><span class="tsd-kind-parameter">stakeAccountAddress</span>: <span class="tsd-signature-type">string</span></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/elsoul/skeet-solana-utils/blob/8e20754/src/lib/solanaUtils/stakeAccountBalance.ts#L4">lib/solanaUtils/stakeAccountBalance.ts:4</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/elsoul/skeet-solana-utils/blob/2228238/src/lib/solanaUtils/stakeAccountBalance.ts#L4">lib/solanaUtils/stakeAccountBalance.ts:4</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
8 changes: 4 additions & 4 deletions docs/interfaces/SolanaUtilsOptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h4>Hierarchy</h4>
<ul class="tsd-hierarchy">
<li><span class="target">SolanaUtilsOptions</span></li></ul></section><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/elsoul/skeet-solana-utils/blob/8e20754/src/lib/solanaUtils/solanaUtilsTypes.ts#L1">lib/solanaUtils/solanaUtilsTypes.ts:1</a></li></ul></aside>
<li>Defined in <a href="https://github.com/elsoul/skeet-solana-utils/blob/2228238/src/lib/solanaUtils/solanaUtilsTypes.ts#L1">lib/solanaUtils/solanaUtilsTypes.ts:1</a></li></ul></aside>
<section class="tsd-panel-group tsd-index-group">
<section class="tsd-panel tsd-index-panel">
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
Expand All @@ -38,17 +38,17 @@ <h2>Properties</h2>
<h3 class="tsd-anchor-link"><span>endpoint</span><a href="#endpoint" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-property">endpoint</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/elsoul/skeet-solana-utils/blob/8e20754/src/lib/solanaUtils/solanaUtilsTypes.ts#L2">lib/solanaUtils/solanaUtilsTypes.ts:2</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/elsoul/skeet-solana-utils/blob/2228238/src/lib/solanaUtils/solanaUtilsTypes.ts#L2">lib/solanaUtils/solanaUtilsTypes.ts:2</a></li></ul></aside></section>
<section class="tsd-panel tsd-member"><a id="mintAddress" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>mint<wbr/>Address</span><a href="#mintAddress" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-property">mint<wbr/>Address</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/elsoul/skeet-solana-utils/blob/8e20754/src/lib/solanaUtils/solanaUtilsTypes.ts#L3">lib/solanaUtils/solanaUtilsTypes.ts:3</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/elsoul/skeet-solana-utils/blob/2228238/src/lib/solanaUtils/solanaUtilsTypes.ts#L3">lib/solanaUtils/solanaUtilsTypes.ts:3</a></li></ul></aside></section>
<section class="tsd-panel tsd-member"><a id="secretKeyPath" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>secret<wbr/>Key<wbr/>Path</span><a href="#secretKeyPath" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-property">secret<wbr/>Key<wbr/>Path</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/elsoul/skeet-solana-utils/blob/8e20754/src/lib/solanaUtils/solanaUtilsTypes.ts#L4">lib/solanaUtils/solanaUtilsTypes.ts:4</a></li></ul></aside></section></section></div>
<li>Defined in <a href="https://github.com/elsoul/skeet-solana-utils/blob/2228238/src/lib/solanaUtils/solanaUtilsTypes.ts#L4">lib/solanaUtils/solanaUtilsTypes.ts:4</a></li></ul></aside></section></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@skeet-framework/solana-utils",
"version": "0.1.3",
"version": "0.1.4",
"description": "Skeet Framework Plugin - Solana Utils",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
19 changes: 18 additions & 1 deletion src/lib/solanaUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { Connection, LAMPORTS_PER_SOL } from '@solana/web3.js'
import { SolanaUtilsOptions } from './solanaUtilsTypes'
import { stakeAccountBalance } from './stakeAccountBalance'
import { lastStakingReward } from './lastStakingReward'
import { checkOwnerNFTs, nftOwnerAddress } from './nftOwnerAddress'
import {
checkOwnerNFTs,
nftCollectionOwnerAddress,
nftOwnerAddress,
} from './nftOwnerAddress'

export class SolanaUtils {
public connection: Connection
Expand All @@ -21,6 +25,19 @@ export class SolanaUtils {
return await lastStakingReward(this, stakeAccountAddress)
}

async getOwnerNFTAddresses(
this: SolanaUtils,
userWalletAddress: string,
collectionAddress: string,
) {
const ownerNFTs = await nftCollectionOwnerAddress(
this,
userWalletAddress,
collectionAddress,
)
return ownerNFTs
}

async getOwnerNFTs(this: SolanaUtils, userWalletAddress: string) {
return await nftOwnerAddress(this, userWalletAddress)
}
Expand Down
11 changes: 11 additions & 0 deletions src/lib/solanaUtils/nftOwnerAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,14 @@ export const checkOwnerNFTs = async (
return result
}
}

const run = async () => {
const solanaUtils = new SolanaUtils({
endpoint: 'https://api.devnet.solana.com',
})
const nfts = await solanaUtils.getOwnerNFTs(
'DcLN5EYHBSexnKdipnSmiFAKevcxGijURonzaWfri8Cq',
)
console.log(nfts)
}
run()
2 changes: 1 addition & 1 deletion src/lib/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.1.3'
export const VERSION = '0.1.4'

0 comments on commit ab20fb3

Please sign in to comment.