@phantom/server-sdk 1.0.0-beta.22 → 1.0.0-beta.24
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/index.js +14 -11
- package/dist/index.mjs +14 -11
- package/package.json +12 -7
package/dist/index.js
CHANGED
|
@@ -58,8 +58,13 @@ var import_bs58 = __toESM(require("bs58"));
|
|
|
58
58
|
// package.json
|
|
59
59
|
var package_default = {
|
|
60
60
|
name: "@phantom/server-sdk",
|
|
61
|
-
version: "1.0.0-beta.
|
|
61
|
+
version: "1.0.0-beta.24",
|
|
62
62
|
description: "Server SDK for Phantom Wallet",
|
|
63
|
+
repository: {
|
|
64
|
+
type: "git",
|
|
65
|
+
url: "https://github.com/phantom/phantom-connect-sdk",
|
|
66
|
+
directory: "packages/server-sdk"
|
|
67
|
+
},
|
|
63
68
|
main: "dist/index.js",
|
|
64
69
|
module: "dist/index.mjs",
|
|
65
70
|
types: "dist/index.d.ts",
|
|
@@ -146,7 +151,8 @@ var ServerSDK = class {
|
|
|
146
151
|
{
|
|
147
152
|
apiBaseUrl: config.apiBaseUrl || import_constants.DEFAULT_WALLET_API_URL,
|
|
148
153
|
organizationId: config.organizationId,
|
|
149
|
-
headers
|
|
154
|
+
headers,
|
|
155
|
+
walletType: "server-wallet"
|
|
150
156
|
},
|
|
151
157
|
stamper
|
|
152
158
|
);
|
|
@@ -158,14 +164,10 @@ var ServerSDK = class {
|
|
|
158
164
|
* @returns Promise<ParsedSignatureResult> - Parsed signature with explorer URL
|
|
159
165
|
*/
|
|
160
166
|
async signMessage(params) {
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
networkId: params.networkId,
|
|
166
|
-
derivationIndex: params.derivationIndex
|
|
167
|
-
};
|
|
168
|
-
const rawResponse = (0, import_utils.isEthereumChain)(params.networkId) ? await this.client.ethereumSignMessage(signMessageParams) : await this.client.signRawPayload(signMessageParams);
|
|
167
|
+
const rawResponse = (0, import_utils.isEthereumChain)(params.networkId) ? await this.client.ethereumSignMessage({
|
|
168
|
+
...params,
|
|
169
|
+
message: (0, import_base64url.stringToBase64url)(params.message)
|
|
170
|
+
}) : await this.client.signUtf8Message(params);
|
|
169
171
|
return (0, import_parsers.parseSignMessageResponse)(rawResponse, params.networkId);
|
|
170
172
|
}
|
|
171
173
|
/**
|
|
@@ -214,7 +216,8 @@ var ServerSDK = class {
|
|
|
214
216
|
{
|
|
215
217
|
apiBaseUrl: this.config.apiBaseUrl || import_constants.DEFAULT_WALLET_API_URL,
|
|
216
218
|
organizationId: this.config.organizationId,
|
|
217
|
-
headers
|
|
219
|
+
headers,
|
|
220
|
+
walletType: "server-wallet"
|
|
218
221
|
},
|
|
219
222
|
new import_api_key_stamper.ApiKeyStamper({
|
|
220
223
|
apiSecretKey: keyPair.secretKey
|
package/dist/index.mjs
CHANGED
|
@@ -11,8 +11,13 @@ import bs58 from "bs58";
|
|
|
11
11
|
// package.json
|
|
12
12
|
var package_default = {
|
|
13
13
|
name: "@phantom/server-sdk",
|
|
14
|
-
version: "1.0.0-beta.
|
|
14
|
+
version: "1.0.0-beta.24",
|
|
15
15
|
description: "Server SDK for Phantom Wallet",
|
|
16
|
+
repository: {
|
|
17
|
+
type: "git",
|
|
18
|
+
url: "https://github.com/phantom/phantom-connect-sdk",
|
|
19
|
+
directory: "packages/server-sdk"
|
|
20
|
+
},
|
|
16
21
|
main: "dist/index.js",
|
|
17
22
|
module: "dist/index.mjs",
|
|
18
23
|
types: "dist/index.d.ts",
|
|
@@ -118,7 +123,8 @@ var ServerSDK = class {
|
|
|
118
123
|
{
|
|
119
124
|
apiBaseUrl: config.apiBaseUrl || DEFAULT_WALLET_API_URL,
|
|
120
125
|
organizationId: config.organizationId,
|
|
121
|
-
headers
|
|
126
|
+
headers,
|
|
127
|
+
walletType: "server-wallet"
|
|
122
128
|
},
|
|
123
129
|
stamper
|
|
124
130
|
);
|
|
@@ -130,14 +136,10 @@ var ServerSDK = class {
|
|
|
130
136
|
* @returns Promise<ParsedSignatureResult> - Parsed signature with explorer URL
|
|
131
137
|
*/
|
|
132
138
|
async signMessage(params) {
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
networkId: params.networkId,
|
|
138
|
-
derivationIndex: params.derivationIndex
|
|
139
|
-
};
|
|
140
|
-
const rawResponse = isEthereumChain(params.networkId) ? await this.client.ethereumSignMessage(signMessageParams) : await this.client.signRawPayload(signMessageParams);
|
|
139
|
+
const rawResponse = isEthereumChain(params.networkId) ? await this.client.ethereumSignMessage({
|
|
140
|
+
...params,
|
|
141
|
+
message: stringToBase64url(params.message)
|
|
142
|
+
}) : await this.client.signUtf8Message(params);
|
|
141
143
|
return parseSignMessageResponse(rawResponse, params.networkId);
|
|
142
144
|
}
|
|
143
145
|
/**
|
|
@@ -186,7 +188,8 @@ var ServerSDK = class {
|
|
|
186
188
|
{
|
|
187
189
|
apiBaseUrl: this.config.apiBaseUrl || DEFAULT_WALLET_API_URL,
|
|
188
190
|
organizationId: this.config.organizationId,
|
|
189
|
-
headers
|
|
191
|
+
headers,
|
|
192
|
+
walletType: "server-wallet"
|
|
190
193
|
},
|
|
191
194
|
new ApiKeyStamper({
|
|
192
195
|
apiSecretKey: keyPair.secretKey
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phantom/server-sdk",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.24",
|
|
4
4
|
"description": "Server SDK for Phantom Wallet",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/phantom/phantom-connect-sdk",
|
|
8
|
+
"directory": "packages/server-sdk"
|
|
9
|
+
},
|
|
5
10
|
"main": "dist/index.js",
|
|
6
11
|
"module": "dist/index.mjs",
|
|
7
12
|
"types": "dist/index.d.ts",
|
|
@@ -37,12 +42,12 @@
|
|
|
37
42
|
"typescript": "^5.0.4"
|
|
38
43
|
},
|
|
39
44
|
"dependencies": {
|
|
40
|
-
"@phantom/api-key-stamper": "^1.0.0-beta.
|
|
41
|
-
"@phantom/base64url": "^1.0.0-beta.
|
|
42
|
-
"@phantom/client": "^1.0.0-beta.
|
|
43
|
-
"@phantom/constants": "^1.0.0-beta.
|
|
44
|
-
"@phantom/parsers": "^1.0.0-beta.
|
|
45
|
-
"@phantom/utils": "^1.0.0-beta.
|
|
45
|
+
"@phantom/api-key-stamper": "^1.0.0-beta.12",
|
|
46
|
+
"@phantom/base64url": "^1.0.0-beta.12",
|
|
47
|
+
"@phantom/client": "^1.0.0-beta.24",
|
|
48
|
+
"@phantom/constants": "^1.0.0-beta.12",
|
|
49
|
+
"@phantom/parsers": "^1.0.0-beta.12",
|
|
50
|
+
"@phantom/utils": "^1.0.0-beta.24",
|
|
46
51
|
"bs58": "^6.0.0"
|
|
47
52
|
},
|
|
48
53
|
"files": [
|