GlacierClient
The GlacierClient
class is a class that allows for making Connections to Glacier
.
constructor
Type
interface WalletOptions {
privateKey?: string
provider?: any
}
class GlacierClient {
constructor(endpoint: string, options?: WalletOptions)
}
Details
endpoint
- Glacier service addressprivateKey
- Ethereum wallet private keyprovider
- Ethereum wallet provider
Example
const client = new GlacierClient('https://p0.onebitdev.com/glacier-gateway', {
provider: window.ethereum
})
Methods
namespace
Returns a reference to a Glacier Namespace.
Type
class GlacierClient {
namespace(name: string): Namespace
}
namespaces
Fetch all namespaces of an account under the current client.
Type
interface NamespaceRecord {
owner: string
network: string
namespace: string
sqpId: number
dataset: string[]
createdAt: number
updatedAt: number
}
class GlacierClient {
namespaces(owner: string): Promise<NamespaceRecord[]>
}
createNamespace
Create a new namespace with the specified name.
Type
interface InsertResult {
insertedId: string
}
class GlacierClient {
createNamespace(name: string): Promise<InsertResult>
}