@coinbase/cdp-solana-standard-wallet 0.0.56 → 0.0.58
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/esm/index3.js +1 -1
- package/dist/esm/index5.js +9 -9
- package/package.json +3 -3
package/dist/esm/index3.js
CHANGED
package/dist/esm/index5.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { sendSolanaTransaction as g, signSolanaTransaction as D, signSolanaMessage as T, getCurrentUser as S } from "@coinbase/cdp-core";
|
|
2
2
|
import { SolanaSignAndSendTransaction as w, SolanaSignTransaction as y, SolanaSignMessage as I } from "@solana/wallet-standard";
|
|
3
3
|
import { ReadonlyWalletAccount as c } from "@wallet-standard/wallet";
|
|
4
|
-
import
|
|
4
|
+
import e from "bs58";
|
|
5
5
|
import { CDP_SOLANA_CHAINS as E, CDP_SOLANA_WALLET_STANDARD_VERSION as o } from "./index7.js";
|
|
6
6
|
import { CdpWalletAccount as N } from "./index4.js";
|
|
7
7
|
class u {
|
|
@@ -16,7 +16,7 @@ class u {
|
|
|
16
16
|
* @param solanaAddresses - Array of Solana addresses (base58 encoded)
|
|
17
17
|
*/
|
|
18
18
|
constructor(n) {
|
|
19
|
-
const t = n.map((s) => new N(
|
|
19
|
+
const t = n.map((s) => new N(e.decode(s)));
|
|
20
20
|
this.#n = t.map((s) => new c(s)), new.target === u && Object.freeze(this);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -103,11 +103,11 @@ class u {
|
|
|
103
103
|
throw new Error("invalid feature");
|
|
104
104
|
if (!this.chains.includes(M)) throw new Error("invalid chain");
|
|
105
105
|
try {
|
|
106
|
-
const r = M === "solana:mainnet" ? "solana" : "solana-devnet",
|
|
106
|
+
const r = M === "solana:mainnet" ? "solana" : "solana-devnet", j = Buffer.from(s).toString("base64"), L = await g({
|
|
107
107
|
solanaAccount: a.address,
|
|
108
|
-
transaction:
|
|
108
|
+
transaction: j,
|
|
109
109
|
network: r
|
|
110
|
-
}), z =
|
|
110
|
+
}), z = e.decode(L.transactionSignature);
|
|
111
111
|
t.push({ signature: new Uint8Array(z) });
|
|
112
112
|
} catch (r) {
|
|
113
113
|
throw new Error(
|
|
@@ -127,8 +127,8 @@ class u {
|
|
|
127
127
|
const i = Buffer.from(s).toString("base64"), r = await D({
|
|
128
128
|
solanaAccount: a.address,
|
|
129
129
|
transaction: i
|
|
130
|
-
}),
|
|
131
|
-
t.push({ signedTransaction: new Uint8Array(
|
|
130
|
+
}), j = Buffer.from(r.signedTransaction, "base64");
|
|
131
|
+
t.push({ signedTransaction: new Uint8Array(j) });
|
|
132
132
|
} catch (i) {
|
|
133
133
|
throw new Error(
|
|
134
134
|
`Failed to sign transaction: ${i instanceof Error ? i.message : "Unknown error"}`
|
|
@@ -146,7 +146,7 @@ class u {
|
|
|
146
146
|
const M = Buffer.from(a).toString("base64"), i = await T({
|
|
147
147
|
solanaAccount: s.address,
|
|
148
148
|
message: M
|
|
149
|
-
}), r =
|
|
149
|
+
}), r = e.decode(i.signature);
|
|
150
150
|
t.push({
|
|
151
151
|
signedMessage: a,
|
|
152
152
|
signature: new Uint8Array(r)
|
|
@@ -166,7 +166,7 @@ class u {
|
|
|
166
166
|
throw new Error("User not authenticated with CDP");
|
|
167
167
|
if (n.solanaAccounts && n.solanaAccounts.length > 0) {
|
|
168
168
|
const t = n.solanaAccounts.map(
|
|
169
|
-
(s) => new N(
|
|
169
|
+
(s) => new N(e.decode(s))
|
|
170
170
|
);
|
|
171
171
|
this.#n = t.map((s) => new c(s)), this.#s("change", { accounts: this.#n });
|
|
172
172
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cdp-solana-standard-wallet",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.58",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@wallet-standard/wallet": "^1.1.0",
|
|
23
23
|
"@wallet-standard/features": "^1.1.0",
|
|
24
24
|
"@wallet-standard/app": "^1.1.0",
|
|
25
|
-
"@coinbase/cdp-core": "^0.0.
|
|
25
|
+
"@coinbase/cdp-core": "^0.0.57"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@testing-library/jest-dom": "^6.6.3",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@size-limit/webpack": "^11.2.0",
|
|
38
38
|
"@size-limit/webpack-why": "^11.2.0",
|
|
39
39
|
"size-limit": "^11.2.0",
|
|
40
|
-
"@coinbase/cdp-core": "^0.0.
|
|
40
|
+
"@coinbase/cdp-core": "^0.0.57"
|
|
41
41
|
},
|
|
42
42
|
"size-limit": [
|
|
43
43
|
{
|