1.1.9 • Published 2 years ago

@snowflake-so/safe-apps-sdk v1.1.9

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

Safe Apps SDK

SDK for apps to integrate with Snowflake Safe via post messaging. Please find compatible supported libraries in the list below.

Installation

npm

npm install @snowflake-so/safe-apps-sdk

yarn add @snowflake-so/safe-apps-sdl

Build

yarn install
yarn build

npm install
npm build

Services

Initialize the SDK

const sdk = new SafeAppsSDK({
  debugMode: boolean,
});

Safe Communicator Service

Get safe info

await sdk.safe.getSafeInfo();

Get safe balance

await sdk.safe.getSafeBalance();

Transaction Communicator Service;

Create a proposal

await sdk.txs.createProposal(
 display: {
   proposalName: string;
 } & NotNestedObject;
 executeInstructions: TransactionInstruction[];
 setupInstructions?: Optional<TransactionInstruction[]>;
 signers: Signer[];
)

Sign message

 public signMessage(
    payload: MessagePayload[MessageMethod.signMessage]
  ): Promise<ResponseMessage<MessageReturnData[MessageMethod.signMessage]>> {
    return this._communicator.send<MessageMethod.signMessage>(
      MessageMethod.signMessage,
      payload
    );
  }

Send transaction

  public sendTransaction(
    payload: MessagePayload[MessageMethod.sendTransaction]
  ): Promise<
    ResponseMessage<MessageReturnData[MessageMethod.sendTransaction]>
  > {
    return this._communicator.send<MessageMethod.sendTransaction>(
      MessageMethod.sendTransaction,
      payload
    );
  }

Journey of a message

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

1.1.1

2 years ago

1.1.0

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.8-beta

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago