👩‍💻Initialization

Choose from React, React Native, Node.js, Python, Java & HTTP

Need technical help or have feedback? Contact an engineer directly [email protected].

React

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

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

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

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

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

Last updated