@phantom/browser-sdk 0.1.0 → 0.2.0
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/README.md +10 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -7
- package/dist/index.mjs +4 -7
- package/package.json +11 -6
package/README.md
CHANGED
|
@@ -210,14 +210,22 @@ const result = await sdk.signAndSendTransaction({
|
|
|
210
210
|
});
|
|
211
211
|
```
|
|
212
212
|
|
|
213
|
-
#### signMessage(
|
|
213
|
+
#### signMessage(params)
|
|
214
214
|
|
|
215
215
|
Sign a message string.
|
|
216
216
|
|
|
217
217
|
```typescript
|
|
218
|
-
const signature = await sdk.signMessage(
|
|
218
|
+
const signature = await sdk.signMessage({
|
|
219
|
+
message: "Hello from Phantom!",
|
|
220
|
+
networkId: NetworkId.SOLANA_MAINNET,
|
|
221
|
+
});
|
|
219
222
|
```
|
|
220
223
|
|
|
224
|
+
**Parameters:**
|
|
225
|
+
|
|
226
|
+
- `params.message` (string) - Message to sign
|
|
227
|
+
- `params.networkId` (NetworkId) - Network identifier
|
|
228
|
+
|
|
221
229
|
#### getAddresses()
|
|
222
230
|
|
|
223
231
|
Get connected wallet addresses.
|
package/dist/index.d.ts
CHANGED
|
@@ -88,7 +88,7 @@ declare class BrowserSDK {
|
|
|
88
88
|
* @param networkId - Network identifier
|
|
89
89
|
* @returns Signature string
|
|
90
90
|
*/
|
|
91
|
-
signMessage(
|
|
91
|
+
signMessage(params: SignMessageParams): Promise<string>;
|
|
92
92
|
/**
|
|
93
93
|
* Sign and send a transaction
|
|
94
94
|
* @param params - Transaction parameters with native transaction object
|
package/dist/index.js
CHANGED
|
@@ -535,14 +535,11 @@ var ProviderManager = class {
|
|
|
535
535
|
/**
|
|
536
536
|
* Sign a message using current provider
|
|
537
537
|
*/
|
|
538
|
-
async signMessage(
|
|
538
|
+
async signMessage(params) {
|
|
539
539
|
if (!this.currentProvider) {
|
|
540
540
|
throw new Error("No provider connected");
|
|
541
541
|
}
|
|
542
|
-
return this.currentProvider.signMessage(
|
|
543
|
-
message,
|
|
544
|
-
networkId
|
|
545
|
-
});
|
|
542
|
+
return this.currentProvider.signMessage(params);
|
|
546
543
|
}
|
|
547
544
|
/**
|
|
548
545
|
* Sign and send transaction using current provider
|
|
@@ -737,8 +734,8 @@ var BrowserSDK = class {
|
|
|
737
734
|
* @param networkId - Network identifier
|
|
738
735
|
* @returns Signature string
|
|
739
736
|
*/
|
|
740
|
-
async signMessage(
|
|
741
|
-
return this.providerManager.signMessage(
|
|
737
|
+
async signMessage(params) {
|
|
738
|
+
return this.providerManager.signMessage(params);
|
|
742
739
|
}
|
|
743
740
|
/**
|
|
744
741
|
* Sign and send a transaction
|
package/dist/index.mjs
CHANGED
|
@@ -507,14 +507,11 @@ var ProviderManager = class {
|
|
|
507
507
|
/**
|
|
508
508
|
* Sign a message using current provider
|
|
509
509
|
*/
|
|
510
|
-
async signMessage(
|
|
510
|
+
async signMessage(params) {
|
|
511
511
|
if (!this.currentProvider) {
|
|
512
512
|
throw new Error("No provider connected");
|
|
513
513
|
}
|
|
514
|
-
return this.currentProvider.signMessage(
|
|
515
|
-
message,
|
|
516
|
-
networkId
|
|
517
|
-
});
|
|
514
|
+
return this.currentProvider.signMessage(params);
|
|
518
515
|
}
|
|
519
516
|
/**
|
|
520
517
|
* Sign and send transaction using current provider
|
|
@@ -709,8 +706,8 @@ var BrowserSDK = class {
|
|
|
709
706
|
* @param networkId - Network identifier
|
|
710
707
|
* @returns Signature string
|
|
711
708
|
*/
|
|
712
|
-
async signMessage(
|
|
713
|
-
return this.providerManager.signMessage(
|
|
709
|
+
async signMessage(params) {
|
|
710
|
+
return this.providerManager.signMessage(params);
|
|
714
711
|
}
|
|
715
712
|
/**
|
|
716
713
|
* Sign and send a transaction
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phantom/browser-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Browser SDK for Phantom Wallet with unified interface",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
|
+
"?pack-release": "When https://github.com/changesets/changesets/issues/432 has a solution we can remove this trick",
|
|
20
|
+
"pack-release": "rimraf ./_release && yarn pack && mkdir ./_release && tar zxvf ./package.tgz --directory ./_release && rm ./package.tgz",
|
|
19
21
|
"build": "rimraf ./dist && tsup",
|
|
20
22
|
"dev": "rimraf ./dist && tsup --watch",
|
|
21
23
|
"clean": "rm -rf dist",
|
|
@@ -25,10 +27,10 @@
|
|
|
25
27
|
"prettier": "prettier --write \"src/**/*.{ts,tsx}\""
|
|
26
28
|
},
|
|
27
29
|
"dependencies": {
|
|
28
|
-
"@phantom/api-key-stamper": "
|
|
29
|
-
"@phantom/base64url": "
|
|
30
|
-
"@phantom/browser-injected-sdk": "
|
|
31
|
-
"@phantom/client": "
|
|
30
|
+
"@phantom/api-key-stamper": "^0.1.0",
|
|
31
|
+
"@phantom/base64url": "^0.1.0",
|
|
32
|
+
"@phantom/browser-injected-sdk": "^0.0.9",
|
|
33
|
+
"@phantom/client": "^0.1.0",
|
|
32
34
|
"axios": "^1.10.0",
|
|
33
35
|
"bs58": "^6.0.0",
|
|
34
36
|
"buffer": "^6.0.3",
|
|
@@ -47,5 +49,8 @@
|
|
|
47
49
|
"ts-jest": "^29.1.2",
|
|
48
50
|
"tsup": "^6.7.0",
|
|
49
51
|
"typescript": "^5.0.4"
|
|
52
|
+
},
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"directory": "_release/package"
|
|
50
55
|
}
|
|
51
|
-
}
|
|
56
|
+
}
|