Skip to content

Commit

Permalink
autobind class
Browse files Browse the repository at this point in the history
  • Loading branch information
Moikapy committed Sep 28, 2022
1 parent 63bd2e5 commit 44b209e
Show file tree
Hide file tree
Showing 6 changed files with 15,253 additions and 14,375 deletions.
36 changes: 4 additions & 32 deletions dabu/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { EthereumAuthProvider, SelfID, WebClient } from '@self.id/web';
import { ThirdwebSDK, ChainId, NATIVE_TOKENS } from '@takolabs/sdk';
import { ThirdwebSDK, ChainId, NATIVE_TOKENS } from '@thirdweb-dev/sdk';
import { useSigner, useAddress } from '@thirdweb-dev/react';
import abi from './abi.js';
import Web3 from 'web3';
import autoBind from 'auto-bind';
var BN = Web3.utils.hexToNumberString;
/**
*
Expand All @@ -25,16 +25,6 @@ var BN = Web3.utils.hexToNumberString;
* seller.
*/

async function handleID(sig, address) {
return await SelfID.authenticate({
authProvider: new EthereumAuthProvider(sig, address),
ceramic: 'testnet-clay',
connectNetwork: 'testnet-clay',
}).then(async (res) => {
return res;
});
}

class DABU {
constructor(environment) {
///
Expand Down Expand Up @@ -70,34 +60,16 @@ class DABU {
this.polygonSDK = ThirdwebSDK.fromSigner(sig, 'polygon');
this.dabu_eth = this.ethSDK.getMarketplace(this.eth_market);
this.dabu_polygon = this.polygonSDK.getMarketplace(this.polygon_market);

// A SelfID instance can only be created with an authenticated Ceramic instance
// const data = (async()=>await handleID(
// window.ethereum,
// window.ethereum.selectedAddress
// ).then( ({ client, did, id }) => {
// // console.log('is', client, did, id);
// this.self = new SelfID({ client });
// this.did = id;
// return {
// client,
// did,
// id,
// };
// }))();
// console.log('qwert',data);
// this.self = new SelfID({ id })a;
} else {
this.dabu_eth = this.ethSDK_ReadOnly.getMarketplace(this.eth_market);
this.dabu_polygon = this.polygonSDK_ReadOnly.getMarketplace(
this.polygon_market
);
}
}
}
// TODO RM - this is not used anymore
async init() {}

autoBind(this);
}
// Query
async get_nft_listing({ listingId, network }) {
try {
Expand Down
8 changes: 0 additions & 8 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ const nextConfig = {
// !! WARN !!
ignoreBuildErrors: true,
},
webpackDevMiddleware: (config) => {
// Solve compiling problem via vagrant
config.watchOptions = {
poll: 1000, // Check for changes every second
aggregateTimeout: 800, // delay before rebuilding
};
return config;
},
async rewrites() {
return [];
},
Expand Down
Loading

0 comments on commit 44b209e

Please sign in to comment.