Skip to content

Commit

Permalink
Merge pull request #216 from atonoy/feature/fix-exports-module
Browse files Browse the repository at this point in the history
Fix examples, delete no need import
  • Loading branch information
fukaoi authored Feb 5, 2024
2 parents e1c46d3 + 3a2805c commit a3479f6
Show file tree
Hide file tree
Showing 21 changed files with 277 additions and 203 deletions.
3 changes: 2 additions & 1 deletion examples/integration1-regular-nft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
//////////////////////////////////////////////

import { Airdrop } from '@solana-suite/airdrop';
import { Account, Node, Pubkey, RegularNft } from '@solana-suite/regular-nft';
import { RegularNft } from '@solana-suite/regular-nft';
import { Account, Node, Pubkey } from '@solana-suite/utils';
import { RandomAsset } from 'test-tools/setupAsset';
import { requestSol } from 'test-tools';
import assert from 'assert';
Expand Down
3 changes: 2 additions & 1 deletion examples/integration10-sbt-mint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import assert from 'assert';
import { Airdrop } from '@solana-suite/airdrop';
import { Account, RegularNft } from '@solana-suite/regular-nft';
import { Account } from '@solana-suite/utils';
import { RegularNft } from '@solana-suite/regular-nft';
import { RandomAsset } from 'test-tools/setupAsset';
import { requestSol } from 'test-tools';

Expand Down
10 changes: 3 additions & 7 deletions examples/integration11-compressed-nft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
//////////////////////////////////////////////

import assert from 'assert';
import {
Account,
CompressedNft,
Explorer,
Node,
sleep,
} from '@solana-suite/compressed-nft';
import { CompressedNft } from '@solana-suite/compressed-nft';

import { Account, Explorer, Node, sleep } from '@solana-suite/utils';
import { RandomAsset } from 'test-tools/setupAsset';
import { requestSol } from 'test-tools';

Expand Down
3 changes: 2 additions & 1 deletion examples/integration2-spl-token-mint-transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import assert from 'assert';
import { Airdrop } from '@solana-suite/airdrop';
import { Account, Node, Pubkey, SplToken } from '@solana-suite/spl-token';
import { SplToken } from '@solana-suite/spl-token';
import { Account, Node, Pubkey } from '@solana-suite/utils';

import { requestSol } from 'test-tools';
import { RandomAsset } from 'test-tools/setupAsset';
Expand Down
3 changes: 2 additions & 1 deletion examples/integration3-handling-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// $ npx ts-node examples/integration3-handling-response
//////////////////////////////////////////////

import { OwnerInfo, SolNative } from '@solana-suite/sol-native';
import { SolNative } from '@solana-suite/sol-native';
import { OwnerInfo } from '@solana-suite/utils';

const DEMO_ADDRESS = 'AorMYhBGmqo8Czp65WLjA42vKaQ5jS69gxyk6KxAsK3x';

Expand Down
3 changes: 2 additions & 1 deletion examples/integration4-multisig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
//////////////////////////////////////////////

import assert from 'assert';
import { Account, Multisig, Node, Pubkey } from '@solana-suite/multisig';
import { Multisig } from '@solana-suite/multisig';
import { Account, Node, Pubkey } from '@solana-suite/utils';
import { Airdrop } from '@solana-suite/airdrop';
import { requestSol } from 'test-tools';

Expand Down
3 changes: 2 additions & 1 deletion examples/integration5-token-memo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import assert from 'assert';
import { Airdrop } from '@solana-suite/airdrop';
import { Account, Node, Pubkey, SplToken } from '@solana-suite/spl-token';
import { Account, Node, Pubkey } from '@solana-suite/utils';
import { SplToken } from '@solana-suite/spl-token';
import { Memo } from '@solana-suite/memo';

import { requestSol } from 'test-tools';
Expand Down
5 changes: 3 additions & 2 deletions examples/integration7-transfer-to-users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import assert from 'assert';
import { Airdrop } from '@solana-suite/airdrop';
import { Account, Pubkey, Secret, SplToken } from '@solana-suite/spl-token';
import { SplToken } from '@solana-suite/spl-token';
import { Account, Pubkey, Secret } from '@solana-suite/utils';
import { requestSol } from 'test-tools';
import { RandomAsset } from 'test-tools/setupAsset';

Expand Down Expand Up @@ -81,7 +82,7 @@ const SLEEP_TIME_WAIT = 0;

let i = 1;
for (const user of users) {
await new Promise(() => setTimeout(() => {}, SLEEP_TIME_WAIT * 1000));
await new Promise(() => setTimeout(() => { }, SLEEP_TIME_WAIT * 1000));
const inst2 = await SplToken.transfer(
mint,
owner.pubkey,
Expand Down
3 changes: 2 additions & 1 deletion examples/integration8-gas-less-transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import assert from 'assert';
import { Airdrop } from '@solana-suite/airdrop';
import { SplToken } from '@solana-suite/spl-token';
import { Account, Pubkey, SolNative } from '@solana-suite/sol-native';
import { SolNative } from '@solana-suite/sol-native';
import { Account, Pubkey } from '@solana-suite/utils';
import { requestSol } from 'test-tools';
import { RandomAsset } from 'test-tools/setupAsset';

Expand Down
3 changes: 2 additions & 1 deletion examples/integration9-gas-less-mint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import assert from 'assert';
import { Airdrop } from '@solana-suite/airdrop';
import { requestSol } from 'test-tools';
import { RandomAsset } from 'test-tools/setupAsset';
import { Account, RegularNft } from '@solana-suite/regular-nft';
import { RegularNft } from '@solana-suite/regular-nft';
import { Account } from '@solana-suite/utils';

(async () => {
// random create
Expand Down
1 change: 1 addition & 0 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"@solana-suite/suite-spl-token": "../packages/suite-spl-token",
"@solana-suite/suite-regular-nft": "../packages/suite-regular-nft/",
"@solana-suite/suite-compressed-nft": "../packages/suite-compressed-nft/",
"@solana-suite/suite-utils": "../packages/suite-utils/",
"test-tools": "../packages/test-tools/"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"tsup": "^7.2.0",
"tsx": "^3.14.0",
"turbo": "^1.12.2",
"typedoc": "^0.25.4"
"typedoc": "^0.25.7"
},
"repository": "[email protected]:atonoy/solana-suite.git",
"author": "fukaoi <[email protected]>",
Expand Down
6 changes: 4 additions & 2 deletions packages/suite-memo/dist/index.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions packages/suite-memo/dist/index.mjs

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions packages/suite-utils/dist/index.d.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as _solana_web3_js from '@solana/web3.js';
import { PublicKey, Commitment, TransactionSignature, TransactionInstruction, Keypair, Connection } from '@solana/web3.js';
import { PublicKey, Commitment, TransactionSignature, Keypair, TransactionInstruction, Connection } from '@solana/web3.js';
import BN from 'bn.js';
import { DataV2 } from '@metaplex-foundation/mpl-token-metadata';

Expand Down Expand Up @@ -367,6 +367,35 @@ declare const convertTimestampToDateTime: (created_at: number | undefined) => Da
*/
declare const unixTimestamp: () => number;

declare global {
interface String {
toPublicKey(): PublicKey;
toKeypair(): Keypair;
toExplorerUrl(explorer?: Explorer, options?: ExplorerOptions): string;
}
interface Number {
toSol(): number;
toLamports(): number;
}
interface Console {
debug(data: unknown, data2?: unknown, data3?: unknown): void;
}
interface Secret {
toKeypair(): Keypair;
}
interface Pubkey {
toPublicKey(): PublicKey;
}
}
declare enum Explorer {
Solscan = "solscan",
SolanaFM = "solanafm",
Xray = "xray"
}
type ExplorerOptions = {
replacePath: string;
};

/**
* Get Associated token Account.
* if not created, create new token accouint
Expand Down Expand Up @@ -422,35 +451,6 @@ declare namespace Account$1 {
}
}

declare global {
interface String {
toPublicKey(): PublicKey;
toKeypair(): Keypair;
toExplorerUrl(explorer?: Explorer, options?: ExplorerOptions): string;
}
interface Number {
toSol(): number;
toLamports(): number;
}
interface Console {
debug(data: unknown, data2?: unknown, data3?: unknown): void;
}
interface Secret {
toKeypair(): Keypair;
}
interface Pubkey {
toPublicKey(): PublicKey;
}
}
declare enum Explorer {
Solscan = "solscan",
SolanaFM = "solanafm",
Xray = "xray"
}
type ExplorerOptions = {
replacePath: string;
};

declare const Account: {
Pda: typeof Account$1.Pda;
Keypair: typeof Account$2.Keypair;
Expand Down
60 changes: 30 additions & 30 deletions packages/suite-utils/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as _solana_web3_js from '@solana/web3.js';
import { PublicKey, Commitment, TransactionSignature, TransactionInstruction, Keypair, Connection } from '@solana/web3.js';
import { PublicKey, Commitment, TransactionSignature, Keypair, TransactionInstruction, Connection } from '@solana/web3.js';
import BN from 'bn.js';
import { DataV2 } from '@metaplex-foundation/mpl-token-metadata';

Expand Down Expand Up @@ -367,6 +367,35 @@ declare const convertTimestampToDateTime: (created_at: number | undefined) => Da
*/
declare const unixTimestamp: () => number;

declare global {
interface String {
toPublicKey(): PublicKey;
toKeypair(): Keypair;
toExplorerUrl(explorer?: Explorer, options?: ExplorerOptions): string;
}
interface Number {
toSol(): number;
toLamports(): number;
}
interface Console {
debug(data: unknown, data2?: unknown, data3?: unknown): void;
}
interface Secret {
toKeypair(): Keypair;
}
interface Pubkey {
toPublicKey(): PublicKey;
}
}
declare enum Explorer {
Solscan = "solscan",
SolanaFM = "solanafm",
Xray = "xray"
}
type ExplorerOptions = {
replacePath: string;
};

/**
* Get Associated token Account.
* if not created, create new token accouint
Expand Down Expand Up @@ -422,35 +451,6 @@ declare namespace Account$1 {
}
}

declare global {
interface String {
toPublicKey(): PublicKey;
toKeypair(): Keypair;
toExplorerUrl(explorer?: Explorer, options?: ExplorerOptions): string;
}
interface Number {
toSol(): number;
toLamports(): number;
}
interface Console {
debug(data: unknown, data2?: unknown, data3?: unknown): void;
}
interface Secret {
toKeypair(): Keypair;
}
interface Pubkey {
toPublicKey(): PublicKey;
}
}
declare enum Explorer {
Solscan = "solscan",
SolanaFM = "solanafm",
Xray = "xray"
}
type ExplorerOptions = {
replacePath: string;
};

declare const Account: {
Pda: typeof Account$1.Pda;
Keypair: typeof Account$2.Keypair;
Expand Down
2 changes: 1 addition & 1 deletion packages/suite-utils/dist/index.js

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions packages/suite-utils/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
export * from '~/account';
export * from './constants';
export * from '~/global';
export * from './result';
export * from './shared';

export * from '~/account';
export * from '~/global';
export * from '~/node';
export * from '~/validator';
export * from '~/types/account';
export * from '~/types/global';

import '~/types/global';
import '~/global';
6 changes: 4 additions & 2 deletions packages/transaction-builder/dist/index.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions packages/transaction-builder/dist/index.mjs

Large diffs are not rendered by default.

Loading

0 comments on commit a3479f6

Please sign in to comment.