Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7524d7a
wip
ciaranightingale Jul 5, 2023
de65f04
merge main
ciaranightingale Jul 5, 2023
98c7018
wip
ciaranightingale Jul 12, 2023
820d4cc
Merge branch 'main' into ciara/tba
ciaranightingale Jul 12, 2023
4755ac0
merge main
ciaranightingale Jul 24, 2023
2580d13
wip
ciaranightingale Jul 24, 2023
279b260
update with clientId & secretKey & requested changes
ciaranightingale Jul 24, 2023
c8445b9
Merge branch 'ciara/tba' of https://github.com/thirdweb-dev/js into c…
ciaranightingale Jul 24, 2023
af57f47
Merge branch 'main' into ciara/tba
ciaranightingale Jul 24, 2023
2db5249
fix build
ciaranightingale Jul 24, 2023
73a51fa
wip
ciaranightingale Jul 26, 2023
39e22b9
wip
ciaranightingale Jul 26, 2023
f34654b
Merge branch 'ciara/tba' of https://github.com/thirdweb-dev/js into c…
ciaranightingale Jul 26, 2023
7477b73
restructure
Jul 26, 2023
5ab826b
cleanup
joaquim-verges Jul 27, 2023
909ca2f
Merge branch 'main' into ciara/tba
joaquim-verges Jul 27, 2023
0c9ada2
Merge branch 'main' into ciara/tba
ciaranightingale Jul 27, 2023
cf5bb93
working code & fix factoryAddress required
ciaranightingale Jul 27, 2023
fdee3f5
Merge branch 'main' into ciara/tba
joaquim-verges Aug 9, 2023
0bdddc0
Merge branch 'main' into ciara/tba
joaquim-verges Aug 9, 2023
f11c12a
Merge branch 'main' into ciara/tba
joaquim-verges Oct 13, 2023
e93da7f
fix types
joaquim-verges Oct 14, 2023
6b4642a
linting
joaquim-verges Oct 14, 2023
8a07db2
fix build
joaquim-verges Oct 14, 2023
a8464f6
Merge branch 'main' into ciara/tba
joaquim-verges Oct 24, 2023
4c8dd1c
require account impl for now
joaquim-verges Oct 24, 2023
c9616ed
changeset
joaquim-verges Oct 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update with clientId & secretKey & requested changes
  • Loading branch information
ciaranightingale committed Jul 24, 2023
commit 279b2605ccc931ba9aab0d6b4db190b53d90c8fb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export class TokenBoundConnnector extends SmartWalletConnector {
const smartWalletConfig: SmartWalletConfig = {
chain: config.chain,
factoryAddress: config.factoryAddress,
thirdwebApiKey: config.thirdwebApiKey,
clientId: config.clientId,
secretKey: config.secretKey,
gasless: config.gasless,
bundlerUrl: config.bundlerUrl,
paymasterUrl: config.paymasterUrl,
Expand Down Expand Up @@ -47,25 +48,23 @@ export class TokenBoundConnnector extends SmartWalletConnector {

protected defaultTokenBoundFactoryInfo(): FactoryContractInfo {
return {
createAccount: async (factory: SmartContract, implementation: SmartContract, chainId: Number, tokenContract: SmartContract, tokenId: Number) => {
createAccount: async (factory: SmartContract, implementation: SmartContract, chainId: Number, tokenContract: SmartContract, tokenId: Number, salt: Number = 1) => {
return factory.prepare("createAccount", [
implementation,
chainId,
tokenContract,
tokenId,
// TODO salt
1,
salt,
ethers.utils.toUtf8Bytes(""),
]);
},
getAccountAddress: async (factory, implementation, chainId, tokenContract, tokenId) => {
getAccountAddress: async (factory, implementation, chainId, tokenContract, tokenId, salt = 1) => {
return await factory.call("address", [
implementation,
chainId,
tokenContract,
tokenId,
// TODO salt
1
salt
]);
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export type FactoryContractInfo = {
implementation: SmartContract,
chainId: Number,
tokenContract: SmartContract,
tokenId: Number
tokenId: Number,
salt: Number
) => Promise<string>;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export class TokenBoundSmartWallet extends SmartWallet {
"ipfs://QmeAJVqn17aDNQhjEU3kcWVZCFBrfta8LzaDGkS8Egdiyk/smart-wallet.svg",
};

static id = walletIds.tokenBoundSmartWallet;
public get walletName() {
return "Token Bound Smart Wallet" as "Smart Wallet";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the as part? Was there a type error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, type error

}

constructor(options: WalletOptions<TokenBoundSmartWalletConfig>) {
options.walletId = walletIds.tokenBoundSmartWallet;
super(options
);
}
Expand Down