SDK for interacting with Salt's MPC self custody & treasury
npm install salt-sdkTypeScript client for Salt, an open MPC self-custodial infrastructure for organisations. With Salt, anyone can spin up a system of self-sovereignty for self-custodial wealth management, including delegations to 3rd parties such as asset managers, robo-advisors or agents.
You will need an existing Salt organisation to make use of the SDK. Visit https://testnet.salt.space to set up a test account.
``typescript
import { Salt, TransferType } from 'salt-sdk';
import { Wallet, ethers } from 'ethers';
// Create an instance of Salt SDK - https://developer.salt.space/sdk/classes/Salt.html#constructor
const salt = new Salt({
environment: 'TESTNET',
});
// Substitute this with a proper signer creation
const signer = Wallet.createRandom();
// Authenticate with SIWE - https://developer.salt.space/sdk/classes/Salt.html#authenticate
await salt.authenticate(signer);
// Transfer funds - https://developer.salt.space/sdk/classes/Salt.html#submitTx
await salt.submitTx({
accountId: '0123456', // Salt account ID - https://developer.salt.space/classes/Salt.html#getAccounts
to: '0x000000000000000000000000000000000000dEaD',
value: '1',
chainId: 1,
signer: signer,
sendingProvider: new ethers.providers.StaticJsonRpcProvider({
url: 'ADD_RPC_URL' || '',
skipFetchSetup: true,
}),
});
``
Examples and a full list of available functionality are available at https://developer.salt.space/sdk.
See ARCHITECTURE.md for more details.