Skip to content

Commit 74339e6

Browse files
dantefariasDante
andauthored
Fix declare get nft info (#239)
* Declare getNFTinfo * Declare registeredNFT Co-authored-by: Dante <dante@Dantes-MacBook-Pro.local>
1 parent 55e496f commit 74339e6

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"typescript": "^4.5"
5959
},
6060
"name": "@psychedelic/plug-controller",
61-
"version": "0.24.7",
61+
"version": "0.24.8",
6262
"description": "Internet Computer Plug wallet's controller",
6363
"main": "dist/index.js",
6464
"scripts": {

src/PlugKeyRing/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { PlugStateStorage, PlugStateInstance } from '../interfaces/plug_keyring'
1414
import { GetTransactionsResponse } from '../interfaces/transactions';
1515
import { KeyringStorage, StorageData } from '../interfaces/storage';
1616
import { TokenBalance, StandardToken } from '../interfaces/token';
17-
import { WalletNFTCollection } from '../interfaces/plug_wallet';
17+
import { WalletNFTCollection, WalletNFTInfo } from '../interfaces/plug_wallet';
1818
import { Address } from '../interfaces/contact_registry';
1919
import { ERRORS, ERROR_CODES } from '../errors';
2020
import { IdentityFactory } from './../utils/identity/identityFactory'
@@ -27,6 +27,7 @@ import { getVersion } from '../utils/version';
2727
import Storage from '../utils/storage';
2828

2929
import NetworkModule, { NetworkModuleParams } from './modules/NetworkModule';
30+
import { RegisteredNFT } from './modules/NetworkModule/Network';
3031
import {
3132
CreateAndPersistKeyRingOptions,
3233
CreateImportResponse,
@@ -73,6 +74,9 @@ class PlugKeyRing {
7374
public getTransactions: (args: { subaccount?: string }) => Promise<GetTransactionsResponse>;
7475
public send: (args: { subaccount?: string, to: string, amount: string, canisterId: string, opts?: TokenInterfaces.SendOpts }) => Promise<TokenInterfaces.SendResponse>;
7576
public delegateIdentity: (args: { to: Buffer, targets: string[], subaccount?: string }) => Promise<string>;
77+
public getNFTInfo: (args: { canisterId: string, standard?: string, subaccount?: string }) => Promise<WalletNFTInfo>;
78+
public registerNFT: (args: { canisterId: string, standard?: string, subaccount?: string }) => Promise<RegisteredNFT[]>;
79+
7680

7781
public constructor(
7882
StorageAdapter = new Storage() as KeyringStorage,

src/PlugWallet/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
ICNSData,
3636
PlugWalletArgs,
3737
WalletNFTCollection,
38+
WalletNFTInfo,
3839
} from '../interfaces/plug_wallet';
3940
import { StandardToken, TokenBalance } from '../interfaces/token';
4041
import { GetTransactionsResponse } from '../interfaces/transactions';
@@ -213,7 +214,7 @@ class PlugWallet {
213214
return balance;
214215
};
215216

216-
public getNFTInfo = async ({ canisterId, standard }) => {
217+
public getNFTInfo = async ({ canisterId, standard }): Promise<WalletNFTInfo> => {
217218
const nft = await this.network.getNftInfo({ canisterId, identity: this.identity, standard });
218219
return nft;
219220
}

src/constants/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const PLUG_CONTROLLER_VERSION = "0.24.7";
1+
export const PLUG_CONTROLLER_VERSION = "0.24.8";

src/interfaces/plug_wallet.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,7 @@ export interface NFTDetailsBase<idT = bigint> {
5252
export interface WalletNFTCollection extends Omit<NFTCollection, 'tokens'> {
5353
tokens: NFTDetailsBase<bigint | string>[];
5454
}
55+
56+
export interface WalletNFTInfo extends NFTCollection {
57+
registeredBy: Array<string>;
58+
}

0 commit comments

Comments
 (0)