Import

Sign with the P-Chain address for the following actions:

When Exporting from C-> P, sign with the C-Chain address.

In order to successfully transfer tokens from the C-Chain to the P-Chain, or vice versa, you must complete a two step process.

The first step of a transfer is an Export transaction, which then must be followed up with an Import transaction.

If for example I wanted to transfer 10 AVAX from C-Chain to P-Chain, I would:

If I wanted to transfer 10 AVAX from P-Chain to C-Chain, then I would do the same two steps but switch the from_address and to_address.


Network

Type: string
Enum: fujimainnet
Required
Avalanche network to build transaction for, mainnet or fuji

Allowed:
fuji, mainnet

Parameters


Sample Response

201 Transaction Created

{
  "data": {
    "network": "fuji",
    "unsigned_transaction_serialized": "0x7b22636f6465634964223a2230222c22766d223a2250564d222c2274784279746573223a223078303030303030303030303161303030303030303530303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303133643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161303030303030303730303030303030303030303338333438303030303030303030303030303030303030303030303031303030303030303134303638336631306635653763343830313432626233346361316633616635373161346465623235303030303030303230396265646163643230323163643463323566373162613635663364386436346130343431333234653034373639396633316164353366333230386637313033303030303030303133643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161303030303030303530303030303030303362396163613030303030303030303130303030303030303039626564616364323032316364346332356637316261363566336438643634613034343133323465303437363939663331616435336633323038663731303330303030303032336439626461633065643164373631333330636636383065666465623161343231353965623338376436643239353063393666376432386636316262653261613030303030303037303030303030303033623961636130303030303030303030303030303030303030303030303030313030303030303031343036383366313066356537633438303134326262333463613166336166353731613464656232353030303030303062303030303030303030303030303030303030303030303031303030303030303134303638336631306635653763343830313432626233346361316633616635373161346465623235222c227574786f73223a5b2230783039626564616364323032316364346332356637316261363566336438643634613034343133323465303437363939663331616435336633323038663731303330303030303030323364396264616330656431643736313333306366363830656664656231613432313539656233383764366432393530633936663764323866363162626532616130303030303030373030303030303030303030336166343430303030303030303130303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303"
  }
}

Error Response

422 Invalid request

Example API Call

curl --request POST \
     --url https://api.figment.io/avalanche/import \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'x-api-key: your-api-key-here' \
     --data '{"network":"fuji"}'

Updated 3 months ago


Did this page help you?

Yes

No