
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
@matrix-labs/one-sync-sdk
Advanced tools
https://docs.openzeppelin.com/contracts/4.x/api/token/erc721#ERC721
export interface OneSyncERC721Client extends ERC721Client {
connectProvider(
address: string,
provider: Provider
): Promise<OneSyncERC721Client>;
connectSigner(signer: Signer): OneSyncERC721Client;
setWaitConfirmations(num: number): void;
/**
* Get the owner/admin of the token
*
* @param {CallOverrides} [config] - Override the default contract call config
* @return {Promise<string>} - The owner of the collection
*/
owner(config?: CallOverrides): Promise<string>;
/**
* Get contract implementation version
*
* @param {CallOverrides} [config] - Override the default contract call config
* @return {Promise<string>} - The contract implementation version
*/
implementationVersion(config?: CallOverrides): Promise<string>;
/**
* Get latest token Version (tokenVersion + 1 after unlock and lock)
*
* @param {BigNumber} tokenId - The token id
* @param {CallOverrides} [config] - Override the default contract call config
* @return {Promise<string>} - The contract implementation version
*/
tokenVersion(tokenId: BigNumber, config?: CallOverrides): Promise<BigNumber>;
/**
* Check if the token is locked
*
* @param {BigNumber} tokenId - The token id
* @param {CallOverrides} [config] - Override the default contract call config
* @return {Promise<string>} - The contract implementation version
*/
locked(tokenId: BigNumber, config?: CallOverrides): Promise<boolean>;
/**
* Lock the token
*
* @param {BigNumber} tokenId - The token id
* @param config
* @return {Promise<ContractReceipt>} - The contract receipt
*/
lock(tokenId: BigNumber, config?: PayableOverrides): Promise<ContractReceipt>;
/**
* Unlock the token
*
* @param {BigNumber} tokenId - The token id
* @param {BigNumber} version - The current version of the token
* @param {string} signature - The signature of the transaction
* @param config
* @return {Promise<ContractReceipt>} - The contract receipt
*/
unLock(
tokenId: BigNumber,
version: BigNumber,
signature: string,
config?: PayableOverrides
): Promise<ContractReceipt>;
/**
* Mint token with the given signature
*
* @param {string} to - The address of token recipient
* @param {BigNumber} tokenId - The token id
* @param isLocked - Mint with locked status or not
* @param nonce
* @param {string} signature - The signature received from the service
* @param config
* @return {Promise<ContractReceipt>} - The contract receipt
*/
mintWithSignature(
to: string,
tokenId: BigNumber,
isLocked: boolean,
nonce: string,
signature: string,
config?: PayableOverrides
): Promise<ContractReceipt>;
/**
* Mint batch tokens with the given signature
*
* @param {string} to - The address of token recipient
* @param {Array<BigNumber>} tokenIds - The token id list
* @param nonce
* @param isLocked - Mint with locked status or not
* @param {string} signature - The signature received from the service
* @param config
* @return {Promise<ContractReceipt>} - The contract receipt
*/
mintBatchWithSignature(
to: string,
tokenIds: Array<BigNumber>,
isLocked: boolean,
nonce: string,
signature: string,
config?: PayableOverrides
): Promise<ContractReceipt>;
/**
* Burn the token
* NOTICE: the token should not at the status of locked
*
* @param {BigNumber} tokenId - The token id
* @param config
* @return {Promise<ContractReceipt>} - The contract receipt
*/
burn(tokenId: BigNumber, config?: PayableOverrides): Promise<ContractReceipt>;
/**
* Burn the token with the given signature
*
* @param {Array<BigNumber>} tokenIds - The token id list
* @param config
* @return {Promise<ContractReceipt>} - The contract receipt
*/
burnBatch(tokenIds: Array<BigNumber>, config?: PayableOverrides): Promise<ContractReceipt>;
/**
* Burn the token with the given signature
*
* @param {Array<BigNumber>} tokenIds - The token id list
* @param nonce
* @param {string} signature - The signature received from the service
* @param config
* @return {Promise<ContractReceipt>} - The contract receipt
*/
burnBatchWithSignature(
tokenIds: Array<BigNumber>,
nonce: string,
signature: string,
config?: PayableOverrides
): Promise<ContractReceipt>;
}
Browser:
// setup client
const web3Provider = new ethers.providers.Web3Provider(window.ethereum);
await web3Provider.current.send('eth_requestAccounts', []);
const signer = ethProvider.current.getSigner();
const contractAddress = '0x......';
const nftClient = EtherOneSyncERC721Client();
await nftClient.connectProvider(contractAddress, web3Provider);
nftClient.connectSigner(signer);
nftClient.setWaitConfirmations(1); // 1 for testnet, 5 for mainnet
// const result = await nftClient.[ERC721 + OnceSync APIs]
FAQs
### ERC721 related APIs
We found that @matrix-labs/one-sync-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.