NAME

Circle::Chain - The Circle::Chain SDks.

VERSION

Version 0.06

SYNOPSIS

use Circle::Chain qw(:user :wallet :block :node);
# 1. first register or login
my $response = send_register_verify_code(
    {
        email => 'circle-node@gmail.com'
    }
);
if ( $response->{status} != 200 ) {
    croak 'cannot send register verify code:' . $response->{status};
}

# receive you verify code in email or your mobile phone.
$response = register(
    {
        email          => 'circle-node@gmail.com',
        passwordInput1 => '<password>',
        passwordInput2 => '<password>',
        verifyCode     => '<verify_code>'
    }
);
if ( $response->{status} != 200 ) {
    croak 'cannot register status' . $response->{status};
}
$response = send_verify_code(
    {
        email => 'circle-node@gmail.com'
    }
);
if ( $response->{status} != 200 ) {
    croak 'cannot send login verify code:' . $response->{status};
}

# receive you verify code in email or your mobile phone.
$response = login(
    {
        email      => 'circle-node@gmail.com',
        verifyCode => '<verify_code>',
        password   => '<password>'
    }
);
if ( $response->{status} != 200 ) {
    croak 'cannot login status' . $response->{status};
}

# 2. new user will create wallet.
$response = create_wallet();
my $address;
if ( $response->{status} == 200 ) {
    $address = $response->{data};
}
$response = balance_of_address($address);
# $response->{status} == 200, get the balance: $response->{data}
$response = assets_of_address($address);
# $response->{status} == 200, get the assets: $response->{data}
# if you created wallets
$response = list_wallet();
# $response->{status} == 200, get the address list: $response->{data}

# 3. anonymous user will invoke get_block_hashlist api.
my $response = get_block_hashlist(0);
if ( $response->{status} != 200 ) {
    croak 'cannot get block hash list:' . $response->{status};
}
...

EXPORT

If you want to use user module:

use Circle::Chain ':user';

for user module, the exported subroutines:

1. send_register_verify_code
2. register
3. send_verify_code
4. login
5. logout
6. send_pay_verify_code
7. set_pay_password
8. have_pay_password
9. send_reset_password_verify_code
10. reset_password
11. add_contacts
12. list_contacts
13. save_or_update_user_info
14. get_user_info

If you want to use block module:

use Circle::Chain ':block';

for block module, the exported subroutines:

1. get_block_hashlist
2. get_block
3. get_block_header_list
4. get_block_data
5. get_blocktails_hashlist
6. get_blocktails_po
7. get_tx_by_txid
8. search_tx_by_txid
9. search_tx_by_address
10. search_utxos

If you want to use wallet module:

use Circle::Chain ':wallet';

for wallet module, the exported subroutines:

1. create_wallet
2. list_wallet
3. balance_of_address
4. balance_of_wallet
5. assets_of_address
6. assets_of_wallet
7. public_key_hash_from_address
8. send_to
9. pay
10. search_tx_by_type
11. search_tx_by_time
12. let_me_try
13. public_address_of_uid
14. public_balance_of_address
15. public_assets_of_address
16. public_search_transaction

If you want to use node module:

use Circle::Chain ':node';

for node module, the exported subroutines:

1. subscribe
2. serverFeatures
3. broadcastTransaction

SUBROUTINES/METHODS

please refer to Circle::User, Circle::Wallet, Circle::Block, Circle::Node modules.

AUTHOR

charles li, <lidh04 at gmail.com>

BUGS

Please report any bugs or feature requests to bug-circle-chain at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Circle-Chain. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SEE ALSO

See Circle::Common for circle common module.

See Circle::User for circle user module .

See Circle::Wallet for circle wallet module.

See Circle::Block for circle block module.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Circle::Chain

You can also look for information at:

LICENSE AND COPYRIGHT

This software is Copyright (c) 2024 by charles li.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)