flipmeme-sdk 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -10,7 +10,7 @@ declare enum BlockchainType {
|
|
|
10
10
|
}
|
|
11
11
|
interface CollectionInfo {
|
|
12
12
|
collectionAddress: PublicKey;
|
|
13
|
-
|
|
13
|
+
collectionNumber: number;
|
|
14
14
|
}
|
|
15
15
|
interface EthereumConfig {
|
|
16
16
|
rpcUrl: string;
|
|
@@ -27,6 +27,10 @@ interface CollectionParams {
|
|
|
27
27
|
tokenUri: string;
|
|
28
28
|
totalSupply: number;
|
|
29
29
|
}
|
|
30
|
+
interface CreateCollectionResponse {
|
|
31
|
+
collectionId: string;
|
|
32
|
+
collectionAddress: string;
|
|
33
|
+
}
|
|
30
34
|
interface NFTTradingData {
|
|
31
35
|
name: string;
|
|
32
36
|
tokenId: number;
|
|
@@ -68,7 +72,7 @@ declare class FlipmemeSDK {
|
|
|
68
72
|
private solana;
|
|
69
73
|
constructor(chainType: BlockchainType, config: EthereumConfig | SolanaConfig);
|
|
70
74
|
updateConfig(chainType: BlockchainType, config: EthereumConfig | SolanaConfig): void;
|
|
71
|
-
createCollection(params: CollectionParams): Promise<
|
|
75
|
+
createCollection(params: CollectionParams): Promise<CreateCollectionResponse>;
|
|
72
76
|
getCollectionPda(): Promise<CollectionInfo>;
|
|
73
77
|
buy(params: BuyParams): Promise<void>;
|
|
74
78
|
flipSell(params: SellParams): Promise<void>;
|
|
@@ -111,4 +115,4 @@ declare class FlipmemeSDK {
|
|
|
111
115
|
}>;
|
|
112
116
|
}
|
|
113
117
|
|
|
114
|
-
export { BlockchainType, type BuyCreditParams, type BuyParams, type CollectionInfo, type CollectionParams, type EthereumConfig, FlipmemeSDK, type NFTTradingData, type ProfileSellParams, type ReserveToken, type SellParams, type SolanaConfig, isEthereumConfig, isSolanaConfig };
|
|
118
|
+
export { BlockchainType, type BuyCreditParams, type BuyParams, type CollectionInfo, type CollectionParams, type CreateCollectionResponse, type EthereumConfig, FlipmemeSDK, type NFTTradingData, type ProfileSellParams, type ReserveToken, type SellParams, type SolanaConfig, isEthereumConfig, isSolanaConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ declare enum BlockchainType {
|
|
|
10
10
|
}
|
|
11
11
|
interface CollectionInfo {
|
|
12
12
|
collectionAddress: PublicKey;
|
|
13
|
-
|
|
13
|
+
collectionNumber: number;
|
|
14
14
|
}
|
|
15
15
|
interface EthereumConfig {
|
|
16
16
|
rpcUrl: string;
|
|
@@ -27,6 +27,10 @@ interface CollectionParams {
|
|
|
27
27
|
tokenUri: string;
|
|
28
28
|
totalSupply: number;
|
|
29
29
|
}
|
|
30
|
+
interface CreateCollectionResponse {
|
|
31
|
+
collectionId: string;
|
|
32
|
+
collectionAddress: string;
|
|
33
|
+
}
|
|
30
34
|
interface NFTTradingData {
|
|
31
35
|
name: string;
|
|
32
36
|
tokenId: number;
|
|
@@ -68,7 +72,7 @@ declare class FlipmemeSDK {
|
|
|
68
72
|
private solana;
|
|
69
73
|
constructor(chainType: BlockchainType, config: EthereumConfig | SolanaConfig);
|
|
70
74
|
updateConfig(chainType: BlockchainType, config: EthereumConfig | SolanaConfig): void;
|
|
71
|
-
createCollection(params: CollectionParams): Promise<
|
|
75
|
+
createCollection(params: CollectionParams): Promise<CreateCollectionResponse>;
|
|
72
76
|
getCollectionPda(): Promise<CollectionInfo>;
|
|
73
77
|
buy(params: BuyParams): Promise<void>;
|
|
74
78
|
flipSell(params: SellParams): Promise<void>;
|
|
@@ -111,4 +115,4 @@ declare class FlipmemeSDK {
|
|
|
111
115
|
}>;
|
|
112
116
|
}
|
|
113
117
|
|
|
114
|
-
export { BlockchainType, type BuyCreditParams, type BuyParams, type CollectionInfo, type CollectionParams, type EthereumConfig, FlipmemeSDK, type NFTTradingData, type ProfileSellParams, type ReserveToken, type SellParams, type SolanaConfig, isEthereumConfig, isSolanaConfig };
|
|
118
|
+
export { BlockchainType, type BuyCreditParams, type BuyParams, type CollectionInfo, type CollectionParams, type CreateCollectionResponse, type EthereumConfig, FlipmemeSDK, type NFTTradingData, type ProfileSellParams, type ReserveToken, type SellParams, type SolanaConfig, isEthereumConfig, isSolanaConfig };
|
package/dist/index.js
CHANGED
|
@@ -64,6 +64,10 @@ var EthereumConnector = class {
|
|
|
64
64
|
}
|
|
65
65
|
createCollection(collection) {
|
|
66
66
|
return __async(this, null, function* () {
|
|
67
|
+
return {
|
|
68
|
+
collectionId: "",
|
|
69
|
+
collectionAddress: ""
|
|
70
|
+
};
|
|
67
71
|
});
|
|
68
72
|
}
|
|
69
73
|
};
|
|
@@ -1587,7 +1591,7 @@ var SolanaConnector = class {
|
|
|
1587
1591
|
);
|
|
1588
1592
|
return {
|
|
1589
1593
|
collectionAddress: collectionPda2,
|
|
1590
|
-
|
|
1594
|
+
collectionNumber: state.collectionCount
|
|
1591
1595
|
};
|
|
1592
1596
|
});
|
|
1593
1597
|
}
|
|
@@ -1635,7 +1639,8 @@ var SolanaConnector = class {
|
|
|
1635
1639
|
const addPriorityFee = import_web34.ComputeBudgetProgram.setComputeUnitPrice({
|
|
1636
1640
|
microLamports: 1e4
|
|
1637
1641
|
});
|
|
1638
|
-
const
|
|
1642
|
+
const lastestBlockhash = yield this.config.provider.connection.getLatestBlockhash();
|
|
1643
|
+
const blockHash = lastestBlockhash.blockhash;
|
|
1639
1644
|
const messageV0 = new import_web34.TransactionMessage({
|
|
1640
1645
|
payerKey: this.config.wallet,
|
|
1641
1646
|
recentBlockhash: blockHash,
|
|
@@ -1645,12 +1650,22 @@ var SolanaConnector = class {
|
|
|
1645
1650
|
const result = yield this.config.provider.connection.simulateTransaction(
|
|
1646
1651
|
versionedTransaction
|
|
1647
1652
|
);
|
|
1653
|
+
console.log("simulation result === ", result);
|
|
1648
1654
|
const tx = new import_web34.Transaction().add(modifyComputeUnits).add(addPriorityFee).add(instruction);
|
|
1649
1655
|
const txHash = yield this.config.sendTransaction(
|
|
1650
1656
|
tx,
|
|
1651
1657
|
this.config.provider.connection
|
|
1652
1658
|
);
|
|
1653
|
-
|
|
1659
|
+
this.config.provider.connection.confirmTransaction({
|
|
1660
|
+
blockhash: blockHash,
|
|
1661
|
+
lastValidBlockHeight: lastestBlockhash.lastValidBlockHeight,
|
|
1662
|
+
signature: txHash
|
|
1663
|
+
});
|
|
1664
|
+
console.log("signature == ", txHash);
|
|
1665
|
+
return {
|
|
1666
|
+
collectionId: collectionID.toString(),
|
|
1667
|
+
collectionAddress: collection.toString()
|
|
1668
|
+
};
|
|
1654
1669
|
});
|
|
1655
1670
|
}
|
|
1656
1671
|
//useBuy.ts
|