Searchโ€ฆ
๐Ÿ‘ฉ๐Ÿ’ป
Initialization
Choose from React, React Native, Node.js, Python, Java & HTTP
Need technical help or have feedback? Contact an engineer directly [email protected].

React

1. Download SDKโ€‹

npm i smilecoin-sdk-react

2. Import package

import { SmileReceiveButton, SmileSendButton } from 'smilecoin-sdk-react'

3. Initialize component

import { SmileReceiveButton, SmileSendButton } from 'smilecoin-sdk-react'
โ€‹
return (
<>
//Receive user payments
<SmilePayButton
amount={100}: (Number: units of smile)
platform="Test Partner" (String: platform name)
platform_address="X" (String: platform's receive wallet)
platform_parameters={ custom_parameter_1: "x"... } (Object: will take any sensitive custom parameters you would like to encrypt and track, this will append to the provided note)
uuid="1" (String: platform's user identifier in their own records)
note="testdk" (String: note describing the transaction)
callback={myCallback} (Function: Returns signed_txn to pass to partner BE)
env="dev" (String: "dev" | "prod")
/>
//Send user payments
<SmileSendButton
callback={myCallback}
/>
)

React Native

1. Download SDKโ€‹

npm i smilecoin-sdk-react-native

2. Import package

import { SmileReceiveButton, SmileSendButton } from 'smilecoin-sdk-react'

3. Initialize component

import { SmileReceiveButton, SmileSendButton } from 'smilecoin-sdk-react'
โ€‹
return (
<>
//Receive user payments
<SmilePayButton
amount={100}: (Number: units of smile)
platform="Test Partner" (String: platform name)
platform_address="X" (String: platform's receive wallet)
platform_parameters={ custom_parameter_1: "x"... } (Object: will take any sensitive custom parameters you would like to encrypt and track, this will append to the provided note)
uuid="1" (String: platform's user identifier in their own records)
note="testdk" (String: note describing the transaction)
callback={myCallback} (Function: Returns signed_txn to pass to partner BE)
env="dev" (String: "dev" | "prod")
/>
//Send user payments
<SmileSendButton
callback={myCallback}
/>
)
โ€‹

Python

1. Download SDKโ€‹

pip3 install smilecoin

2. Import package

import smilecoin

3. Authorize client

smilecoin.api.auth(<your-api-key>)

4. Start making calls (next section)

txn_status = smile_coin.api.<action>(<payload>)

Node.js

1. Download SDKโ€‹

npm i install SmileCoinSDK

2. Import package

var smile = require('SmileCoinSDK');

3. Authorize client

var smileCoin = smile.api.auth(<your-api-key>)

4. Start making calls (next section)

var txnStatus = smileCoin.api.<action>(<payload>)
โ€‹

Java

โ€‹1. Download packageโ€‹

In your pom.xml add the following new dependency (under <dependencies>)
<dependency>
<groupId>us.smilecoin</groupId>
<artifactId>SmileCoinSDK</artifactId>
<version>1.0</version>
</dependency>

2. Import package

Import us.smilecoin.API;

3. Authorize client

API smileSDK = new API(
"testnet", //environ: (String: chosen environment, "testnet" || "mainnet")
);
smileSDK.auth(โ€œapi_keyโ€); //(your api_key)
โ€‹

4. Start making calls (next section)

smileSDK.<action>(<payload>);

HTTP

See next section
Copy link
On this page
React
React Native
Python
Node.js
Java
HTTP