@hot-labs/kit 1.4.21 → 1.4.23
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/CHANGELOG.md +5 -0
- package/build/core/token.js +1 -1
- package/build/core/token.js.map +1 -1
- package/build/cosmos/connector.js +1 -1
- package/build/cosmos/connector.js.map +1 -1
- package/build/cosmos/wallet.d.ts +1 -1
- package/build/cosmos/wallet.js +3 -1
- package/build/cosmos/wallet.js.map +1 -1
- package/build/solana/WalletStandard.d.ts +2 -1
- package/build/solana/WalletStandard.js +9 -4
- package/build/solana/WalletStandard.js.map +1 -1
- package/build/solana/connector.js +1 -1
- package/build/solana/connector.js.map +1 -1
- package/examples-node/token.ts +24 -0
- package/examples-node/transfer.ts +1 -1
- package/examples-node/withdraw.ts +1 -1
- package/package.json +1 -1
- package/skill.md +2 -1211
- package/src/core/token.ts +1 -1
- package/src/cosmos/connector.ts +1 -1
- package/src/cosmos/wallet.ts +4 -1
- package/src/solana/WalletStandard.ts +8 -3
- package/src/solana/connector.ts +1 -2
package/src/core/token.ts
CHANGED
|
@@ -68,7 +68,7 @@ export class Token {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
get originalChainIcon() {
|
|
71
|
-
if (this.originalChain === Network.Juno) return "https://
|
|
71
|
+
if (this.originalChain === Network.Juno) return "https://cryptologos.cc/logos/cosmos-atom-logo.svg";
|
|
72
72
|
return `https://storage.herewallet.app/ft/${this.originalChain}:native.png`;
|
|
73
73
|
}
|
|
74
74
|
|
package/src/cosmos/connector.ts
CHANGED
|
@@ -100,7 +100,7 @@ export default class CosmosConnector extends OmniConnector<CosmosWallet> {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
get icon() {
|
|
103
|
-
return chains.getByKey(this.chainId)?.logo || "
|
|
103
|
+
return chains.getByKey(this.chainId)?.logo || "";
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
get name() {
|
package/src/cosmos/wallet.ts
CHANGED
|
@@ -23,13 +23,16 @@ interface ProtocolWallet {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export default class CosmosWallet extends OmniWallet {
|
|
26
|
-
readonly icon = "https://legacy.cosmos.network/presskit/cosmos-brandmark-dynamic-dark.svg";
|
|
27
26
|
readonly type = WalletType.COSMOS;
|
|
28
27
|
|
|
29
28
|
constructor(readonly wallet: ProtocolWallet) {
|
|
30
29
|
super();
|
|
31
30
|
}
|
|
32
31
|
|
|
32
|
+
get icon() {
|
|
33
|
+
return chains.getByKey(this.wallet.chainId)?.logo || "";
|
|
34
|
+
}
|
|
35
|
+
|
|
33
36
|
get address() {
|
|
34
37
|
return this.wallet.account.address;
|
|
35
38
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { base58 } from "@scure/base";
|
|
1
2
|
import type { Connection, Transaction, VersionedTransaction } from "@solana/web3.js";
|
|
2
3
|
import type { Wallet } from "@wallet-standard/base";
|
|
3
4
|
|
|
@@ -9,12 +10,15 @@ export interface ISolanaProtocolWallet {
|
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
class SolanaProtocolWallet implements ISolanaProtocolWallet {
|
|
12
|
-
|
|
13
|
+
readonly address: string;
|
|
14
|
+
constructor(readonly wallet: Wallet, readonly publicKey: Uint8Array) {
|
|
15
|
+
this.address = base58.encode(publicKey);
|
|
16
|
+
}
|
|
13
17
|
|
|
14
18
|
static async connect(wallet: Wallet, { silent = false }: { silent?: boolean } = {}): Promise<ISolanaProtocolWallet> {
|
|
15
|
-
const a = new SolanaProtocolWallet(wallet,
|
|
19
|
+
const a = new SolanaProtocolWallet(wallet, new Uint8Array(32));
|
|
16
20
|
const account = await a.getAccount({ silent });
|
|
17
|
-
return new SolanaProtocolWallet(wallet, account.
|
|
21
|
+
return new SolanaProtocolWallet(wallet, new Uint8Array(account.publicKey));
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
async getAccount({ silent = false }: { silent?: boolean } = {}) {
|
|
@@ -28,6 +32,7 @@ class SolanaProtocolWallet implements ISolanaProtocolWallet {
|
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
if (!accounts.length) throw new Error("No account found");
|
|
35
|
+
if (!accounts[0].publicKey) throw new Error("No account found");
|
|
31
36
|
return accounts[0];
|
|
32
37
|
}
|
|
33
38
|
|
package/src/solana/connector.ts
CHANGED
|
@@ -98,6 +98,7 @@ class SolanaConnector extends OmniConnector<SolanaWallet, { wallet: Wallet }> {
|
|
|
98
98
|
return this.setWallet(
|
|
99
99
|
new SolanaWallet({
|
|
100
100
|
address: account,
|
|
101
|
+
disconnect: () => this.disconnectWalletConnect(),
|
|
101
102
|
sendTransaction: async (tx: Transaction | VersionedTransaction, connection: Connection, options?: any) => {
|
|
102
103
|
const transaction = Buffer.from(tx.serialize()).toString("base64");
|
|
103
104
|
const { signature } = await this.requestWalletConnect<{ signature: string }>({
|
|
@@ -114,8 +115,6 @@ class SolanaConnector extends OmniConnector<SolanaWallet, { wallet: Wallet }> {
|
|
|
114
115
|
});
|
|
115
116
|
return base58.decode(signature);
|
|
116
117
|
},
|
|
117
|
-
|
|
118
|
-
disconnect: () => this.disconnectWalletConnect(),
|
|
119
118
|
})
|
|
120
119
|
);
|
|
121
120
|
}
|