@shapeshiftoss/hdwallet-coinbase 1.55.2 → 1.55.4-alpha.1
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/adapter.js +30 -72
- package/dist/adapter.js.map +1 -1
- package/dist/coinbase.js +184 -295
- package/dist/coinbase.js.map +1 -1
- package/dist/ethereum.js +87 -137
- package/dist/ethereum.js.map +1 -1
- package/dist/index.js +2 -18
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/tsconfig.tsbuildinfo +1 -1
package/dist/ethereum.js
CHANGED
|
@@ -1,45 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.ethSignMessage = exports.ethSignTypedData = exports.ethVerifyMessage = exports.ethSendTx = exports.ethSignTx = exports.ethGetAddress = exports.ethGetAccountPaths = exports.describeETHPath = void 0;
|
|
36
|
-
const core = __importStar(require("@shapeshiftoss/hdwallet-core"));
|
|
37
|
-
const utils_1 = require("ethers/lib/utils");
|
|
38
|
-
function describeETHPath(path) {
|
|
1
|
+
import * as core from "@shapeshiftoss/hdwallet-core";
|
|
2
|
+
import { isHexString } from "ethers/lib/utils";
|
|
3
|
+
export function describeETHPath(path) {
|
|
39
4
|
return core.describeETHPath(path);
|
|
40
5
|
}
|
|
41
|
-
|
|
42
|
-
function ethGetAccountPaths(msg) {
|
|
6
|
+
export function ethGetAccountPaths(msg) {
|
|
43
7
|
const slip44 = core.slip44ByCoin(msg.coin);
|
|
44
8
|
if (slip44 === undefined)
|
|
45
9
|
return [];
|
|
@@ -52,109 +16,95 @@ function ethGetAccountPaths(msg) {
|
|
|
52
16
|
},
|
|
53
17
|
];
|
|
54
18
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
19
|
+
export async function ethGetAddress(ethereum) {
|
|
20
|
+
if (!(ethereum && ethereum.request)) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
const ethAccounts = await ethereum.request({
|
|
25
|
+
method: "eth_accounts",
|
|
26
|
+
});
|
|
27
|
+
return ethAccounts[0];
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.error(error);
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
72
33
|
}
|
|
73
|
-
exports.ethGetAddress = ethGetAddress;
|
|
74
34
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
75
|
-
function ethSignTx(msg, ethereum, from) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return null;
|
|
79
|
-
});
|
|
35
|
+
export async function ethSignTx(msg, ethereum, from) {
|
|
36
|
+
console.error("Method ethSignTx unsupported for Coinbase wallet");
|
|
37
|
+
return null;
|
|
80
38
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
39
|
+
export async function ethSendTx(msg, ethereum, from) {
|
|
40
|
+
try {
|
|
41
|
+
const utxBase = {
|
|
42
|
+
from: from,
|
|
43
|
+
to: msg.to,
|
|
44
|
+
value: msg.value,
|
|
45
|
+
data: msg.data,
|
|
46
|
+
chainId: msg.chainId,
|
|
47
|
+
nonce: msg.nonce,
|
|
48
|
+
gas: msg.gasLimit,
|
|
49
|
+
};
|
|
50
|
+
const utx = msg.maxFeePerGas
|
|
51
|
+
? {
|
|
52
|
+
...utxBase,
|
|
53
|
+
maxFeePerGas: msg.maxFeePerGas,
|
|
54
|
+
maxPriorityFeePerGas: msg.maxPriorityFeePerGas,
|
|
55
|
+
}
|
|
56
|
+
: { ...utxBase, gasPrice: msg.gasPrice };
|
|
57
|
+
const signedTx = await ethereum.request({
|
|
58
|
+
method: "eth_sendTransaction",
|
|
59
|
+
params: [utx],
|
|
60
|
+
});
|
|
61
|
+
return {
|
|
62
|
+
hash: signedTx,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
console.error(error);
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
109
69
|
}
|
|
110
|
-
exports.ethSendTx = ethSendTx;
|
|
111
70
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
112
|
-
function ethVerifyMessage(msg, ethereum) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return null;
|
|
116
|
-
});
|
|
71
|
+
export async function ethVerifyMessage(msg, ethereum) {
|
|
72
|
+
console.error("Method ethVerifyMessage unsupported for Coinbase wallet!");
|
|
73
|
+
return null;
|
|
117
74
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
});
|
|
75
|
+
export async function ethSignTypedData(msg, ethereum, address) {
|
|
76
|
+
try {
|
|
77
|
+
const signedMsg = await ethereum.request({
|
|
78
|
+
method: "eth_signTypedData_v4",
|
|
79
|
+
params: [address, JSON.stringify(msg.typedData)],
|
|
80
|
+
from: address,
|
|
81
|
+
});
|
|
82
|
+
return {
|
|
83
|
+
address: address,
|
|
84
|
+
signature: signedMsg,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
console.error(error);
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
137
91
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
return null;
|
|
156
|
-
}
|
|
157
|
-
});
|
|
92
|
+
export async function ethSignMessage(msg, ethereum, address) {
|
|
93
|
+
try {
|
|
94
|
+
if (!isHexString(msg.message))
|
|
95
|
+
throw new Error("data is not an hex string");
|
|
96
|
+
const signedMsg = await ethereum.request({
|
|
97
|
+
method: "personal_sign",
|
|
98
|
+
params: [msg, address],
|
|
99
|
+
});
|
|
100
|
+
return {
|
|
101
|
+
address: address,
|
|
102
|
+
signature: signedMsg,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
console.error(error);
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
158
109
|
}
|
|
159
|
-
exports.ethSignMessage = ethSignMessage;
|
|
160
110
|
//# sourceMappingURL=ethereum.js.map
|
package/dist/ethereum.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ethereum.js","sourceRoot":"","sources":["../src/ethereum.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ethereum.js","sourceRoot":"","sources":["../src/ethereum.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,8BAA8B,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,UAAU,eAAe,CAAC,IAAoB;IAClD,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,GAA2B;IAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,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SACd,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,SAAS;SACD,CAAC;IACxB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,GAAwB,EACxB,QAAa,EACb,OAAe;IAEf,IAAI,CAAC;QACH,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC5E,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC;YACvC,MAAM,EAAE,eAAe;YACvB,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC;SACvB,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,SAAS;SACD,CAAC;IACxB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./adapter"), exports);
|
|
18
|
-
__exportStar(require("./coinbase"), exports);
|
|
1
|
+
export * from "./adapter";
|
|
2
|
+
export * from "./coinbase";
|
|
19
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapeshiftoss/hdwallet-coinbase",
|
|
3
|
-
"version": "1.55.
|
|
3
|
+
"version": "1.55.4-alpha.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@coinbase/wallet-sdk": "^3.6.6",
|
|
18
|
-
"@shapeshiftoss/hdwallet-core": "1.55.
|
|
18
|
+
"@shapeshiftoss/hdwallet-core": "^1.55.4-alpha.1",
|
|
19
19
|
"eth-rpc-errors": "^4.0.3",
|
|
20
20
|
"lodash": "^4.17.21"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/lodash": "^4.14.168"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "d53f2770ee5def052ea44385216063c43a2de777"
|
|
26
26
|
}
|