Skip to content

Commit

Permalink
Merge pull request #201 from atonoy/feature/a-bit-modify
Browse files Browse the repository at this point in the history
Feature/a bit modify
  • Loading branch information
fukaoi authored Dec 21, 2023
2 parents f9246c6 + 55da188 commit 8cee976
Show file tree
Hide file tree
Showing 16 changed files with 613 additions and 2,355 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
"devDependencies": {
"@types/node": "16.11.7",
"ava": "^5.3.1",
"depcheck": "^1.4.6",
"eslint": "^8.50.0",
"depcheck": "^1.4.7",
"eslint": "^8.56.0",
"prettier": "3.0.3",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"tsc-alias": "^1.8.8",
"tslib": "^2.6.2",
"tsup": "^7.2.0",
"tsx": "^3.13.0",
"tsx": "^3.14.0",
"turbo": "^1.11.2"
},
"repository": "[email protected]:atonoy/solana-suite.git",
Expand Down
3 changes: 1 addition & 2 deletions packages/storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
"test": "ava --config node_modules/build-configs/ava/base.cjs"
},
"dependencies": {
"@irys/sdk": "^0.0.3",
"@irys/sdk": "^0.0.4",
"nft.storage": "^7.1.1"
},
"devDependencies": {
"@solana-suite/config": "workspace:*",
"@solana/wallet-adapter-wallets": "^0.19.23",
"build-configs/ava": "workspace:*",
"build-configs/eslint": "workspace:*",
"build-configs/prettier": "workspace:*",
Expand Down
17 changes: 9 additions & 8 deletions packages/suite-compressed-nft/dist/index.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ type Sortable = {
sortDirection: SortDirection;
};
type FindOptions = {
limit?: number;
page?: number;
sortBy?: Sortable;
before?: string;
after?: string;
limit: number;
page: number;
sortBy: Sortable;
before: string;
after: string;
};

type DelegateOptions = {
Expand Down Expand Up @@ -137,6 +137,7 @@ type NftMetadata = {
type SpaceOptions = {
feePayer: Secret$1;
};
type SpaceNumber = 8 | 16000 | 100000 | 16700000 | 67000000 | 1000000000;

type bignum = number | BN;
declare enum UseMethod {
Expand Down Expand Up @@ -743,12 +744,12 @@ declare namespace CompressedNft$1 {
* This function needs only 1 call
*
* @param {Secret} owner
* @param {number} spaceSize
* @param {SpaceNumber} spaceSize
* @param {Partial<SpaceOptions>} options
*
* @return Promise<Result<MintTransaction, Error>>
*/
const createSpace: (owner: Secret, spaceSize: number, options?: Partial<SpaceOptions>) => Promise<Result<MintStructure, Error>>;
const createSpace: (owner: Secret, spaceSize: SpaceNumber, options?: Partial<SpaceOptions>) => Promise<Result<MintStructure, Error>>;
/**
* Calculate space cost
*
Expand All @@ -766,7 +767,7 @@ declare const CompressedNft: {
mintCollection: (owner: Secret$1, input: InputNftMetadata, options?: Partial<MintCollectionOptions>) => Promise<Result<MintStructure, Error>>;
Space: typeof CompressedNft$1.Space;
initSpace: (owner: Secret, maxDepth: number, maxBufferSize: number, canopyDepth: number, options?: Partial<SpaceOptions>) => Promise<Result<MintStructure, Error>>;
createSpace: (owner: Secret, spaceSize: number, options?: Partial<SpaceOptions>) => Promise<Result<MintStructure, Error>>;
createSpace: (owner: Secret, spaceSize: SpaceNumber, options?: Partial<SpaceOptions>) => Promise<Result<MintStructure, Error>>;
calculateSpaceCost: (spaceSize: number) => Promise<{
sol: number;
}>;
Expand Down
17 changes: 9 additions & 8 deletions packages/suite-compressed-nft/dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ type Sortable = {
sortDirection: SortDirection;
};
type FindOptions = {
limit?: number;
page?: number;
sortBy?: Sortable;
before?: string;
after?: string;
limit: number;
page: number;
sortBy: Sortable;
before: string;
after: string;
};

type DelegateOptions = {
Expand Down Expand Up @@ -137,6 +137,7 @@ type NftMetadata = {
type SpaceOptions = {
feePayer: Secret$1;
};
type SpaceNumber = 8 | 16000 | 100000 | 16700000 | 67000000 | 1000000000;

type bignum = number | BN;
declare enum UseMethod {
Expand Down Expand Up @@ -743,12 +744,12 @@ declare namespace CompressedNft$1 {
* This function needs only 1 call
*
* @param {Secret} owner
* @param {number} spaceSize
* @param {SpaceNumber} spaceSize
* @param {Partial<SpaceOptions>} options
*
* @return Promise<Result<MintTransaction, Error>>
*/
const createSpace: (owner: Secret, spaceSize: number, options?: Partial<SpaceOptions>) => Promise<Result<MintStructure, Error>>;
const createSpace: (owner: Secret, spaceSize: SpaceNumber, options?: Partial<SpaceOptions>) => Promise<Result<MintStructure, Error>>;
/**
* Calculate space cost
*
Expand All @@ -766,7 +767,7 @@ declare const CompressedNft: {
mintCollection: (owner: Secret$1, input: InputNftMetadata, options?: Partial<MintCollectionOptions>) => Promise<Result<MintStructure, Error>>;
Space: typeof CompressedNft$1.Space;
initSpace: (owner: Secret, maxDepth: number, maxBufferSize: number, canopyDepth: number, options?: Partial<SpaceOptions>) => Promise<Result<MintStructure, Error>>;
createSpace: (owner: Secret, spaceSize: number, options?: Partial<SpaceOptions>) => Promise<Result<MintStructure, Error>>;
createSpace: (owner: Secret, spaceSize: SpaceNumber, options?: Partial<SpaceOptions>) => Promise<Result<MintStructure, Error>>;
calculateSpaceCost: (spaceSize: number) => Promise<{
sol: number;
}>;
Expand Down
2 changes: 1 addition & 1 deletion packages/suite-compressed-nft/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/suite-compressed-nft/dist/index.mjs

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions packages/suite-compressed-nft/src/space.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Constants, debugLog, Result, Try } from '~/shared';
import { Node } from '~/node';
import { TransactionBuilder } from '~/transaction-builder';
import { MintStructure } from '~/types/transaction-builder';
import { SpaceOptions } from '~/types/compressed-nft';
import { SpaceNumber, SpaceOptions } from '~/types/compressed-nft';

export namespace CompressedNft {
export class Space {
Expand Down Expand Up @@ -116,14 +116,14 @@ export namespace CompressedNft {
* This function needs only 1 call
*
* @param {Secret} owner
* @param {number} spaceSize
* @param {SpaceNumber} spaceSize
* @param {Partial<SpaceOptions>} options
*
* @return Promise<Result<MintTransaction, Error>>
*/
export const createSpace = async (
owner: Secret,
spaceSize: number,
spaceSize: SpaceNumber,
options: Partial<SpaceOptions> = {},
): Promise<Result<MintStructure, Error>> => {
const { maxDepth, maxBufferSize, canopyDepth } =
Expand Down Expand Up @@ -160,9 +160,9 @@ export namespace CompressedNft {
/// | --------- | --------------------- |
/// | 3 | (8) | node: 8
/// | 14 | (64, 256, 1024, 2048) | node: 16,384
/// | 20 | (64, 256, 1024, 2048) | node: 131,072
/// | 24 | (64, 256, 512, 1024, 2048) | node: 1,048,576
/// | 26 | (64, 256, 512, 1024, 2048) | node: ???
/// | 20 | (64, 256, 1024, 2048) | node: 1,048,576
/// | 24 | (64, 256, 512, 1024, 2048) | node: 16,777,216
/// | 26 | (64, 256, 512, 1024, 2048) | node: 67,108,864
/// | 30 | (512, 1024, 2048) | node: 1,073,741,824
const calculateSpaceNumberToDepth = (space: number) => {
const log2 = Math.ceil(Math.log2(space));
Expand Down
3 changes: 2 additions & 1 deletion packages/types/dist/compressed-nft.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@ type NftMetadata = {
type SpaceOptions = {
feePayer: Secret;
};
type SpaceNumber = 8 | 16000 | 100000 | 16700000 | 67000000 | 1000000000;

export { Authority, CompressedNftMetadata, Creators, DelegateOptions, MintCollectionOptions, MintOptions, NftMetadata, SpaceOptions };
export { Authority, CompressedNftMetadata, Creators, DelegateOptions, MintCollectionOptions, MintOptions, NftMetadata, SpaceNumber, SpaceOptions };
3 changes: 2 additions & 1 deletion packages/types/dist/compressed-nft.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@ type NftMetadata = {
type SpaceOptions = {
feePayer: Secret;
};
type SpaceNumber = 8 | 16000 | 100000 | 16700000 | 67000000 | 1000000000;

export { Authority, CompressedNftMetadata, Creators, DelegateOptions, MintCollectionOptions, MintOptions, NftMetadata, SpaceOptions };
export { Authority, CompressedNftMetadata, Creators, DelegateOptions, MintCollectionOptions, MintOptions, NftMetadata, SpaceNumber, SpaceOptions };
10 changes: 5 additions & 5 deletions packages/types/dist/find.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ type Sortable = {
sortDirection: SortDirection;
};
type FindOptions = {
limit?: number;
page?: number;
sortBy?: Sortable;
before?: string;
after?: string;
limit: number;
page: number;
sortBy: Sortable;
before: string;
after: string;
};
type Find = {
sol?: string;
Expand Down
10 changes: 5 additions & 5 deletions packages/types/dist/find.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ type Sortable = {
sortDirection: SortDirection;
};
type FindOptions = {
limit?: number;
page?: number;
sortBy?: Sortable;
before?: string;
after?: string;
limit: number;
page: number;
sortBy: Sortable;
before: string;
after: string;
};
type Find = {
sol?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/types/dist/find.js

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

2 changes: 1 addition & 1 deletion packages/types/dist/find.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export {
SortBy,
SortDirection
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2ZpbmQvaW5kZXgudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB7IFB1YmtleSB9IGZyb20gJy4uL2FjY291bnQnO1xuXG5leHBvcnQgZW51bSBTb3J0RGlyZWN0aW9uIHtcbiAgQXNjID0gJ2FzYycsXG4gIERlc2MgPSAnZGVzYycsXG59XG5cbmV4cG9ydCBlbnVtIFNvcnRCeSB7XG4gIENyZWF0ZWQgPSAnY3JlYXRlZCcsXG4gIFVwZGF0ZWQgPSAndXBkYXRlZCcsXG4gIFJlY2VudCA9ICdyZWNlbnRfYWN0aW9uJyxcbn1cblxuZXhwb3J0IHR5cGUgU29ydGFibGUgPSB7XG4gIHNvcnRCeTogU29ydEJ5O1xuICBzb3J0RGl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zogc3RyaW5nO1xuICBpbm5lckluc3RydWN0aW9uPzogYm9vbGVhbjtcbn07XG4iXSwKICAibWFwcGluZ3MiOiAiO0FBRU8sSUFBSyxnQkFBTCxrQkFBS0EsbUJBQUw7QUFDTCxFQUFBQSxlQUFBLFNBQU07QUFDTixFQUFBQSxlQUFBLFVBQU87QUFGRyxTQUFBQTtBQUFBLEdBQUE7QUFLTCxJQUFLLFNBQUwsa0JBQUtDLFlBQUw7QUFDTCxFQUFBQSxRQUFBLGFBQVU7QUFDVixFQUFBQSxRQUFBLGFBQVU7QUFDVixFQUFBQSxRQUFBLFlBQVM7QUFIQyxTQUFBQTtBQUFBLEdBQUE7IiwKICAibmFtZXMiOiBbIlNvcnREaXJlY3Rpb24iLCAiU29ydEJ5Il0KfQo=
2 changes: 2 additions & 0 deletions packages/types/src/compressed-nft/space.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ import { Secret } from '../account';
export type SpaceOptions = {
feePayer: Secret;
};

export type SpaceNumber = 8 | 16000 | 100000 | 16700000 | 67000000 | 1000000000;
10 changes: 5 additions & 5 deletions packages/types/src/find/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ export type Sortable = {
};

export type FindOptions = {
limit?: number;
page?: number;
sortBy?: Sortable;
before?: string;
after?: string;
limit: number;
page: number;
sortBy: Sortable;
before: string;
after: string;
};

export type Find = {
Expand Down
Loading

0 comments on commit 8cee976

Please sign in to comment.