Appearance
SkcCms
SkcCms
class provides functionalities to interact with the CMS, including CRUD operations, file uploads, and Ethereum transaction signing. It implements the following interfaces: Database
, Signer
, FileServer
, ARSGateway
, MPGateway
, and Notifications
.
Creating Instances
new SkcCms( baseUrl: string
)
Creates a new instance of SkcCms
, enabling interaction with the CMS for data management and on-chain operations.
Properties
skcCms.baseUrl
⇒string
The base URL of the CMS.
Instance Methods
skcCms.login ( options: SkcCmsConnectOptions
)
Logs in to the CMS using API keys or credentials, retrieves the user, and sets up the provider for Ethereum interactions.
skcCms.withOffset ( offset: string
)
Sets an offset value for single-use Ethereum public key generation.
skcCms.create ( collectionName: string
, data: any
)
Creates a new record in the specified CMS collection.
skcCms.read ( collectionName: string
, query?: string
) ⇒ Promise<any>
Retrieves records from the specified CMS collection with optional query parameters.
skcCms.update ( collectionName: string
, updateData: Popcode
| Dlpc
| Skucode
, id?: string
)
Updates an existing record in the CMS collection by ID.
skcCms.delete ( collectionName: string
, id: string
)
Deletes a record from the CMS collection by ID.
skcCms.upload ( description: string
, filePath: string
, fileType: string
)
Uploads a file to the CMS with a description and file type.
skcCms.download ( accessToken: string
, cId: string
)
Downloads a file from the CMS using an access token and content ID.
skcCms.connect ( provider: Provider
) ⇒ this
Connects the CMS to an Ethereum provider and returns a Signer
instance.
skcCms.getAddress () ⇒ Promise<string
>
Returns the Ethereum address for the user.
skcCms.getNonce ( blockTag?: BlockTag
) ⇒ Promise<number
>
Returns the nonce for the Ethereum address associated with the user.
skcCms.populateCall ( tx: TransactionRequest
) ⇒ Promise<TransactionLike
<string>>
Populates a transaction request object for on-chain interactions.
skcCms.call ( tx: TransactionRequest
) ⇒ Promise<string
>
Performs a transaction call using the CMS provider.
skcCms.estimateGas ( tx: TransactionRequest
) ⇒ Promise<bigint
>
Estimates the gas required for a transaction.
skcCms.resolveName ( name: string
) ⇒ Promise<null | string>
Resolves an ENS name to an Ethereum address.
skcCms.sendTransaction ( tx: TransactionRequest
) ⇒ Promise<TransactionResponse
>
Sends a transaction to the Ethereum network using the CMS provider.
skcCms.signTypedData ( domain: TypedDataDomain
, types: Record<string, Array<TypedDataField
>, value: Record<string, any>) ⇒ Promise<string
>
Signs typed data (EIP-712) using the EthereumSigns typed data (EIP-712) using the Ethereum wallet. wallet.
skcCms.signTransaction ( txData: TransactionRequest
) ⇒ Promise<string
>
Signs a transaction using the CMS KMS.
skcCms.signMessage ( message: any
, offset?: string
| "" ) ⇒ Promise<string
>
Signs a message with the Ethereum wallet using ECDSA.
skcCms.register ( popcodeId: string
, dId: string
, salt: string
) ⇒ Promise<any>
Registers an asset with the CMS Address Resolution Service (ARS) by Popcode ID, dId, and salt.
skcCms.batchResolve ( assetId: string
, addresses: string
[] ) ⇒ Promise<any>
Resolves a batch of addresses for a given asset ID.
For more details, visit Method Implementation Reference