0.2.0-alpha.22 • Published 2 years ago
@snowballtools/snowball-ts-sdk v0.2.0-alpha.22
Snowball TS SDK
This is a simple library to authenticate with the Snowball SDK
Installation
npm i @snowballtools/snowball-ts-sdk
yarn add @snowballtools/snowball-ts-sdk
Usage
import {
Snowball,
CHAINS,
AuthProvider,
SmartWalletProvider,
AlchemySmartWalletProviderKey,
} from "@snowballtools/snowball-ts-sdk";
import {
ALCHEMY_GOERLI_API_KEY,
ALCHEMY_GOERLI_GAS_POLICY_ID,
ALCHEMY_SEPOLIA_API_KEY,
ALCHEMY_SEPOLIA_GAS_POLICY_ID,
} from "./env";
export const snowball = new Snowball(
"snowball-api-key",
CHAINS.goerli,
{
name: AuthProvider.lit,
},
{
name: SmartWalletProvider.alchemy,
apiKeys: {
[AlchemySmartWalletProviderKey.goerli]: ALCHEMY_GOERLI_API_KEY,
[AlchemySmartWalletProviderKey.goerli_gasPolicyId]:
ALCHEMY_GOERLI_GAS_POLICY_ID,
[AlchemySmartWalletProviderKey.sepolia]: ALCHEMY_SEPOLIA_API_KEY,
[AlchemySmartWalletProviderKey.sepolia_gasPolicyId]:
ALCHEMY_SEPOLIA_GAS_POLICY_ID,
},
}
);
Methods
register(username: string): Promise<void>; // passkey
authenticate(): Promise<void>; // passkey
getEthersWallet(): Promise<PKPEthersWallet>;
changeChain(chain: Chain): void;
sendUserOperation(targetAddress: Address, data: Address, sponsorGas: Boolean): Promise<{ hash: string; }>
getAddress(): Promise<Address>; // smart wallet (incl counterfactual)
waitForUserOperationTransaction(hash: Hash): Promise<Hash>;
getUserOperationByHash(hash: Hash): Promise<UserOperationResponse>;
getUserOperationReceipt(hash: Hash): Promise<UserOperationReceipt>;
Docs
0.2.0-alpha.22
2 years ago
0.2.0-alpha.21
2 years ago
0.2.0-alpha.20
2 years ago
0.2.0-alpha.19
2 years ago
0.2.0-alpha.18
2 years ago
0.2.0-alpha.17
2 years ago
0.2.0-alpha.16
2 years ago
0.2.0-alpha.15
2 years ago
0.2.0-alpha.14
2 years ago
0.2.0-alpha.13
2 years ago
0.2.0-alpha.12
2 years ago
0.2.0-alpha.11
2 years ago
0.2.0-alpha.10
2 years ago
0.2.0-alpha.9
2 years ago
0.2.0-alpha.8
2 years ago
0.2.0-alpha.7
2 years ago
0.2.0-alpha.6
2 years ago
0.2.0-alpha.5
2 years ago
0.2.0-alpha.4
2 years ago
0.2.0-alpha.3
2 years ago
0.2.0-alpha.2
2 years ago
0.2.0-alpha.1
2 years ago
0.2.0
2 years ago
0.1.9-alpha.4
2 years ago
0.1.9-alpha.3
2 years ago
0.1.9-alpha.2
2 years ago
0.1.9-alpha.1
2 years ago
0.1.9
2 years ago
0.1.8
2 years ago
0.1.7
2 years ago
0.1.6
2 years ago
0.1.5
2 years ago
0.1.4
2 years ago
0.1.3
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago