@open-wallet-standard/core 0.4.2 → 0.4.3
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 +2 -2
- package/index.d.ts +25 -0
- package/index.js +8 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -7,9 +7,9 @@ Secure signing and wallet management for every chain. One vault, one interface
|
|
|
7
7
|
|
|
8
8
|
## Why OWS
|
|
9
9
|
|
|
10
|
-
- **Zero key exposure.** Private keys are encrypted at rest, decrypted only
|
|
10
|
+
- **Zero key exposure.** Private keys are encrypted at rest, decrypted only after policy checks pass, then immediately wiped from memory. Agents authenticate with scoped API tokens and never see raw key material.
|
|
11
11
|
- **Every chain, one interface.** EVM, Solana, Sui, Bitcoin, Cosmos, Tron, TON — all first-class. CAIP-2/CAIP-10 addressing abstracts away chain-specific details.
|
|
12
|
-
- **Policy before signing.** A pre-signing policy engine gates
|
|
12
|
+
- **Policy before signing.** A pre-signing policy engine gates agent (API key) operations — chain allowlists, expiry, and optional custom executables — before any key is touched.
|
|
13
13
|
- **Built for agents.** MCP server, native SDK, and CLI. A wallet created by one tool works in every other.
|
|
14
14
|
|
|
15
15
|
## Install
|
package/index.d.ts
CHANGED
|
@@ -60,5 +60,30 @@ export declare function signTransaction(wallet: string, chain: string, txHex: st
|
|
|
60
60
|
export declare function signMessage(wallet: string, chain: string, message: string, passphrase?: string | undefined | null, encoding?: string | undefined | null, index?: number | undefined | null, vaultPathOpt?: string | undefined | null): SignResult
|
|
61
61
|
/** Sign EIP-712 typed structured data (EVM only). Returns hex-encoded signature. */
|
|
62
62
|
export declare function signTypedData(wallet: string, chain: string, typedDataJson: string, passphrase?: string | undefined | null, index?: number | undefined | null, vaultPathOpt?: string | undefined | null): SignResult
|
|
63
|
+
/** Register a policy from a JSON string. */
|
|
64
|
+
export declare function createPolicy(policyJson: string, vaultPathOpt?: string | undefined | null): void
|
|
65
|
+
/** List all registered policies. */
|
|
66
|
+
export declare function listPolicies(vaultPathOpt?: string | undefined | null): Array<any>
|
|
67
|
+
/** Get a single policy by ID. */
|
|
68
|
+
export declare function getPolicy(id: string, vaultPathOpt?: string | undefined | null): any
|
|
69
|
+
/** Delete a policy by ID. */
|
|
70
|
+
export declare function deletePolicy(id: string, vaultPathOpt?: string | undefined | null): void
|
|
71
|
+
/** API key creation result. */
|
|
72
|
+
export interface ApiKeyResult {
|
|
73
|
+
/** The raw token (shown once — caller must save it). */
|
|
74
|
+
token: string
|
|
75
|
+
/** The key file ID. */
|
|
76
|
+
id: string
|
|
77
|
+
name: string
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Create an API key for agent access to wallets.
|
|
81
|
+
* Returns the raw token (shown once) and key metadata.
|
|
82
|
+
*/
|
|
83
|
+
export declare function createApiKey(name: string, walletIds: Array<string>, policyIds: Array<string>, passphrase: string, expiresAt?: string | undefined | null, vaultPathOpt?: string | undefined | null): ApiKeyResult
|
|
84
|
+
/** List all API keys (tokens are never returned). */
|
|
85
|
+
export declare function listApiKeys(vaultPathOpt?: string | undefined | null): Array<any>
|
|
86
|
+
/** Revoke (delete) an API key by ID. */
|
|
87
|
+
export declare function revokeApiKey(id: string, vaultPathOpt?: string | undefined | null): void
|
|
63
88
|
/** Sign and broadcast a transaction. Returns the transaction hash. */
|
|
64
89
|
export declare function signAndSend(wallet: string, chain: string, txHex: string, passphrase?: string | undefined | null, index?: number | undefined | null, rpcUrl?: string | undefined | null, vaultPathOpt?: string | undefined | null): SendResult
|
package/index.js
CHANGED
|
@@ -310,7 +310,7 @@ if (!nativeBinding) {
|
|
|
310
310
|
throw new Error(`Failed to load native binding`)
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
const { generateMnemonic, deriveAddress, createWallet, importWalletMnemonic, importWalletPrivateKey, listWallets, getWallet, deleteWallet, exportWallet, renameWallet, signTransaction, signMessage, signTypedData, signAndSend } = nativeBinding
|
|
313
|
+
const { generateMnemonic, deriveAddress, createWallet, importWalletMnemonic, importWalletPrivateKey, listWallets, getWallet, deleteWallet, exportWallet, renameWallet, signTransaction, signMessage, signTypedData, createPolicy, listPolicies, getPolicy, deletePolicy, createApiKey, listApiKeys, revokeApiKey, signAndSend } = nativeBinding
|
|
314
314
|
|
|
315
315
|
module.exports.generateMnemonic = generateMnemonic
|
|
316
316
|
module.exports.deriveAddress = deriveAddress
|
|
@@ -325,4 +325,11 @@ module.exports.renameWallet = renameWallet
|
|
|
325
325
|
module.exports.signTransaction = signTransaction
|
|
326
326
|
module.exports.signMessage = signMessage
|
|
327
327
|
module.exports.signTypedData = signTypedData
|
|
328
|
+
module.exports.createPolicy = createPolicy
|
|
329
|
+
module.exports.listPolicies = listPolicies
|
|
330
|
+
module.exports.getPolicy = getPolicy
|
|
331
|
+
module.exports.deletePolicy = deletePolicy
|
|
332
|
+
module.exports.createApiKey = createApiKey
|
|
333
|
+
module.exports.listApiKeys = listApiKeys
|
|
334
|
+
module.exports.revokeApiKey = revokeApiKey
|
|
328
335
|
module.exports.signAndSend = signAndSend
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-wallet-standard/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "Node.js native bindings for the Open Wallet Standard",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"@napi-rs/cli": "^2.18.0"
|
|
32
32
|
},
|
|
33
33
|
"optionalDependencies": {
|
|
34
|
-
"@open-wallet-standard/core-linux-x64-gnu": "0.4.
|
|
35
|
-
"@open-wallet-standard/core-linux-arm64-gnu": "0.4.
|
|
36
|
-
"@open-wallet-standard/core-darwin-x64": "0.4.
|
|
37
|
-
"@open-wallet-standard/core-darwin-arm64": "0.4.
|
|
34
|
+
"@open-wallet-standard/core-linux-x64-gnu": "0.4.3",
|
|
35
|
+
"@open-wallet-standard/core-linux-arm64-gnu": "0.4.3",
|
|
36
|
+
"@open-wallet-standard/core-darwin-x64": "0.4.3",
|
|
37
|
+
"@open-wallet-standard/core-darwin-arm64": "0.4.3"
|
|
38
38
|
},
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"files": [
|