@rarible/aptos-wallet
Advanced tools
Comparing version 0.13.68-fix.24 to 0.13.68-fix.25
@@ -1,2 +0,2 @@ | ||
import type { PendingTransactionResponse, Account as GenericAccount } from "@aptos-labs/ts-sdk"; | ||
import type { Account as GenericAccount } from "@aptos-labs/ts-sdk"; | ||
export interface AptosWalletInterface { | ||
@@ -8,6 +8,10 @@ signMessage(message: string): Promise<string>; | ||
}>; | ||
signAndSubmitTransaction(payload: AptosTransaction): Promise<PendingTransactionResponse>; | ||
signAndSubmitTransaction(payload: AptosTransaction): Promise<{ | ||
hash: string; | ||
}>; | ||
} | ||
export type ExternalAccount = { | ||
signAndSubmitTransaction: (payload: EntryFunctionPayload) => Promise<PendingTransactionResponse>; | ||
signAndSubmitTransaction: (payload: EntryFunctionPayload) => Promise<{ | ||
hash: string; | ||
}>; | ||
signMessage: (payload: SignMessagePayload) => Promise<SignMessageResponse>; | ||
@@ -14,0 +18,0 @@ connect: () => Promise<AccountInfo>; |
export * from "./domain"; | ||
export * from "./common"; | ||
export { AptosGenericSdkWallet } from "./wallets/generic"; | ||
export { AptosSdkWallet } from "./wallets/external"; |
@@ -6,3 +6,2 @@ "use strict"; | ||
tslib_1.__exportStar(require("./domain"), exports); | ||
tslib_1.__exportStar(require("./common"), exports); | ||
var generic_1 = require("./wallets/generic"); | ||
@@ -9,0 +8,0 @@ Object.defineProperty(exports, "AptosGenericSdkWallet", { enumerable: true, get: function () { return generic_1.AptosGenericSdkWallet; } }); |
@@ -5,3 +5,3 @@ import type { AptosTransaction, AptosWalletInterface, ExternalAccount } from "../domain"; | ||
constructor(account: ExternalAccount); | ||
signMessage(msg: string): Promise<string>; | ||
signMessage(msg: string): Promise<any>; | ||
getAccountInfo(): Promise<{ | ||
@@ -12,3 +12,5 @@ address: string; | ||
getPublicKey(): Promise<string>; | ||
signAndSubmitTransaction(payload: AptosTransaction): Promise<import("@aptos-labs/ts-sdk").PendingTransactionResponse>; | ||
signAndSubmitTransaction(payload: AptosTransaction): Promise<{ | ||
hash: string; | ||
}>; | ||
} |
@@ -6,9 +6,6 @@ "use strict"; | ||
const types_1 = require("@rarible/types"); | ||
const common_1 = require("../common"); | ||
const sdk_common_1 = require("@rarible/sdk-common"); | ||
class AptosSdkWallet { | ||
constructor(account) { | ||
this.account = account; | ||
if (!(0, common_1.isExternalAccount)(this.account)) { | ||
throw new Error("Unrecognized wallet"); | ||
} | ||
} | ||
@@ -21,3 +18,6 @@ signMessage(msg) { | ||
}); | ||
return signature; | ||
if (Array.isArray(signature)) { | ||
return signature[0]; | ||
} | ||
return signature.toString(); | ||
}); | ||
@@ -29,3 +29,3 @@ } | ||
return { | ||
address, | ||
address: (0, sdk_common_1.normalizeAddress)(address), | ||
publicKey, | ||
@@ -37,3 +37,3 @@ }; | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
const account = yield this.account.account(); | ||
const account = yield this.getAccountInfo(); | ||
return account.publicKey; | ||
@@ -44,3 +44,3 @@ }); | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
return this.account.signAndSubmitTransaction({ | ||
const { hash } = yield this.account.signAndSubmitTransaction({ | ||
arguments: payload.arguments, | ||
@@ -50,2 +50,3 @@ function: payload.function, | ||
}); | ||
return { hash }; | ||
}); | ||
@@ -52,0 +53,0 @@ } |
@@ -9,7 +9,9 @@ import type { Account as GenericAccount, Aptos } from "@aptos-labs/ts-sdk"; | ||
getAccountInfo(): Promise<{ | ||
address: `0x${string}`; | ||
address: string; | ||
publicKey: string; | ||
}>; | ||
signAndSubmitTransaction(payload: AptosTransaction): Promise<import("@aptos-labs/ts-sdk").PendingTransactionResponse>; | ||
signAndSubmitTransaction(payload: AptosTransaction): Promise<{ | ||
hash: string; | ||
}>; | ||
} | ||
export { GenericAccount }; |
@@ -5,3 +5,3 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const common_1 = require("../common"); | ||
const sdk_common_1 = require("@rarible/sdk-common"); | ||
class AptosGenericSdkWallet { | ||
@@ -11,5 +11,2 @@ constructor(aptos, account) { | ||
this.account = account; | ||
if (!(0, common_1.isGenericAccount)(this.account)) { | ||
throw new Error("Unrecognized wallet"); | ||
} | ||
} | ||
@@ -24,3 +21,3 @@ signMessage(msg) { | ||
return { | ||
address: this.account.accountAddress.toString(), | ||
address: (0, sdk_common_1.normalizeAddress)(this.account.accountAddress.toString()), | ||
publicKey: this.account.publicKey.toString(), | ||
@@ -40,6 +37,7 @@ }; | ||
}); | ||
return this.aptos.signAndSubmitTransaction({ | ||
const { hash } = yield this.aptos.signAndSubmitTransaction({ | ||
signer: this.account, | ||
transaction: tx, | ||
}); | ||
return { hash }; | ||
}); | ||
@@ -46,0 +44,0 @@ } |
{ | ||
"name": "@rarible/aptos-wallet", | ||
"version": "0.13.68-fix.24", | ||
"version": "0.13.68-fix.25", | ||
"keywords": [ | ||
@@ -9,32 +9,57 @@ "solana", | ||
"license": "Apache-2.0", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"exports": { | ||
"./package.json": "./package.json", | ||
"./build/": "./build/", | ||
"./esm/": "./esm/", | ||
".": { | ||
"types": { | ||
"require": "./build/index.d.ts", | ||
"import": "./esm/index.d.ts" | ||
}, | ||
"require": "./build/index.js", | ||
"import": "./esm/index.js", | ||
"default": "./build/index.js" | ||
}, | ||
"./*": { | ||
"types": { | ||
"require": "./build/*.d.ts", | ||
"import": "./esm/*.d.ts" | ||
}, | ||
"require": "./build/*.js", | ||
"import": "./esm/*.js", | ||
"default": "./build/*.js" | ||
} | ||
}, | ||
"main": "./build/index.js", | ||
"module": "./esm/index.js", | ||
"types": "./build/index.d.ts", | ||
"files": [ | ||
"build" | ||
"build", | ||
"umd", | ||
"esm" | ||
], | ||
"scripts": { | ||
"build": "run-s build:*", | ||
"build:esm": "tsc --project tsconfig-build.json", | ||
"build:cjs": "tsc -p tsconfig.cjs.json", | ||
"build:esm": "tsc -p tsconfig.esm.json", | ||
"clean": "run-s clean:*", | ||
"clean:build": "rimraf ./build", | ||
"clean:build": "rimraf ./build ./esm", | ||
"clean:tsbuildinfo": "rimraf ./tsconfig.tsbuildinfo", | ||
"test": "echo \"There's no tests yet\"", | ||
"verify": "tsc --noEmit --project tsconfig-build.json" | ||
"verify": "tsc" | ||
}, | ||
"dependencies": { | ||
"@aptos-labs/ts-sdk": "^1.5.1", | ||
"@rarible/logger": "^0.9.12", | ||
"@rarible/sdk-common": "^0.13.68-fix.24", | ||
"@rarible/types": "~0.9.26", | ||
"@rarible/utils": "~0.9.10", | ||
"node-fetch": "^2.6.7" | ||
"@rarible/sdk-common": "^0.13.68-fix.25", | ||
"@rarible/types": "~0.9.26" | ||
}, | ||
"devDependencies": { | ||
"@types/node-fetch": "^2.6.1", | ||
"aptos": "^1.21.0", | ||
"form-data": "^4.0.0" | ||
}, | ||
"peerDependencies": { | ||
"@aptos-labs/ts-sdk": "^1.5.1", | ||
"@aptos-labs/wallet-adapter-core": "~4.1.2", | ||
"tslib": "^2.3.1" | ||
}, | ||
"peerDependenciesMeta": { | ||
"@aptos-labs/wallet-adapter-core": { | ||
"optional": true | ||
} | ||
}, | ||
"publishConfig": { | ||
@@ -44,3 +69,3 @@ "access": "public", | ||
}, | ||
"gitHead": "c11abca98375da2fc8d10ffc5aa93279e854047a" | ||
"gitHead": "30af304a1d5445ab24d60137ae136b2cdf170a2e" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
181237
5
0
25
523
1
+ Added@aptos-labs/wallet-adapter-core@4.1.3(transitive)
+ Added@aptos-labs/wallet-standard@0.0.11(transitive)
+ Added@atomrigslab/aptos-wallet-adapter@0.1.21(transitive)
+ Added@atomrigslab/dekey-web-wallet-provider@1.2.1(transitive)
+ Added@atomrigslab/providers@1.1.0(transitive)
+ Added@metamask/object-multiplex@1.3.0(transitive)
+ Added@metamask/safe-event-emitter@2.0.0(transitive)
+ Added@noble/hashes@1.3.3(transitive)
+ Added@scure/base@1.1.9(transitive)
+ Added@scure/bip39@1.2.1(transitive)
+ Added@types/chrome@0.0.136(transitive)
+ Added@types/filesystem@0.0.36(transitive)
+ Added@types/filewriter@0.0.33(transitive)
+ Added@types/har-format@1.2.16(transitive)
+ Added@wallet-standard/app@1.1.0(transitive)
+ Added@wallet-standard/base@1.1.0(transitive)
+ Added@wallet-standard/core@1.0.3(transitive)
+ Added@wallet-standard/features@1.1.0(transitive)
+ Added@wallet-standard/wallet@1.1.0(transitive)
+ Addedaptos@1.21.0(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddetect-browser@5.3.0(transitive)
+ Addedeth-rpc-errors@4.0.3(transitive)
+ Addedeventemitter3@4.0.7(transitive)
+ Addedextension-port-stream@2.1.1(transitive)
+ Addedfast-deep-equal@2.0.1(transitive)
+ Addedfast-safe-stringify@2.1.1(transitive)
+ Addedform-data@4.0.0(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedjson-rpc-engine@6.1.0(transitive)
+ Addedjson-rpc-middleware-stream@3.0.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedtweetnacl@1.0.3(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwebextension-polyfill@0.12.00.7.0(transitive)
+ Addedwebextension-polyfill-ts@0.25.0(transitive)
- Removed@aptos-labs/ts-sdk@^1.5.1
- Removed@rarible/logger@^0.9.12
- Removed@rarible/utils@~0.9.10
- Removednode-fetch@^2.6.7
- Removed@rarible/logger@0.9.18(transitive)
- Removed@rarible/utils@0.9.18(transitive)
- Removedbignumber.js@9.1.2(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)