1.0.2 • Published 2 years ago

@snowflake-so/safe-aptos-provider v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Safe Aptos Provider

A React library provides Provider, Context API and hooks to support Safe apps integration.

Installation

npm

npm install @snowflake-so/safe-aptos-provider

yarn add @snowflake-so/safe-aptos-provider

Quick start guide

Note: The implemented application only works inner Safe Aptos app.

Wrap your root component with SafeProvider and use the React hook useSafeContext to retrieve the data of the Snowflake Safe parent window.

import React from 'react';
import { useSafe, SafeProvider } from '@snowflake-so/safe-aptos-provider';

const AppContent = () => {
  const { safe } = useSafe();
  return <div>{safe.safeInfo.address}</div>;
};

const App = () => {
  return (
    <SafeProvider>
      <AppContent />
    </SafeProvider>
  );
};

export default App;

Support

Struggle with the SDK integration?

If you have any problem with using the SDK in your system, drop a question our Snowflake Discord #sdk to receive a support from our engineers.

Find a bug or want to contribute to Snowflake?

If you find a bug or have any problem and idea while using the SDK, you can create an issue on SDK Github.

License MIT