npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@azify/caas-sdk

v2.0.1

Published

TypeScript SDK for Azify CaaS (Crypto as a Service) API - Vaults, Wallets, and Transactions

Readme

Azify CaaS SDK

SDK em TypeScript para integração com a API Azify Crypto as a Service (CaaS), fornecendo acesso fácil às funcionalidades de Cofres, Carteiras e Transações.

Instalação

npm install @azify/caas-sdk

Início Rápido

import { CaasSDK } from '@azify/caas-sdk';

const sdk = new CaasSDK({
  baseUrl: 'https://api.azify.com',
  apiKey: 'sua-chave-api',
  partnerId: 123
});

Exemplos de Uso

Gerenciamento de Cofres

// Criar um novo cofre
const novoCofreParams = {
  ownerIdentificator: 'usuario123',
  ownerType: 'user',
  currencies: ['BTC_TEST', 'ETH_TEST5']
};

const cofre = await sdk.vaults.create(novoCofreParams);
console.log('Cofre criado:', cofre);

// Buscar cofres por proprietário
const cofresDoUsuario = await sdk.vaults.getByOwner('usuario123');
console.log('Cofres do usuário:', cofresDoUsuario);

// Obter detalhes de um cofre específico
const detalhesCofre = await sdk.vaults.getById('uuid-do-cofre');
console.log('Detalhes do cofre:', detalhesCofre);

// Consultar saldo do cofre
const saldo = await sdk.vaults.getBalance('uuid-do-cofre', 'BTC_TEST');
console.log('Saldo do cofre em BTC_TEST:', saldo);

// Obter endereços de depósito
const enderecosDeposito = await sdk.vaults.getDepositAddresses('uuid-do-cofre', 'BTC_TEST');
console.log('Endereços de depósito:', enderecosDeposito);

Gerenciamento de Carteiras

// Criar um novo endereço de depósito
const novoEndereco = await sdk.wallets.createDepositAddress({
  vaultUuid: 'uuid-do-cofre',
  currency: 'BTC_TEST'
});
console.log('Novo endereço criado:', novoEndereco);

// Obter endereço de depósito existente
const enderecoExistente = await sdk.wallets.getDepositAddress({
  vaultUuid: 'uuid-do-cofre',
  currency: 'BTC_TEST'
});
console.log('Endereço de depósito:', enderecoExistente);

// Listar carteiras
const carteiras = await sdk.wallets.get({
  vaultUuid: 'uuid-do-cofre',
  currency: 'BTC_TEST'
});
console.log('Carteiras do cofre:', carteiras);

Criação de Transações

// Criar uma transação simples
const transacaoParams = {
  currency: 'BTC_TEST',
  amount: 0.001,
  destinationAddress: '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa',
  vaultUuid: 'uuid-do-cofre'
};

const transacao = await sdk.transactions.create(transacaoParams);
console.log('Transação criada:', transacao);

// Criar transação com taxa customizada
const transacaoComTaxa = await sdk.transactions.create({
  currency: 'ETH_TEST5',
  amount: 0.1,
  destinationAddress: '0x742d35Cc6B54C1234567890123456789012345',
  vaultUuid: 'uuid-do-cofre',
  fee: {
    level: 'HIGH'
  }
});
console.log('Transação com taxa alta:', transacaoComTaxa);

Tratamento de Erros

import { CaasSDKError } from '@azify/caas-sdk';

try {
  const cofre = await sdk.vaults.create({
    ownerIdentificator: 'usuario123',
    ownerType: 'user',
    currencies: ['BTC_TEST']
  });
} catch (error) {
  if (error instanceof CaasSDKError) {
    console.error('Erro do SDK:', {
      message: error.message,
      statusCode: error.statusCode,
      details: error.details
    });
  } else {
    console.error('Erro inesperado:', error);
  }
}

Exemplo Completo

import { CaasSDK, CaasSDKError } from '@azify/caas-sdk';

async function exemploCompleto() {
  const sdk = new CaasSDK({
    baseUrl: 'https://api.azify.com',
    apiKey: 'sua-chave-api',
    partnerId: 123
  });

  try {
    // 1. Criar um cofre
    const cofre = await sdk.vaults.create({
      ownerIdentificator: 'usuario-exemplo',
      ownerType: 'user',
      currencies: ['BTC_TEST', 'ETH_TEST5']
    });
    
    console.log('✅ Cofre criado com sucesso:', cofre.uuid);

    // 2. Criar endereço de depósito para BTC
    const enderecoBTC = await sdk.wallets.createDepositAddress({
      vaultUuid: cofre.uuid,
      currency: 'BTC_TEST'
    });
    
    console.log('✅ Endereço BTC criado:', enderecoBTC.address);

    // 3. Verificar saldo (será 0 inicialmente)
    const saldoBTC = await sdk.vaults.getBalance(cofre.uuid, 'BTC_TEST');
    console.log('💰 Saldo atual:', saldoBTC);

    // 4. Simular uma transação (após receber fundos)
    // const transacao = await sdk.transactions.create({
    //   currency: 'BTC_TEST',
    //   amount: 0.0001,
    //   destinationAddress: 'endereco-destino',
    //   vaultUuid: cofre.uuid
    // });
    
  } catch (error) {
    if (error instanceof CaasSDKError) {
      console.error('❌ Erro na operação:', error.message);
    } else {
      console.error('❌ Erro inesperado:', error);
    }
  }
}

exemploCompleto();

Tipos TypeScript

O SDK inclui tipos TypeScript abrangentes para todas as requisições e respostas da API, proporcionando:

  • Autocompletar no IDE
  • Verificação de tipos em tempo de compilação
  • Documentação inline dos parâmetros
  • Tratamento de erros tipado

Licença

MIT