@suilend/sui-fe 0.3.48 → 0.3.49

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/lib/keypair.d.ts CHANGED
@@ -16,9 +16,7 @@ export type LastSignedTransaction<T> = {
16
16
  export declare const checkLastTransactionSignature: <T>(type: T, lastCurrentFlowTransaction: SuiTransactionBlockResponse | undefined, lastSignedTransaction: LastSignedTransaction<T> | undefined, setLastSignedTransaction: (value: LastSignedTransaction<T> | undefined) => void, suiClient: SuiClient, validCallback: (res: SuiTransactionBlockResponse) => Promise<void>, invalidCallback: () => Promise<void>) => Promise<void>;
17
17
  export declare const onSign: <T>(type: T, setLastSignedTransaction: (value: LastSignedTransaction<T> | undefined) => void, index?: number) => (signedTransaction: SignatureWithBytes) => void;
18
18
  export declare const KEYPAIR_SEED_MESSAGE = "send:wallet-connect";
19
- export declare const createKeypair: (signPersonalMessage: (message: Uint8Array) => Promise<{
20
- signature: string;
21
- }>) => Promise<{
19
+ export declare const createKeypair: (signature: string) => Promise<{
22
20
  keypair: Ed25519Keypair;
23
21
  address: string;
24
22
  privateKey: string;
package/lib/keypair.js CHANGED
@@ -19,6 +19,7 @@ const utils_1 = require("@mysten/sui/utils");
19
19
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
20
20
  const coinType_1 = require("./coinType");
21
21
  const transactions_2 = require("./transactions");
22
+ const constants_1 = require("./constants");
22
23
  // SIGN, EXECUTE, AND WAIT FOR
23
24
  class TransactionStatusError extends Error {
24
25
  constructor(message) {
@@ -108,15 +109,21 @@ const onSign = (type, setLastSignedTransaction, index) => {
108
109
  exports.onSign = onSign;
109
110
  // CREATE KEYPAIR
110
111
  exports.KEYPAIR_SEED_MESSAGE = "send:wallet-connect";
111
- const createKeypair = (signPersonalMessage) => __awaiter(void 0, void 0, void 0, function* () {
112
- const message = Buffer.from(exports.KEYPAIR_SEED_MESSAGE);
113
- const { signature } = yield signPersonalMessage(message);
112
+ const createKeypair = (signature) => __awaiter(void 0, void 0, void 0, function* () {
114
113
  const signatureBytes = (0, utils_1.fromBase64)(signature);
115
114
  const signatureHex = (0, utils_1.toHex)(signatureBytes);
116
115
  const keypair = ed25519_1.Ed25519Keypair.deriveKeypairFromSeed(signatureHex);
117
116
  const address = keypair.toSuiAddress();
118
117
  const privateKey = keypair.getSecretKey();
119
118
  console.log("[createKeypair] keypair:", keypair, "address:", address);
119
+ yield fetch(`${constants_1.API_URL}/steamm/proxy-wallet-mapping`, {
120
+ method: "POST",
121
+ body: JSON.stringify({
122
+ proxyWalletAddress: address,
123
+ ownerAddress: "<user's connected wallet address>",
124
+ signature: "<the signature from signPersonalMessage>",
125
+ }),
126
+ });
120
127
  return { keypair, address, privateKey };
121
128
  });
122
129
  exports.createKeypair = createKeypair;
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@suilend/sui-fe","version":"0.3.48","private":false,"description":"A collection of TypeScript frontend libraries","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./lib/api":"./lib/api.js","./lib/coin":"./lib/coin.js","./lib/coinMetadata":"./lib/coinMetadata.js","./lib/coinType":"./lib/coinType.js","./lib/constants":"./lib/constants.js","./lib/format":"./lib/format.js","./lib":"./lib/index.js","./lib/indexedDB":"./lib/indexedDB.js","./lib/keypair":"./lib/keypair.js","./lib/ledger":"./lib/ledger.js","./lib/msafe":"./lib/msafe.js","./lib/transactions":"./lib/transactions.js"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix \"./src/**/*.ts\"","prettier":"prettier --write \"./src/**/*\"","lint":"bun eslint && bun prettier && bun tsc --noEmit","release":"bun run build && bun ts-node ./release.ts && cd ./dist && npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/suilend/sui-fe.git"},"bugs":{"url":"https://github.com/suilend/sui-fe/issues"},"dependencies":{"@mysten/wallet-standard":"0.19.2","bignumber.js":"^9.1.2","blake2b":"^2.1.4","lodash":"^4.17.21","p-limit":"3.1.0"},"devDependencies":{"@tsconfig/recommended":"^1.0.8","@types/blake2b":"^2.1.3","@types/lodash":"^4.17.13","@types/node":"^22.9.0","@typescript-eslint/eslint-plugin":"^8.14.0","@typescript-eslint/parser":"^8.14.0","eslint":"^9.14.0","eslint-config-prettier":"^9.1.0","eslint-plugin-import":"^2.31.0","eslint-plugin-prettier":"^5.2.1","prettier":"^3.3.3","ts-node":"^10.9.2","typescript":"^5.6.3"},"peerDependencies":{"@mysten/sui":"1.42.0"}}
1
+ {"name":"@suilend/sui-fe","version":"0.3.49","private":false,"description":"A collection of TypeScript frontend libraries","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./lib/api":"./lib/api.js","./lib/coin":"./lib/coin.js","./lib/coinMetadata":"./lib/coinMetadata.js","./lib/coinType":"./lib/coinType.js","./lib/constants":"./lib/constants.js","./lib/format":"./lib/format.js","./lib":"./lib/index.js","./lib/indexedDB":"./lib/indexedDB.js","./lib/keypair":"./lib/keypair.js","./lib/ledger":"./lib/ledger.js","./lib/msafe":"./lib/msafe.js","./lib/transactions":"./lib/transactions.js"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix \"./src/**/*.ts\"","prettier":"prettier --write \"./src/**/*\"","lint":"bun eslint && bun prettier && bun tsc --noEmit","release":"bun run build && bun ts-node ./release.ts && cd ./dist && npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/suilend/sui-fe.git"},"bugs":{"url":"https://github.com/suilend/sui-fe/issues"},"dependencies":{"@mysten/wallet-standard":"0.19.2","bignumber.js":"^9.1.2","blake2b":"^2.1.4","lodash":"^4.17.21","p-limit":"3.1.0"},"devDependencies":{"@tsconfig/recommended":"^1.0.8","@types/blake2b":"^2.1.3","@types/lodash":"^4.17.13","@types/node":"^22.9.0","@typescript-eslint/eslint-plugin":"^8.14.0","@typescript-eslint/parser":"^8.14.0","eslint":"^9.14.0","eslint-config-prettier":"^9.1.0","eslint-plugin-import":"^2.31.0","eslint-plugin-prettier":"^5.2.1","prettier":"^3.3.3","ts-node":"^10.9.2","typescript":"^5.6.3"},"peerDependencies":{"@mysten/sui":"1.42.0"}}